com.tensegrity.composite
Class CompositeViewOperations

java.lang.Object
  extended bycom.tensegrity.composite.CompositeViewOperations

public class CompositeViewOperations
extends java.lang.Object

The CompositeViewOperations class provides some basic functionalities that can be used when working with a CompositeView.

Version:
$Id: CompositeViewOperations.java,v 1.12 2005/12/20 16:48:54 MichaelKegel Exp $
Author:
MichaelKegel

Field Summary
static double MAXIMUM_ZOOM_LIMIT
          Constants for the zoom limits
static double MINIMUM_ZOOM_LIMIT
          Constants for the zoom limits
static int TRANSLATE_CENTERED
          constant that defines a translation mode
static int TRANSLATE_CENTERED_IF_NOT_VISIBLE
          constant that defines a translation mode
 
Method Summary
static void gatherComposites(BaseCompositeContainer bcc, java.util.List list)
          Gathers recursively all BaseComposites of the given BaseCompositeContainer
static int getModifierMask(CompositeView view)
          Creates a modifier mask from the pressed keys SHIFT, ALT and CONTROL in the given CompositeView.
static BoundingBox getViewBoundingBox(CompositeView view, int calculationFlags)
          Returns the view boundaries of the given view.
static java.util.Map recursiveEventDisable_SelectionChange(CompositeView compositeview)
           Recursively disables selection-change events and returns a Map that is filled with Lists of the currently selected BaseComposite objects.
static void recursiveEventEnable_SelectionChange(CompositeView compositeview, java.util.Map mappedSelectionOld)
           Recursively enables beforehand disabled selection-change events and raises those events if a corresponding List with the old selected BaseComposite objects can be found in the Map given by mappedSelectionOld.
static void recursiveSelection(CompositeView compositeview, boolean selection)
           Recursively sets all the BaseComposite objects that are contained in the specified CompositeView to the desired selection-state.
static void translateSelection(CompositeView compositview, int mode)
          Translates the current selection of the CompositeView given by compositeview so that it becomes visible in the CompositeViews viewport.
static void translateViewport(CompositeView compositeview, Boundary bbox, int mode)
          Translates the viewport of the CompositeView given by compositeview with regard to the translation mode given by mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINIMUM_ZOOM_LIMIT

public static final double MINIMUM_ZOOM_LIMIT
Constants for the zoom limits

See Also:
Constant Field Values

MAXIMUM_ZOOM_LIMIT

public static final double MAXIMUM_ZOOM_LIMIT
Constants for the zoom limits

See Also:
Constant Field Values

TRANSLATE_CENTERED

public static final int TRANSLATE_CENTERED
constant that defines a translation mode

See Also:
Constant Field Values

TRANSLATE_CENTERED_IF_NOT_VISIBLE

public static final int TRANSLATE_CENTERED_IF_NOT_VISIBLE
constant that defines a translation mode

See Also:
Constant Field Values
Method Detail

translateSelection

public static final void translateSelection(CompositeView compositview,
                                            int mode)
Translates the current selection of the CompositeView given by compositeview so that it becomes visible in the CompositeViews viewport. The translation is done with regards to the tranlation mode given by mode. The possible modes are defined through constants of this class.

Parameters:
compositview - the CompositeView.
mode - the translation mode. Valid modes are TRANSLATE_CENTERED and TRANSLATE_CENTERED_IF_NOT_VISIBLE.

translateViewport

public static final void translateViewport(CompositeView compositeview,
                                           Boundary bbox,
                                           int mode)
Translates the viewport of the CompositeView given by compositeview with regard to the translation mode given by mode. The possible modes are defined through constants of this class.

Parameters:
compositeview - the CompositeView
bbox - the bounding box to translate the CompositeViews viewport to.
mode - the translation mode.

getModifierMask

public static int getModifierMask(CompositeView view)
Creates a modifier mask from the pressed keys SHIFT, ALT and CONTROL in the given CompositeView.

Parameters:
view - The view to get the pressed keys of
Returns:
The modifier mask

gatherComposites

public static void gatherComposites(BaseCompositeContainer bcc,
                                    java.util.List list)
Gathers recursively all BaseComposites of the given BaseCompositeContainer

Parameters:
bcc - The container to gather elements from
list - The list to add the items to

recursiveEventDisable_SelectionChange

public static final java.util.Map recursiveEventDisable_SelectionChange(CompositeView compositeview)

Recursively disables selection-change events and returns a Map that is filled with Lists of the currently selected BaseComposite objects.
The returned Map is organized such that a certain BaseCompositeContainer instance is the key for its List of former selected BaseComposite objects.
If the selection-change event was disabled beforehand no entry is created in the Map.

Parameters:
compositeview - the CompositeView to process.
Returns:
a Map filled with Lists of the currently selected BaseComposite objects.
See Also:
recursiveEventEnable_SelectionChange(CompositeView, Map)

recursiveEventEnable_SelectionChange

public static final void recursiveEventEnable_SelectionChange(CompositeView compositeview,
                                                              java.util.Map mappedSelectionOld)

Recursively enables beforehand disabled selection-change events and raises those events if a corresponding List with the old selected BaseComposite objects can be found in the Map given by mappedSelectionOld.
The Map should be organized such that the BaseCompositeContainer instance is the key for the List of former selected BaseComposite objects.

Parameters:
compositeview - the CompositeView to process.
mappedSelectionOld - used to find the List with the former selected BaseComposite objects of a certain BaseCompositeContainer.
See Also:
recursiveEventDisable_SelectionChange(CompositeView)

recursiveSelection

public static final void recursiveSelection(CompositeView compositeview,
                                            boolean selection)

Recursively sets all the BaseComposite objects that are contained in the specified CompositeView to the desired selection-state.

BaseComposite objects that are nested in embedded BaseCompositeContainer objects are processed as well.

Parameters:
compositeview - the CompositeView to process.
See Also:
recursiveEventDisable_SelectionChange(CompositeView), recursiveEventEnable_SelectionChange(CompositeView, Map)

getViewBoundingBox

public static BoundingBox getViewBoundingBox(CompositeView view,
                                             int calculationFlags)
Returns the view boundaries of the given view. This method extends the functionality of CompositeNavigatorProvider.getCompositeBoundingBox() to control how to compute the bounding box. This method internally uses Composite.getBoundingBox(int) whenever possible and passes the given calculation flags to that method.

Parameters:
view - The view to calculate the boundaries of
calculationFlags - Flags to control the calculation. Composite.getBoundingBox(int)
Returns:
The calculated BoundingBox


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.