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 Object
This class is used to provide Ribs functionality to Swing JComponents.
  • Constructor Details

    • RJHelper

      public RJHelper()
  • Method Details

    • newInstance

      public Object newInstance(RXElement anElement)
      Creates a new instance of class for given element.
    • initInstance

      public void initInstance(JComponent aComponent)
      Initializes the given instance (actually called the first time an owner is set).
    • getComponentCount

      public int getComponentCount(JComponent aComponent)
      Returns the Ribs-relevant child component count.
    • getComponent

      public JComponent getComponent(JComponent aComponent, int anIndex)
      Returns the Ribs-relevant child component at the given index.
    • get

      public JComponent get(JComponent aComponent, String aName)
      Returns the given component or any of its children that have the give name.
    • add

      public void add(JComponent aComponent, JComponent aChild)
      Adds a child into the parent's component heirarchy.
    • getOwner

      public Object getOwner(JComponent aComponent)
      Returns given component's owner.
    • setOwner

      public void setOwner(JComponent aComponent, Object anOwner)
      Sets given component's owner.
    • getMaster

      public RJPanel getMaster(JComponent aComponent)
      Returns the top level panel of the rib file (the one that given component was loaded from).
    • setMaster

      public void setMaster(JComponent aComponent, RJPanel aMaster)
      Sets the top level panel of this rib file (the one that the given component was loaded from).
    • getCallback

      public String getCallback(@Nonnull JComponent aComponent)
      Returns given component's callback method (respondUI is the default).
    • setCallback

      public void setCallback(JComponent aComponent, String aCallback)
      Sets given component's callback method (respondUI is the default).
    • getBindKey

      public String getBindKey(JComponent aComponent)
      Returns this component's bind key chain.
    • setBindKey

      public void setBindKey(JComponent aComponent, String aBindKey)
      Sets this component's bind key chain.
    • sendAction

      public void sendAction(JComponent aComponent, RJAction anAction)
      Sends action for the given component.
    • performBindKeyGet

      public void performBindKeyGet(JComponent aComponent)
      Performs bind key get.
    • performBindKeySet

      public void performBindKeySet(JComponent aComponent)
      Performs bind key set.
    • getSubstitutionClassString

      public String getSubstitutionClassString(JComponent aComponent)
      Returns the subclass string for the given component.
    • setSubstitutionClassString

      public void setSubstitutionClassString(JComponent aComponent, String aClassString)
      Sets the subclass string for the given component.
    • getAutosizing

      public String getAutosizing(JComponent aComponent)
      Returns the autosizing for the given component.
    • setAutosizing

      public void setAutosizing(JComponent aComponent, String aValue)
      Sets the autosizing for the given component.
    • getRibX

      public int getRibX(JComponent aComponent)
      Returns the original X of the given component as defined in the rib file.
    • getRibY

      public int getRibY(JComponent aComponent)
      Returns the original Y of the given component as defined in the rib file.
    • getRibWidth

      public int getRibWidth(JComponent aComponent)
      Returns the original width of the given component as defined in the rib file.
    • getRibHeight

      public int getRibHeight(JComponent aComponent)
      Returns the original height of the given component as defined in the rib file.
    • setMinimumSize

      public void setMinimumSize(JComponent aComponent, Dimension min)
      Sets the minimum size for a component and records the fact that we've changed it.
    • getMinimumSize

      public Dimension getMinimumSize(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(JComponent aComponent, Dimension max)
      Sets the maximum size for a component and records the fact that we've changed it.
    • getMaximumSize

      public Dimension getMaximumSize(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 Object getValue(JComponent aComponent)
      Returns a component's value.
    • setValue

      public void setValue(JComponent aComponent, Object aValue)
      Sets a component's value.
    • getStringValue

      public String getStringValue(JComponent aComponent)
      Returns a component's value as a string.
    • setValue

      public void setValue(JComponent aComponent, String aValue)
      Sets a component's value from given string.
    • getBooleanValue

      public Boolean getBooleanValue(JComponent aComponent)
      Returns a component's value as a Boolean.
    • setValue

      public void setValue(JComponent aComponent, Boolean aValue)
      Sets a component's value from given Boolean.
    • getBoolValue

      public boolean getBoolValue(JComponent aComponent)
      Returns a component's value as a boolean.
    • setValue

      public void setValue(JComponent aComponent, boolean aValue)
      Sets a component's value from given boolean.
    • getIntValue

      public int getIntValue(JComponent aComponent)
      Returns a component's value as an int.
    • setValue

      public void setValue(JComponent aComponent, int aValue)
      Sets a component's value from given int.
    • getFloatValue

      public float getFloatValue(JComponent aComponent)
      Returns a component's value as a float.
    • setValue

      public void setValue(JComponent aComponent, float aValue)
      Sets a component's value from given float.
    • getColorValue

      public Color getColorValue(JComponent aComponent)
      Returns a component's value as color.
    • setValue

      public void setValue(JComponent aComponent, Color aValue)
      Sets a component's value from given Color.
    • getActionListener

      public ActionListener getActionListener()
      Returns an action listener suitable for many controls.
    • getChangeListener

      public ChangeListener getChangeListener()
      Returns a change listener suitable for some controls.
    • getFocusListener

      public FocusListener getFocusListener()
      Returns a focus listener suitable for the occasional control.
    • getAutoscrolls

      public Boolean getAutoscrolls(JComponent aComponent)
      Returns whether a component autoscrolls if explicitly set, null otherwise.
    • setAutoscrolls

      public void setAutoscrolls(JComponent aComponent, Boolean aValue)
      Sets whether a component autoscrolls and client property (so we know it was explicitly set).
    • getForeground

      public Color getForeground(JComponent aComponent)
      Returns the given component's foreground color if explicitly set, otherwise null.
    • setForeground

      public void setForeground(JComponent aComponent, Color aColor)
      Sets the given component's foreground color and client property (so we know it was explicitly set).
    • getBackground

      public Color getBackground(JComponent aComponent)
      Returns the given component's background color if explicitly set, otherwise null.
    • setBackground

      public void setBackground(JComponent aComponent, Color aColor)
      Sets the given component's background color and client property (so we know it was explicitly set).
    • isOpaque

      public Boolean isOpaque(JComponent aComponent)
      Returns component's opacity if explicitly set, null otherwise.
    • setOpaque

      public void setOpaque(JComponent aComponent, Boolean aValue)
      Set component's opacity and client property (so we know it was explicitly set).
    • focusGained

      public void focusGained(JComponent aComponent, FocusEvent fe)
      Called by default focus listener when the component gains focus.
    • focusLost

      public void focusLost(JComponent aComponent, 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(JComponent aComponent)
      Returns whether this component sends action when it loses focus.
    • setSendActionOnFocusLost

      public void setSendActionOnFocusLost(JComponent aComponent, boolean aValue)
      Sets whether this text field sends action when it loses focus.
    • takeIntValue

      public void takeIntValue(JComponent aComponent, JComponent aCaller)
      A generic callback method for component to component callbacks.
    • takeFloatValue

      public void takeFloatValue(JComponent aComponent, JComponent aCaller)
      A generic callback method for component to component callbacks.
    • toXML

      public RXElement toXML(JComponent aComponent, RXArchiver anArchiver)
      XML archival utility method.
    • toXMLDeep

      public void toXMLDeep(JComponent aComponent, RXArchiver anArchiver, RXElement anElement)
      XML archival utility method.
    • fromXML

      public void fromXML(JComponent aComponent, RXArchiver anArchiver, RXElement anElement)
      XML unarchival utility method.
    • fromXMLDeep

      public void fromXMLDeep(JComponent aComponent, RXArchiver anArchiver, RXElement anElement)
      XML unarchival utility method.
    • testOutBeanBag

      public void testOutBeanBag(JComponent c)