public class GridView extends TiledView
Modifier and Type | Class and Description |
---|---|
static class |
GridView.Horizontal
The grid horizontal type.
|
static class |
GridView.Style
The grid style.
|
static class |
GridView.Vertical
The grid vertical type.
|
Constructor and Description |
---|
GridView()
Constructs a grid view with default types, style, and color.
|
GridView(java.awt.Color color)
Constructs a grid view with specified color.
|
GridView(GridView.Horizontal horizontal,
GridView.Vertical vertical)
Constructs a grid view with specified types.
|
GridView(GridView.Horizontal horizontal,
GridView.Vertical vertical,
java.awt.Color color)
Constructs a grid view with specified types and color.
|
GridView(GridView.Horizontal horizontal,
GridView.Vertical vertical,
java.awt.Color color,
GridView.Style style)
Constructs a grid view with specified types, style, and color.
|
GridView(GridView.Style style)
Constructs a grid view with specified style.
|
GridView(java.lang.String parameters)
Constructs a grid view with specified parameters string.
|
Modifier and Type | Method and Description |
---|---|
void |
paint(java.awt.Graphics2D g2d)
Paints this tiled view.
|
void |
setColor(java.awt.Color color)
Sets the grid color.
|
void |
setHorizontal(GridView.Horizontal horizontal)
Sets the grid horizontal type.
|
void |
setParameters(java.lang.String parameters)
Sets the grid types, color, and style parameters from a string.
|
void |
setStyle(GridView.Style style)
Sets the grid style.
|
void |
setVertical(GridView.Vertical vertical)
Sets the grid vertical type.
|
getBestHorizontalProjector, getBestVerticalProjector, getHorizontalProjector, getLineWidth, getTile, getTranscaler, getVerticalProjector, repaint, setBestProjectors
public GridView()
public GridView(GridView.Horizontal horizontal, GridView.Vertical vertical)
horizontal
- the grid horizontal type.vertical
- the grid vertical type.public GridView(GridView.Style style)
style
- the grid style.public GridView(java.awt.Color color)
color
- the grid color.public GridView(GridView.Horizontal horizontal, GridView.Vertical vertical, java.awt.Color color)
horizontal
- the grid horizontal type.vertical
- the grid vertical type.color
- the grid color.public GridView(GridView.Horizontal horizontal, GridView.Vertical vertical, java.awt.Color color, GridView.Style style)
horizontal
- the grid horizontal type.vertical
- the grid vertical type.color
- the grid color.style
- the grid style.public GridView(java.lang.String parameters)
setParameters(String)
for the format of the parameters string.parameters
- the color and style of grid lines.public void setHorizontal(GridView.Horizontal horizontal)
horizontal
- the grid horizontal typepublic void setVertical(GridView.Vertical vertical)
vertical
- the grid vertical typepublic void setColor(java.awt.Color color)
color
- the color; null, for default color.public void setStyle(GridView.Style style)
style
- the style.public void setParameters(java.lang.String parameters)
To specify grid horizontal type, the parameters string may contain "H0" for grid horizontal type zero, or simply "H" for grid horizontal type major. Otherwise, the grid horizontal type is none.
To specify grid vertical type, the parameters string may contain "V0" for grid vertical type zero, or simply "V" for grid vertical type major. Otherwise, the grid vertical type is none.
To specify a grid color, the parameters string may contain one of "r" for red, "g" for green, "b" for blue, "c" for cyan, "m" for magenta, "y" for yellow, "k" for black, or "w" for white. If the parameter string contains none of these colors, then the default color is used.
To specify a grid style, the parameters string may contain one of "-" for solid lines, "--" for dashed lines, "-." for dotted lines, or "--." for dash-dotted lines. If the parameters string contains none of these line styles, then no grid lines are painted.
parameters
- the grid parameters string.public void paint(java.awt.Graphics2D g2d)
TiledView
Tiled views should not replace (set) entirely the transform in the specified graphics context. This transform may already have been set by the tile or its mosaic. Therefore, tiled views should modify this transform only by specifying additional scaling, translation, etc.