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
showEmptyFields inherited from interface org.graffiti.plugin.editcomponent.ValueEditComponent
EMPTY_STRING -
Method Summary
Modifier and Type Method Description JComponentgetComponent()Returns theJComponentassociated with this value edit component.voidsetDisplayable(Displayable attr)Sets the displayable.voidsetEditFieldValue()Sets the current value of theAttributein the correspondingJComponent.voidsetEnabled(boolean enabled)Specifies whether this component should allow editing.voidsetShowEmpty(boolean showEmpty)Called with a value of true when this component should display nothing instead of the value of its associated displayable.voidsetValue()Sets the value of the displayable specified in theJComponent.Methods inherited from class org.graffiti.plugin.editcomponent.AbstractValueEditComponent
getDisplayable, getShowEmpty, isEnabled, postAttributeChanged, preAttributeChangedMethods 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 theJComponentassociated with this value edit component. In this case a JSpinner.- Returns:
- the
JComponentassociated with this value edit component.
-
setDisplayable
Sets the displayable.- Specified by:
setDisplayablein interfaceValueEditComponent- Overrides:
setDisplayablein classAbstractValueEditComponent- Parameters:
attr- new displayable
-
setEditFieldValue
public void setEditFieldValue()Sets the current value of theAttributein the correspondingJComponent. -
setEnabled
public void setEnabled(boolean enabled)Description copied from interface:ValueEditComponentSpecifies whether this component should allow editing.- Specified by:
setEnabledin interfaceValueEditComponent- Overrides:
setEnabledin classAbstractValueEditComponent
-
setShowEmpty
public void setShowEmpty(boolean showEmpty)Description copied from interface:ValueEditComponentCalled 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:
setShowEmptyin interfaceValueEditComponent- Overrides:
setShowEmptyin 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.
-