public class GridLayer extends CanvasLayer implements VisibleComponent
Constructor and Description |
---|
GridLayer()
Create a new GridLayer with a default one-pixel grid stroke
and a light grey grid color.
|
GridLayer(java.awt.Shape s,
java.awt.Paint p)
Create a new GridLayer with the given vertex shape and paint.
|
GridLayer(java.awt.Stroke s,
java.awt.Paint p)
Create a new GridLayer with the given grid stroke and paint
|
Modifier and Type | Method and Description |
---|---|
java.awt.Paint |
getGridPaint()
Get the grid line paint.
|
java.awt.Stroke |
getGridStroke()
Get the grid line stroke.
|
java.awt.Paint |
getVertexPaint()
Get the vertex point paint.
|
java.awt.Shape |
getVertexShape()
Get the vertex point shape.
|
boolean |
isVisible()
Test the visibility flag of this layer.
|
void |
paint(java.awt.Graphics2D g)
Paint this layer onto a 2D graphics object.
|
void |
paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D region)
Paint this layer onto a 2D graphics object, within the given
region.
|
void |
setGridPaint(java.awt.Paint p)
Set the grid line paint.
|
void |
setGridStroke(java.awt.Stroke s)
Set the grid line stroke.
|
void |
setVertexPaint(java.awt.Paint p)
Set the vertex point paint.
|
void |
setVertexShape(java.awt.Shape s)
Set the vertex point shape.
|
void |
setVisible(boolean flag)
Set the visibility flag of this layer.
|
getCanvasPane, getLayerBounds, getParent, getToolTipText, getTransformContext, repaint, repaint, setParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParent, getTransformContext, repaint, repaint
public GridLayer()
public GridLayer(java.awt.Stroke s, java.awt.Paint p)
public GridLayer(java.awt.Shape s, java.awt.Paint p)
public java.awt.Stroke getGridStroke()
public java.awt.Paint getGridPaint()
public java.awt.Shape getVertexShape()
public java.awt.Paint getVertexPaint()
public boolean isVisible()
isVisible
in interface VisibleComponent
public void paint(java.awt.Graphics2D g)
FIXME: Vertexes are not yet supported.
paint
in interface VisibleComponent
g
- The 2D graphics object that this object
it to be painted upon.public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D region)
paint
in interface VisibleComponent
g
- The 2D graphics object that this object
it to be painted upon.region
- The region.public void setGridStroke(java.awt.Stroke s)
public void setGridPaint(java.awt.Paint p)
public void setVertexShape(java.awt.Shape s)
public void setVertexPaint(java.awt.Paint p)
public void setVisible(boolean flag)
setVisible
in interface VisibleComponent
flag
- True if this object is to be visible.