org.graffiti.plugin.editcomponent
Interface ValueEditComponent

All Superinterfaces:
AttributeListener, EdgeListener, EventListener, GraphListener, NodeListener, TransactionListener
All Known Implementing Classes:
AbstractDialogableEditComponent, AbstractValueEditComponent, ComboBoxEditComponent, EdgeEditComponent, GraphComponentEditComponent, NodeEditComponent, NumberEditComponent, SelectionEditComponent, SingleGraphElementEditComponent, SpinnerEditComponent, StandardValueEditComponent, ValueEditComponentAdapter

public interface ValueEditComponent
extends AttributeListener, EdgeListener, GraphListener, NodeListener, TransactionListener

A generic extension of a javax.swing.JComponent which allows editing of Attributes. Each class extending ValueEditComponent contains an org.graffiti.attributes.Attribute and a javax.swing.JComponent for editing the org.graffiti.attributes.Attribute. As attribute values may change from several sources a ValueEditComponent must implement the org.graffiti.event.AttributeListener-interface.

See Also:
Attribute, AttributeListener, JComponent

Field Summary
static String EMPTY_STRING
          Preferred string to be displayed by edit components that have a showEmpty value of true.
 
Method Summary
 void addVECChangeListener(ValueEditComponentListener listener)
          Register a new value edit component listener.
 void fireVECChanged(VECChangeEvent event)
          Fire a VECChange event.
 JComponent getComponent()
          Returns the ValueEditComponent's JComponent.
 Displayable<?> getDisplayable()
          Returns the Displayable instance the current ValueEditComponent contains.
 Displayable<?>[] getDisplayables()
          Returns the Displayable instances the current ValueEditComponent contains.
 String getErrorMessageOfInvalidParameter()
          Returns an error message if the value of the ValueEditComponent is invalid,
 boolean getShowEmpty()
          Returns true when this component actually does not represent the value of an attribute.
 boolean isEnabled()
          Returns whether this component allows editing.
 boolean isValid()
          Returns true if the value of the ValueEditComponent is valid,
 void removeVECChangeListener(ValueEditComponentListener listener)
          Remove a value edit component listener.
 void setDisplayable(Displayable<?> disp)
          Sets the object that will be displayed.
 void setDisplayables(Displayable<?>[] disps)
          Sets the objects that will be displayed.
 void setEditFieldValue()
          Sets the current value of the Displayable in the corresponding 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.
 void setValue()
          Sets the value of the Displayable specified in the JComponent.
 
Methods inherited from interface org.graffiti.event.AttributeListener
postAttributeAdded, postAttributeChanged, postAttributeRemoved, preAttributeAdded, preAttributeChanged, preAttributeRemoved
 
Methods inherited from interface org.graffiti.event.EdgeListener
postDirectedChanged, postEdgeReversed, postSourceNodeChanged, postTargetNodeChanged, preDirectedChanged, preEdgeReversed, preSourceNodeChanged, preTargetNodeChanged
 
Methods inherited from interface org.graffiti.event.GraphListener
postEdgeAdded, postEdgeRemoved, postGraphCleared, postNodeAdded, postNodeRemoved, preEdgeAdded, preEdgeRemoved, preGraphCleared, preNodeAdded, preNodeRemoved
 
Methods inherited from interface org.graffiti.event.NodeListener
postInEdgeAdded, postInEdgeRemoved, postOutEdgeAdded, postOutEdgeRemoved, postUndirectedEdgeAdded, postUndirectedEdgeRemoved, preInEdgeAdded, preInEdgeRemoved, preOutEdgeAdded, preOutEdgeRemoved, preUndirectedEdgeAdded, preUndirectedEdgeRemoved
 
Methods inherited from interface org.graffiti.event.TransactionListener
transactionFinished, transactionStarted
 

Field Detail

EMPTY_STRING

static final String EMPTY_STRING
Preferred string to be displayed by edit components that have a showEmpty value of true.

See Also:
Constant Field Values
Method Detail

getComponent

JComponent getComponent()
Returns the ValueEditComponent's JComponent.

Returns:
the ValueEditComponent's JComponent.

setDisplayable

void setDisplayable(Displayable<?> disp)
Sets the object that will be displayed.

Parameters:
disp - the object to connect to this component.

setDisplayables

void setDisplayables(Displayable<?>[] disps)
Sets the objects that will be displayed.

Parameters:
disps - the objects to connect to this component.

getDisplayable

Displayable<?> getDisplayable()
Returns the Displayable instance the current ValueEditComponent contains.

Returns:
the Displayable instance the current ValueEditComponent contains.

getDisplayables

Displayable<?>[] getDisplayables()
Returns the Displayable instances the current ValueEditComponent contains.

Returns:
the Displayable instances the current ValueEditComponent contains.

setEditFieldValue

void setEditFieldValue()
Sets the current value of the Displayable in the corresponding JComponent. If showEmpty is set to true, this component should instead show only empty fields.


setEnabled

void setEnabled(boolean enabled)
Specifies whether this component should allow editing.

Parameters:
enabled -

isEnabled

boolean isEnabled()
Returns whether this component allows editing.

Returns:
DOCUMENT ME!

setShowEmpty

void setShowEmpty(boolean showEmpty)
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.


getShowEmpty

boolean getShowEmpty()
Returns true when this component actually does not represent the value of an attribute.

Returns:
DOCUMENT ME!

setValue

void setValue()
Sets the value of the Displayable specified in the JComponent. Should only change the value if the value is really different otherwise too many events will be sent.


isValid

boolean isValid()
Returns true if the value of the ValueEditComponent is valid,

Returns:
DOCUMENT ME!

getErrorMessageOfInvalidParameter

String getErrorMessageOfInvalidParameter()
Returns an error message if the value of the ValueEditComponent is invalid,

Returns:
DOCUMENT ME!

addVECChangeListener

void addVECChangeListener(ValueEditComponentListener listener)
Register a new value edit component listener.

Parameters:
listener - the listener to add.

removeVECChangeListener

void removeVECChangeListener(ValueEditComponentListener listener)
Remove a value edit component listener.

Parameters:
listener - the listener to remove.

fireVECChanged

void fireVECChanged(VECChangeEvent event)
Fire a VECChange event.

Parameters:
event - the event to fire.


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