org.graffiti.plugin.editcomponent
Class NumberEditComponent

java.lang.Object
  extended by org.graffiti.plugin.editcomponent.ValueEditComponentAdapter
      extended by org.graffiti.plugin.editcomponent.AbstractValueEditComponent
          extended by org.graffiti.plugin.editcomponent.NumberEditComponent
All Implemented Interfaces:
EventListener, AttributeListener, EdgeListener, GraphListener, NodeListener, TransactionListener, ValueEditComponent

public abstract class NumberEditComponent
extends AbstractValueEditComponent

NumberEditComponent provides an abstract implementation for editing numerical attributes.

See Also:
AbstractValueEditComponent, Number, JTextField

Field Summary
protected  SpinnerEditComponent spinner
          The gui element of this component.
 
Fields inherited from class org.graffiti.plugin.editcomponent.AbstractValueEditComponent
editField, showEmpty
 
Fields inherited from class org.graffiti.plugin.editcomponent.ValueEditComponentAdapter
displayable, displayables
 
Fields inherited from interface org.graffiti.plugin.editcomponent.ValueEditComponent
EMPTY_STRING
 
Constructor Summary
protected NumberEditComponent(Displayable<?> disp)
          Constructs a new integer edit component.
 
Method Summary
 JComponent getComponent()
          Returns the JComponent associated with this value edit component.
protected  void setDispEditFieldValue()
          Sets the current value of the Attribute in the corresponding JComponent.
 void setDisplayable(Displayable<?> attr)
          Sets the displayable.
protected  void setDispValue()
          Sets the value of the displayable specified in the JComponent.
 void setEnabled(boolean enabled)
          Specifies whether this component should allow editing.
 void setShowEmpty(boolean showEmpty)
          Called with a value of true when this component should display nothing instead of the value of its associated displayable.
 
Methods inherited from class org.graffiti.plugin.editcomponent.AbstractValueEditComponent
addVECChangeListener, fireVECChanged, fireVECChanged, getDisplayable, getDisplayables, getShowEmpty, isEnabled, postAttributeChanged, preAttributeChanged, removeVECChangeListener, setDisplayables, setEditFieldValue, setValue
 
Methods inherited from class org.graffiti.plugin.editcomponent.ValueEditComponentAdapter
getErrorMessageOfInvalidParameter, isValid, postAttributeAdded, postAttributeRemoved, postDirectedChanged, postEdgeAdded, postEdgeRemoved, postEdgeReversed, postGraphCleared, postInEdgeAdded, postInEdgeRemoved, postNodeAdded, postNodeRemoved, postOutEdgeAdded, postOutEdgeRemoved, postSourceNodeChanged, postTargetNodeChanged, postUndirectedEdgeAdded, postUndirectedEdgeRemoved, preAttributeAdded, preAttributeRemoved, preDirectedChanged, preEdgeAdded, preEdgeRemoved, preEdgeReversed, preGraphCleared, preInEdgeAdded, preInEdgeRemoved, preNodeAdded, preNodeRemoved, preOutEdgeAdded, preOutEdgeRemoved, preSourceNodeChanged, preTargetNodeChanged, preUndirectedEdgeAdded, preUndirectedEdgeRemoved, transactionFinished, transactionStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spinner

protected SpinnerEditComponent spinner
The gui element of this component.

Constructor Detail

NumberEditComponent

protected NumberEditComponent(Displayable<?> disp)
Constructs a new integer edit component.

Parameters:
disp - DOCUMENT ME!
Method Detail

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 - DOCUMENT ME!

setDispEditFieldValue

protected void setDispEditFieldValue()
Sets the current value of the Attribute in the corresponding JComponent.

Specified by:
setDispEditFieldValue in class AbstractValueEditComponent

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

setDispValue

protected void setDispValue()
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.

Specified by:
setDispValue in class AbstractValueEditComponent


Generated at 2012-05-30 11:00:36 PM CEST