com.tensegrity.gui.swt.graph
Class SwtNavigator

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended bycom.tensegrity.gui.swt.graph.SwtNavigator
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable, Observer

public class SwtNavigator
extends org.eclipse.swt.widgets.Composite
implements Observer

Instances of SwtNavigator are responsible for providing the means for displaying a CompositeNavigator in SWT-based applications.

This class represents the SWT equivalent of the Swing-based class NavigatorPanel).

An instance initializes itself with a default rendering configuration It is possible, however, to change it by retrieving the renderer configuration attribute set (see getRendererConfiguration()) and modifying that object.

The following methods allow you to modify various CompositeNavigator colors:

The graphical display of CompositeNavigatorProvider content is performed by delegating to an instance of class CompositeNavigator. This instance can be retrieved by calling the getCompositeNavigator() method.

Version:
$Id: SwtNavigator.java,v 1.36 2006/03/02 11:42:01 BurkhardWick Exp $
Author:
S�bastien Guyon

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
SwtNavigator(org.eclipse.swt.widgets.Composite parent, int style)
          Since SwtNavigator extends the SWT Composite class and in order to leave more control to the caller this constructor delegates its call to that of Composite.
 
Method Summary
 void addZoomValueListener(CompositeNavigator.ZoomValueListener listener)
          Registers the CompositeNavigator.ZoomValueListener given by listener at the underlying CompositeNavigator so that the CompositeNavigator.ZoomValueListener will be notified on every zoom change the CompositeNavigator performs to the associated CompositeView.
 void defaultInitCompositeNavigator()
          This method perform some default initializations on the passed compositeNavigator.
 ApplicationFrame getApplicationFrame()
           
 CompositeNavigator getCompositeNavigator()
          Returns the internal CompositeNavigator
 java.lang.String getName()
           
static AttributeSet getRendererConfiguration()
          Returns the AttributeSet that can be used to configure the rendering settings that used by all instances of NavigatorPanel during user-interaction.
 boolean isUpdateDuringActing()
          Query whether this NavigatorPanel is updating during action of its CompositeNavigatorProvider.
 void removeZoomValueListener(CompositeNavigator.ZoomValueListener listener)
          Removes the CompositeNavigator.ZoomValueListener given by listener from the underlying CompositeNavigator so that the CompositeNavigator.ZoomValueListener will no longer be notified on zoom changes the CompositeNavigator performs to the associated CompositeView.
 void setApplicationFrame(ApplicationFrame applicationFrame)
           Sets the local instance of ApplicationFrame to applicationFrame.
 void setName(java.lang.String s)
           
 void setNavigatorBackground(int navigatorBackground)
          Sets the Color value for the navigator background.
 void setSelected(boolean b)
           
 void setUpdateDuringActing(boolean updateDuringActing)
          Configure whether this NavigatorPanel is updating during action of its CompositeNavigatorProvider.
 void setViewRectBackground(int viewRectBackground)
          Sets the Color value for the navigator view rectangle background
 void setViewRectBorder(int viewRectBorder)
          Sets the Color value for the navigator view rectangle border.
 void update(Observable observable, java.lang.Object arg)
          The callback method of an observer that is invoked by the Observable each time the state has changed.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SwtNavigator

public SwtNavigator(org.eclipse.swt.widgets.Composite parent,
                    int style)
Since SwtNavigator extends the SWT Composite class and in order to leave more control to the caller this constructor delegates its call to that of Composite. In addition it performs the default initialization of the internal CompositeNavigator.

Parameters:
parent - a Composite which will be the parent of the new instance (cannot be null)
style - the style of SwtNavigator to construct
See Also:
defaultInitCompositeNavigator()
Method Detail

defaultInitCompositeNavigator

public void defaultInitCompositeNavigator()
This method perform some default initializations on the passed compositeNavigator.

See Also:
CompositeNavigator.setPaint(PaintFormat), CompositeNavigator.setViewportRectPaint(PaintFormat), CompositeNavigator.setViewportRectStroke(StrokeFormat)

update

public void update(Observable observable,
                   java.lang.Object arg)
Description copied from interface: Observer
The callback method of an observer that is invoked by the Observable each time the state has changed.

Specified by:
update in interface Observer
Parameters:
observable - the observable that triggered the call.
arg - an object carrying additional information.

getRendererConfiguration

public static final AttributeSet getRendererConfiguration()
Returns the AttributeSet that can be used to configure the rendering settings that used by all instances of NavigatorPanel during user-interaction.

Returns:
the AttributeSet for rendering configuration.
See Also:
RendererConfiguration

setUpdateDuringActing

public void setUpdateDuringActing(boolean updateDuringActing)
Configure whether this NavigatorPanel is updating during action of its CompositeNavigatorProvider. If set to false, then during acting the navigator is not updated, which may result in improved performance.

Parameters:
updateDuringActing - if false, then during acting the navigator is not updated, otherwise it is updated.

isUpdateDuringActing

public boolean isUpdateDuringActing()
Query whether this NavigatorPanel is updating during action of its CompositeNavigatorProvider.

Returns:
true if the navigator is updated during acting, false otherwise.

getCompositeNavigator

public CompositeNavigator getCompositeNavigator()
Returns the internal CompositeNavigator

Returns:
CompositeNavigator the internal CompositeNavigator

addZoomValueListener

public void addZoomValueListener(CompositeNavigator.ZoomValueListener listener)
Registers the CompositeNavigator.ZoomValueListener given by listener at the underlying CompositeNavigator so that the CompositeNavigator.ZoomValueListener will be notified on every zoom change the CompositeNavigator performs to the associated CompositeView.

Parameters:
listener - the CompositeNavigator.ZoomValueListener to register

removeZoomValueListener

public void removeZoomValueListener(CompositeNavigator.ZoomValueListener listener)
Removes the CompositeNavigator.ZoomValueListener given by listener from the underlying CompositeNavigator so that the CompositeNavigator.ZoomValueListener will no longer be notified on zoom changes the CompositeNavigator performs to the associated CompositeView.

Parameters:
listener - the CompositeNavigator.ZoomValueListener to remove

setName

public void setName(java.lang.String s)

getName

public java.lang.String getName()

getApplicationFrame

public ApplicationFrame getApplicationFrame()

setSelected

public void setSelected(boolean b)

setApplicationFrame

public void setApplicationFrame(ApplicationFrame applicationFrame)

Sets the local instance of ApplicationFrame to applicationFrame.

Parameters:
applicationFrame - the ApplicationFrame to which this navigator is associated.

setNavigatorBackground

public void setNavigatorBackground(int navigatorBackground)
Sets the Color value for the navigator background.

Parameters:
navigatorBackground - Color value for the navigator background
See Also:
CompositeNavigator.setPaint(PaintFormat)

Find more information in the class documentation


setViewRectBackground

public void setViewRectBackground(int viewRectBackground)
Sets the Color value for the navigator view rectangle background

Parameters:
viewRectBackground - the Color value for the navigator view rectangle background
See Also:
CompositeNavigator.setViewportRectPaint(PaintFormat)

Find more information in the class documentation


setViewRectBorder

public void setViewRectBorder(int viewRectBorder)
Sets the Color value for the navigator view rectangle border.

Parameters:
viewRectBorder - the Color value for the navigator view rectangle border
See Also:
CompositeNavigator.setViewportRectStroke(StrokeFormat)

Find more information in the class documentation



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