Class BlockCurvatureJComboBox

All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener

JComboBox to display / select block curvature.
See Also:
  • Constructor Details

    • BlockCurvatureJComboBox

      Create a new JComboBox to display / select block curvature.

      Options are presented in localised String form and can be set / retrieved in Block Constant format.

      Block.NONE, Block.GRADUAL, Block.TIGHT, Block.SEVERE

      Defaults to No curvature.

    • BlockCurvatureJComboBox

      public BlockCurvatureJComboBox(int curvature)
      Create a new JComboBox to display / select block curvature.

      Block.NONE, Block.GRADUAL, Block.TIGHT, Block.SEVERE

      Defaults to No curvature if invalid number in curvature field.

      Parameters:
      curvature - Block constant for Curvature.
  • Method Details

    • setJTableCellClientProperties

      Set UI properties for a JTable cell.
    • setCurvature

      public final void setCurvature(int blockCurve)
      Set the Block Curvature by Block Constant format. If unrecognised constant, does not error or change selected value.
      Parameters:
      blockCurve - e.g. "Block.TIGHT" or "Block.NONE"
    • getStringFromCurvature

      public static String getStringFromCurvature(int blockCurve)
      Get the String of Block Curvature from Block Constant format. .e.g. Bundle.getMessage("BlockTight")
      Parameters:
      blockCurve - Block Constant, e.g. Block.GRADUAL
      Returns:
      localised String, or Bundle.getMessage("BlockNone") if unmatched.
    • getCurvature

      public int getCurvature()
      Get the Block Curvature in Block Constant format. e.g. "Block.TIGHT" or "Block.NONE"
      Returns:
      selected Block Curvature constant.
    • getCurvatureFromString

      public static int getCurvatureFromString(String s)
      Get the Block Curvature in Block Constant format.e.g. "Block.TIGHT" or "Block.NONE"
      Parameters:
      s - localised String, e.g. Bundle.getMessage("BlockSevere")
      Returns:
      Block Curvature constant, Block.NONE if String unrecognised.
    • getCurvatureFromObject

      public static int getCurvatureFromObject(Object obj)
      Get the Curvature Constant from a JComboBox passed as an Object. For use in setValueAt() in Table Models.
      Parameters:
      obj - the object which should be a JComboBox.
      Returns:
      Block curvature Constant if JComboBox found and selected item text matches, else Block.NONE