This renderer displays entries that implement the CellView interface.
beginDeco
protected int beginDeco
Painting attributes of the current edgeview
beginFill
protected boolean beginFill
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
beginSize
protected int beginSize
Painting attributes of the current edgeview
borderColor
protected Color borderColor
Color attributes of the current edgeview. This components foreground is
set to the edgecolor, the fontColor is in an extra variable. If the
fontColor is null, the current foreground is used. The default background
instead is used for text and is not visible if the label is not visible
or if opaque is true.
childrenSelected
protected boolean childrenSelected
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
dashOffset
protected float dashOffset
Contains the current dash offset. Null means no offset.
defaultBackground
protected Color defaultBackground
Color attributes of the current edgeview. This components foreground is
set to the edgecolor, the fontColor is in an extra variable. If the
fontColor is null, the current foreground is used. The default background
instead is used for text and is not visible if the label is not visible
or if opaque is true.
defaultForeground
protected Color defaultForeground
Color attributes of the current edgeview. This components foreground is
set to the edgecolor, the fontColor is in an extra variable. If the
fontColor is null, the current foreground is used. The default background
instead is used for text and is not visible if the label is not visible
or if opaque is true.
endDeco
protected int endDeco
Painting attributes of the current edgeview
endFill
protected boolean endFill
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
endSize
protected int endSize
Painting attributes of the current edgeview
extraLabelFont
public Font extraLabelFont
Override this if you want the extra labels to appear in a special fontJ
focus
protected boolean focus
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
fontColor
protected Color fontColor
Color attributes of the current edgeview. This components foreground is
set to the edgecolor, the fontColor is in an extra variable. If the
fontColor is null, the current foreground is used. The default background
instead is used for text and is not visible if the label is not visible
or if opaque is true.
fontGraphics
protected static Graphics fontGraphics
Static Graphics used for Font Metrics
gradientColor
protected Color gradientColor
The gradient color of the edge
graph
protected WeakReference graph
Cache the current graph for drawing
gridColor
protected Color gridColor
The color of the graph grid
highlightColor
protected Color highlightColor
The color of highlighted cells
isMoveBelowZero
protected boolean isMoveBelowZero
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
labelBorder
protected boolean labelBorder
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
labelTransformEnabled
protected boolean labelTransformEnabled
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
lineDash
protected float[] lineDash
Contains the current dash pattern. Null means no pattern.
lineStyle
protected int lineStyle
Painting attributes of the current edgeview
lineWidth
protected float lineWidth
Width of the current edge view
lockedHandleColor
protected Color lockedHandleColor
The color of the second available handle
metrics
protected FontMetrics metrics
Reference to the font metrics of the above
opaque
protected boolean opaque
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
preview
protected boolean preview
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
selected
protected boolean selected
Boolean attributes of the current edgeview. Fill flags are checked for
valid decorations.
simpleExtraLabels
public boolean simpleExtraLabels
A switch for painting the extra labels
view
protected EdgeView view
Cache the current edgeview for drawing
createLineEnd
protected Shape createLineEnd(int size,
int style,
Point2D src,
Point2D dst)
Paint the current view's direction. Sets tmpPoint as a side-effect such
that the invoking method can use it to determine the connection point to
this decoration.
createShape
protected Shape createShape()
Returns the shape that represents the current edge in the context of the
current graph. This method sets the global beginShape, lineShape and
endShape variables as a side-effect.
firePropertyChange
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
firePropertyChange
public void firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
firePropertyChange
public void firePropertyChange(String propertyName,
byte oldValue,
byte newValue)
firePropertyChange
public void firePropertyChange(String propertyName,
char oldValue,
char newValue)
firePropertyChange
public void firePropertyChange(String propertyName,
double oldValue,
double newValue)
firePropertyChange
public void firePropertyChange(String propertyName,
float oldValue,
float newValue)
firePropertyChange
public void firePropertyChange(String propertyName,
int oldValue,
int newValue)
firePropertyChange
public void firePropertyChange(String propertyName,
long oldValue,
long newValue)
firePropertyChange
public void firePropertyChange(String propertyName,
short oldValue,
short newValue)
getBounds
public Rectangle2D getBounds(CellView value)
Returns the bounds of the edge shape.
getExtraLabelBounds
public Rectangle2D getExtraLabelBounds(JGraph paintingContext,
EdgeView view,
int index)
Returns the label bounds of the specified view in the given graph. Note:
The index is the position of the String object for the label in the extra
labels array of the view.
getExtraLabelPosition
public Point2D getExtraLabelPosition(EdgeView view,
int index)
Returns the label position of the specified view in the given graph.
getExtraLabelSize
public Dimension getExtraLabelSize(JGraph paintingContext,
EdgeView view,
int index)
Returns the label size of the specified view in the given graph.
getGradientColor
public Color getGradientColor()
- Returns the gradientColor.
getLabelBounds
public Rectangle2D getLabelBounds(Point2D p,
Dimension d,
String label)
Returns the label bounds of the specified view in the given graph.
getLabelBounds
public Rectangle2D getLabelBounds(JGraph paintingContext,
EdgeView view)
Returns the label bounds of the specified view in the given graph.
getLabelPosition
protected Point2D getLabelPosition(Point2D pos)
Returns the label position of the specified view in the given graph.
getLabelPosition
public Point2D getLabelPosition(EdgeView view)
Returns the label position of the specified view in the given graph.
getLabelSize
public Dimension getLabelSize(EdgeView view,
String label)
Returns the label size of the specified view in the given graph.
getPaintBounds
public Rectangle2D getPaintBounds(EdgeView view)
Returns the bounds of the edge shape without label
getRelativeLabelPosition
protected Point2D getRelativeLabelPosition(EdgeView edge,
Point2D geometry)
getRendererComponent
public Component getRendererComponent(JGraph graph,
CellView view,
boolean sel,
boolean focus,
boolean preview)
Configure and return the renderer based on the passed in components. The
value is typically set from messaging the graph with
convertValueToString
.
- getRendererComponent in interface CellViewRenderer
graph
- the graph that that defines the rendering context.view
- the cell view that should be rendered.sel
- whether the object is selected.focus
- whether the object has the focus.preview
- whether we are drawing a preview.
- the component used to render the value.
installAttributes
protected void installAttributes(CellView view)
Installs the attributes of specified cell in this renderer instance. This
means, retrieve every published key from the cells hashtable and set
global variables or superclass properties accordingly.
view
- the cell view to retrieve the attribute values from.
intersects
public boolean intersects(JGraph graph,
CellView value,
Rectangle rect)
Returns true if the edge shape intersects the given rectangle.
isFillable
protected boolean isFillable(int decoration)
paint
public void paint(Graphics g)
Paint the renderer.
paintLabel
protected void paintLabel(Graphics g,
String label,
Point2D p,
boolean mainLabel)
Paint the specified label for the current edgeview.
paintSelectionBorder
protected void paintSelectionBorder(Graphics g)
Provided for subclassers to paint a selection border.
repaint
public void repaint(Rectangle r)
repaint
public void repaint(long tm,
int x,
int y,
int width,
int height)
revalidate
public void revalidate()
setGradientColor
public void setGradientColor(Color gradientColor)
gradientColor
- The gradientColor to set.
translateGraphics
protected void translateGraphics(Graphics g)
validate
public void validate()