|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.composite.util.CompositeHierarchyUtilities
Class CompositeHierarchyUtilities contains some utility functions
that will ease your life if you ever have to deal with transformations from or to
Composite instances.
| Field Summary | |
static int |
CRITERION_NONE
Constants to specify the criterion. |
static int |
CRITERION_X1
Constants to specify the criterion. |
static int |
CRITERION_X2
Constants to specify the criterion. |
static int |
CRITERION_XCENTER
Constants to specify the criterion. |
static int |
CRITERION_Y1
Constants to specify the criterion. |
static int |
CRITERION_Y2
Constants to specify the criterion. |
static int |
CRITERION_YCENTER
Constants to specify the criterion. |
static int |
HIERARCHY_ADDED_ORDER
Constants to specify the order |
static int |
HIERARCHY_DRAWING_ORDER
Constants to specify the order |
static int |
HIERARCHY_EXCLUDES_COMPOSITE_LINES
Constants to specify the exclusion mode |
static int |
HIERARCHY_EXCLUDES_FOLDED_GROUPS
Constants to specify the exclusion mode |
static int |
HIERARCHY_EXCLUDES_NONE
Constants to specify the exclusion mode |
static int |
HIERARCHY_SELECTION_ORDER
Constants to specify the order |
static int |
TRANSFORM_FROM_COMPOSITE_TO_VIEW
Vice versa, apart from the direction same as TRANSFORM_FROM_VIEW_TO_COMPOSITE. |
static int |
TRANSFORM_FROM_CONTAINER_TO_VIEW
Vice versa, but apart from the direction same as TRANSFORM_FROM_VIEW_TO_CONTAINER. |
static int |
TRANSFORM_FROM_VIEW_TO_COMPOSITE
The transformation is done using the (Composite)View as the starting point and the first appearing Composite in the path as the end-point. |
static int |
TRANSFORM_FROM_VIEW_TO_CONTAINER
The transformation is done using the View as the starting point and the first appearing (BaseComposite)Container object in the path as the end-point. |
| Method Summary | |
static java.util.Collection |
buildCollectionFromHierarchy(CompositeHierarchy hierarchy)
|
static CompositeHierarchy |
buildCompleteHierarchy(CompositeGroup compositegroup,
int type)
Return the CompositeHierarchy of type type for
the given CompositeGroup. |
static CompositeHierarchy |
buildCompleteHierarchy(CompositeView compositeview,
int type)
Returns the complete CompositeHierarchy of type
type for the given CompositeView. |
static CompositeHierarchy |
buildLeveledHierarchy(CompositeGroup compositegroup,
int type,
int maxlevel)
Return the CompositeHierarchy of type type up
to level maxlevel for the given CompositeGroup. |
static CompositeHierarchy |
buildLeveledSelectionHierarchy(CompositeGroup compositegroup,
int type,
int maxlevel)
Return the CompositeHierarchy of type type up
to level maxlevel for the given CompositeGroup.
|
static CompositeHierarchy |
buildLeveledSelectionHierarchy(CompositeView compositeview,
int type,
int maxlevel)
Return the CompositeHierarchy of type type up
to level maxlevel for the given CompositeGroup.
|
static Transform2D |
buildTransformation(CompositeHierarchyPath hierarchypath,
int type)
Returns the transformation of type type for the given
CompositeHierarchyPath. |
static java.util.Map |
buildTransformationMap(CompositeHierarchy hierarchy,
int type)
Returns a map containing all transforms of the given CompositeHierarchy. |
static void |
dumpHierarchy(CompositeHierarchy hierarchy,
java.io.PrintStream ps)
Dumps the given CompositeHierarchy to the specified
PrintStream. |
static void |
dumpHierarchyPath(CompositeHierarchyPath path,
java.io.PrintStream ps)
Dumps the given CompositeHierarchyPath to the specified
PrintStream. |
static CompositeHierarchyPath |
findCompositeHierarchyAt(CompositeView compositeview,
int x,
int y)
Returns the CompositeHierarchyPath found int the specified
CompositeView at location (x, y). |
static CompositeHierarchyPath |
findCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
java.lang.Class[] instanceclass)
Returns the CompositeHierarchyPath found int the specified
CompositeView at location (x, y) that matches
the class given by instanceclass. |
static CompositeHierarchy |
findSelectionHierarchy(CompositeView compositeview)
Return the CompositeHierarchyPath for the current selection
in the given CompositeView. |
static CompositeHierarchyPath |
findSingleSelectionHierarchyPath(CompositeView compositeview)
Return the CompositeHierarchyPath for the current selection
in the given CompositeView. |
static CompositeHierarchyPath |
findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass)
Returns the CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass. |
static CompositeHierarchyPath |
findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
boolean includeExternalPrimitives)
Returns the CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass. |
static CompositeHierarchyPath |
findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
boolean includeExternalPrimitives,
boolean ignoreSelected)
Returns the CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass. |
static CompositeHierarchyPath |
findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
boolean includeExternalPrimitives,
boolean ignoreSelected,
int minLabelWidth,
int minLabelHeight)
Returns the CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass. |
static CompositeHierarchyPath |
findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
boolean includeExternalPrimitives,
int minLabelWidth,
int minLabelHeight)
Returns the CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass. |
static CompositeHierarchyPath |
findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
int minLabelWidth,
int minLabelHeight)
Returns the CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass. |
static CompositeHierarchyPath |
getCompositeHierarchyFor(BaseComposite bcomposite)
Returns the CompositeHierarchyPath found int the specified
BaseComposite. |
static void |
sortHierarchyToLocation(CompositeHierarchy hierarchy,
int primarySortCriterion,
boolean primaryAscending)
Sorts the given CompositeHierarchy under consideration of
the given sort criteria and -ascending. |
static void |
sortHierarchyToLocation(CompositeHierarchy hierarchy,
int primarySortCriterion,
boolean primaryAscending,
int secondarySortCriterion,
boolean secondaryAscending)
Sorts the given CompositeHierarchy under consideration of
the given sort criterias and -ascendings. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int HIERARCHY_EXCLUDES_NONE
public static final int HIERARCHY_EXCLUDES_COMPOSITE_LINES
public static final int HIERARCHY_EXCLUDES_FOLDED_GROUPS
public static final int HIERARCHY_ADDED_ORDER
public static final int HIERARCHY_DRAWING_ORDER
public static final int HIERARCHY_SELECTION_ORDER
public static final int TRANSFORM_FROM_VIEW_TO_COMPOSITE
Composite in the path as the end-point.
public static final int TRANSFORM_FROM_COMPOSITE_TO_VIEW
TRANSFORM_FROM_VIEW_TO_COMPOSITE.
public static final int TRANSFORM_FROM_VIEW_TO_CONTAINER
public static final int TRANSFORM_FROM_CONTAINER_TO_VIEW
TRANSFORM_FROM_VIEW_TO_CONTAINER.
public static final int CRITERION_NONE
sortHierarchyToLocation.
public static final int CRITERION_X1
sortHierarchyToLocation.
public static final int CRITERION_X2
sortHierarchyToLocation.
public static final int CRITERION_Y1
sortHierarchyToLocation.
public static final int CRITERION_Y2
sortHierarchyToLocation.
public static final int CRITERION_XCENTER
sortHierarchyToLocation.
public static final int CRITERION_YCENTER
sortHierarchyToLocation.
| Method Detail |
public static final void sortHierarchyToLocation(CompositeHierarchy hierarchy,
int primarySortCriterion,
boolean primaryAscending)
CompositeHierarchy under consideration of
the given sort criteria and -ascending.
hierarchy - CompositeHierarchy to sort.primarySortCriterion - the primary sort criteria.primaryAscending - indicating whether the primary sort sequence is
ascending.
public static final void sortHierarchyToLocation(CompositeHierarchy hierarchy,
int primarySortCriterion,
boolean primaryAscending,
int secondarySortCriterion,
boolean secondaryAscending)
CompositeHierarchy under consideration of
the given sort criterias and -ascendings.
hierarchy - CompositeHierarchy to sort.primarySortCriterion - the primary sort criteria.primaryAscending - indicating whether the primary sort sequence is
ascending.secondarySortCriterion - the secondary sort criteria.secondaryAscending - indicating whether the primary sort sequence is
ascending.public static final java.util.Collection buildCollectionFromHierarchy(CompositeHierarchy hierarchy)
public static final java.util.Map buildTransformationMap(CompositeHierarchy hierarchy,
int type)
CompositeHierarchy.
hierarchy - the CompositeHierarchy to retrieve the
transforms for.type - the type of the transformations.
CompositeHierarchy.
public static final Transform2D buildTransformation(CompositeHierarchyPath hierarchypath,
int type)
type for the given
CompositeHierarchyPath.
hierarchypath - the CompositeHierarchyPath to retrieve
the Tranform2D of the given type for.type - the type of the transformation to return.
type for the given
CompositeHierarchyPath.
public static final CompositeHierarchy buildCompleteHierarchy(CompositeView compositeview,
int type)
CompositeHierarchy of type
type for the given CompositeView.
compositeview - the CompositeView to retrieve the
CompositeHierarchy for.type - the type of build; valid values are
HIERARCHY_EXCLUDES_NONE and
HIERARCHY_EXCLUDES_COMPOSITE_LINES.
CompositeHierarchy of type
type for the given CompositeView.
public static final CompositeHierarchy buildCompleteHierarchy(CompositeGroup compositegroup,
int type)
CompositeHierarchy of type type for
the given CompositeGroup.
compositegroup - CompositeGroup to examine.type - the type the CompositeHierarchy to build.
Valid values are
HIERARCHY_EXCLUDES_NONE and
HIERARCHY_EXCLUDES_COMPOSITE_LINES.
CompositeHierarchy.
public static final CompositeHierarchy buildLeveledHierarchy(CompositeGroup compositegroup,
int type,
int maxlevel)
CompositeHierarchy of type type up
to level maxlevel for the given CompositeGroup.
compositegroup - the CompositeGroup to examine.type - the type to look up.maxlevel - up to this level we go.
CompositeHierarchy.
public static final CompositeHierarchy buildLeveledSelectionHierarchy(CompositeView compositeview,
int type,
int maxlevel)
CompositeHierarchy of type type up
to level maxlevel for the given CompositeGroup.
Only the currently selected BaseComposites are added to the
hierarchy.
type - the type to look up.maxlevel - up to this level we go.
CompositeHierarchy.
public static final CompositeHierarchy buildLeveledSelectionHierarchy(CompositeGroup compositegroup,
int type,
int maxlevel)
CompositeHierarchy of type type up
to level maxlevel for the given CompositeGroup.
Only the currently selected BaseComposites are added to the
hierarchy.
compositegroup - the CompositeGroup to examine.type - the type to look up.maxlevel - up to this level we go.
CompositeHierarchy.public static final CompositeHierarchy findSelectionHierarchy(CompositeView compositeview)
CompositeHierarchyPath for the current selection
in the given CompositeView.
compositeview - the CompositeView to examine.
CompositeHierarchyPath.public static final CompositeHierarchyPath findSingleSelectionHierarchyPath(CompositeView compositeview)
CompositeHierarchyPath for the current selection
in the given CompositeView.
compositeview - the CompositeView to examine.
CompositeHierarchyPath; null,
if nothing or more than one element is selected.public static final CompositeHierarchyPath getCompositeHierarchyFor(BaseComposite bcomposite)
CompositeHierarchyPath found int the specified
BaseComposite.
bcomposite - the BaseComposite examine.
CompositeHierarchyPath, might be empty.
public static final CompositeHierarchyPath findCompositeHierarchyAt(CompositeView compositeview,
int x,
int y)
CompositeHierarchyPath found int the specified
CompositeView at location (x, y).
compositeview - the CompositeView examine.x - the x-coordinate of the location to search.y - the y-coordinate of the location to search.
CompositeHierarchyPath, might be empty.
public static final CompositeHierarchyPath findCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
java.lang.Class[] instanceclass)
CompositeHierarchyPath found int the specified
CompositeView at location (x, y) that matches
the class given by instanceclass.
compositeview - the CompositeView examine.x - the x-coordinate of the location to search.y - the y-coordinate of the location to search.instanceclass - the classes the returned composite must be a type of
CompositeHierarchyPath, might be empty.
public static final CompositeHierarchyPath findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
int minLabelWidth,
int minLabelHeight)
CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass.
compositeview - the CompositeView examine.x - the x-coordinate of the location to search.y - the y-coordinate of the location to search.instanceclass - the classes the returned composite must be a type ofminLabelWidth - The minimum size for labels, the boundary of a
label will automatically be resized to this for
hit checking. Pass 0 to disable this.minLabelHeight - The minimum size for labels, the boundary of a
label will automatically be resized to this for
hit checking. Pass 0 to disable this.
CompositeHierarchyPath, might be empty.
public static final CompositeHierarchyPath findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass)
CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass.
compositeview - the CompositeView examine.x - the x-coordinate of the location to search.y - the y-coordinate of the location to search.instanceclass - the classes the returned composite must be a type of
CompositeHierarchyPath, might be empty.
public static final CompositeHierarchyPath findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
boolean includeExternalPrimitives)
CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass.
compositeview - the CompositeView examine.x - the x-coordinate of the location to search.y - the y-coordinate of the location to search.instanceclass - the classes the returned composite must be a type of
CompositeHierarchyPath, might be empty.
public static final CompositeHierarchyPath findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
boolean includeExternalPrimitives,
int minLabelWidth,
int minLabelHeight)
CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass.
compositeview - the CompositeView examine.x - the x-coordinate of the location to search.y - the y-coordinate of the location to search.instanceclass - the classes the returned composite must be a type ofminLabelWidth - The minimum size for labels, the boundary of a
label will automatically be resized to this for
hit checking. Pass 0 to disable this.minLabelHeight - The minimum size for labels, the boundary of a
label will automatically be resized to this for
hit checking. Pass 0 to disable this.
CompositeHierarchyPath, might be empty.
public static final CompositeHierarchyPath findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
boolean includeExternalPrimitives,
boolean ignoreSelected)
CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass.
compositeview - the CompositeView examine.x - the x-coordinate of the location to search.y - the y-coordinate of the location to search.instanceclass - the classes the returned composite must be a type of
CompositeHierarchyPath, might be empty.
public static final CompositeHierarchyPath findZOrderedBaseCompositeHierarchyAt(CompositeView compositeview,
int x,
int y,
boolean checkInvisible,
java.lang.Class[] instanceclass,
boolean includeExternalPrimitives,
boolean ignoreSelected,
int minLabelWidth,
int minLabelHeight)
CompositeHierarchyPath found in the specified
CompositeView at location (x, y) that matches
the class given by instanceclass.
compositeview - the CompositeView examine.x - the x-coordinate of the location to search.y - the y-coordinate of the location to search.instanceclass - the classes the returned composite must be a type ofminLabelWidth - The minimum size for labels, the boundary of a
label will automatically be resized to this for
hit checking. Pass 0 to disable this.minLabelHeight - The minimum size for labels, the boundary of a
label will automatically be resized to this for
hit checking. Pass 0 to disable this.
CompositeHierarchyPath, might be empty.
public static final void dumpHierarchy(CompositeHierarchy hierarchy,
java.io.PrintStream ps)
CompositeHierarchy to the specified
PrintStream.
hierarchy - the CompositeHierarchy to dump out.ps - the PrintStream to dump to.
public static final void dumpHierarchyPath(CompositeHierarchyPath path,
java.io.PrintStream ps)
CompositeHierarchyPath to the specified
PrintStream.
path - the CompositeHierarchyPath to dump out.ps - the PrintStream to dump to.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||