|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A CompositeViewGrid builds up a set of lines intersecting at a
right angle. The lines divide the view-area of the
CompositeView into uniform rectangular sections. Composite
objects lying within the view can be adjusted to lie on the intersection
points of this grid.
CompositeView,
CompositeViewRuler| Field Summary | |
static java.lang.String |
CATEGORY_VIEW_GRID_DESC
Constant holding the name of the ruler AttributeSet. |
static java.lang.String |
DISTANCE_DESC
Constant holding the name of the raster size Attribute. |
static int |
SNAP_STRENGTH_100
Constants specifying the different snap-strength values |
static java.lang.String |
SNAP_STRENGTH_100_DESC
Constants holding names for the various snap strength values |
static int |
SNAP_STRENGTH_25
Constants specifying the different snap-strength values |
static java.lang.String |
SNAP_STRENGTH_25_DESC
Constants holding names for the various snap strength values |
static int |
SNAP_STRENGTH_50
Constants specifying the different snap-strength values |
static java.lang.String |
SNAP_STRENGTH_50_DESC
Constants holding names for the various snap strength values |
static java.lang.String |
SNAP_STRENGTH_DESC
Constant holding a name for the snap-strength Attribute. |
static java.lang.String |
SNAP_TO_GRID_DESC
Constant holding a name for the snap-to-grid Attribute. |
static java.lang.String |
STROKE_MAIN_DESC
Constant holding a name for the division stroke Attribute. |
static java.lang.String |
STROKE_SUBSECTIONS_DESC
Constant holding a name for the subsection stroke Attribute. |
static java.lang.String |
STYLE_DESC
Constant holding the name of the style Attribute. |
static int |
STYLE_LINE
Constants specifying the different grid-styles |
static java.lang.String |
STYLE_LINE_DESC
Constants holding names for the various styles |
static int |
STYLE_POINT
Constants specifying the different grid-styles |
static java.lang.String |
STYLE_POINT_DESC
Constants holding names for the various styles |
static java.lang.String |
SUBSECTIONS_DESC
Constant holding the name of the raster size Attribute. |
| Fields inherited from interface com.tensegrity.composite.CompositeViewMeasurementObject |
METRIC_UNIT_DESC, VISIBLE_DESC |
| Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet |
TREE_SUBSET_POSTFIX |
| Method Summary | |
void |
draw(Renderer renderer,
Device device)
Draws the grid using the given renderer and device |
Transform2D |
getContextTransform()
Returns the context transformation that is used for drawing instead of the default context transformation of the view. |
double |
getGridDistance()
Returns the grid distance by means of the set metric. |
double |
getPrinterScale()
Returns the factor used to scale the grid strokes when the device is a printer device. |
int |
getSnapStrength()
Returns the currently set snap strength. |
StrokeFormat |
getStroke()
REturns the StrokeFormat of the main grid lines. |
int |
getStyle()
Returns the visual style of the grid. |
int |
getSubSections()
Returns the number of subsections the grid is divided into. |
StrokeFormat |
getSubSectionStroke()
Returns the StrokeFormat of the subsection lines. |
AttributeSet |
getWriteOutAttributes()
Returns an AttributeSet that is the same as the one returned
by AttributableOnSet.getAttributes() excepts for the Attributes
holding formats. |
boolean |
isSnapEnabled()
Determines whether grid snapping is enabled. |
void |
setContextTransform(Transform2D trans)
Sets the context transformation that should be used instead of the default. |
void |
setGridDistance(double steps)
Sets the grid distance by means of the set metric. |
void |
setPrinterScale(double scale)
Sets a factor to scale the grid strokes when the device is a printer device. |
void |
setSnapEnabled(boolean b)
Enables the snapping of object type InteractionRestriction. |
void |
setSnapStrength(int strength)
Sets the strength of the snap the grid performs. |
void |
setSnapStrength(java.lang.String desc)
Sets the snap strength of the grid. |
void |
setStroke(StrokeFormat format)
Sets the StrokeFormat of the main grid lines. |
void |
setStyle(int style)
Sets the grid style. |
void |
setStyle(java.lang.String desc)
Sets the grid style. |
void |
setSubSections(int divisions)
Sets the number of subsections of the grid raster. |
void |
setSubSectionStroke(StrokeFormat format)
Sets the StrokeFormat of the subsection lines. |
void |
snap(int[] coords)
Snaps the given coordinates to the next fitting point in the grid. |
| Methods inherited from interface com.tensegrity.composite.CompositeViewMeasurementObject |
getMetric, getUnit, isVisible, setMetric, setUnit, setVisible |
| Methods inherited from interface com.tensegrity.generic.attribute.AttributableOnSet |
addAttributableOnSetListener, areAttributableEventsEnabled, disableAttributableEvents, enableAttributableEvents, getAttributes, getAttributesTree, removeAttributableOnSetListener, setAttributes, setAttributesTree |
| Methods inherited from interface com.tensegrity.generic.attribute.Attributable |
getAttribute, getAttributeType, getAttributeValue, setAttribute, setAttributeValue |
| Field Detail |
public static final java.lang.String CATEGORY_VIEW_GRID_DESC
AttributeSet.
public static final java.lang.String DISTANCE_DESC
Attribute.
public static final java.lang.String SUBSECTIONS_DESC
Attribute.
public static final java.lang.String STYLE_DESC
Attribute.
public static final java.lang.String SNAP_TO_GRID_DESC
Attribute.
public static final java.lang.String SNAP_STRENGTH_DESC
Attribute.
public static final java.lang.String STROKE_MAIN_DESC
Attribute.
public static final java.lang.String STROKE_SUBSECTIONS_DESC
Attribute.
public static final java.lang.String STYLE_LINE_DESC
public static final java.lang.String STYLE_POINT_DESC
public static final int STYLE_LINE
public static final int STYLE_POINT
public static final java.lang.String SNAP_STRENGTH_25_DESC
public static final java.lang.String SNAP_STRENGTH_50_DESC
public static final java.lang.String SNAP_STRENGTH_100_DESC
public static final int SNAP_STRENGTH_25
public static final int SNAP_STRENGTH_50
public static final int SNAP_STRENGTH_100
| Method Detail |
public void setGridDistance(double steps)
steps - the distance of the main grid lines.public double getGridDistance()
public void setSubSections(int divisions)
divisions - the number of sub-sections.public int getSubSections()
public void setStyle(int style)
style - the style to set.public void setStyle(java.lang.String desc)
desc - the description of the style to set.public int getStyle()
setStyle(int)public void snap(int[] coords)
CoordinateSystemMetric).
coords - an array holding the coordinate-pairs to snap to the grid.
InvalidArgumentException - if the
number of given coordinates is not dividable by 2 or the argument is
nullpublic void setSnapEnabled(boolean b)
InteractionRestriction.
b - true to enable grid snapping.InteractionRestrictionpublic boolean isSnapEnabled()
true, if snapping is enabled.public void setSnapStrength(int strength)
strength - the attraction of the grid lines. Valid values are:
public void setSnapStrength(java.lang.String desc)
InteractionRestriction.
desc - the description of the attraction of the grid lines. Valid
values are:
.InteractionRestrictionpublic int getSnapStrength()
public void setStroke(StrokeFormat format)
StrokeFormat of the main grid lines.
format - the StrokeFormat to set.public StrokeFormat getStroke()
StrokeFormat of the main grid lines.
StrokeFormat of the main grid lines.public void setSubSectionStroke(StrokeFormat format)
StrokeFormat of the subsection lines.
format - the StrokeFormat to set.public StrokeFormat getSubSectionStroke()
StrokeFormat of the subsection lines.
StrokeFormat of the subsection lines.public AttributeSet getWriteOutAttributes()
AttributeSet that is the same as the one returned
by AttributableOnSet.getAttributes() excepts for the Attributes
holding formats. Every format will be returned in an own
AttributeSet and is thus ready to be used for graph
document write out.
AttributeSet ready for document write out.AttributableOnSet.getAttributes()
public void draw(Renderer renderer,
Device device)
renderer - The renderer to use for drawingdevice - The device to draw topublic void setContextTransform(Transform2D trans)
trans - The transformation to use or null to use the defaultpublic Transform2D getContextTransform()
public void setPrinterScale(double scale)
scale - The scale to setpublic double getPrinterScale()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||