Package xal.app.knobs
Class KnobControl
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.Box
-
- xal.app.knobs.KnobControl
-
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,KnobListener
public class KnobControl extends Box implements KnobListener
view for allowing users to use a knob- Author:
- unknown, Blaz Kranjc
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.Box
Box.AccessibleBox, Box.Filler
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_isSynchingdetermine if the control is synchingprotected KnobKNOBthe knob to editprotected JSliderKNOB_SLIDERslider displaying the current setting as a fraction of the knob's rangeprotected xal.extension.widgets.swing.WheelswitchKNOB_WHEELwheel for setting the current knob valueprotected JButtonREADY_INDICATORindicator of whether the knob is ready-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description KnobControl(Knob knob)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildView()build viewprotected xal.extension.widgets.swing.WheelswitchcreateKnobWheel()create the knob wheelprotected JButtoncreateZeroButton()create the zero buttonvoidcurrentSettingChanged(Knob knob, double value)event indicating that the knob's current value setting has changedvoidelementAdded(Knob knob, KnobElement element)event indicating that an element has been addedvoidelementModified(Knob knob, KnobElement element)event indicating that the specified knob element has been modifiedvoidelementRemoved(Knob knob, KnobElement element)event indicating that an element has been removedvoidlimitsChanged(Knob knob, double lowerLimit, double upperLimit)event indicating that the knob's limits have changedvoidnameChanged(Knob knob, String newName)event indicating that the specified knob's name has changedvoidreadyStateChanged(Knob knob, boolean isReady)ready state changedprotected voidresync(boolean forceLimitsUpdate)resynchronize the control with the knob settingsprotected voidupdateReadyStatus()update connection statusvoidvalueSettingPublished(Knob knob)event indicating that the knob's most previously pending set operation has completed-
Methods inherited from class javax.swing.Box
createGlue, createHorizontalBox, createHorizontalGlue, createHorizontalStrut, createRigidArea, createVerticalBox, createVerticalGlue, createVerticalStrut, getAccessibleContext, paintComponent, setLayout
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
KNOB
protected final Knob KNOB
the knob to edit
-
KNOB_WHEEL
protected final xal.extension.widgets.swing.Wheelswitch KNOB_WHEEL
wheel for setting the current knob value
-
KNOB_SLIDER
protected final JSlider KNOB_SLIDER
slider displaying the current setting as a fraction of the knob's range
-
READY_INDICATOR
protected final JButton READY_INDICATOR
indicator of whether the knob is ready
-
_isSynching
protected volatile boolean _isSynching
determine if the control is synching
-
-
Constructor Detail
-
KnobControl
public KnobControl(Knob knob)
Constructor
-
-
Method Detail
-
buildView
protected void buildView()
build view
-
updateReadyStatus
protected void updateReadyStatus()
update connection status
-
createKnobWheel
protected xal.extension.widgets.swing.Wheelswitch createKnobWheel()
create the knob wheel
-
createZeroButton
protected JButton createZeroButton()
create the zero button
-
resync
protected void resync(boolean forceLimitsUpdate)
resynchronize the control with the knob settings
-
nameChanged
public void nameChanged(Knob knob, String newName)
event indicating that the specified knob's name has changed- Specified by:
nameChangedin interfaceKnobListener
-
readyStateChanged
public void readyStateChanged(Knob knob, boolean isReady)
ready state changed- Specified by:
readyStateChangedin interfaceKnobListener
-
limitsChanged
public void limitsChanged(Knob knob, double lowerLimit, double upperLimit)
event indicating that the knob's limits have changed- Specified by:
limitsChangedin interfaceKnobListener
-
currentSettingChanged
public void currentSettingChanged(Knob knob, double value)
event indicating that the knob's current value setting has changed- Specified by:
currentSettingChangedin interfaceKnobListener
-
elementAdded
public void elementAdded(Knob knob, KnobElement element)
event indicating that an element has been added- Specified by:
elementAddedin interfaceKnobListener
-
elementRemoved
public void elementRemoved(Knob knob, KnobElement element)
event indicating that an element has been removed- Specified by:
elementRemovedin interfaceKnobListener
-
elementModified
public void elementModified(Knob knob, KnobElement element)
event indicating that the specified knob element has been modified- Specified by:
elementModifiedin interfaceKnobListener
-
valueSettingPublished
public void valueSettingPublished(Knob knob)
event indicating that the knob's most previously pending set operation has completed- Specified by:
valueSettingPublishedin interfaceKnobListener
-
-