T
- the type of the vertex to renderpublic class DefaultVertexRenderer<T extends Vertex> extends java.lang.Object implements VertexRenderer<T>
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
background
the background color
|
protected java.awt.geom.Ellipse2D.Float |
circle
the circle
|
protected java.awt.Stroke |
edgeStroke
the stroke for the vertex edge
|
protected int |
edgeWidth
the line width of the edge
|
protected java.awt.Font |
font
the font
|
protected java.awt.Color |
foreground
the foreground color
|
protected int |
xCenter
the x position of the center of the vertex
|
protected int |
yCenter
the y position of the center of the vertex
|
Constructor and Description |
---|
DefaultVertexRenderer()
Creates a new default vertex renderer.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics2D g,
T o)
Renders the object to the graphics context.
|
void |
setAttachmentPoint(int x,
int y)
Sets the attachment point of the vertex.
|
void |
setBackground(java.awt.Color c)
Sets the background color.
|
void |
setDiameter(int d)
Sets the diameter of the vertex.
|
void |
setEdgeWidth(int w)
Sets the line width of the edge of the vertex.
|
void |
setFont(java.awt.Font f)
Sets the font.
|
void |
setForeground(java.awt.Color c)
Sets the foreground color.
|
void |
setPositionCenter(int x,
int y)
Sets the center position of the vertex.
|
void |
setPositionLeftTop(int x,
int y)
Sets the left top position of the vertex.
|
protected final java.awt.geom.Ellipse2D.Float circle
protected java.awt.Color background
protected java.awt.Color foreground
protected int xCenter
protected int yCenter
protected java.awt.Font font
protected int edgeWidth
protected java.awt.Stroke edgeStroke
public DefaultVertexRenderer()
public void setBackground(java.awt.Color c)
Renderer
setBackground
in interface Renderer<T extends Vertex>
c
- the background colorpublic void setForeground(java.awt.Color c)
Renderer
setForeground
in interface Renderer<T extends Vertex>
c
- the foreground colorpublic void draw(java.awt.Graphics2D g, T o)
Renderer
public void setPositionLeftTop(int x, int y)
VertexRenderer
setPositionLeftTop
in interface VertexRenderer<T extends Vertex>
x
- the x positiony
- the y positionpublic void setPositionCenter(int x, int y)
VertexRenderer
setPositionCenter
in interface VertexRenderer<T extends Vertex>
x
- the x positiony
- the y positionpublic void setDiameter(int d)
VertexRenderer
setDiameter
in interface VertexRenderer<T extends Vertex>
d
- the diameterpublic void setFont(java.awt.Font f)
Renderer
public void setEdgeWidth(int w)
VertexRenderer
setEdgeWidth
in interface VertexRenderer<T extends Vertex>
w
- the line widthpublic void setAttachmentPoint(int x, int y)
VertexRenderer
setAttachmentPoint
in interface VertexRenderer<T extends Vertex>
x
- the x position of the attachment pointy
- the y position of the attachment point