Package com.ribs
Class RJHelper
- java.lang.Object
-
- com.ribs.RJHelper
-
- Direct Known Subclasses:
JButtonOrLabelHpr,JComboBoxHpr,JListHpr,JMenuBarHpr,JMenuItemHpr,JPopupMenuHpr,JProgressBarHpr,JScrollPaneHpr,JSeparatorHpr,JSliderHpr,JSpinnerHpr,JSplitPaneHpr,JTabbedPaneHpr,JTableHpr,JTextComponentHpr,JTreeHpr,RJColorWellHpr,RJCustomViewHpr,RJPanelHpr,RJSwitchPaneHpr,RJThumbWheelHpr
public class RJHelper extends java.lang.ObjectThis class is used to provide Ribs functionality to Swing JComponents.
-
-
Constructor Summary
Constructors Constructor Description RJHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(javax.swing.JComponent aComponent, javax.swing.JComponent aChild)Adds a child into the parent's component heirarchy.voidfocusGained(javax.swing.JComponent aComponent, java.awt.event.FocusEvent fe)Called by default focus listener when the component gains focus.voidfocusLost(javax.swing.JComponent aComponent, java.awt.event.FocusEvent fe)Called by the default focus listener when focus is lost on a component, but before any action is fired.voidfromXML(javax.swing.JComponent aComponent, RXArchiver anArchiver, RXElement anElement)XML unarchival utility method.voidfromXMLDeep(javax.swing.JComponent aComponent, RXArchiver anArchiver, RXElement anElement)XML unarchival utility method.javax.swing.JComponentget(javax.swing.JComponent aComponent, java.lang.String aName)Returns the given component or any of its children that have the give name.java.awt.event.ActionListenergetActionListener()Returns an action listener suitable for many controls.java.lang.BooleangetAutoscrolls(javax.swing.JComponent aComponent)Returns whether a component autoscrolls if explicitly set, null otherwise.java.lang.StringgetAutosizing(javax.swing.JComponent aComponent)Returns the autosizing for the given component.java.awt.ColorgetBackground(javax.swing.JComponent aComponent)Returns the given component's background color if explicitly set, otherwise null.java.lang.StringgetBindKey(javax.swing.JComponent aComponent)Returns this component's bind key chain.java.lang.BooleangetBooleanValue(javax.swing.JComponent aComponent)Returns a component's value as a Boolean.booleangetBoolValue(javax.swing.JComponent aComponent)Returns a component's value as a boolean.java.lang.StringgetCallback(javax.swing.JComponent aComponent)Returns given component's callback method (respondUI is the default).javax.swing.event.ChangeListenergetChangeListener()Returns a change listener suitable for some controls.java.awt.ColorgetColorValue(javax.swing.JComponent aComponent)Returns a component's value as color.javax.swing.JComponentgetComponent(javax.swing.JComponent aComponent, int anIndex)Returns the Ribs-relevant child component at the given index.intgetComponentCount(javax.swing.JComponent aComponent)Returns the Ribs-relevant child component count.floatgetFloatValue(javax.swing.JComponent aComponent)Returns a component's value as a float.java.awt.event.FocusListenergetFocusListener()Returns a focus listener suitable for the occasional control.java.awt.ColorgetForeground(javax.swing.JComponent aComponent)Returns the given component's foreground color if explicitly set, otherwise null.intgetIntValue(javax.swing.JComponent aComponent)Returns a component's value as an int.RJPanelgetMaster(javax.swing.JComponent aComponent)Returns the top level panel of the rib file (the one that given component was loaded from).java.awt.DimensiongetMaximumSize(javax.swing.JComponent aComponent)Returns null unless the maximum size has explicitly been set by the user, in which case it uses the component's maximum size.java.awt.DimensiongetMinimumSize(javax.swing.JComponent aComponent)Returns null unless the minimum size has explicitly been set by the user, in which case it uses the component's minimum size.java.lang.ObjectgetOwner(javax.swing.JComponent aComponent)Returns given component's owner.intgetRibHeight(javax.swing.JComponent aComponent)Returns the original height of the given component as defined in the rib file.intgetRibWidth(javax.swing.JComponent aComponent)Returns the original width of the given component as defined in the rib file.intgetRibX(javax.swing.JComponent aComponent)Returns the original X of the given component as defined in the rib file.intgetRibY(javax.swing.JComponent aComponent)Returns the original Y of the given component as defined in the rib file.booleangetSendActionOnFocusLost(javax.swing.JComponent aComponent)Returns whether this component sends action when it loses focus.java.lang.StringgetStringValue(javax.swing.JComponent aComponent)Returns a component's value as a string.java.lang.StringgetSubstitutionClassString(javax.swing.JComponent aComponent)Returns the subclass string for the given component.java.lang.ObjectgetValue(javax.swing.JComponent aComponent)Returns a component's value.voidinitInstance(javax.swing.JComponent aComponent)Initializes the given instance (actually called the first time an owner is set).java.lang.BooleanisOpaque(javax.swing.JComponent aComponent)Returns component's opacity if explicitly set, null otherwise.java.lang.ObjectnewInstance(RXElement anElement)Creates a new instance of class for given element.voidperformBindKeyGet(javax.swing.JComponent aComponent)Performs bind key get.voidperformBindKeySet(javax.swing.JComponent aComponent)Performs bind key set.voidsendAction(javax.swing.JComponent aComponent, RJAction anAction)Sends action for the given component.voidsetAutoscrolls(javax.swing.JComponent aComponent, java.lang.Boolean aValue)Sets whether a component autoscrolls and client property (so we know it was explicitly set).voidsetAutosizing(javax.swing.JComponent aComponent, java.lang.String aValue)Sets the autosizing for the given component.voidsetBackground(javax.swing.JComponent aComponent, java.awt.Color aColor)Sets the given component's background color and client property (so we know it was explicitly set).voidsetBindKey(javax.swing.JComponent aComponent, java.lang.String aBindKey)Sets this component's bind key chain.voidsetCallback(javax.swing.JComponent aComponent, java.lang.String aCallback)Sets given component's callback method (respondUI is the default).voidsetForeground(javax.swing.JComponent aComponent, java.awt.Color aColor)Sets the given component's foreground color and client property (so we know it was explicitly set).voidsetMaster(javax.swing.JComponent aComponent, RJPanel aMaster)Sets the top level panel of this rib file (the one that the given component was loaded from).voidsetMaximumSize(javax.swing.JComponent aComponent, java.awt.Dimension max)Sets the maximum size for a component and records the fact that we've changed it.voidsetMinimumSize(javax.swing.JComponent aComponent, java.awt.Dimension min)Sets the minimum size for a component and records the fact that we've changed it.voidsetOpaque(javax.swing.JComponent aComponent, java.lang.Boolean aValue)Set component's opacity and client property (so we know it was explicitly set).voidsetOwner(javax.swing.JComponent aComponent, java.lang.Object anOwner)Sets given component's owner.voidsetSendActionOnFocusLost(javax.swing.JComponent aComponent, boolean aValue)Sets whether this text field sends action when it loses focus.voidsetSubstitutionClassString(javax.swing.JComponent aComponent, java.lang.String aClassString)Sets the subclass string for the given component.voidsetValue(javax.swing.JComponent aComponent, boolean aValue)Sets a component's value from given boolean.voidsetValue(javax.swing.JComponent aComponent, float aValue)Sets a component's value from given float.voidsetValue(javax.swing.JComponent aComponent, int aValue)Sets a component's value from given int.voidsetValue(javax.swing.JComponent aComponent, java.awt.Color aValue)Sets a component's value from given Color.voidsetValue(javax.swing.JComponent aComponent, java.lang.Boolean aValue)Sets a component's value from given Boolean.voidsetValue(javax.swing.JComponent aComponent, java.lang.Object aValue)Sets a component's value.voidsetValue(javax.swing.JComponent aComponent, java.lang.String aValue)Sets a component's value from given string.voidtakeFloatValue(javax.swing.JComponent aComponent, javax.swing.JComponent aCaller)A generic callback method for component to component callbacks.voidtakeIntValue(javax.swing.JComponent aComponent, javax.swing.JComponent aCaller)A generic callback method for component to component callbacks.voidtestOutBeanBag(javax.swing.JComponent c)RXElementtoXML(javax.swing.JComponent aComponent, RXArchiver anArchiver)XML archival utility method.voidtoXMLDeep(javax.swing.JComponent aComponent, RXArchiver anArchiver, RXElement anElement)XML archival utility method.
-
-
-
Method Detail
-
newInstance
public java.lang.Object newInstance(RXElement anElement)
Creates a new instance of class for given element.
-
initInstance
public void initInstance(javax.swing.JComponent aComponent)
Initializes the given instance (actually called the first time an owner is set).
-
getComponentCount
public int getComponentCount(javax.swing.JComponent aComponent)
Returns the Ribs-relevant child component count.
-
getComponent
public javax.swing.JComponent getComponent(javax.swing.JComponent aComponent, int anIndex)Returns the Ribs-relevant child component at the given index.
-
get
public javax.swing.JComponent get(javax.swing.JComponent aComponent, java.lang.String aName)Returns the given component or any of its children that have the give name.
-
add
public void add(javax.swing.JComponent aComponent, javax.swing.JComponent aChild)Adds a child into the parent's component heirarchy.
-
getOwner
public java.lang.Object getOwner(javax.swing.JComponent aComponent)
Returns given component's owner.
-
setOwner
public void setOwner(javax.swing.JComponent aComponent, java.lang.Object anOwner)Sets given component's owner.
-
getMaster
public RJPanel getMaster(javax.swing.JComponent aComponent)
Returns the top level panel of the rib file (the one that given component was loaded from).
-
setMaster
public void setMaster(javax.swing.JComponent aComponent, RJPanel aMaster)Sets the top level panel of this rib file (the one that the given component was loaded from).
-
getCallback
public java.lang.String getCallback(javax.swing.JComponent aComponent)
Returns given component's callback method (respondUI is the default).
-
setCallback
public void setCallback(javax.swing.JComponent aComponent, java.lang.String aCallback)Sets given component's callback method (respondUI is the default).
-
getBindKey
public java.lang.String getBindKey(javax.swing.JComponent aComponent)
Returns this component's bind key chain.
-
setBindKey
public void setBindKey(javax.swing.JComponent aComponent, java.lang.String aBindKey)Sets this component's bind key chain.
-
sendAction
public void sendAction(javax.swing.JComponent aComponent, RJAction anAction)Sends action for the given component.
-
performBindKeyGet
public void performBindKeyGet(javax.swing.JComponent aComponent)
Performs bind key get.
-
performBindKeySet
public void performBindKeySet(javax.swing.JComponent aComponent)
Performs bind key set.
-
getSubstitutionClassString
public java.lang.String getSubstitutionClassString(javax.swing.JComponent aComponent)
Returns the subclass string for the given component.
-
setSubstitutionClassString
public void setSubstitutionClassString(javax.swing.JComponent aComponent, java.lang.String aClassString)Sets the subclass string for the given component.
-
getAutosizing
public java.lang.String getAutosizing(javax.swing.JComponent aComponent)
Returns the autosizing for the given component.
-
setAutosizing
public void setAutosizing(javax.swing.JComponent aComponent, java.lang.String aValue)Sets the autosizing for the given component.
-
getRibX
public int getRibX(javax.swing.JComponent aComponent)
Returns the original X of the given component as defined in the rib file.
-
getRibY
public int getRibY(javax.swing.JComponent aComponent)
Returns the original Y of the given component as defined in the rib file.
-
getRibWidth
public int getRibWidth(javax.swing.JComponent aComponent)
Returns the original width of the given component as defined in the rib file.
-
getRibHeight
public int getRibHeight(javax.swing.JComponent aComponent)
Returns the original height of the given component as defined in the rib file.
-
setMinimumSize
public void setMinimumSize(javax.swing.JComponent aComponent, java.awt.Dimension min)Sets the minimum size for a component and records the fact that we've changed it.
-
getMinimumSize
public java.awt.Dimension getMinimumSize(javax.swing.JComponent aComponent)
Returns null unless the minimum size has explicitly been set by the user, in which case it uses the component's minimum size. Note that some components may not let you change minimum size. What you do in that situation, I'm not sure.
-
setMaximumSize
public void setMaximumSize(javax.swing.JComponent aComponent, java.awt.Dimension max)Sets the maximum size for a component and records the fact that we've changed it.
-
getMaximumSize
public java.awt.Dimension getMaximumSize(javax.swing.JComponent aComponent)
Returns null unless the maximum size has explicitly been set by the user, in which case it uses the component's maximum size.
-
getValue
public java.lang.Object getValue(javax.swing.JComponent aComponent)
Returns a component's value.
-
setValue
public void setValue(javax.swing.JComponent aComponent, java.lang.Object aValue)Sets a component's value.
-
getStringValue
public java.lang.String getStringValue(javax.swing.JComponent aComponent)
Returns a component's value as a string.
-
setValue
public void setValue(javax.swing.JComponent aComponent, java.lang.String aValue)Sets a component's value from given string.
-
getBooleanValue
public java.lang.Boolean getBooleanValue(javax.swing.JComponent aComponent)
Returns a component's value as a Boolean.
-
setValue
public void setValue(javax.swing.JComponent aComponent, java.lang.Boolean aValue)Sets a component's value from given Boolean.
-
getBoolValue
public boolean getBoolValue(javax.swing.JComponent aComponent)
Returns a component's value as a boolean.
-
setValue
public void setValue(javax.swing.JComponent aComponent, boolean aValue)Sets a component's value from given boolean.
-
getIntValue
public int getIntValue(javax.swing.JComponent aComponent)
Returns a component's value as an int.
-
setValue
public void setValue(javax.swing.JComponent aComponent, int aValue)Sets a component's value from given int.
-
getFloatValue
public float getFloatValue(javax.swing.JComponent aComponent)
Returns a component's value as a float.
-
setValue
public void setValue(javax.swing.JComponent aComponent, float aValue)Sets a component's value from given float.
-
getColorValue
public java.awt.Color getColorValue(javax.swing.JComponent aComponent)
Returns a component's value as color.
-
setValue
public void setValue(javax.swing.JComponent aComponent, java.awt.Color aValue)Sets a component's value from given Color.
-
getActionListener
public java.awt.event.ActionListener getActionListener()
Returns an action listener suitable for many controls.
-
getChangeListener
public javax.swing.event.ChangeListener getChangeListener()
Returns a change listener suitable for some controls.
-
getFocusListener
public java.awt.event.FocusListener getFocusListener()
Returns a focus listener suitable for the occasional control.
-
getAutoscrolls
public java.lang.Boolean getAutoscrolls(javax.swing.JComponent aComponent)
Returns whether a component autoscrolls if explicitly set, null otherwise.
-
setAutoscrolls
public void setAutoscrolls(javax.swing.JComponent aComponent, java.lang.Boolean aValue)Sets whether a component autoscrolls and client property (so we know it was explicitly set).
-
getForeground
public java.awt.Color getForeground(javax.swing.JComponent aComponent)
Returns the given component's foreground color if explicitly set, otherwise null.
-
setForeground
public void setForeground(javax.swing.JComponent aComponent, java.awt.Color aColor)Sets the given component's foreground color and client property (so we know it was explicitly set).
-
getBackground
public java.awt.Color getBackground(javax.swing.JComponent aComponent)
Returns the given component's background color if explicitly set, otherwise null.
-
setBackground
public void setBackground(javax.swing.JComponent aComponent, java.awt.Color aColor)Sets the given component's background color and client property (so we know it was explicitly set).
-
isOpaque
public java.lang.Boolean isOpaque(javax.swing.JComponent aComponent)
Returns component's opacity if explicitly set, null otherwise.
-
setOpaque
public void setOpaque(javax.swing.JComponent aComponent, java.lang.Boolean aValue)Set component's opacity and client property (so we know it was explicitly set).
-
focusGained
public void focusGained(javax.swing.JComponent aComponent, java.awt.event.FocusEvent fe)Called by default focus listener when the component gains focus.
-
focusLost
public void focusLost(javax.swing.JComponent aComponent, java.awt.event.FocusEvent fe)Called by the default focus listener when focus is lost on a component, but before any action is fired.
-
getSendActionOnFocusLost
public boolean getSendActionOnFocusLost(javax.swing.JComponent aComponent)
Returns whether this component sends action when it loses focus.
-
setSendActionOnFocusLost
public void setSendActionOnFocusLost(javax.swing.JComponent aComponent, boolean aValue)Sets whether this text field sends action when it loses focus.
-
takeIntValue
public void takeIntValue(javax.swing.JComponent aComponent, javax.swing.JComponent aCaller)A generic callback method for component to component callbacks.
-
takeFloatValue
public void takeFloatValue(javax.swing.JComponent aComponent, javax.swing.JComponent aCaller)A generic callback method for component to component callbacks.
-
toXML
public RXElement toXML(javax.swing.JComponent aComponent, RXArchiver anArchiver)
XML archival utility method.
-
toXMLDeep
public void toXMLDeep(javax.swing.JComponent aComponent, RXArchiver anArchiver, RXElement anElement)XML archival utility method.
-
fromXML
public void fromXML(javax.swing.JComponent aComponent, RXArchiver anArchiver, RXElement anElement)XML unarchival utility method.
-
fromXMLDeep
public void fromXMLDeep(javax.swing.JComponent aComponent, RXArchiver anArchiver, RXElement anElement)XML unarchival utility method.
-
testOutBeanBag
public void testOutBeanBag(javax.swing.JComponent c)
-
-