public class DefaultVertexRenderer extends Object implements VertexRenderer
| Modifier and Type | Field and Description |
|---|---|
static Paint |
ERROR_PAINT |
static Paint |
FILL_PAINT |
static Paint |
LINE_PAINT |
static Paint |
TEXT_PAINT |
| Constructor and Description |
|---|
DefaultVertexRenderer() |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(Graphics2D g2d,
Vertex vertex)
Default implementation draws the outline and the name of the vertex
|
void |
drawLinesOfTexts(Graphics2D g2d,
Vertex vertex,
ArrayList<String> linesOfText,
Paint textPaint)
Draw lines of text within the boundaries of the vertex
|
void |
drawName(Graphics2D g2d,
Vertex vertex,
Paint textPaint)
Write the name of the vertex in the centre of it
|
void |
drawOutline(Graphics2D g2d,
Vertex vertex,
Paint fillPaint,
Paint linePaint)
Fill and then draw the outline as a Polygon
|
void |
drawOutline3DRect(Graphics2D g2d,
Vertex vertex,
Paint fillPaint)
Fills the outline as 3D rectangle, but it does not draw the border of the outline
|
void |
drawOutline3DRect(Graphics2D g2d,
Vertex vertex,
Paint fillPaint,
Paint linePaint)
Fills the outline as 3D rectangle.
|
void |
drawOutlineRect(Graphics2D g2d,
Vertex vertex,
Paint fillPaint)
Fills the outline as rectangle, but it does not draw the border of the outline
|
void |
drawOutlineRect(Graphics2D g2d,
Vertex vertex,
Paint fillPaint,
Paint linePaint)
Fills the outline as rectangle.
|
void |
drawText(Graphics2D g2d,
Vertex vertex,
String text,
Paint textPaint)
Draw the text within the boundaries of the vertex
|
public static final Paint FILL_PAINT
public static final Paint LINE_PAINT
public static final Paint TEXT_PAINT
public static final Paint ERROR_PAINT
public void draw(Graphics2D g2d, Vertex vertex)
draw in interface VertexRendererg2d - the canvas to draw onvertex - the vertex to be drawpublic void drawOutline(Graphics2D g2d, Vertex vertex, Paint fillPaint, Paint linePaint)
g2d - the canvasvertex - the vertex to be drawnpublic void drawOutline3DRect(Graphics2D g2d, Vertex vertex, Paint fillPaint)
g2d - the canvasvertex - the vertex to be drawnfillPaint - the fill colorpublic void drawOutline3DRect(Graphics2D g2d, Vertex vertex, Paint fillPaint, Paint linePaint)
g2d - the canvasvertex - the vertex to be drawnfillPaint - the fill colorlinePaint - the color of the line, can be nullpublic void drawOutlineRect(Graphics2D g2d, Vertex vertex, Paint fillPaint)
g2d - the canvasvertex - the vertex to be drawnfillPaint - the fill colorpublic void drawOutlineRect(Graphics2D g2d, Vertex vertex, Paint fillPaint, Paint linePaint)
g2d - the canvasvertex - the vertex to be drawnfillPaint - the fill colorlinePaint - the color of the line, can be nullpublic void drawText(Graphics2D g2d, Vertex vertex, String text, Paint textPaint)
g2d - the canvasvertex - the vertex in which the text is drawntext - the text to drawtextPaint - the color of the textpublic void drawName(Graphics2D g2d, Vertex vertex, Paint textPaint)
g2d - the canvasvertex - the vertex in which the name is drawnpublic void drawLinesOfTexts(Graphics2D g2d, Vertex vertex, ArrayList<String> linesOfText, Paint textPaint)
g2d - the canvasvertex - the vertex for which the text to be drawnlinesOfText - lines of the texttextPaint - the color of the textCopyright © 1997–2019 CRISTAL-iSE. All rights reserved.