final class AWTPlotRenderer extends AbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color> implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
(package private) CommitGraphPane.GraphCellRender |
cell |
(package private) java.awt.Graphics2D |
g |
private static long |
serialVersionUID |
Constructor and Description |
---|
AWTPlotRenderer(CommitGraphPane.GraphCellRender c) |
Modifier and Type | Method and Description |
---|---|
protected void |
drawBoundaryDot(int x,
int y,
int w,
int h)
Draw a single boundary commit (aka uninteresting commit) dot.
|
protected void |
drawCommitDot(int x,
int y,
int w,
int h)
Draw a single commit dot.
|
protected int |
drawLabel(int x,
int y,
Ref ref)
Draw a decoration for the Ref ref at x,y
|
protected void |
drawLine(java.awt.Color color,
int x1,
int y1,
int x2,
int y2,
int width)
Draw a single line within this cell.
|
protected void |
drawText(java.lang.String msg,
int x,
int y)
Draw a single line of text.
|
protected java.awt.Color |
laneColor(SwingCommitList.SwingLane myLane)
Obtain the color reference used to paint this lane.
|
(package private) void |
paint(java.awt.Graphics in,
PlotCommit<SwingCommitList.SwingLane> commit) |
(package private) void |
paintTriangleDown(int cx,
int y,
int h) |
paintCommit
private static final long serialVersionUID
final CommitGraphPane.GraphCellRender cell
transient java.awt.Graphics2D g
AWTPlotRenderer(CommitGraphPane.GraphCellRender c)
void paint(java.awt.Graphics in, PlotCommit<SwingCommitList.SwingLane> commit)
protected void drawLine(java.awt.Color color, int x1, int y1, int x2, int y2, int width)
drawLine
in class AbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color>
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.protected void drawCommitDot(int x, int y, int w, int h)
Usually the commit dot is a filled oval in blue, then a drawn oval in black, using the same coordinates for both operations.
drawCommitDot
in class AbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color>
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.protected void drawBoundaryDot(int x, int y, int w, int h)
Usually a boundary commit dot is a light gray oval with a white center.
drawBoundaryDot
in class AbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color>
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.protected void drawText(java.lang.String msg, int x, int y)
The font and colors used to render the text are left up to the implementation.
drawText
in class AbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color>
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.protected java.awt.Color laneColor(SwingCommitList.SwingLane myLane)
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.
laneColor
in class AbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color>
myLane
- the current lane. May be null.void paintTriangleDown(int cx, int y, int h)
protected int drawLabel(int x, int y, Ref ref)
drawLabel
in class AbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color>
x
- lefty
- topref
- A peeled ref