|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mindfusion.diagramming.ScriptHelper
public class ScriptHelper
Provides helper methods to help accessing the JDiagram API from JavaScript.
An instance of this class is returned by the DiagramApplet.getScriptHelper() method.
| Constructor Summary | |
|---|---|
ScriptHelper()
|
|
| Method Summary | |
|---|---|
AnchorPattern |
anchorPatternFromId(java.lang.String id)
Gets the AnchorPattern object that has the specified ID. |
AnchorPattern |
createAnchorPattern(java.lang.String id)
Creates a new empty AnchorPattern with the specified identifier. |
AnchorPoint |
createAnchorPoint(float x,
float y)
Creates a new AnchorPoint instance by setting its relative position
in nodes. |
AnnealLayout |
createAnnealLayout()
Creates a new AnnealLayout instance. |
CircularLayout |
createCircularLayout()
Creates a new CircularLayout instance. |
java.awt.Color |
createColor(int r,
int g,
int b)
Creates a new Color instance. |
java.awt.Font |
createFont(java.lang.String name,
float size)
Creates a Font object with the specified name and size. |
GradientBrush |
createGradientBrush(int r1,
int g1,
int b1,
int r2,
int g2,
int b2,
int angle)
Creates a new GradientBrush instance. |
GridLayout |
createGridLayout()
Creates a new GridLayout instance. |
LayeredLayout |
createLayeredLayout()
Creates a new LayeredLayout instance. |
OrthogonalLayout |
createOrthogonalLayout()
Creates a new OrthogonalLayout instance. |
OrthogonalRouter |
createOrthogonalRouter()
Creates a new OrthogonalRouter instance. |
java.awt.print.PageFormat |
createPageFormat()
Creates a java.awt.print.PageFormat instance. |
java.awt.print.Paper |
createPaper()
Creates a java.awt.print.Paper instance. |
PathFinder |
createPathFinder()
Creates a new PathFinder instance. |
Pen |
createPen(float width,
int r,
int g,
int b)
Creates a new Pen instance. |
java.awt.Point |
createPoint(int x,
int y)
Creates a Point instance with the specified coordinates. |
java.awt.geom.Point2D.Float |
createPointF(float x,
float y)
Creates a Point2D.Float instance with the specified coordinates. |
java.awt.Rectangle |
createRectangle(int x,
int y,
int width,
int height)
Creates a Rectangle instance with the specified coordinates. |
java.awt.geom.Rectangle2D.Float |
createRectangleF(float x,
float y,
float width,
float height)
Creates a Rectangle2D.Float instance with the specified coordinates. |
java.awt.Dimension |
createSize(int width,
int height)
Creates a Dimension instance with the specified width and height. |
java.awt.geom.Dimension2D |
createSizeF(float width,
float height)
Creates a Dimension2D instance with the specified width and height. |
SolidBrush |
createSolidBrush(int r,
int g,
int b)
Creates a new SolidBrush instance. |
SolidBrush |
createSolidBrush(int r,
int g,
int b,
int a)
Creates a new SolidBrush instance. |
SpringLayout |
createSpringLayout()
Creates a new SpringLayout instance. |
TextFormat |
createTextFormat(int horizontalAlign,
int verticalAlign,
boolean noWrap,
boolean wrapAtCharacter)
Creates a TextFormat object. |
TreeLayout |
createTreeLayout()
Creates a new TreeLayout instance. |
static java.lang.Object |
getConstant(java.lang.String className,
java.lang.String field)
Provides access to constants (public static fields) defined in subpackages of com.mindfusion.diagramming. |
ShapeList |
getShapes()
Gets the list of predefined shapes. |
void |
loadShapeLibrary(java.lang.String url)
Loads a ShapeLibrary from the specified URL. |
Shape |
shapeFromId(java.lang.String shapeId)
Gets the predefined shape that has the specified ID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ScriptHelper()
| Method Detail |
|---|
public Shape shapeFromId(java.lang.String shapeId)
shapeId - A string identifying the shape.
Shape instance identified by the shapeId parameter.public ShapeList getShapes()
ShapeList instance containing the predefined JDiagram shapes.public void loadShapeLibrary(java.lang.String url)
ShapeLibrary from the specified URL.
The URL must be fully qualified, relative paths are not supported.
url - Location of the shape library file.public GridLayout createGridLayout()
GridLayout instance.
GridLayout instance.public LayeredLayout createLayeredLayout()
LayeredLayout instance.
LayeredLayout instance.public SpringLayout createSpringLayout()
SpringLayout instance.
SpringLayout instance.public TreeLayout createTreeLayout()
TreeLayout instance.
TreeLayout instance.public AnnealLayout createAnnealLayout()
AnnealLayout instance.
AnnealLayout instance.public OrthogonalRouter createOrthogonalRouter()
OrthogonalRouter instance.
OrthogonalRouter instance.public OrthogonalLayout createOrthogonalLayout()
OrthogonalLayout instance.
OrthogonalLayout instance.public CircularLayout createCircularLayout()
CircularLayout instance.
CircularLayout instance.public PathFinder createPathFinder()
PathFinder instance.
PathFinder instance.public java.awt.print.PageFormat createPageFormat()
java.awt.print.PageFormat instance.
java.awt.print.PageFormat instance.public java.awt.print.Paper createPaper()
java.awt.print.Paper instance.
java.awt.print.Paper instance.
public java.awt.Color createColor(int r,
int g,
int b)
Color instance.
r - A int value specifying the red channel value.g - A int value specifying the green channel value.b - A int value specifying the blue channel value.
Color instance.
public Pen createPen(float width,
int r,
int g,
int b)
Pen instance.
width - A float value representing the pen width.r - A int value specifying the red channel value.g - A int value specifying the green channel value.b - A int value specifying the blue channel value.
Pen instance.
public SolidBrush createSolidBrush(int r,
int g,
int b)
SolidBrush instance.
r - A int value specifying the red channel value.g - A int value specifying the green channel value.b - A int value specifying the blue channel value.
SolidBrush instance.
public SolidBrush createSolidBrush(int r,
int g,
int b,
int a)
SolidBrush instance.
r - A int value specifying the red channel value.g - A int value specifying the green channel value.b - A int value specifying the blue channel value.a - A int value specifying the alpha component.
SolidBrush instance.
public GradientBrush createGradientBrush(int r1,
int g1,
int b1,
int r2,
int g2,
int b2,
int angle)
GradientBrush instance.
r1 - A int value specifying the first color's red channel value.g1 - A int value specifying the first color's green channel value.b1 - A int value specifying the first color's blue channel value.r2 - A int value specifying the second color's red channel value.g2 - A int value specifying the second color's green channel value.b2 - A int value specifying the second color's blue channel value.angle - An int value specifying the gradient's angle.
GradientBrush instance.
public java.awt.Dimension createSize(int width,
int height)
width - Specifies the width.height - Specifies the height.
public java.awt.Rectangle createRectangle(int x,
int y,
int width,
int height)
x - X coordinate of the rectangle.y - Y coordinate of the rectangle.width - Width of the rectangle.height - Height of the rectangle.
public java.awt.geom.Dimension2D createSizeF(float width,
float height)
width - Specifies the width.height - Specifies the height.
public java.awt.geom.Rectangle2D.Float createRectangleF(float x,
float y,
float width,
float height)
x - X coordinate of the rectangle.y - Y coordinate of the rectangle.width - Width of the rectangle.height - Height of the rectangle.
public java.awt.Point createPoint(int x,
int y)
x - X coordinate of the rectangle.y - Y coordinate of the rectangle.
public java.awt.geom.Point2D.Float createPointF(float x,
float y)
x - X coordinate of the rectangle.y - Y coordinate of the rectangle.
public java.awt.Font createFont(java.lang.String name,
float size)
name - The font name.size - The font size.
java.awt.Font instance.
public static java.lang.Object getConstant(java.lang.String className,
java.lang.String field)
className - Name of the class that defines the constant.field - Name of the constant field.
public TextFormat createTextFormat(int horizontalAlign,
int verticalAlign,
boolean noWrap,
boolean wrapAtCharacter)
TextFormat object.
horizontalAlign - Specifies the horizontal alignment.verticalAlign - Specifies the vertical alignment.noWrap - Specifies whether text wrapping should be disabled.wrapAtCharacter - Specifies whether text can be wrapped to a new line at an arbitrary character.
TextFormat object.public AnchorPattern createAnchorPattern(java.lang.String id)
AnchorPattern with the specified identifier.
id - A string used to identify the new AnchorPattern.
AnchorPattern object.
public AnchorPoint createAnchorPoint(float x,
float y)
AnchorPoint instance by setting its relative position
in nodes. The point will allow both outgoing and incoming arrows.
x - The horizontal position of the anchor point specified as
percents of the node width.y - The vertical position of the anchor point specified as
percents of the node height.
AnchorPoint object.public AnchorPattern anchorPatternFromId(java.lang.String id)
AnchorPattern object that has the specified ID.
id - A string identifying the AnchorPattern.
AnchorPattern instance identified by the id parameter.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||