Class NumberEditComponent
java.lang.Object
org.graffiti.plugin.editcomponent.ValueEditComponentAdapter
org.graffiti.plugin.editcomponent.AbstractValueEditComponent
org.graffiti.plugin.editcomponent.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
-
Field Summary
Fields inherited from class org.graffiti.plugin.editcomponent.AbstractValueEditComponent
showEmpty
Fields inherited from interface org.graffiti.plugin.editcomponent.ValueEditComponent
EMPTY_STRING
-
Method Summary
Modifier and Type Method Description JComponent
getComponent()
Returns theJComponent
associated with this value edit component.void
setDisplayable(Displayable attr)
Sets the displayable.void
setEditFieldValue()
Sets the current value of theAttribute
in the correspondingJComponent
.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.void
setValue()
Sets the value of the displayable specified in theJComponent
.Methods inherited from class org.graffiti.plugin.editcomponent.AbstractValueEditComponent
getDisplayable, getShowEmpty, isEnabled, postAttributeChanged, preAttributeChanged
Methods inherited from class org.graffiti.plugin.editcomponent.ValueEditComponentAdapter
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, setParameter, setValue, transactionFinished, transactionStarted
-
Method Details
-
getComponent
Returns theJComponent
associated with this value edit component. In this case a JSpinner.- Returns:
- the
JComponent
associated with this value edit component.
-
setDisplayable
Sets the displayable.- Specified by:
setDisplayable
in interfaceValueEditComponent
- Overrides:
setDisplayable
in classAbstractValueEditComponent
- Parameters:
attr
- new displayable
-
setEditFieldValue
public void setEditFieldValue()Sets the current value of theAttribute
in the correspondingJComponent
. -
setEnabled
public void setEnabled(boolean enabled)Description copied from interface:ValueEditComponent
Specifies whether this component should allow editing.- Specified by:
setEnabled
in interfaceValueEditComponent
- Overrides:
setEnabled
in classAbstractValueEditComponent
-
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 interfaceValueEditComponent
- Overrides:
setShowEmpty
in classAbstractValueEditComponent
-
setValue
public void setValue()Sets the value of the displayable specified in theJComponent
. Calls setAttribute in the associated spinner, i.e. it only changes the value if it is different.
-