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 voidaddListener(KnobListener listener)adds a listener which gets notified, if the knob value changesprotected abstract voiddoSetTotalValue(double value)has to be implemented by subclass to set the total value to madx.doublegetOffset()doublegetValue()voidremoveListener(KnobListener listener)removes a listener if available.voidsetOffset(double offset)set the actual offset of the knobvoidsetValue(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:Knobset the actual value
-
getOffset
public final double getOffset()
-
setOffset
public final void setOffset(double offset)
Description copied from interface:Knobset 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:Knobadds a listener which gets notified, if the knob value changes- Specified by:
addListenerin interfaceKnob- Parameters:
listener- the listener to add
-
removeListener
public final void removeListener(KnobListener listener)
Description copied from interface:Knobremoves a listener if available.- Specified by:
removeListenerin interfaceKnob- Parameters:
listener- the listener to remove
-
-