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
 
 public abstract class UIOwner<EVENT extends UIEvent,UITYPE> extends java.lang.ObjectA base controller class class that manages a SwingPanel usually loaded from a rib file.
- 
- 
Field SummaryFields Modifier and Type Field Description static UIEvent.TypeDragDropstatic UIEvent.TypeDragEnterUIEvent.Type[]DragEventsstatic UIEvent.TypeDragExitstatic UIEvent.TypeDragOverUIEvent.Type[]KeyEventsstatic UIEvent.TypeKeyFinishedstatic UIEvent.TypeKeyPressedstatic UIEvent.TypeKeyReleasedstatic UIEvent.TypeKeyTypedstatic UIEvent.TypeMouseClickedstatic UIEvent.TypeMouseDraggedstatic UIEvent.TypeMouseEnteredUIEvent.Type[]MouseEventsstatic UIEvent.TypeMouseExitedstatic UIEvent.TypeMouseFinishedstatic UIEvent.TypeMouseMovedstatic UIEvent.TypeMousePressedstatic UIEvent.TypeMouseReleased
 - 
Constructor SummaryConstructors Constructor Description UIOwner()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddKeyActionEvent(java.lang.String aName, java.lang.String aKey)Configures an ActionEvent to be sent to owner for given name and key description (in KeyStroke string format).voidaddNodeBinding(java.lang.Object anObj, java.lang.String aPropertyName, java.lang.String aKeyPath)Adds a binding to a UI node.protected abstract UITYPEcreateUI()Creates the UI panel.voiddisableEvents(java.lang.Object anObj, UIEvent.Type... theTypes)Enables events on given object.voidenableEvents(java.lang.Object anObj, UIEvent.Type... theTypes)Enables events on given object.protected java.lang.ObjectgetBindingModelValue(Binding aBinding)Returns the key value for a given binding.protected java.lang.ObjectgetBindingNodeValue(Binding aBinding)Returns the UI node value for the given binding.java.util.Map<java.lang.String,java.lang.String>getConversionMap(java.lang.String aName)Returns a named map to perform value conversions.protected java.lang.ObjectgetConversionMapKey(java.lang.String aConversionMapName, java.lang.Object aValue)Converts a UI node value to binder object value using conversion key map.java.util.Map<java.lang.String,java.util.Map>getConversionMaps()Returns the map of maps, each of which is used to perform value conversions.java.lang.ObjectgetConversionMapValue(java.lang.String aConversionMapName, java.lang.Object aKey)Converts a binder object value to UI node using conversion key map.java.lang.ObjectgetFirstFocus()Returns the first focus UI node for when window/dialog is made visible.java.lang.ObjectgetModelValue(java.lang.String aKey)Returns the model value for given key expression from this UIOwner.protected UITYPEgetNode(java.lang.Object anObj)Returns the specific UI child node for given object (name, event or node).UITYPEgetNode(java.lang.String aName)Returns the specific UI child node with the given name.<T extends UITYPE>
 TgetNode(java.lang.String aName, java.lang.Class<T> aClass)Returns the specific UI child node with the given name as the given class.java.lang.StringgetNodeAction(java.lang.Object anObj)Returns a node action.booleangetNodeBoolValue(java.lang.Object anObj)Returns the boolean value for a given name or UI node.floatgetNodeFloatValue(java.lang.Object anObj)Returns the float value for a given name or UI node.protected abstract UIHelpergetNodeHelper(java.lang.Object anObj)Returns the helper for a given UI node.intgetNodeIntValue(java.lang.Object anObj)Returns the int value for a given name or UI node.java.lang.StringgetNodeItemDisplayKey(java.lang.Object anObj, java.lang.String aKey)Returns the display key for given name or UI node.java.util.ListgetNodeItems(java.lang.Object anObj)Returns the items for a given name or UI node.intgetNodeSelectedIndex(java.lang.Object anObj)Returns the selected index for given name or UI node.java.lang.ObjectgetNodeSelectedItem(java.lang.Object anObj)Returns the selected item for given name or UI node.java.lang.StringgetNodeStringValue(java.lang.Object anObj)Returns the string value for a given name or UI node.java.lang.StringgetNodeText(java.lang.Object anObj)Returns the text value for a given name or UI node.java.lang.ObjectgetNodeValue(java.lang.Object anObj)Returns the object value for a given name or UI node.UITYPEgetUI()Returns the main UI node.<T extends UITYPE>
 TgetUI(java.lang.Class<T> aClass)Returns the main UI node with the given name as the given class.protected UIHelpergetUIHpr()Returns the helper for a given object.protected voidinitUI()Initializes the UI panel.protected voidinitUI(java.lang.Object anObj)Initialize UI.protected abstract booleanisEventThread()Returns whether current thread is event thread.voidisNodeEnabled(java.lang.Object anObj)Returns whether given name or UI node is enabled.booleanisNodeValueAdjusting(java.lang.Object anObj)Returns whether given name or UI node is currently being modified.booleanisSendEventDisabled()Returns whether Ribs' send event facility is disabled (so controls can be updated without triggering response).booleanisUISet()Returns whether UI has been set.protected voidprocessResetUI()Called to reset bindings and resetUI().protected voidprocessRespondUI(EVENT anEvent)Called to invoke respondUI().abstract voidrequestFocus(java.lang.Object anObj)Focuses given UI node (name or node).voidresetLater()Resets UI later.protected voidresetNodeBindings(java.lang.Object anObj)Reset bindings for UI node (recurses for children).protected voidresetUI()Reset UI controls.protected voidrespondUI(EVENT anEvent)Respond to UI controls.abstract voidrunLater(java.lang.Runnable aRunnable)Runs the given runnable in the next event.voidrunLaterDelayed(int aDelay, java.lang.Runnable aRunnable)Runs the runnable after the given delay in milliseconds.voidrunLaterOnce(java.lang.String aName, java.lang.Runnable aRunnable)Invokes the given runnable for name once (cancels unexecuted previous runLater registered with same name).voidsendEvent(EVENT anEvent)Sends an event for a UI node.abstract voidsendEvent(java.lang.Object anObj)Sends an event for a UI node (name or node).protected voidsendNodeAction(java.lang.Object anObj, java.lang.String anAction)Sends a node action.protected voidsetBindingModelValue(Binding aBinding)Sets the key value for the given binding from the UI node.protected voidsetBindingNodeValue(Binding aBinding)Sets the UI node value for the given binding from the key value.voidsetFirstFocus(java.lang.Object anObj)Sets the first focus UI node.voidsetModelValue(java.lang.String aKey, java.lang.Object aValue)Sets the model value for given key expression and value for this UIOwner.voidsetNodeAction(java.lang.Object anObj, java.lang.String anAction)Sets a node action.voidsetNodeEnabled(java.lang.Object anObj, boolean aValue)Sets whether given name or UI node is enabled.voidsetNodeItemDisplayKey(java.lang.Object anObj, java.lang.String aKey)Sets the display key for given name or UI node.voidsetNodeItems(java.lang.Object anObj, java.lang.Object... theItems)Sets the items for a given name or UI node.voidsetNodeItems(java.lang.Object anObj, java.util.List theItems)Sets the items for a given name or UI node.voidsetNodeSelectedIndex(java.lang.Object anObj, int aValue)Sets the selected index for given name or UI node.voidsetNodeSelectedItem(java.lang.Object anObj, java.lang.Object anItem)Sets the selected item for given name or UI node.voidsetNodeText(java.lang.Object anObj, java.lang.String aValue)Sets the object value for a given name or UI node.voidsetNodeValue(java.lang.Object anObj, java.lang.Object aValue)Sets the object value for a given name or UI node.booleansetSendEventDisabled(boolean aFlag)Sets whether Ribs' send event facility is disabled (so controls can be updated without triggering response).
 
- 
- 
- 
Field Detail- 
KeyPressedpublic static final UIEvent.Type KeyPressed 
 - 
KeyReleasedpublic static final UIEvent.Type KeyReleased 
 - 
KeyTypedpublic static final UIEvent.Type KeyTyped 
 - 
KeyFinishedpublic static final UIEvent.Type KeyFinished 
 - 
MousePressedpublic static final UIEvent.Type MousePressed 
 - 
MouseDraggedpublic static final UIEvent.Type MouseDragged 
 - 
MouseReleasedpublic static final UIEvent.Type MouseReleased 
 - 
MouseClickedpublic static final UIEvent.Type MouseClicked 
 - 
MouseFinishedpublic static final UIEvent.Type MouseFinished 
 - 
MouseEnteredpublic static final UIEvent.Type MouseEntered 
 - 
MouseMovedpublic static final UIEvent.Type MouseMoved 
 - 
MouseExitedpublic static final UIEvent.Type MouseExited 
 - 
DragEnterpublic static final UIEvent.Type DragEnter 
 - 
DragOverpublic static final UIEvent.Type DragOver 
 - 
DragExitpublic static final UIEvent.Type DragExit 
 - 
DragDroppublic static final UIEvent.Type DragDrop 
 - 
KeyEventspublic UIEvent.Type[] KeyEvents 
 - 
MouseEventspublic UIEvent.Type[] MouseEvents 
 - 
DragEventspublic UIEvent.Type[] DragEvents 
 
- 
 - 
Method Detail- 
isUISetpublic boolean isUISet() Returns whether UI has been set.
 - 
getUIpublic UITYPE getUI() Returns the main UI node.
 - 
getUIpublic <T extends UITYPE> T getUI(java.lang.Class<T> aClass) Returns the main UI node with the given name as the given class.
 - 
createUIprotected abstract UITYPE createUI() Creates the UI panel.
 - 
initUIprotected void initUI() Initializes the UI panel.
 - 
initUIprotected void initUI(java.lang.Object anObj) Initialize UI.
 - 
resetUIprotected void resetUI() Reset UI controls.
 - 
respondUIprotected void respondUI(EVENT anEvent) Respond to UI controls.
 - 
resetLaterpublic void resetLater() Resets UI later.
 - 
processResetUIprotected void processResetUI() Called to reset bindings and resetUI().
 - 
processRespondUIprotected void processRespondUI(EVENT anEvent) Called to invoke respondUI().
 - 
getNodepublic UITYPE getNode(java.lang.String aName) Returns the specific UI child node with the given name.
 - 
getNodeprotected UITYPE getNode(java.lang.Object anObj) Returns the specific UI child node for given object (name, event or node).
 - 
getNode@Nullable public <T extends UITYPE> T getNode(java.lang.String aName, java.lang.Class<T> aClass) Returns the specific UI child node with the given name as the given class.
 - 
getNodeValuepublic java.lang.Object getNodeValue(java.lang.Object anObj) Returns the object value for a given name or UI node.
 - 
setNodeValuepublic void setNodeValue(java.lang.Object anObj, java.lang.Object aValue)Sets the object value for a given name or UI node.
 - 
getNodeStringValuepublic java.lang.String getNodeStringValue(java.lang.Object anObj) Returns the string value for a given name or UI node.
 - 
getNodeBoolValuepublic boolean getNodeBoolValue(java.lang.Object anObj) Returns the boolean value for a given name or UI node.
 - 
getNodeIntValuepublic int getNodeIntValue(java.lang.Object anObj) Returns the int value for a given name or UI node.
 - 
getNodeFloatValuepublic float getNodeFloatValue(java.lang.Object anObj) Returns the float value for a given name or UI node.
 - 
getNodeTextpublic java.lang.String getNodeText(java.lang.Object anObj) Returns the text value for a given name or UI node.
 - 
setNodeTextpublic void setNodeText(java.lang.Object anObj, java.lang.String aValue)Sets the object value for a given name or UI node.
 - 
getNodeItemspublic java.util.List getNodeItems(java.lang.Object anObj) Returns the items for a given name or UI node.
 - 
setNodeItemspublic void setNodeItems(java.lang.Object anObj, java.util.List theItems)Sets the items for a given name or UI node.
 - 
setNodeItemspublic void setNodeItems(java.lang.Object anObj, java.lang.Object... theItems)Sets the items for a given name or UI node.
 - 
getNodeItemDisplayKeypublic java.lang.String getNodeItemDisplayKey(java.lang.Object anObj, java.lang.String aKey)Returns the display key for given name or UI node.
 - 
setNodeItemDisplayKeypublic void setNodeItemDisplayKey(java.lang.Object anObj, java.lang.String aKey)Sets the display key for given name or UI node.
 - 
getNodeSelectedIndexpublic int getNodeSelectedIndex(java.lang.Object anObj) Returns the selected index for given name or UI node.
 - 
setNodeSelectedIndexpublic void setNodeSelectedIndex(java.lang.Object anObj, int aValue)Sets the selected index for given name or UI node.
 - 
getNodeSelectedItempublic java.lang.Object getNodeSelectedItem(java.lang.Object anObj) Returns the selected item for given name or UI node.
 - 
setNodeSelectedItempublic void setNodeSelectedItem(java.lang.Object anObj, java.lang.Object anItem)Sets the selected item for given name or UI node.
 - 
isNodeEnabledpublic void isNodeEnabled(java.lang.Object anObj) Returns whether given name or UI node is enabled.
 - 
setNodeEnabledpublic void setNodeEnabled(java.lang.Object anObj, boolean aValue)Sets whether given name or UI node is enabled.
 - 
isNodeValueAdjustingpublic boolean isNodeValueAdjusting(java.lang.Object anObj) Returns whether given name or UI node is currently being modified.
 - 
getNodeHelperprotected abstract UIHelper getNodeHelper(java.lang.Object anObj) Returns the helper for a given UI node.
 - 
getNodeActionpublic java.lang.String getNodeAction(java.lang.Object anObj) Returns a node action.
 - 
setNodeActionpublic void setNodeAction(java.lang.Object anObj, java.lang.String anAction)Sets a node action.
 - 
sendNodeActionprotected void sendNodeAction(java.lang.Object anObj, java.lang.String anAction)Sends a node action.
 - 
addNodeBindingpublic void addNodeBinding(java.lang.Object anObj, java.lang.String aPropertyName, java.lang.String aKeyPath)Adds a binding to a UI node.
 - 
resetNodeBindingsprotected void resetNodeBindings(java.lang.Object anObj) Reset bindings for UI node (recurses for children).
 - 
getBindingNodeValueprotected java.lang.Object getBindingNodeValue(Binding aBinding) Returns the UI node value for the given binding.
 - 
setBindingNodeValueprotected void setBindingNodeValue(Binding aBinding) Sets the UI node value for the given binding from the key value.
 - 
getBindingModelValueprotected java.lang.Object getBindingModelValue(Binding aBinding) Returns the key value for a given binding.
 - 
setBindingModelValueprotected void setBindingModelValue(Binding aBinding) Sets the key value for the given binding from the UI node.
 - 
getFirstFocuspublic java.lang.Object getFirstFocus() Returns the first focus UI node for when window/dialog is made visible.
 - 
setFirstFocuspublic void setFirstFocus(java.lang.Object anObj) Sets the first focus UI node.
 - 
requestFocuspublic abstract void requestFocus(java.lang.Object anObj) Focuses given UI node (name or node).
 - 
getConversionMapspublic java.util.Map<java.lang.String,java.util.Map> getConversionMaps() Returns the map of maps, each of which is used to perform value conversions.
 - 
getConversionMappublic java.util.Map<java.lang.String,java.lang.String> getConversionMap(java.lang.String aName) Returns a named map to perform value conversions.
 - 
getConversionMapKeyprotected java.lang.Object getConversionMapKey(java.lang.String aConversionMapName, java.lang.Object aValue)Converts a UI node value to binder object value using conversion key map.
 - 
getConversionMapValuepublic java.lang.Object getConversionMapValue(java.lang.String aConversionMapName, java.lang.Object aKey)Converts a binder object value to UI node using conversion key map.
 - 
enableEventspublic void enableEvents(java.lang.Object anObj, UIEvent.Type... theTypes)Enables events on given object.
 - 
disableEventspublic void disableEvents(java.lang.Object anObj, UIEvent.Type... theTypes)Enables events on given object.
 - 
sendEventpublic abstract void sendEvent(java.lang.Object anObj) Sends an event for a UI node (name or node).
 - 
sendEventpublic void sendEvent(EVENT anEvent) Sends an event for a UI node.
 - 
isSendEventDisabledpublic boolean isSendEventDisabled() Returns whether Ribs' send event facility is disabled (so controls can be updated without triggering response).
 - 
setSendEventDisabledpublic boolean setSendEventDisabled(boolean aFlag) Sets whether Ribs' send event facility is disabled (so controls can be updated without triggering response).
 - 
addKeyActionEventpublic abstract void addKeyActionEvent(java.lang.String aName, java.lang.String aKey)Configures an ActionEvent to be sent to owner for given name and key description (in KeyStroke string format).- See Also:
- KeyStroke
 
 - 
runLaterpublic abstract void runLater(java.lang.Runnable aRunnable) Runs the given runnable in the next event.
 - 
runLaterDelayedpublic void runLaterDelayed(int aDelay, java.lang.Runnable aRunnable)Runs the runnable after the given delay in milliseconds.
 - 
runLaterOncepublic void runLaterOnce(java.lang.String aName, java.lang.Runnable aRunnable)Invokes the given runnable for name once (cancels unexecuted previous runLater registered with same name).
 - 
isEventThreadprotected abstract boolean isEventThread() Returns whether current thread is event thread.
 - 
getUIHprprotected UIHelper getUIHpr() Returns the helper for a given object.
 - 
getModelValuepublic java.lang.Object getModelValue(java.lang.String aKey) Returns the model value for given key expression from this UIOwner.
 - 
setModelValuepublic void setModelValue(java.lang.String aKey, java.lang.Object aValue)Sets the model value for given key expression and value for this UIOwner.
 
- 
 
-