uk.org.toot.control
Class Control

java.lang.Object
  extended by java.util.Observable
      extended by uk.org.toot.control.Control
Direct Known Subclasses:
BooleanControl, CompoundControl, EnumControl, LawControl, MeterControls.OverIndicator

public abstract class Control
extends java.util.Observable

The abstract base class for generic concrete Controls. Because the various types of Controls have different purposes and features, all of their functionality is accessed from the subclasses that define each kind of Control. The Controls are concrete so they separate the control state from a process. This eases development of simple processes. Differences to javax.sound.sampled.Controls: Composite parent association is provided to support Chain of Responsibility pattern through Control hierarchies. Observable to support the Observer pattern. Controls may be hidden. This is intended to inhibit UI display of a Control. e.g. filter Q when NOT Parametric, obviously the filter still has a Q, it's just immutable. Controls may be indicators. This is intended to allow UIs to decide how to represent and manage a Control. Controls do not have a Type inner class.


Method Summary
 java.lang.String getAnnotation()
           
 java.lang.String getControlPath()
           
 java.lang.String getControlPath(Control from, java.lang.String sep)
           
 int getId()
          Obtains the control's id.
 int getIntValue()
           
 java.lang.String getName()
          Obtains the control's name.
 CompoundControl getParent()
          Obtains the control's parent control.
 java.lang.String getValueString()
          override for real value strings where possible
 boolean isAdjusting()
           
 boolean isEnabled()
           
 boolean isHidden()
          a hint to a UI to inhibit display of this control.
 boolean isIndicator()
          a hint to a UI to decide how to represent this control.
 void setAdjusting(boolean state)
           
 void setAnnotation(java.lang.String a)
          Set a specific annotation, other than the default name
 void setEnabled(boolean enable)
           
 void setHidden(boolean h)
           
 void setIntValue(int value)
           
 void setName(java.lang.String s)
          Set the control's name
 java.lang.String toString()
          Obtains a String describing the control type and its current state.
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setHidden

public void setHidden(boolean h)

getId

public int getId()
Obtains the control's id.

Returns:
the control's id.

getParent

public CompoundControl getParent()
Obtains the control's parent control.

Returns:
the control's parent control.

getName

public java.lang.String getName()
Obtains the control's name.

Returns:
the control's name.

setName

public void setName(java.lang.String s)
Set the control's name

Parameters:
s - the name

getAnnotation

public java.lang.String getAnnotation()

setAnnotation

public void setAnnotation(java.lang.String a)
Set a specific annotation, other than the default name

Parameters:
a - the annotation

setIntValue

public void setIntValue(int value)

getIntValue

public int getIntValue()

getValueString

public java.lang.String getValueString()
override for real value strings where possible


isHidden

public boolean isHidden()
a hint to a UI to inhibit display of this control.


isIndicator

public boolean isIndicator()
a hint to a UI to decide how to represent this control.


isAdjusting

public boolean isAdjusting()

setAdjusting

public void setAdjusting(boolean state)

setEnabled

public void setEnabled(boolean enable)

isEnabled

public boolean isEnabled()

toString

public java.lang.String toString()
Obtains a String describing the control type and its current state.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of the Control.

getControlPath

public java.lang.String getControlPath()

getControlPath

public java.lang.String getControlPath(Control from,
                                       java.lang.String sep)


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.