visad
Class Control

java.lang.Object
  extended by visad.Control
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
AnimationSetControl, AVControlJ2D, AVControlJ3D, BaseColorControl, ContourControl, FlowControl, GraphicsModeControl, ProjectionControl, RangeControl, RendererControl, ShapeControl, TextControl, ToggleControl

public abstract class Control
extends Object
implements Cloneable, Serializable

Control is the abstract VisAD superclass for controls for DisplayRealTypes.

See Also:
Serialized Form

Constructor Summary
Control(DisplayImpl d)
          construct a Control for the given DisplayImpl
 
Method Summary
 void addControlListener(ControlListener listener)
          add a ControlListener
 void animation_string(RealType real, Set set, double value, int current)
          build String representation of current animation step and pass it to DisplayRenderer.setAnimationString() called by java3d.AnimationControlJ3D and java2d.AnimationControlJ2D
 void changeControl(boolean tick)
          invoked every time values of this Control change
 boolean checkTicks(DataRenderer r, DataDisplayLink link)
          check if this Control changed and requires re-Transform
 Object clone()
           
 boolean equals(Object o)
          Indicates whether or not this instance equals an Object
 DisplayImpl getDisplay()
           
 DisplayRenderer getDisplayRenderer()
           
 int getInstanceNumber()
           
abstract  String getSaveString()
           
 long incTick()
          increment long counter NewTick: NewTick > OldTick indicates that there is event in this Control that the DisplayImpl must process; this method is invoked every time Control changes
 void nullControl()
          end this control (called by ScalarMap.nullDisplay())
 boolean peekTicks(DataRenderer r, DataDisplayLink link)
          peek at future value of checkTicks()
 void removeControlListener(ControlListener listener)
          remove a ControlListener
 void resetTicks()
          reset tickFlag and propagate to sub-Controls
abstract  void setSaveString(String save)
          reconstruct this Control using the specified save string
 void setTicks()
          set tickFlag if NewTick > OldTick, and reset OldTick = NewTick also invoke subSetTicks() to propagate to any sub-Controls
 boolean subCheckTicks(DataRenderer r, DataDisplayLink link)
          run checkTicks on any sub-Controls this default for no sub-Controls
 boolean subPeekTicks(DataRenderer r, DataDisplayLink link)
          run peekTicks on any sub-Controls this default for no sub-Controls
 void subResetTicks()
          run resetTicks on any sub-Controls this default for no sub-Controls
 void subSetTicks()
          run setTicks on any sub-Controls; this default for no sub-Controls
abstract  void syncControl(Control rmt)
          copy the state of a remote control to this control
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Control

public Control(DisplayImpl d)
construct a Control for the given DisplayImpl

Parameters:
d - - DisplayImpl this Control is associated with
Method Detail

getDisplayRenderer

public DisplayRenderer getDisplayRenderer()
Returns:
DisplayRenderer assciated with this Control

changeControl

public void changeControl(boolean tick)
                   throws VisADException,
                          RemoteException
invoked every time values of this Control change

Parameters:
tick - true to notify the Display for possible re-transform
Throws:
VisADException
RemoteException

addControlListener

public void addControlListener(ControlListener listener)
add a ControlListener

Parameters:
listener - ControlListener to add

removeControlListener

public void removeControlListener(ControlListener listener)
remove a ControlListener

Parameters:
listener - ControlListener to remove

nullControl

public void nullControl()
end this control (called by ScalarMap.nullDisplay())


incTick

public long incTick()
increment long counter NewTick: NewTick > OldTick indicates that there is event in this Control that the DisplayImpl must process; this method is invoked every time Control changes

Returns:
incremented value of NewTick counter

setTicks

public void setTicks()
set tickFlag if NewTick > OldTick, and reset OldTick = NewTick also invoke subSetTicks() to propagate to any sub-Controls


peekTicks

public boolean peekTicks(DataRenderer r,
                         DataDisplayLink link)
peek at future value of checkTicks()

Parameters:
r - DataRenderer to check if changes to this Control require re-transform
link - DataDisplayLink involved in decision whether changes to this Control require re-transform
Returns:
true if checkTicks() will return true after next setTicks()

checkTicks

public boolean checkTicks(DataRenderer r,
                          DataDisplayLink link)
check if this Control changed and requires re-Transform

Parameters:
r - DataRenderer to check if changes to this Control require re-transform
link - DataDisplayLink involved in decision whether changes to this Control require re-transform
Returns:
true if Control changed and requires re-Transform

resetTicks

public void resetTicks()
reset tickFlag and propagate to sub-Controls


subSetTicks

public void subSetTicks()
run setTicks on any sub-Controls; this default for no sub-Controls


subCheckTicks

public boolean subCheckTicks(DataRenderer r,
                             DataDisplayLink link)
run checkTicks on any sub-Controls this default for no sub-Controls

Parameters:
r - DataRenderer to check if changes to this Control require re-transform
link - DataDisplayLink involved in decision whether changes to this Control require re-transform
Returns:
'logical or' of values from checkTicks on sub-Controls

subPeekTicks

public boolean subPeekTicks(DataRenderer r,
                            DataDisplayLink link)
run peekTicks on any sub-Controls this default for no sub-Controls

Parameters:
r - DataRenderer to check if changes to this Control require re-transform
link - DataDisplayLink involved in decision whether changes to this Control require re-transform
Returns:
'logical or' of values from peekTicks on sub-Controls

subResetTicks

public void subResetTicks()
run resetTicks on any sub-Controls this default for no sub-Controls


animation_string

public void animation_string(RealType real,
                             Set set,
                             double value,
                             int current)
                      throws VisADException
build String representation of current animation step and pass it to DisplayRenderer.setAnimationString() called by java3d.AnimationControlJ3D and java2d.AnimationControlJ2D

Parameters:
real - - RealType mapped to Display.Animation
set - - Set from AnimationSetControl
value - - real value associated with current animation step
current - - index of current animation step
Throws:
VisADException - a VisAD error occurred

getInstanceNumber

public int getInstanceNumber()
Returns:
'instance number' (index + 1 ?) of this Control in display.ControlVector

getDisplay

public DisplayImpl getDisplay()
Returns:
DisplayImpl associated with this Control

getSaveString

public abstract String getSaveString()
Returns:
String representation of this Control

setSaveString

public abstract void setSaveString(String save)
                            throws VisADException,
                                   RemoteException
reconstruct this Control using the specified save string

Parameters:
save - - String representation for reconstruction
Throws:
VisADException - if a VisAD error occurs
RemoteException - if an RMI error occurs

syncControl

public abstract void syncControl(Control rmt)
                          throws VisADException
copy the state of a remote control to this control

Parameters:
rmt - remote Control whose state is copied
Throws:
VisADException - if a VisAD error occurs

clone

public Object clone()
Overrides:
clone in class Object
Returns:
a copy of this Control

equals

public boolean equals(Object o)
Indicates whether or not this instance equals an Object

Overrides:
equals in class Object
Parameters:
o - an Object
Returns:
true if and only if this instance is equal to o

toString

public String toString()
Overrides:
toString in class Object
Returns:
a simple String representation of this Control