Package org.eclipse.jgit.awtui
Class AWTPlotRenderer
- java.lang.Object
-
- org.eclipse.jgit.revplot.AbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color>
-
- org.eclipse.jgit.awtui.AWTPlotRenderer
-
- All Implemented Interfaces:
java.io.Serializable
final class AWTPlotRenderer extends AbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color> implements java.io.Serializable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CommitGraphPane.GraphCellRendercell(package private) java.awt.Graphics2Dgprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description AWTPlotRenderer(CommitGraphPane.GraphCellRender c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddrawBoundaryDot(int x, int y, int w, int h)Draw a single boundary commit (aka uninteresting commit) dot.protected voiddrawCommitDot(int x, int y, int w, int h)Draw a single commit dot.protected intdrawLabel(int x, int y, Ref ref)Draw a decoration for the Ref ref at x,yprotected voiddrawLine(java.awt.Color color, int x1, int y1, int x2, int y2, int width)Draw a single line within this cell.protected voiddrawText(java.lang.String msg, int x, int y)Draw a single line of text.protected java.awt.ColorlaneColor(SwingCommitList.SwingLane myLane)Obtain the color reference used to paint this lane.(package private) voidpaint(java.awt.Graphics in, PlotCommit<SwingCommitList.SwingLane> commit)(package private) voidpaintTriangleDown(int cx, int y, int h)-
Methods inherited from class org.eclipse.jgit.revplot.AbstractPlotRenderer
paintCommit
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
cell
final CommitGraphPane.GraphCellRender cell
-
g
transient java.awt.Graphics2D g
-
-
Constructor Detail
-
AWTPlotRenderer
AWTPlotRenderer(CommitGraphPane.GraphCellRender c)
-
-
Method Detail
-
paint
void paint(java.awt.Graphics in, PlotCommit<SwingCommitList.SwingLane> commit)
-
drawLine
protected void drawLine(java.awt.Color color, int x1, int y1, int x2, int y2, int width)Draw a single line within this cell.- Specified by:
drawLinein classAbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.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:
drawCommitDotin classAbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.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:
drawBoundaryDotin classAbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.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(java.lang.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:
drawTextin classAbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.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 java.awt.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:
laneColorin classAbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.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:
drawLabelin classAbstractPlotRenderer<SwingCommitList.SwingLane,java.awt.Color>- Parameters:
x- lefty- topref- A peeled ref- Returns:
- width of label in pixels
-
-