JGraph X 1.4.1.0


com.mxgraph.io.vdx
Class mxVdxShape

java.lang.Object
  extended by com.mxgraph.io.vdx.mxGeneralShape
      extended by com.mxgraph.io.vdx.mxVdxShape

public class mxVdxShape
extends mxGeneralShape

This class is a wrapper for one Shape Element.
This class is responsible for retrieve all the properties of the shape and add it to the graph. If a property is not found in the shape element but it is an instance of a Master, the property is taken from the masterShape element. If the property is not found neither in the masterShape , and it has a reference to a stylesheet the property is taken from there.


Field Summary
 
Fields inherited from class com.mxgraph.io.vdx.mxGeneralShape
shape
 
Constructor Summary
mxVdxShape(Element shape)
          Create a new instance of mxVdxShape.
 
Method Summary
 mxCell addComplexShapeToGraph(mxGraph graph, Object parent, double parentHeight)
          Adds a Complex shape to the graph.
 mxCell addSimpleShapeToGraph(mxGraph graph, Object parent, double parentHeight)
          Adds a simple shape to the graph
 boolean containsXForm1D()
          Checks if the shape or the master shape has the XForm1D element.
 String getAlignVertical()
          Returns the vertical align of the label.
The property may to be defined in master shape or text stylesheet.
 double getBottomSpacing()
          Returns the bottom spacing of the label in pixels.
The property may to be defined in master shape or text stylesheet.
 mxPoint getDimentions()
          Returns the width and height of the Shape expressed like a mxPoint.
x = width
y = height
When a dimention is not found, it is taken from masterShape.
 String getEdgeStyle()
          Returns the style of the edge.
 String getFinalArrow()
          Returns the end arrow of the line.
 float getFinalArrowSize()
          Returns the end arrow size.
The property may to be defined in master shape or line stylesheet.
Determines the value in pixels of each arrow size category in .vdx.
 String getIsRounded()
          Returns if the line is Rounded.
The property may to be defined in master shape or line stylesheet.
 String getIsShadow()
          Return if the line has shadow.
The property may to be defined in master shape or line stylesheet.
 String getLabelBkgndColor()
          Returns the label background color.
The property may to be defined in master shape or text stylesheet.
 boolean getLabelRotation()
          Checks if the label must be rotated.
The property may to be defined in master shape or text stylesheet.
 double getLeftSpacing()
          Returns the left spacing of the label in pixels.
The property may to be defined in master shape or text stylesheet.
 String getLineStrokeColor()
          Returns the line color.
The property may to be defined in master shape or line stylesheet.
 double getLineWidth()
          Returns the line width.
The property may to be defined in master shape or line stylesheet.
 String getMasterId()
          Returns the master's Id of the Shape.
 mxPoint getOriginPoint(double parentHeight)
          Returns the coordinates of the top left corner of the Shape.
 double getRightSpacing()
          Returns the right spacing of the label in pixels.
The property may to be defined in master shape or text stylesheet.
 double getRotation()
          Returns the rotation of the shape.
If no gradient must be applicated, returns an empty string.
 String getShapeMasterId()
          Returns the masterShape's Id of the shape.
 String getStartArrow()
          Returns the start arrow of the line.
 float getStartArrowSize()
          Returns the start arrow size.
The property may to be defined in master shape or line stylesheet.
Determines the value in pixels of each arrow size category in .vdx.
 String getStyleFromEdgeShape(double parentHeight)
          Analizes a edge shape and returns a string with the style.
 String getStyleFromShape(double parentHeight)
          Analizes the shape and returns a string whith the style.
 String getTextLabel()
          Returns the value of the Text element.
If the shape has not text, it is obtained from master shape.
 double getTopSpacing()
          Returns the top spacing of the label in pixels.
The property may to be defined in master shape or text stylesheet.
 mxPoint[] getVertexPoints(double parentHeight)
          Returns the points of a vertex shape.
 boolean isComplexShape()
          Returns if the shape is composed for several shapes.
 boolean isConnectorBigNameU(String nameU)
          Checks if a nameU is for big connectors.
 boolean isDashed()
          Checks if the lines of the shape are dashed.
The property may to be defined in master shape or line stylesheet.
 boolean isExceptionEdge()
          Checks if the shape must be treated as an edge.
 boolean isGroup()
          Checks if a shape contains other shapes inside.
 boolean isSupportedShape()
          Checks if the shape is supported by the application.
 boolean isVertexShape()
          Checks if the shape represents a vertex.
 String lookForMasterId()
          Gets the Master's Id of the shape.
 
Methods inherited from class com.mxgraph.io.vdx.mxGeneralShape
getAmountArcTo, getAmountConnection, getAmountEllipticalArcTo, getAmountLineTo, getAngle, getBeginArrow, getBeginArrowSize, getBeginXY, getBullet, getEndArrow, getEndArrowSize, getEndXY, getFillColor, getFillForeColor, getFillPattern, getFillStyleId, getFlags, getHeight, getHorizontalAlign, getId, getIndentFirst, getIndentLeft, getIndentRight, getLetterSpace, getLineColor, getLinePattern, getLineStyleId, getLineToXY, getLineWeight, getLocPinX, getLocPinY, getNameU, getNumericalValueOfSecundaryTag, getPinX, getPinY, getPrimaryTag, getPrimaryTagIndexed, getRounding, getRoutingPoints, getRTLText, getShape, getShdwPattern, getSpAfter, getSpBefore, getSpLine, getText, getTextBkgndColor, getTextBottomMargin, getTextCase, getTextChildrens, getTextColor, getTextFont, getTextLeftMargin, getTextPos, getTextRightMargin, getTextSize, getTextStrike, getTextStyle, getTextStyleId, getTextTopMargin, getTransparence, getTxtAngle, getValueOfSecundaryTag, getVerticalAlign, getWidth, hasAngle, hasBeginArrow, hasBeginArrowSize, hasBullet, hasEllipse, hasEndArrow, hasEndArrowSize, hasFillColor, hasFillForeColor, hasFillPattern, hasFlags, hasHeight, hasHorizontalAlign, hasIndentFirst, hasIndentLeft, hasIndentRight, hasLetterSpace, hasLineColor, hasLinePattern, hasLineWeight, hasLocPinX, hasLocPinY, hasPinX, hasPinY, hasPrimaryTag, hasRounding, hasRTLText, hasSecundaryTag, hasShdwPattern, hasSpAfter, hasSpBefore, hasSpLine, hasText, hasTextBkgndColor, hasTextBottomMargin, hasTextCase, hasTextColor, hasTextFont, hasTextLeftMargin, hasTextPos, hasTextRightMargin, hasTextSize, hasTextStrike, hasTextStyle, hasTextTopMargin, hasTransparence, hasTxtAngle, hasVerticalAlign, hasWidth, hasXForm1D, setShape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

mxVdxShape

public mxVdxShape(Element shape)
Create a new instance of mxVdxShape. This method get the references to the master element, master shape and stylesheet.

Parameters:
shape -
Method Detail

getTextLabel

public String getTextLabel()
Returns the value of the Text element.
If the shape has not text, it is obtained from master shape. If html labels are enabled, the text properties are set with tags html.

Returns:
Text label of the shape.

isConnectorBigNameU

public boolean isConnectorBigNameU(String nameU)
Checks if a nameU is for big connectors.

Parameters:
nameU - NameU attribute.
Returns:
Returns true if a nameU is for big connectors.

containsXForm1D

public boolean containsXForm1D()
Checks if the shape or the master shape has the XForm1D element.

Returns:
Returns true if the shape or the master shape has the XForm1D element.

isExceptionEdge

public boolean isExceptionEdge()
Checks if the shape must be treated as an edge.

Returns:
Returns true if the shape must be treated as an edge.

isVertexShape

public boolean isVertexShape()
Checks if the shape represents a vertex.

Returns:
Returns true if the shape represents a vertex.

isSupportedShape

public boolean isSupportedShape()
Checks if the shape is supported by the application.

Returns:
Returns true if the shape is supported by the application.

getOriginPoint

public mxPoint getOriginPoint(double parentHeight)
Returns the coordinates of the top left corner of the Shape. When a coordinate is not found, it is taken from masterShape.

Parameters:
parentHeight - Height of the parent cell of the shape.
Returns:
mxPoint that represents the co-ordinates

getDimentions

public mxPoint getDimentions()
Returns the width and height of the Shape expressed like a mxPoint.
x = width
y = height
When a dimention is not found, it is taken from masterShape.

Returns:
mxPoint that represents the dimentions of the shape.

getRotation

public double getRotation()
Returns the rotation of the shape.
If no gradient must be applicated, returns an empty string.

Returns:
Rotation of the shape in degrees.

getLabelBkgndColor

public String getLabelBkgndColor()
Returns the label background color.
The property may to be defined in master shape or text stylesheet.

Returns:
hexadecimal representation of the color.

getTopSpacing

public double getTopSpacing()
Returns the top spacing of the label in pixels.
The property may to be defined in master shape or text stylesheet.

Returns:
Top spacing in double precision.

getBottomSpacing

public double getBottomSpacing()
Returns the bottom spacing of the label in pixels.
The property may to be defined in master shape or text stylesheet.

Returns:
Bottom spacing in double precision.

getLeftSpacing

public double getLeftSpacing()
Returns the left spacing of the label in pixels.
The property may to be defined in master shape or text stylesheet.

Returns:
Left spacing in double precision.

getRightSpacing

public double getRightSpacing()
Returns the right spacing of the label in pixels.
The property may to be defined in master shape or text stylesheet.

Returns:
Right spacing in double precision.

getAlignVertical

public String getAlignVertical()
Returns the vertical align of the label.
The property may to be defined in master shape or text stylesheet.

Returns:
Vertical align (bottom, middle and top)

getLabelRotation

public boolean getLabelRotation()
Checks if the label must be rotated.
The property may to be defined in master shape or text stylesheet.

Returns:
Returns true if the label must remains horizontal.

getStyleFromShape

public String getStyleFromShape(double parentHeight)
Analizes the shape and returns a string whith the style.

Returns:
style readed from the shape.

isDashed

public boolean isDashed()
Checks if the lines of the shape are dashed.
The property may to be defined in master shape or line stylesheet.

Returns:
Returns true if the lines of the shape are dashed.

getStartArrow

public String getStartArrow()
Returns the start arrow of the line.

Returns:
Type of start arrow.

getFinalArrow

public String getFinalArrow()
Returns the end arrow of the line.

Returns:
Type of end arrow.

getLineStrokeColor

public String getLineStrokeColor()
Returns the line color.
The property may to be defined in master shape or line stylesheet.

Returns:
hexadecimal representation of the color.

getLineWidth

public double getLineWidth()
Returns the line width.
The property may to be defined in master shape or line stylesheet.

Returns:
Line width in pixels.

getStartArrowSize

public float getStartArrowSize()
Returns the start arrow size.
The property may to be defined in master shape or line stylesheet.
Determines the value in pixels of each arrow size category in .vdx.

Returns:
Size in pixels.

getFinalArrowSize

public float getFinalArrowSize()
Returns the end arrow size.
The property may to be defined in master shape or line stylesheet.
Determines the value in pixels of each arrow size category in .vdx.

Returns:
Size in pixels.

getIsRounded

public String getIsRounded()
Returns if the line is Rounded.
The property may to be defined in master shape or line stylesheet.

Returns:
Returns mxVdxConstants.TRUE if the line is Rounded.

getIsShadow

public String getIsShadow()
Return if the line has shadow.
The property may to be defined in master shape or line stylesheet.

Returns:
Returns mxVdxConstants.TRUE if the line has shadow.

getEdgeStyle

public String getEdgeStyle()
Returns the style of the edge. (Orthogonal or straight)

Returns:
Edge Style.

getStyleFromEdgeShape

public String getStyleFromEdgeShape(double parentHeight)
Analizes a edge shape and returns a string with the style.

Returns:
style read from the edge shape.

getVertexPoints

public mxPoint[] getVertexPoints(double parentHeight)
Returns the points of a vertex shape.

Parameters:
parentHeight - Height of the parent cell of the shape.
Returns:
array of mxPoint whith the vertex's points

getMasterId

public String getMasterId()
Returns the master's Id of the Shape.

Returns:
Master's ID of the shape, null if has not a master.

lookForMasterId

public String lookForMasterId()
Gets the Master's Id of the shape. If it not has the master atribute, the function look for it in his parents.

Returns:
Master's Id of the shape.

getShapeMasterId

public String getShapeMasterId()
Returns the masterShape's Id of the shape.

Returns:
Master Shape's ID of the shape, null if has not a master shape.

isGroup

public boolean isGroup()
Checks if a shape contains other shapes inside.

Returns:
Returns true if a shape contains other shapes inside.

isComplexShape

public boolean isComplexShape()
Returns if the shape is composed for several shapes.

Returns:
Returns true if the shape is composed for several shapes.

addComplexShapeToGraph

public mxCell addComplexShapeToGraph(mxGraph graph,
                                     Object parent,
                                     double parentHeight)
Adds a Complex shape to the graph. The sub-shapes of a complex shape are processed like part of the shape.

Parameters:
graph - Graph where the parsed graph is included.
parent - Parent cell of the shape.
parentHeight - Height of the parent cell of the shape.
Returns:
Cell added to the graph.

addSimpleShapeToGraph

public mxCell addSimpleShapeToGraph(mxGraph graph,
                                    Object parent,
                                    double parentHeight)
Adds a simple shape to the graph

Parameters:
graph - Graph where the parsed graph is included.
parent - Parent cell of the shape.
parentHeight - Height of the parent cell of the shape.
Returns:
Cell added to the graph.

JGraph X 1.4.1.0


Copyright (c) 2010 Gaudenz Alder. All rights reserved.