public class SettableRenderer extends AbstractRenderer
The default is to paint vertices with Black foreground text and Red backgrounds. Picked vertices are orange. [Whether a vertex is Picked is resolved with v.getUserDatum(_VisualizationViewer.VIS_KEY);]
Note that setting a stroke width other than 1 is likely to slow down the visualization noticably, as is using transparency.
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
edgeColor
Deprecated.
|
protected EdgeColorFunction |
edgeColorFunction
Deprecated.
|
protected int |
edgeThickness
Deprecated.
|
protected EdgeThicknessFunction |
edgeThicknessFunction
Deprecated.
|
protected Arrow |
mArrow
Deprecated.
|
protected boolean |
mDrawLightBoxes
Deprecated.
|
protected EdgeStringer |
mEdgeLabelFunction
Deprecated.
|
protected int |
mLineHeight
Deprecated.
|
protected boolean |
mShouldDrawArrowsDirected
Deprecated.
|
protected boolean |
mShouldDrawArrowsUndirected
Deprecated.
|
protected boolean |
mShouldDrawSelfLoops
Deprecated.
|
protected StringLabeller |
mStringLabeller
Deprecated.
|
protected static EdgePredicate |
self_loop
Deprecated.
|
protected java.awt.Color |
vertexBGColor
Deprecated.
|
protected VertexColorFunction |
vertexColorFunction
Deprecated.
|
protected java.awt.Color |
vertexFGColor
Deprecated.
|
protected java.awt.Color |
vertexPickedColor
Deprecated.
|
Constructor and Description |
---|
SettableRenderer()
Deprecated.
This variant simply renders vertices as small empty boxes without labels.
|
SettableRenderer(StringLabeller sl)
Deprecated.
Creates a SettableRenderer that will be drawn in the "heavy" style: a box
around the label
|
SettableRenderer(StringLabeller sl,
EdgeStringer el)
Deprecated.
Creates a SettableRenderer that will label edges with the given EdgeStringer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
drawArrowhead(java.awt.Graphics2D g2d,
Edge e,
int xsource,
int ysource,
int xdest,
int ydest)
Deprecated.
Draws an arrowhead on this edge in the direction from xsource,ysource to
xend, yend
|
protected void |
drawEdge(float edgeWidth,
java.awt.Graphics g,
Edge e,
int x1,
int y1,
int x2,
int y2)
Deprecated.
Draws the edge at the given width, then restores the previous stroke.
|
protected void |
drawEdgeSimple(java.awt.Graphics g,
Edge e,
int x1,
int y1,
int x2,
int y2)
Deprecated.
|
protected java.lang.String |
getLabel(Vertex v)
Deprecated.
Simple label function returns the StringLabeller's notion of v's label.
|
void |
labelEdge(java.awt.Graphics2D g2d,
Edge e,
java.lang.String label,
int x1,
int x2,
int y1,
int y2)
Deprecated.
Labels the edge at the half-way point (if undirected) or three-quarters
if directed or 15 pixels above the vertex if self-loop.
|
void |
paintEdge(java.awt.Graphics g,
Edge e,
int x1,
int y1,
int x2,
int y2)
Deprecated.
Paints the edge in the color specified by the EdgeColorFunction or the
hard-set color, and at the thickness set with an
EdgeThicknessFunction.
|
protected void |
paintLightVertex(java.awt.Graphics g,
Vertex v,
int x,
int y,
java.lang.String label)
Deprecated.
|
void |
paintVertex(java.awt.Graphics g,
Vertex v,
int x,
int y)
Deprecated.
Paints the vertex, using the settings above (VertexColors, etc).
|
void |
setEdgeColor(java.awt.Color c)
Deprecated.
|
void |
setEdgeColorFunction(EdgeColorFunction ecf)
Deprecated.
Edges are drawn by calling EdgeColorFunction with the edge, to
decide how it is to be drawn.
|
void |
setEdgeThickness(int i)
Deprecated.
Forces all edges to draw with this thickness.
|
void |
setEdgeThicknessFunction(EdgeThicknessFunction etf)
Deprecated.
This version takes a function that dynamically chooses an edge thickness.
|
void |
setLightDrawing(boolean b)
Deprecated.
Creates a SettableRenderer that will be drawn in the "light" style: a
colored box next to text, instead of text overlaying the box.
|
void |
setShouldDrawDirectedArrows(boolean b)
Deprecated.
Sets whether the system should draw arrows on directed edges.
|
void |
setShouldDrawSelfLoops(boolean b)
Deprecated.
Sets whether the system should draw self-loops.
|
void |
setShouldDrawUndirectedArrows(boolean b)
Deprecated.
Sets whether the system should draw arrows on directed edges.
|
void |
setStringLabeller(StringLabeller sl)
Deprecated.
|
void |
setVertexBGColor(java.awt.Color vertexColor)
Deprecated.
Manually sets the color of an unpicked Vertex's background (i.e. its
field).
|
void |
setVertexColorFunction(VertexColorFunction vcf)
Deprecated.
Finds the color of a vertex with a VertexColorFunction.
|
void |
setVertexForegroundColor(java.awt.Color vertexColor)
Deprecated.
Manually sets the color of a Vertex's foreground (i.e. its text).
|
void |
setVertexPickedColor(java.awt.Color vertexColor)
Deprecated.
Manually sets the color of a picked Vertex's background (i.e. its field).
|
getPickedKey, isPicked, isPicked, setPickedKey
protected java.awt.Color vertexFGColor
protected java.awt.Color vertexPickedColor
protected java.awt.Color vertexBGColor
protected VertexColorFunction vertexColorFunction
protected EdgeThicknessFunction edgeThicknessFunction
protected int edgeThickness
protected java.awt.Color edgeColor
protected EdgeColorFunction edgeColorFunction
protected StringLabeller mStringLabeller
protected boolean mShouldDrawSelfLoops
protected boolean mDrawLightBoxes
protected boolean mShouldDrawArrowsUndirected
protected boolean mShouldDrawArrowsDirected
protected Arrow mArrow
protected EdgeStringer mEdgeLabelFunction
protected int mLineHeight
protected static EdgePredicate self_loop
public SettableRenderer()
public SettableRenderer(StringLabeller sl)
sl
- public SettableRenderer(StringLabeller sl, EdgeStringer el)
sl
- el
- public void setLightDrawing(boolean b)
public void setStringLabeller(StringLabeller sl)
public void setEdgeColor(java.awt.Color c)
public void setEdgeColorFunction(EdgeColorFunction ecf)
ecf
- public void setEdgeThickness(int i)
i
- public void setEdgeThicknessFunction(EdgeThicknessFunction etf)
etf
- public void setShouldDrawDirectedArrows(boolean b)
b
- public void setShouldDrawUndirectedArrows(boolean b)
b
- public void setShouldDrawSelfLoops(boolean b)
b
- public void paintEdge(java.awt.Graphics g, Edge e, int x1, int y1, int x2, int y2)
paintEdge
in interface Renderer
paintEdge
in class AbstractRenderer
EdgeThicknessFunction
,
EdgeColorFunction
public void labelEdge(java.awt.Graphics2D g2d, Edge e, java.lang.String label, int x1, int x2, int y1, int y2)
g2d
- e
- label
- x1
- x2
- y1
- y2
- protected void drawArrowhead(java.awt.Graphics2D g2d, Edge e, int xsource, int ysource, int xdest, int ydest)
protected void drawEdge(float edgeWidth, java.awt.Graphics g, Edge e, int x1, int y1, int x2, int y2)
edgeWidth
- the width of the stroke.protected void drawEdgeSimple(java.awt.Graphics g, Edge e, int x1, int y1, int x2, int y2)
public void setVertexForegroundColor(java.awt.Color vertexColor)
vertexColor
- public void setVertexPickedColor(java.awt.Color vertexColor)
vertexColor
- public void setVertexBGColor(java.awt.Color vertexColor)
vertexColor
- public void setVertexColorFunction(VertexColorFunction vcf)
vcf
- protected java.lang.String getLabel(Vertex v)
v
- a vertexpublic void paintVertex(java.awt.Graphics g, Vertex v, int x, int y)
paintVertex
in interface Renderer
paintVertex
in class AbstractRenderer
protected void paintLightVertex(java.awt.Graphics g, Vertex v, int x, int y, java.lang.String label)
g
- v
- x
- y
-