Package hec.gui

Class DSSI18n

java.lang.Object
hec.gui.DSSI18n

public class DSSI18n extends Object
  • Field Details

  • Constructor Details

    • DSSI18n

      protected DSSI18n(String prefix, String bundleName)
  • Method Details

    • getI18n

      public static DSSI18n getI18n(String prefix)
    • getI18n

      public static DSSI18n getI18n(String prefix, String bundleName)
    • getLabel

      @Deprecated public String getLabel()
      Deprecated.
      use getText()
      get the label (specified by .label) of this I18n object
      Returns:
      the text
    • getText

      public String getText()
      get the text (specified by .text) of this I18n object. if .text isn't defined then for backward compatibibility .label is tried.
      Returns:
      the text
    • getText

      protected String getText(boolean returnNull)
    • getName

      public String getName()
      get the name (specified by .name) of this I18n object
      Returns:
      the name or null
    • getHelp

      public String getHelp()
      get the Help String (specified by .help) of this I18n object
      Returns:
      the help String or null
    • getForeground

      public Color getForeground()
      get the foreground Color object (specified by .foreground) of this I18n object
      Returns:
      the foreground Color or null
    • getBackground

      public Color getBackground()
      get the background Color object (specified by .background) of this I18n object
      Returns:
      the background Color or null
    • getString

      protected String getString(String key, boolean returnNull)
    • getStringArray

      public String[] getStringArray()
      get an array of Strings specified by .array of this I18n object
      Array elements are by default separated by commas (,) but can be specified by the .array.delimiter key. The default array separator can be defined by overriding getDefaultArrayDelimiter()
      Returns:
      an array of elements separated by the .array.delimiter
    • getDoubleArray

      public double[] getDoubleArray()
      get an array of doubles specified by .array of this I18n object
      Array elements are by default separated by commas (,) but can be specified by the .array.delimiter key. The default array separator can be defined by overriding getDefaultArrayDelimiter()
      if an item in the .array can't be parsed as a double it will be set to RmaConst.UNDEF_DOUBLE
      Returns:
      an array of elements separated by the .array.delimiter, if the
      .array can't be found an array of zero length is returned
    • getIntArray

      public int[] getIntArray()
      get an array of ints specified by .array of this I18n object
      Array elements are by default separated by commas (,) but can be specified by the .array.delimiter key. The default array separator can be defined by overriding getDefaultArrayDelimiter()
      if an item in the .array can't be parsed as an int it will be set to RmaConst.UNDEF_INT
      Returns:
      an array of elements separated by the .array.delimiter, if the
      .array can't be found an array of zero length is returned
    • getArrayDelimiter

      protected String getArrayDelimiter(String key)
      get the delimiter String for the array specified by key.delimiter
      Parameters:
      key - the array property key
      Returns:
      the array delimiter, if key.delimiter isn't set then use the value returned by getDefaultArrayDelimiter
    • getDefaultArrayDelimiter

      protected String getDefaultArrayDelimiter()
    • getKeyStroke

      public KeyStroke getKeyStroke()
      get the KeyStroke (specified by .keystroke) of this I18n object
      Returns:
      the Icon object or null
      See Also:
    • getIcon

      public Icon getIcon()
      get the Icon (specified by .icon) of this I18n object
      Returns:
      the Icon object or null
    • getSelectedIcon

      public Icon getSelectedIcon()
      get the Icon (specified by .selectedIcon) of this I18n object
      Returns:
      the Icon object or null
    • getToolTipText

      public String getToolTipText()
      get the tooltip attribute (specified by .tooltip) of this I18n object
      Returns:
      the tooltip attribute or null
    • getMnemonic

      public int getMnemonic()
      get the mnemonic attribute (specified by .mnemonic) of this I18n object
      Returns:
      the mnemonic attribute or null
    • createJButton

      public JButton createJButton()
      create a JButton using the attributes specified by the I18n object
      Returns:
      the new JButton
    • createJToggleButton

      public JToggleButton createJToggleButton()
      Returns:
    • configureButton

      public void configureButton(AbstractButton button)
      configure the button with the attributes specified by this I18n object. This sets its:
    • mnemonic
    • tooltip
    • icon
    • name
      if the corresponding attribute is set
    • Parameters:
      button - the button to configure.
    • createJRadioButton

      public JRadioButton createJRadioButton()
      create a JRadioButton using the attributes specified by the I18n object
      Returns:
      the new JRadioButton
    • createJRadioButton

      public JRadioButton createJRadioButton(Object[] args)
      create a JRadioButton using the attributes specified by the I18n object with the new JRadioButton's text formatted with args
      Returns:
      the new JRadioButton
    • createJCheckBox

      public JCheckBox createJCheckBox()
      create a JCheckBox using the attributes specified by the I18n object
      Returns:
      the new JCheckBox
    • createJCheckBox

      public JCheckBox createJCheckBox(Object[] args)
      create a JCheckBox using the attributes specified by the I18n object with the new JCheckBox's text formatted with args
      Returns:
      the new JCheckBox
    • createMenuItem

      public JMenuItem createMenuItem(Object[] formatArgs)
      create a JMenuItem using the attributes specified by the I18n object with the new JMenuItems's text formatted with formatArgs
      Returns:
      the new JMenuItem
    • createMenuItem

      public JMenuItem createMenuItem()
      create a JMenuItem using the attributes specified by the I18n object
      Returns:
      the new JMenuItem
    • createJLabel

      public JLabel createJLabel(Object[] formatArgs)
      create a JLabel using the attributes specified by the I18n object with the new JLabel's text formatted with formatArgs
      Returns:
      the new JLabel
    • createJLabel

      public JLabel createJLabel()
      create a JLabel using the attributes specified by the I18n object
      Returns:
      the new JLabel
    • createCheckBoxMenuItem

      public JCheckBoxMenuItem createCheckBoxMenuItem()
      create a JCheckBoxMenuItem using the attributes specified by the I18n object
      Returns:
      the new JCheckBoxMenuItem
    • format

      public String format(Object[] args)
      return the text attribute formatted with args
      Parameters:
      args - the arguments to pass to the formatter
      Returns:
      the formatted text attribute
    • format

      public String format(Object arg)
      return the text attribute formatted with arg
      Parameters:
      arg - the argument to pass to the formatter
      Returns:
      the formatted text attribute
    • formatToolTipText

      public String formatToolTipText(Object[] args)
      return the tooltip text attribute formatted with args
      Parameters:
      args - the arguments to pass to the formatter
      Returns:
      the formatted tooltip text attribute
    • getIntValue

      public int getIntValue()
      return the text as an int
      Returns:
      the int value of getText() or undefined
      See Also:
    • getBooleanValue

      public boolean getBooleanValue()
      return the text as a boolean
      Returns:
      the boolean value of getText()
      See Also:
    • configureAction

      public void configureAction(Action action)