public class JLinkPainter extends Object implements LinkPainter
The JLinkPainter
is JBotSim's default LinkPainter
for AWT.
Constructor and Description |
---|
JLinkPainter() |
Modifier and Type | Method and Description |
---|---|
protected void |
drawDestinationPartIfNeeded(Graphics2D g2d,
Link link) |
protected void |
drawDirectedDestinationEnd(Graphics2D g2d,
Point source,
Point destination) |
protected void |
drawLink(Graphics2D g2d,
Link link) |
protected boolean |
isDirected(Link link) |
void |
paintLink(UIComponent uiComponent,
Link link)
Paints the Links.
|
protected void |
setColor(Graphics2D g2d,
Link link)
|
protected void |
setRenderingHints(Graphics2D g2d,
Link link)
Sets the proper
RenderingHints on the provided Graphics2D object, with respect to the provided
Link . |
protected void |
setStroke(Graphics2D g2d,
Link link)
|
public void paintLink(UIComponent uiComponent, Link link)
LinkPainter
paintLink
in interface LinkPainter
uiComponent
- the graphical object to be drawn on.link
- the Link
to be drawn.protected void drawLink(Graphics2D g2d, Link link)
protected void drawDestinationPartIfNeeded(Graphics2D g2d, Link link)
protected void drawDirectedDestinationEnd(Graphics2D g2d, Point source, Point destination)
protected boolean isDirected(Link link)
protected void setColor(Graphics2D g2d, Link link)
Sets the proper Color
on the provided Graphics2D
object, with respect to the provided
Link
.
You can override this method if you need to change the JLinkPainter
's default color management.
g2d
- a Graphics2D
object.link
- the associated Link
.protected void setStroke(Graphics2D g2d, Link link)
Sets the proper Stroke
on the provided Graphics2D
object, with respect to the provided
Link
.
You can override this method if you need to change the JLinkPainter
's default Stroke
.
g2d
- a Graphics2D
object.link
- the associated Link
.protected void setRenderingHints(Graphics2D g2d, Link link)
Sets the proper RenderingHints
on the provided Graphics2D
object, with respect to the provided
Link
.
You can override this method if you need to change the JLinkPainter
rendering behavior.
g2d
- a Graphics2D
object.link
- the associated Link
.