Class JComponentParameterEditor
java.lang.Object
org.graffiti.plugin.editcomponent.JComponentParameterEditor
- All Implemented Interfaces:
EventListener
,AttributeListener
,EdgeListener
,GraphListener
,NodeListener
,TransactionListener
,ValueEditComponent
public class JComponentParameterEditor extends Object implements ValueEditComponent
-
Field Summary
Fields inherited from interface org.graffiti.plugin.editcomponent.ValueEditComponent
EMPTY_STRING
-
Constructor Summary
Constructors Constructor Description JComponentParameterEditor(Displayable disp)
-
Method Summary
Modifier and Type Method Description JComponent
getComponent()
Returns theValueEditComponent
'sJComponent
.Displayable
getDisplayable()
Returns theDisplayable
instance the currentValueEditComponent
contains.boolean
getShowEmpty()
Returns true when this component actually does not represent the value of an attribute.boolean
isEnabled()
Returns whether this component allows editing.void
postAttributeAdded(AttributeEvent e)
Called after an attribute has been added.void
postAttributeChanged(AttributeEvent e)
Called after an attribute has been changed.void
postAttributeRemoved(AttributeEvent e)
Called after an attribute has been removed.void
postDirectedChanged(EdgeEvent e)
Called after the edge was set directed or undirected.void
postEdgeAdded(GraphEvent e)
Called after an edge has been added to the graph.void
postEdgeRemoved(GraphEvent e)
Called after an edge has been removed from the graph.void
postEdgeReversed(EdgeEvent e)
Called after the edge has been reversed.void
postGraphCleared(GraphEvent e)
Called after methodclear()
has been called on a graph.void
postInEdgeAdded(NodeEvent e)
void
postInEdgeRemoved(NodeEvent e)
void
postNodeAdded(GraphEvent e)
Called after an edge has been added to the graph.void
postNodeRemoved(GraphEvent e)
Called after a node has been removed from the graph.void
postOutEdgeAdded(NodeEvent e)
void
postOutEdgeRemoved(NodeEvent e)
void
postSourceNodeChanged(EdgeEvent e)
Called after the source node of an edge has changed.void
postTargetNodeChanged(EdgeEvent e)
Called after the target node of an edge has changed.void
postUndirectedEdgeAdded(NodeEvent e)
Called after an (undirected) edge has been added to the node.void
postUndirectedEdgeRemoved(NodeEvent e)
Called after an (undirected) edge has been removed from the node.void
preAttributeAdded(AttributeEvent e)
Called just before an attribute is added.void
preAttributeChanged(AttributeEvent e)
Called before a change of an attribute takes place.void
preAttributeRemoved(AttributeEvent e)
Called just before an attribute is removed.void
preDirectedChanged(EdgeEvent e)
Called before the edge is set directed or undirected.void
preEdgeAdded(GraphEvent e)
Called just before an edge is added to the graph.void
preEdgeRemoved(GraphEvent e)
Called just before an edge is removed from the graph.void
preEdgeReversed(EdgeEvent e)
Called before the edge is going to be reversed.void
preGraphCleared(GraphEvent e)
Called before methodclear()
is called on a graph.void
preInEdgeAdded(NodeEvent e)
void
preInEdgeRemoved(NodeEvent e)
void
preNodeAdded(GraphEvent e)
Called just before a node is added to the graph.void
preNodeRemoved(GraphEvent e)
Called just before a node is removed from the graph.void
preOutEdgeAdded(NodeEvent e)
void
preOutEdgeRemoved(NodeEvent e)
void
preSourceNodeChanged(EdgeEvent e)
Called before a change of the source node of an edge takes place.void
preTargetNodeChanged(EdgeEvent e)
Called before a change of the target node of an edge takes place.void
preUndirectedEdgeAdded(NodeEvent e)
Called just before an (undirected) edge is added to the node.void
preUndirectedEdgeRemoved(NodeEvent e)
Called just before an (undirected) edge is removed from the node.void
setDisplayable(Displayable disp)
Sets the object that will be displayed.void
setEditFieldValue()
Sets the current value of theDisplayable
in the correspondingJComponent
.void
setEnabled(boolean enabled)
Specifies whether this component should allow editing.void
setParameter(String setting, Object value)
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 theDisplayable
specified in theJComponent
.void
setValue(Collection<Displayable> attributes)
void
transactionFinished(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status)
Called when a transaction has stopped.void
transactionStarted(TransactionEvent e)
Called when a transaction has started.
-
Constructor Details
-
JComponentParameterEditor
-
-
Method Details
-
getComponent
Description copied from interface:ValueEditComponent
Returns theValueEditComponent
'sJComponent
.- Specified by:
getComponent
in interfaceValueEditComponent
- Returns:
- the
ValueEditComponent
'sJComponent
.
-
getDisplayable
Description copied from interface:ValueEditComponent
Returns theDisplayable
instance the currentValueEditComponent
contains.- Specified by:
getDisplayable
in interfaceValueEditComponent
- Returns:
- the
Displayable
instance the currentValueEditComponent
contains.
-
getShowEmpty
public boolean getShowEmpty()Description copied from interface:ValueEditComponent
Returns true when this component actually does not represent the value of an attribute.- Specified by:
getShowEmpty
in interfaceValueEditComponent
- Returns:
- DOCUMENT ME!
-
isEnabled
public boolean isEnabled()Description copied from interface:ValueEditComponent
Returns whether this component allows editing.- Specified by:
isEnabled
in interfaceValueEditComponent
- Returns:
- DOCUMENT ME!
-
setDisplayable
Description copied from interface:ValueEditComponent
Sets the object that will be displayed.- Specified by:
setDisplayable
in interfaceValueEditComponent
- Parameters:
disp
- the object to connect to this component.
-
setEditFieldValue
public void setEditFieldValue()Description copied from interface:ValueEditComponent
Sets the current value of theDisplayable
in the correspondingJComponent
. IfshowEmpty
is set to true, this component should instead show only empty fields.- Specified by:
setEditFieldValue
in interfaceValueEditComponent
-
setEnabled
public void setEnabled(boolean enabled)Description copied from interface:ValueEditComponent
Specifies whether this component should allow editing.- Specified by:
setEnabled
in interfaceValueEditComponent
-
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
-
setValue
public void setValue()Description copied from interface:ValueEditComponent
Sets the value of theDisplayable
specified in theJComponent
. Should only change the value if the value is really different otherwise too many events will be sent.- Specified by:
setValue
in interfaceValueEditComponent
-
postAttributeAdded
Description copied from interface:AttributeListener
Called after an attribute has been added.- Specified by:
postAttributeAdded
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
postAttributeChanged
Description copied from interface:AttributeListener
Called after an attribute has been changed.- Specified by:
postAttributeChanged
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
postAttributeRemoved
Description copied from interface:AttributeListener
Called after an attribute has been removed.- Specified by:
postAttributeRemoved
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
preAttributeAdded
Description copied from interface:AttributeListener
Called just before an attribute is added.- Specified by:
preAttributeAdded
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
preAttributeChanged
Description copied from interface:AttributeListener
Called before a change of an attribute takes place.- Specified by:
preAttributeChanged
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
preAttributeRemoved
Description copied from interface:AttributeListener
Called just before an attribute is removed.- Specified by:
preAttributeRemoved
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
transactionFinished
public void transactionFinished(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status)Description copied from interface:TransactionListener
Called when a transaction has stopped.
The classTransactionHashMap
merges duplicateAttributeEvent
s. In case the Attribute path for the sameAttributable
is not equal, detailed information about Attribute path is lost. Instead a genericAttributeEvent
containing just theAttributable
is in the list of changed Objects (seeTransactionEvent
).
In case no detailed information about an Attribute change is available, your code should completely re-process the affectedAttributable
.- Specified by:
transactionFinished
in interfaceTransactionListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
transactionStarted
Description copied from interface:TransactionListener
Called when a transaction has started.- Specified by:
transactionStarted
in interfaceTransactionListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
postDirectedChanged
Description copied from interface:EdgeListener
Called after the edge was set directed or undirected.- Specified by:
postDirectedChanged
in interfaceEdgeListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
postEdgeReversed
Description copied from interface:EdgeListener
Called after the edge has been reversed.- Specified by:
postEdgeReversed
in interfaceEdgeListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
postSourceNodeChanged
Description copied from interface:EdgeListener
Called after the source node of an edge has changed.- Specified by:
postSourceNodeChanged
in interfaceEdgeListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
postTargetNodeChanged
Description copied from interface:EdgeListener
Called after the target node of an edge has changed.- Specified by:
postTargetNodeChanged
in interfaceEdgeListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
preDirectedChanged
Description copied from interface:EdgeListener
Called before the edge is set directed or undirected.- Specified by:
preDirectedChanged
in interfaceEdgeListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
preEdgeReversed
Description copied from interface:EdgeListener
Called before the edge is going to be reversed.- Specified by:
preEdgeReversed
in interfaceEdgeListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
preSourceNodeChanged
Description copied from interface:EdgeListener
Called before a change of the source node of an edge takes place.- Specified by:
preSourceNodeChanged
in interfaceEdgeListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
preTargetNodeChanged
Description copied from interface:EdgeListener
Called before a change of the target node of an edge takes place.- Specified by:
preTargetNodeChanged
in interfaceEdgeListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
postEdgeAdded
Description copied from interface:GraphListener
Called after an edge has been added to the graph.- Specified by:
postEdgeAdded
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
postEdgeRemoved
Description copied from interface:GraphListener
Called after an edge has been removed from the graph.- Specified by:
postEdgeRemoved
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
postGraphCleared
Description copied from interface:GraphListener
Called after methodclear()
has been called on a graph. No other events (like remove events) are generated.- Specified by:
postGraphCleared
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
postNodeAdded
Description copied from interface:GraphListener
Called after an edge has been added to the graph.- Specified by:
postNodeAdded
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
postNodeRemoved
Description copied from interface:GraphListener
Called after a node has been removed from the graph. All edges incident to this node have already been removed (preEdgeRemoved and postEdgeRemoved have been called).- Specified by:
postNodeRemoved
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preEdgeAdded
Description copied from interface:GraphListener
Called just before an edge is added to the graph.- Specified by:
preEdgeAdded
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preEdgeRemoved
Description copied from interface:GraphListener
Called just before an edge is removed from the graph.- Specified by:
preEdgeRemoved
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preGraphCleared
Description copied from interface:GraphListener
Called before methodclear()
is called on a graph. No other events (like remove events) are generated.- Specified by:
preGraphCleared
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preNodeAdded
Description copied from interface:GraphListener
Called just before a node is added to the graph.- Specified by:
preNodeAdded
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preNodeRemoved
Description copied from interface:GraphListener
Called just before a node is removed from the graph. This method is called before the incident edges are deleted.- Specified by:
preNodeRemoved
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
postInEdgeAdded
-
postInEdgeRemoved
-
postOutEdgeAdded
-
postOutEdgeRemoved
-
postUndirectedEdgeAdded
Description copied from interface:NodeListener
Called after an (undirected) edge has been added to the node. (For directed edges pre- In/Out- EdgeAdded is called.)- Specified by:
postUndirectedEdgeAdded
in interfaceNodeListener
- Parameters:
e
- The NodeEvent detailing the changes.
-
postUndirectedEdgeRemoved
Description copied from interface:NodeListener
Called after an (undirected) edge has been removed from the node. (For directed edges pre- In/Out- EdgeRemoved is called.)- Specified by:
postUndirectedEdgeRemoved
in interfaceNodeListener
- Parameters:
e
- The NodeEvent detailing the changes.
-
preInEdgeAdded
-
preInEdgeRemoved
-
preOutEdgeAdded
-
preOutEdgeRemoved
-
preUndirectedEdgeAdded
Description copied from interface:NodeListener
Called just before an (undirected) edge is added to the node. (For directed edges pre- In/Out- EdgeAdded is called.)- Specified by:
preUndirectedEdgeAdded
in interfaceNodeListener
- Parameters:
e
- The NodeEvent detailing the changes.
-
preUndirectedEdgeRemoved
Description copied from interface:NodeListener
Called just before an (undirected) edge is removed from the node. (For directed edges pre- In/Out- EdgeRemoved is called.)- Specified by:
preUndirectedEdgeRemoved
in interfaceNodeListener
- Parameters:
e
- The NodeEvent detailing the changes.
-
setValue
- Specified by:
setValue
in interfaceValueEditComponent
-
setParameter
- Specified by:
setParameter
in interfaceValueEditComponent
-