Class NumberEditComponent

All Implemented Interfaces:
EventListener, AttributeListener, EdgeListener, GraphListener, NodeListener, TransactionListener, ValueEditComponent
Direct Known Subclasses:
ByteEditComponent, DoubleEditComponent, FloatEditComponent, IntegerEditComponent, LongEditComponent, ShortEditComponent

public abstract class NumberEditComponent
extends AbstractValueEditComponent
NumberEditComponent provides an abstract implementation for editing numerical attributes.
See Also:
AbstractValueEditComponent, Number, JTextField
  • Method Details

    • getComponent

      public JComponent getComponent()
      Returns the JComponent associated with this value edit component. In this case a JSpinner.
      Returns:
      the JComponent associated with this value edit component.
    • setDisplayable

      public void setDisplayable​(Displayable attr)
      Sets the displayable.
      Specified by:
      setDisplayable in interface ValueEditComponent
      Overrides:
      setDisplayable in class AbstractValueEditComponent
      Parameters:
      attr - new displayable
    • setEditFieldValue

      public void setEditFieldValue()
      Sets the current value of the Attribute in the corresponding JComponent.
    • setEnabled

      public void setEnabled​(boolean enabled)
      Description copied from interface: ValueEditComponent
      Specifies whether this component should allow editing.
      Specified by:
      setEnabled in interface ValueEditComponent
      Overrides:
      setEnabled in class AbstractValueEditComponent
    • setShowEmpty

      public void setShowEmpty​(boolean showEmpty)
      Description copied from interface: ValueEditComponent
      Called with a value of true when this component should display nothing instead of the value of its associated displayable. This is used when several displayables use this component but have different values. When set to false, the value of the displayable associated with this component is used.
      Specified by:
      setShowEmpty in interface ValueEditComponent
      Overrides:
      setShowEmpty in class AbstractValueEditComponent
    • setValue

      public void setValue()
      Sets the value of the displayable specified in the JComponent. Calls setAttribute in the associated spinner, i.e. it only changes the value if it is different.