com.jgraph.components.labels
public class MultiLineVertexRenderer extends VertexRenderer
Field Summary | |
---|---|
protected Area | cylinderArea
Holds the area to be painted for the cylinder shape. |
static String | CLIENTPROPERTY_SHOWFOLDINGICONS
Client property for JGraph to control the display of the folding icons.
|
protected Polygon | diamond
Holds the shape to be painted for diamond cells. |
protected JGraph | graph
Holds a reference to fetch the correct cell value from the model in
paint. |
protected Color | graphBackground
Holds the background and foreground of the graph. |
protected Color | graphForeground
Holds the background and foreground of the graph. |
static Rectangle | handle
Defines the root handle size and location. |
protected boolean | isEditing
Specifies whether the current view is a rich text value, and if the image
should be stretched. |
protected boolean | isGroup
Specifies whether the current view is a rich text value, and if the image
should be stretched. |
protected boolean | isRichText
Specifies whether the current view is a rich text value, and if the image
should be stretched. |
static int | INSET
Defines the default inset to render rich text. |
protected int | roundRectArc
Holds the round rect arc size for rounded rectangles. |
protected int | shape
Holds the shape of the current view. |
protected boolean | showFoldingIcons
Specifies whether the current view is a rich text value, and if the image
should be stretched. |
protected boolean | showHeavyweight
Specified if a heavyweight should be painted. |
protected boolean | stretchImage
Specifies whether the current view is a rich text value, and if the image
should be stretched. |
static int | SHAPE_CIRCLE
Defines the shape constants to be used as values for the
VERTEXSHAPE attributes. |
static int | SHAPE_CYLINDER
Defines the shape constants to be used as values for the
VERTEXSHAPE attributes. |
static int | SHAPE_DIAMOND
Defines the shape constants to be used as values for the
VERTEXSHAPE attributes. |
static int | SHAPE_RECTANGLE
Defines the shape constants to be used as values for the
VERTEXSHAPE attributes. |
static int | SHAPE_ROUNDED
Defines the shape constants to be used as values for the
VERTEXSHAPE attributes. |
static int | SHAPE_TRIANGLE
Defines the shape constants to be used as values for the
VERTEXSHAPE attributes. |
static JTextPane | textPane
Holds the text pane to be used for rich text rendering. |
protected Object | userObject
Holds the user object of the current cell. |
protected Component | valueComponent
References the value component of the user object if one exists. |
protected static JComponent | wrapperRenderer
Holds the wrapper renderer used for heavyweights. |
static Dimension | ZERO_DIMENSION
Defines a dimension of width and height 0. |
Constructor Summary | |
---|---|
MultiLineVertexRenderer()
Constructs a new vertex renderer. |
Method Summary | |
---|---|
static int | getArcSize(int width, int height)
Returns an appropriate arc for the corners of the rectangle for boundary
size cases of width and height. |
Point2D | getCirclePerimeterPoint(VertexView view, Point2D source, Point2D p)
Utility method to return the perimeter point for a circle.
|
Point2D | getDiamondPerimeterPoint(VertexView view, Point2D source, Point2D p)
Utility method to return the perimeter point for a diamond.
|
Point2D | getPerimeterPoint(VertexView view, Point2D source, Point2D p)
Overrides the parent's implementation to return the perimeter points for
non-rectangular shapes, namely diamonds and circles. |
Dimension | getPreferredSize()
Overrides the parent's implementation to return a slightly larger
preferred size for circles and rounded rectangles.
|
Component | getRendererComponent(JGraph graph, CellView view, boolean sel, boolean focus, boolean preview)
Overrides the parent implementation to return the value component stored
in the user object instead of this renderer if a value component exists.
|
Point2D | getTrianglePerimeterPoint(VertexView view, Point2D source, Point2D p)
Utility method to return the perimeter point for a triangle.
|
boolean | inHitRegion(Point2D pt)
Detects whether or not a point has hit the folding icon. |
void | installAttributes(CellView view)
Extends the parent's method to configure the renderer for displaying the
specified view.
|
protected Point2D | intersection(Point2D lineOneStart, Point2D lineOneEnd, Point2D lineTwoStart, Point2D lineTwoEnd)
Find the point of intersection of two straight lines (which follow the
equation y=mx+b) one line is an incoming edge and the other is one side
of the diamond.
|
void | paint(Graphics g)
Paints the renderer component for the configured view. |
protected void | paintBackground(Graphics g)
Utility method to paint the background for all non-rectangular shapes.
|
protected void | paintFoldingIcon(Graphics g)
Utility method to paint the folding icon for groups.
|
protected void | paintRichText(Graphics g)
Utility method to paint the rich text content for rich text values. |
protected void | paintShapeBorder(Graphics g)
Utility method to paint the border for all non-rectangular shapes.
|
protected void | resetAttributes()
Resets attributes that would affect rendering if the
installAttributes is not being called, which is the
case if the view is a group and it's groupOpaque attribute is set to
false. |
graph.putClientProperty( JGraphpadVertexRenderer.CLIENTPROPERTY_SHOWFOLDINGICONS, new Boolean(false));
Parameters: width The width to compute the arc size for. height The height to compute the arc size for.
Returns: Returns the arc size.
Parameters: view The view that defines the bounds of the circle. source The start point of theline to intersect with the circle. p The end point of the line to intersect with the circle.
Returns: The interaction of the circle and the line between source and p.
Parameters: view The view that defines the bounds of the diamond. source The start point of theline to intersect with the diamond. p The end point of the line to intersect with the diamond.
Returns: The interaction of the diamond and the line between source and p.
Parameters: view The view to return the perimeter point for. source The location of the start point of the line to be intersected with the boundaries. p The location of the end point of the line to be intersected with the boundaries.
Returns: Returns the preferreds size for the current view.
Returns: Returns a configured renderer for the specified view.
Parameters: view The view that defines the bounds of the diamond. source The start point of theline to intersect with the diamond. p The end point of the line to intersect with the diamond.
Returns: The interaction of the diamond and the line between source and p.
Parameters: pt The point to check
Returns: Returns true if pt
intersects with the folding
icon.
Parameters: view The view to configure the renderer for.
Parameters: lineOneStart The start point of the first line. lineOneEnd The end point of the first line. lineTwoStart The start point of the second line. lineTwoEnd The end point of the second line.
Returns: Returns the intersection point between the first and the second line.
Parameters: g The graphics to paint the cell to.
Parameters: g The graphics to paint the background to.
Parameters: g The graphics to paint the border to.
Parameters: g The graphics to paint the rich text content to.
Parameters: g The graphics to paint the border to.