Class AbstractKnob
- java.lang.Object
-
- cern.accsoft.steering.jmad.domain.knob.AbstractKnob
-
- All Implemented Interfaces:
Knob
- Direct Known Subclasses:
AbstractModelKnob
,AbstractMultiModelKnob
,BeanPropertyKnob
,ElementAttribute
,SimpleStrength
public abstract class AbstractKnob extends java.lang.Object implements Knob
the abstract implementation of a genera knob
-
-
Constructor Summary
Constructors Constructor Description AbstractKnob()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addListener(KnobListener listener)
adds a listener which gets notified, if the knob value changesprotected abstract void
doSetTotalValue(double value)
has to be implemented by subclass to set the total value to madx.double
getOffset()
double
getValue()
void
removeListener(KnobListener listener)
removes a listener if available.void
setOffset(double offset)
set the actual offset of the knobvoid
setValue(double value)
set the actual value-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cern.accsoft.steering.jmad.domain.knob.Knob
getDescription, getKey, getName, getTotalValue, getType
-
-
-
-
Method Detail
-
getValue
public final double getValue()
-
setValue
public final void setValue(double value)
Description copied from interface:Knob
set the actual value
-
getOffset
public final double getOffset()
-
setOffset
public final void setOffset(double offset)
Description copied from interface:Knob
set the actual offset of the knob
-
doSetTotalValue
protected abstract void doSetTotalValue(double value)
has to be implemented by subclass to set the total value to madx. The only call from this is from setTotalValue, which also notifies the listeners.- Parameters:
value
- the value to set
-
addListener
public final void addListener(KnobListener listener)
Description copied from interface:Knob
adds a listener which gets notified, if the knob value changes- Specified by:
addListener
in interfaceKnob
- Parameters:
listener
- the listener to add
-
removeListener
public final void removeListener(KnobListener listener)
Description copied from interface:Knob
removes a listener if available.- Specified by:
removeListener
in interfaceKnob
- Parameters:
listener
- the listener to remove
-
-