public class JBackgroundPainter extends Object implements BackgroundPainter
The JBackgroundPainter
is JBotSim's default BackgroundPainter
for AWT.
Constructor and Description |
---|
JBackgroundPainter() |
Modifier and Type | Method and Description |
---|---|
protected void |
drawSensingRange(Graphics2D g2d,
Node n) |
void |
paintBackground(UIComponent uiComponent,
Topology tp)
Provides a way to draw things on the background.
|
protected void |
setColor(Graphics2D g2d,
Topology topology)
|
protected void |
setRenderingHints(Graphics2D g2d,
Topology topology)
Sets the proper
RenderingHints on the provided Graphics2D object, with respect to the provided
Topology . |
protected void |
setStroke(Graphics2D g2d,
Topology topology)
|
public void paintBackground(UIComponent uiComponent, Topology tp)
BackgroundPainter
paintBackground
in interface BackgroundPainter
uiComponent
- the graphical object to be drawn on.tp
- the Topology
to pick information from.protected void drawSensingRange(Graphics2D g2d, Node n)
protected void setColor(Graphics2D g2d, Topology topology)
Sets the proper Color
on the provided Graphics2D
object, with respect to the provided
Topology
.
You can override this method if you need to change the JBackgroundPainter
's default color management.
g2d
- a Graphics2D
object.topology
- the associated Topology
.protected void setStroke(Graphics2D g2d, Topology topology)
Sets the proper Stroke
on the provided Graphics2D
object, with respect to the provided
Topology
.
You can override this method if you need to change the JBackgroundPainter
's default Stroke
.
g2d
- a Graphics2D
object.topology
- the associated Topology
.protected void setRenderingHints(Graphics2D g2d, Topology topology)
Sets the proper RenderingHints
on the provided Graphics2D
object, with respect to the provided
Topology
.
You can override this method if you need to change the JBackgroundPainter
rendering behavior.
g2d
- a Graphics2D
object.topology
- the associated Topology
.