Class DefaultVertexRenderer

java.lang.Object
org.cristalise.kernel.graph.renderer.DefaultVertexRenderer
All Implemented Interfaces:
VertexRenderer
Direct Known Subclasses:
ActivityDefRenderer, ActivityRenderer, AggregationMemberRenderer, DefaultSplitJoinRenderer

public class DefaultVertexRenderer extends Object implements VertexRenderer
Default vertex renderer implementing VertexRenderer. Use it as is or as a base class
  • Field Details

    • FILL_PAINT

      public static final Paint FILL_PAINT
    • LINE_PAINT

      public static final Paint LINE_PAINT
    • TEXT_PAINT

      public static final Paint TEXT_PAINT
    • ERROR_PAINT

      public static final Paint ERROR_PAINT
  • Constructor Details

    • DefaultVertexRenderer

      public DefaultVertexRenderer()
  • Method Details

    • draw

      public void draw(Graphics2D g2d, Vertex vertex)
      Default implementation draws the outline and the name of the vertex
      Specified by:
      draw in interface VertexRenderer
      Parameters:
      g2d - the canvas to draw on
      vertex - the vertex to be draw
    • drawOutline

      public void drawOutline(Graphics2D g2d, Vertex vertex, Paint fillPaint, Paint linePaint)
      Fill and then draw the outline as a Polygon
      Parameters:
      g2d - the canvas
      vertex - the vertex to be drawn
    • drawOutline3DRect

      public void drawOutline3DRect(Graphics2D g2d, Vertex vertex, Paint fillPaint)
      Fills the outline as 3D rectangle, but it does not draw the border of the outline
      Parameters:
      g2d - the canvas
      vertex - the vertex to be drawn
      fillPaint - the fill color
    • drawOutline3DRect

      public void drawOutline3DRect(Graphics2D g2d, Vertex vertex, Paint fillPaint, Paint linePaint)
      Fills the outline as 3D rectangle. It draws the border of the outline if linePaint is not null
      Parameters:
      g2d - the canvas
      vertex - the vertex to be drawn
      fillPaint - the fill color
      linePaint - the color of the line, can be null
    • drawOutlineRect

      public void drawOutlineRect(Graphics2D g2d, Vertex vertex, Paint fillPaint)
      Fills the outline as rectangle, but it does not draw the border of the outline
      Parameters:
      g2d - the canvas
      vertex - the vertex to be drawn
      fillPaint - the fill color
    • drawOutlineRect

      public void drawOutlineRect(Graphics2D g2d, Vertex vertex, Paint fillPaint, Paint linePaint)
      Fills the outline as rectangle. It draws the border of the outline if linePaint is not null
      Parameters:
      g2d - the canvas
      vertex - the vertex to be drawn
      fillPaint - the fill color
      linePaint - the color of the line, can be null
    • drawText

      public void drawText(Graphics2D g2d, Vertex vertex, String text, Paint textPaint)
      Draw the text within the boundaries of the vertex
      Parameters:
      g2d - the canvas
      vertex - the vertex in which the text is drawn
      text - the text to draw
      textPaint - the color of the text
    • drawName

      public void drawName(Graphics2D g2d, Vertex vertex, Paint textPaint)
      Write the name of the vertex in the centre of it
      Parameters:
      g2d - the canvas
      vertex - the vertex in which the name is drawn
    • drawLinesOfTexts

      public void drawLinesOfTexts(Graphics2D g2d, Vertex vertex, ArrayList<String> linesOfText, Paint textPaint)
      Draw lines of text within the boundaries of the vertex
      Parameters:
      g2d - the canvas
      vertex - the vertex for which the text to be drawn
      linesOfText - lines of the text
      textPaint - the color of the text