Package com.inductiveautomation.snap.ui
Class UIOwner<EVENT extends UIEvent,UITYPE>
java.lang.Object
com.inductiveautomation.snap.ui.UIOwner<EVENT,UITYPE>
- Direct Known Subclasses:
RMViewerOwner
,SwingOwner
A base controller class class that manages a SwingPanel usually loaded from a rib file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
static final UIEvent.Type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
addKeyActionEvent
(String aName, String aKey) Configures an ActionEvent to be sent to owner for given name and key description (in KeyStroke string format).void
addNodeBinding
(Object anObj, String aPropertyName, String aKeyPath) Adds a binding to a UI node.protected abstract UITYPE
createUI()
Creates the UI panel.void
disableEvents
(Object anObj, UIEvent.Type... theTypes) Enables events on given object.void
enableEvents
(Object anObj, UIEvent.Type... theTypes) Enables events on given object.protected Object
getBindingModelValue
(Binding aBinding) Returns the key value for a given binding.protected Object
getBindingNodeValue
(Binding aBinding) Returns the UI node value for the given binding.getConversionMap
(String aName) Returns a named map to perform value conversions.protected Object
getConversionMapKey
(String aConversionMapName, Object aValue) Converts a UI node value to binder object value using conversion key map.Returns the map of maps, each of which is used to perform value conversions.getConversionMapValue
(String aConversionMapName, Object aKey) Converts a binder object value to UI node using conversion key map.Returns the first focus UI node for when window/dialog is made visible.getModelValue
(String aKey) Returns the model value for given key expression from this UIOwner.protected UITYPE
Returns the specific UI child node for given object (name, event or node).Returns the specific UI child node with the given name.<T extends UITYPE>
TReturns the specific UI child node with the given name as the given class.getNodeAction
(Object anObj) Returns a node action.boolean
getNodeBoolValue
(Object anObj) Returns the boolean value for a given name or UI node.float
getNodeFloatValue
(Object anObj) Returns the float value for a given name or UI node.protected abstract UIHelper
getNodeHelper
(Object anObj) Returns the helper for a given UI node.int
getNodeIntValue
(Object anObj) Returns the int value for a given name or UI node.getNodeItemDisplayKey
(Object anObj, String aKey) Returns the display key for given name or UI node.getNodeItems
(Object anObj) Returns the items for a given name or UI node.int
getNodeSelectedIndex
(Object anObj) Returns the selected index for given name or UI node.getNodeSelectedItem
(Object anObj) Returns the selected item for given name or UI node.getNodeStringValue
(Object anObj) Returns the string value for a given name or UI node.getNodeText
(Object anObj) Returns the text value for a given name or UI node.getNodeValue
(Object anObj) Returns the object value for a given name or UI node.getUI()
Returns the main UI node.<T extends UITYPE>
TReturns the main UI node with the given name as the given class.protected UIHelper
getUIHpr()
Returns the helper for a given object.protected void
initUI()
Initializes the UI panel.protected void
Initialize UI.protected abstract boolean
Returns whether current thread is event thread.void
isNodeEnabled
(Object anObj) Returns whether given name or UI node is enabled.boolean
isNodeValueAdjusting
(Object anObj) Returns whether given name or UI node is currently being modified.boolean
Returns whether Ribs' send event facility is disabled (so controls can be updated without triggering response).boolean
isUISet()
Returns whether UI has been set.protected void
Called to reset bindings and resetUI().protected void
processRespondUI
(EVENT anEvent) Called to invoke respondUI().abstract void
requestFocus
(Object anObj) Focuses given UI node (name or node).void
Resets UI later.protected void
resetNodeBindings
(Object anObj) Reset bindings for UI node (recurses for children).protected void
resetUI()
Reset UI controls.protected void
Respond to UI controls.abstract void
Runs the given runnable in the next event.void
runLaterDelayed
(int aDelay, Runnable aRunnable) Runs the runnable after the given delay in milliseconds.void
runLaterOnce
(String aName, Runnable aRunnable) Invokes the given runnable for name once (cancels unexecuted previous runLater registered with same name).void
Sends an event for a UI node.abstract void
Sends an event for a UI node (name or node).protected void
sendNodeAction
(Object anObj, String anAction) Sends a node action.protected void
setBindingModelValue
(Binding aBinding) Sets the key value for the given binding from the UI node.protected void
setBindingNodeValue
(Binding aBinding) Sets the UI node value for the given binding from the key value.void
setFirstFocus
(Object anObj) Sets the first focus UI node.void
setModelValue
(String aKey, Object aValue) Sets the model value for given key expression and value for this UIOwner.void
setNodeAction
(Object anObj, String anAction) Sets a node action.void
setNodeEnabled
(Object anObj, boolean aValue) Sets whether given name or UI node is enabled.void
setNodeItemDisplayKey
(Object anObj, String aKey) Sets the display key for given name or UI node.void
setNodeItems
(Object anObj, Object... theItems) Sets the items for a given name or UI node.void
setNodeItems
(Object anObj, List theItems) Sets the items for a given name or UI node.void
setNodeSelectedIndex
(Object anObj, int aValue) Sets the selected index for given name or UI node.void
setNodeSelectedItem
(Object anObj, Object anItem) Sets the selected item for given name or UI node.void
setNodeText
(Object anObj, String aValue) Sets the object value for a given name or UI node.void
setNodeValue
(Object anObj, Object aValue) Sets the object value for a given name or UI node.boolean
setSendEventDisabled
(boolean aFlag) Sets whether Ribs' send event facility is disabled (so controls can be updated without triggering response).
-
Field Details
-
KeyPressed
-
KeyReleased
-
KeyTyped
-
KeyFinished
-
MousePressed
-
MouseDragged
-
MouseReleased
-
MouseClicked
-
MouseFinished
-
MouseEntered
-
MouseMoved
-
MouseExited
-
DragEnter
-
DragOver
-
DragExit
-
DragDrop
-
KeyEvents
-
MouseEvents
-
DragEvents
-
-
Constructor Details
-
UIOwner
public UIOwner()
-
-
Method Details
-
isUISet
public boolean isUISet()Returns whether UI has been set. -
getUI
Returns the main UI node. -
getUI
Returns the main UI node with the given name as the given class. -
createUI
Creates the UI panel. -
initUI
protected void initUI()Initializes the UI panel. -
initUI
Initialize UI. -
resetUI
protected void resetUI()Reset UI controls. -
respondUI
Respond to UI controls. -
resetLater
public void resetLater()Resets UI later. -
processResetUI
protected void processResetUI()Called to reset bindings and resetUI(). -
processRespondUI
Called to invoke respondUI(). -
getNode
Returns the specific UI child node with the given name. -
getNode
Returns the specific UI child node for given object (name, event or node). -
getNode
Returns the specific UI child node with the given name as the given class. -
getNodeValue
Returns the object value for a given name or UI node. -
setNodeValue
Sets the object value for a given name or UI node. -
getNodeStringValue
Returns the string value for a given name or UI node. -
getNodeBoolValue
Returns the boolean value for a given name or UI node. -
getNodeIntValue
Returns the int value for a given name or UI node. -
getNodeFloatValue
Returns the float value for a given name or UI node. -
getNodeText
Returns the text value for a given name or UI node. -
setNodeText
Sets the object value for a given name or UI node. -
getNodeItems
Returns the items for a given name or UI node. -
setNodeItems
Sets the items for a given name or UI node. -
setNodeItems
Sets the items for a given name or UI node. -
getNodeItemDisplayKey
Returns the display key for given name or UI node. -
setNodeItemDisplayKey
Sets the display key for given name or UI node. -
getNodeSelectedIndex
Returns the selected index for given name or UI node. -
setNodeSelectedIndex
Sets the selected index for given name or UI node. -
getNodeSelectedItem
Returns the selected item for given name or UI node. -
setNodeSelectedItem
Sets the selected item for given name or UI node. -
isNodeEnabled
Returns whether given name or UI node is enabled. -
setNodeEnabled
Sets whether given name or UI node is enabled. -
isNodeValueAdjusting
Returns whether given name or UI node is currently being modified. -
getNodeHelper
Returns the helper for a given UI node. -
getNodeAction
Returns a node action. -
setNodeAction
Sets a node action. -
sendNodeAction
Sends a node action. -
addNodeBinding
Adds a binding to a UI node. -
resetNodeBindings
Reset bindings for UI node (recurses for children). -
getBindingNodeValue
Returns the UI node value for the given binding. -
setBindingNodeValue
Sets the UI node value for the given binding from the key value. -
getBindingModelValue
Returns the key value for a given binding. -
setBindingModelValue
Sets the key value for the given binding from the UI node. -
getFirstFocus
Returns the first focus UI node for when window/dialog is made visible. -
setFirstFocus
Sets the first focus UI node. -
requestFocus
Focuses given UI node (name or node). -
getConversionMaps
Returns the map of maps, each of which is used to perform value conversions. -
getConversionMap
Returns a named map to perform value conversions. -
getConversionMapKey
Converts a UI node value to binder object value using conversion key map. -
getConversionMapValue
Converts a binder object value to UI node using conversion key map. -
enableEvents
Enables events on given object. -
disableEvents
Enables events on given object. -
sendEvent
Sends an event for a UI node (name or node). -
sendEvent
Sends an event for a UI node. -
isSendEventDisabled
public boolean isSendEventDisabled()Returns whether Ribs' send event facility is disabled (so controls can be updated without triggering response). -
setSendEventDisabled
public boolean setSendEventDisabled(boolean aFlag) Sets whether Ribs' send event facility is disabled (so controls can be updated without triggering response). -
addKeyActionEvent
Configures an ActionEvent to be sent to owner for given name and key description (in KeyStroke string format).- See Also:
-
runLater
Runs the given runnable in the next event. -
runLaterDelayed
Runs the runnable after the given delay in milliseconds. -
runLaterOnce
Invokes the given runnable for name once (cancels unexecuted previous runLater registered with same name). -
isEventThread
protected abstract boolean isEventThread()Returns whether current thread is event thread. -
getUIHpr
Returns the helper for a given object. -
getModelValue
Returns the model value for given key expression from this UIOwner. -
setModelValue
Sets the model value for given key expression and value for this UIOwner.
-