Class AWTPlotRenderer

All Implemented Interfaces:
Serializable

final class AWTPlotRenderer extends AbstractPlotRenderer<SwingCommitList.SwingLane,Color> implements Serializable
  • Field Details

  • Constructor Details

  • Method Details

    • paint

      void paint(Graphics in, PlotCommit<SwingCommitList.SwingLane> commit)
    • drawLine

      protected void drawLine(Color color, int x1, int y1, int x2, int y2, int width)
      Draw a single line within this cell.
      Specified by:
      drawLine in class AbstractPlotRenderer<SwingCommitList.SwingLane,Color>
      Parameters:
      color - the color to use while drawing the line.
      x1 - starting X coordinate, 0 based.
      y1 - starting Y coordinate, 0 based.
      x2 - ending X coordinate, 0 based.
      y2 - ending Y coordinate, 0 based.
      width - number of pixels wide for the line. Always at least 1.
    • drawCommitDot

      protected void drawCommitDot(int x, int y, int w, int h)
      Draw a single commit dot.

      Usually the commit dot is a filled oval in blue, then a drawn oval in black, using the same coordinates for both operations.

      Specified by:
      drawCommitDot in class AbstractPlotRenderer<SwingCommitList.SwingLane,Color>
      Parameters:
      x - upper left of the oval's bounding box.
      y - upper left of the oval's bounding box.
      w - width of the oval's bounding box.
      h - height of the oval's bounding box.
    • drawBoundaryDot

      protected void drawBoundaryDot(int x, int y, int w, int h)
      Draw a single boundary commit (aka uninteresting commit) dot.

      Usually a boundary commit dot is a light gray oval with a white center.

      Specified by:
      drawBoundaryDot in class AbstractPlotRenderer<SwingCommitList.SwingLane,Color>
      Parameters:
      x - upper left of the oval's bounding box.
      y - upper left of the oval's bounding box.
      w - width of the oval's bounding box.
      h - height of the oval's bounding box.
    • drawText

      protected void drawText(String msg, int x, int y)
      Draw a single line of text.

      The font and colors used to render the text are left up to the implementation.

      Specified by:
      drawText in class AbstractPlotRenderer<SwingCommitList.SwingLane,Color>
      Parameters:
      msg - the text to draw. Does not contain LFs.
      x - first pixel from the left that the text can be drawn at. Character data must not appear before this position.
      y - pixel coordinate of the baseline of the text. Implementations must adjust this coordinate to account for the way their implementation handles font rendering.
    • laneColor

      protected Color laneColor(SwingCommitList.SwingLane myLane)
      Obtain the color reference used to paint this lane.

      Colors returned by this method will be passed to the other drawing primitives, so the color returned should be application specific.

      If a null lane is supplied the return value must still be acceptable to a drawing method. Usually this means the implementation should return a default color.

      Specified by:
      laneColor in class AbstractPlotRenderer<SwingCommitList.SwingLane,Color>
      Parameters:
      myLane - the current lane. May be null.
      Returns:
      graphics specific color reference. Must be a valid color.
    • paintTriangleDown

      void paintTriangleDown(int cx, int y, int h)
    • drawLabel

      protected int drawLabel(int x, int y, Ref ref)
      Draw a decoration for the Ref ref at x,y
      Specified by:
      drawLabel in class AbstractPlotRenderer<SwingCommitList.SwingLane,Color>
      Parameters:
      x - left
      y - top
      ref - A peeled ref
      Returns:
      width of label in pixels