public class GridVisualCreator extends Object implements IVisualCreator
styles
.GridInfo
,
getGridStyle()
Constructor and Description |
---|
GridVisualCreator()
Initializes a new instance of the
GridVisualCreator class. |
GridVisualCreator(double horizontalSpacing,
double verticalSpacing)
Initializes a new instance of the
GridVisualCreator class. |
GridVisualCreator(GridInfo gridInfo)
Initializes a new instance of the
GridVisualCreator class. |
Modifier and Type | Method and Description |
---|---|
Node |
createVisual(IRenderContext context)
This method is called by the framework to create a
Node that will be included into the IRenderContext . |
GridInfo |
getGridInfo()
Gets the grid info that describes the geometry of the grid.
|
GridStyle |
getGridStyle()
Gets the grid style that this implementation uses.
|
Pen |
getPen()
Gets the pen to use for painting the grid points.
|
double |
getVisibilityThreshold()
Gets the visibility threshold.
|
boolean |
isVisible()
Gets a value indicating whether this
GridVisualCreator is visible. |
void |
setGridInfo(GridInfo value)
Sets the grid info that describes the geometry of the grid.
|
void |
setGridStyle(GridStyle value)
Sets the grid style that this implementation uses.
|
void |
setPen(Pen value)
Sets the pen to use for painting the grid points.
|
void |
setVisibilityThreshold(double value)
Sets the visibility threshold.
|
void |
setVisible(boolean value)
Sets a value indicating whether this
GridVisualCreator is visible. |
Node |
updateVisual(IRenderContext context,
Node oldVisual)
This method updates or replaces a previously created
Node for inclusion in the IRenderContext . |
public GridVisualCreator()
GridVisualCreator
class.
The spacing is initialized to 25 units.
public GridVisualCreator(double horizontalSpacing, double verticalSpacing)
GridVisualCreator
class.
This initializes the GridInfo
field using the given values.
horizontalSpacing
- The x spacing.verticalSpacing
- The y spacing.public GridVisualCreator(GridInfo gridInfo)
GridVisualCreator
class.gridInfo
- The grid info.public final Node createVisual(IRenderContext context)
IVisualCreator
Node
that will be included into the IRenderContext
.
CanvasControl
uses this interface through the ICanvasObjectDescriptor
to populate the visual canvas object tree.
createVisual
in interface IVisualCreator
context
- The context that describes where the visual will be used.null
.IVisualCreator.updateVisual(IRenderContext, Node)
public final GridInfo getGridInfo()
setGridInfo(GridInfo)
public final GridStyle getGridStyle()
setGridStyle(GridStyle)
public final Pen getPen()
setPen(Pen)
public final double getVisibilityThreshold()
This indicates the minimum distance in the view coordinate system between two grid points. If the distance becomes
smaller, the grid will not be rendered. The default value is 20.0d
.
setVisibilityThreshold(double)
public final boolean isVisible()
GridVisualCreator
is visible.true
if visible; false
otherwise.setVisible(boolean)
public final void setGridInfo(GridInfo value)
value
- The grid info.getGridInfo()
public final void setGridStyle(GridStyle value)
value
- The grid style.getGridStyle()
public final void setPen(Pen value)
value
- The pen.getPen()
public final void setVisibilityThreshold(double value)
This indicates the minimum distance in the view coordinate system between two grid points. If the distance becomes
smaller, the grid will not be rendered. The default value is 20.0d
.
value
- The visibility threshold.getVisibilityThreshold()
public final void setVisible(boolean value)
GridVisualCreator
is visible.value
- true
if visible; false
otherwise.isVisible()
public final Node updateVisual(IRenderContext context, Node oldVisual)
IVisualCreator
Node
for inclusion in the IRenderContext
.
The CanvasControl
uses this method to give implementations a chance to update an existing
Visual that has previously been created by the same instance during a call to IVisualCreator.createVisual(IRenderContext)
.
Implementation may update the oldVisual
and return that same reference, or create a new visual and return the
new instance or null
.
updateVisual
in interface IVisualCreator
context
- The context that describes where the visual will be used in.oldVisual
- The visual instance that had been returned the last time the IVisualCreator.createVisual(IRenderContext)
method was called on
this instance.oldVisual
, if this instance modified the visual, or a new visual that should replace the existing one in the
canvas object visual tree.IVisualCreator.createVisual(IRenderContext)
,
ICanvasObjectDescriptor
,
CanvasControl