|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.AbstractAction
y.view.Graph2DViewActions.DeleteSelectionAction
public static class Graph2DViewActions.DeleteSelectionAction
Action that deletes selected elements of predefined types.
![]() |
![]() |
![]() |
![]() |
| Field Summary | |
|---|---|
static int |
ALL_TYPES_MASK
Deletion type mask representing all element types. |
static int |
NODE_TYPES_MASK
Deletion type mask representing all node types. |
static int |
TYPE_BEND
Deletion type mask specifier to consider bends for deletion. |
static int |
TYPE_EDGE
Deletion type mask specifier to consider edges for deletion. |
static int |
TYPE_EDGE_LABEL
Deletion type mask specifier to consider edge labels for deletion. |
static int |
TYPE_GROUP_NODE
Deletion type mask specifier to consider group nodes for deletion. |
static int |
TYPE_NODE_LABEL
Deletion type mask specifier to consider node labels for deletion. |
static int |
TYPE_SIMPLE_NODE
Deletion type mask specifier to consider simple nodes for deletion. |
static int |
TYPE_TABLE_COLUMN
Deletion type mask specifier to consider columns of table nodes for deletion. |
static int |
TYPE_TABLE_NODE
Deletion type mask specifier to consider table nodes for deletion. |
static int |
TYPE_TABLE_ROW
Deletion type mask specifier to consider rows of table nodes for deletion. |
| Fields inherited from class javax.swing.AbstractAction |
|---|
changeSupport, enabled |
| Fields inherited from interface javax.swing.Action |
|---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
|---|---|
Graph2DViewActions.DeleteSelectionAction()
Creates a new DeleteSelectionAction that has no default
view, i.e. if the view cannot be determined from the event that triggers
a delete action, nothing is deleted. |
|
Graph2DViewActions.DeleteSelectionAction(Graph2DView view)
Creates a new DeleteSelectionAction |
|
| Method Summary | |
|---|---|
protected boolean |
acceptBend(Edge edge,
Bend bend)
Returns true if the specified bend should be deleted
or false otherwise. |
protected boolean |
acceptEdge(Graph2D graph,
Edge edge)
Returns true if the specified edge should be deleted
or false otherwise. |
protected boolean |
acceptEdgeLabel(Edge edge,
EdgeLabel label)
Returns true if the specified edge label should be deleted
or false otherwise. |
protected boolean |
acceptNode(Graph2D graph,
Node node)
Returns true if the specified node should be deleted
or false otherwise. |
protected boolean |
acceptNodeLabel(Node node,
NodeLabel label)
Returns true if the specified node label should be deleted
or false otherwise. |
protected boolean |
acceptTableColumn(Node node,
TableGroupNodeRealizer.Column column)
Returns true if the specified table column should be deleted
or false otherwise. |
protected boolean |
acceptTableRow(Node node,
TableGroupNodeRealizer.Row row)
Returns true if the specified table row should be deleted
or false otherwise. |
void |
actionPerformed(ActionEvent e)
Invokes delete for the view returned by delete. |
void |
delete(Graph2DView view)
Deletes graph elements in the specified view. |
protected void |
deleteEdgeElements(Graph2D graph,
Edge edge)
Deletes the graph elements associated to the specified edge and the edge itself if these elements are accepted by the corresponding acceptXXX methods. |
protected void |
deleteNodeElements(Graph2D graph,
Node node)
Deletes the graph elements associated to the specified node and the node itself if these elements are accepted by the corresponding acceptXXX methods. |
int |
getDeletionMask()
Returns the bit mask that determines the element types to consider for deletion. |
protected Graph2DView |
getView(ActionEvent e)
Determines the view in which to delete graph elements. |
boolean |
isKeepingTableNodesOnTableContentDeletion()
Determines whether or not table nodes should be deleted if one or more of their columns or rows have been deleted. |
void |
setDeletionMask(int mask)
Specifies the bit mask that determines the element types to consider for deletion. |
void |
setKeepingTableNodesOnTableContentDeletion(boolean keepingTableNodesOnTableContentDeletion)
Specifies whether or not table nodes should be deleted if one or more of their columns or rows have been deleted. |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_BEND
public static final int TYPE_EDGE
public static final int TYPE_EDGE_LABEL
public static final int TYPE_SIMPLE_NODE
TYPE_GROUP_NODE,
TYPE_TABLE_NODE,
Constant Field Valuespublic static final int TYPE_GROUP_NODE
HierarchyManager whose
isGroupNode
method returns true, and the node is not a table node.
TYPE_SIMPLE_NODE,
TYPE_TABLE_NODE,
Constant Field Valuespublic static final int TYPE_TABLE_NODE
TableGroupNodeRealizer.
TYPE_SIMPLE_NODE,
TYPE_GROUP_NODE,
Constant Field Valuespublic static final int TYPE_NODE_LABEL
public static final int TYPE_TABLE_COLUMN
TYPE_TABLE_NODE,
Constant Field Valuespublic static final int TYPE_TABLE_ROW
TYPE_TABLE_NODE,
Constant Field Valuespublic static final int NODE_TYPES_MASK
TYPE_SIMPLE_NODE,
TYPE_GROUP_NODE,
TYPE_TABLE_NODE,
Constant Field Valuespublic static final int ALL_TYPES_MASK
| Constructor Detail |
|---|
public Graph2DViewActions.DeleteSelectionAction()
DeleteSelectionAction that has no default
view, i.e. if the view cannot be determined from the event that triggers
a delete action, nothing is deleted.
Invoking this constructor is equivalent to:
new DeleteSelectionAction(null)
public Graph2DViewActions.DeleteSelectionAction(Graph2DView view)
DeleteSelectionAction
view - the default view that is used if the actual view cannot
be determined from the information provided by an
ActionEvent.| Method Detail |
|---|
public int getDeletionMask()
public void setDeletionMask(int mask)
mask - the bit mask that determines the element types to consider for
deletion.public boolean isKeepingTableNodesOnTableContentDeletion()
true if table nodes should not be deleted if one or
more of their columns or rows have been deleted; false
otherwise.public void setKeepingTableNodesOnTableContentDeletion(boolean keepingTableNodesOnTableContentDeletion)
keepingTableNodesOnTableContentDeletion - true if
table nodes should not be deleted if one or more of their columns or
rows have been deleted; false otherwise.
protected boolean acceptEdgeLabel(Edge edge,
EdgeLabel label)
true if the specified edge label should be deleted
or false otherwise.
The default implementation accepts selected labels if the deletion mask
includes TYPE_EDGE_LABEL.
edge - the Edge that holds the label.label - the EdgeLabel that is checked for deletion.
true if the specified edge label should be deleted
or false otherwise.getDeletionMask()
protected boolean acceptBend(Edge edge,
Bend bend)
true if the specified bend should be deleted
or false otherwise.
The default implementation accepts selected bends if the deletion mask
includes TYPE_BEND.
edge - the Edge that holds the bend.bend - the Bend that is checked for deletion.
true if the specified bend should be deleted
or false otherwise.getDeletionMask()
protected boolean acceptEdge(Graph2D graph,
Edge edge)
true if the specified edge should be deleted
or false otherwise.
The default implementation accepts selected edges if the deletion mask
includes TYPE_EDGE.
graph - the Graph2D that holds the edge.edge - the Edge that is checked for deletion.
true if the specified edge should be deleted
or false otherwise.getDeletionMask()
protected boolean acceptNodeLabel(Node node,
NodeLabel label)
true if the specified node label should be deleted
or false otherwise.
The default implementation accepts selected labels if the deletion mask
includes TYPE_NODE_LABEL.
node - the Node that holds the label.label - the NodeLabel that is checked for deletion.
true if the specified node label should be deleted
or false otherwise.getDeletionMask()
protected boolean acceptTableColumn(Node node,
TableGroupNodeRealizer.Column column)
true if the specified table column should be deleted
or false otherwise.
The default implementation accepts selected columns if the deletion mask
includes TYPE_TABLE_COLUMN.
node - the Node that is represented by the table
that holds the column.column - the Column that is checked for deletion.
true if the specified table column should be deleted
or false otherwise.getDeletionMask()
protected boolean acceptTableRow(Node node,
TableGroupNodeRealizer.Row row)
true if the specified table row should be deleted
or false otherwise.
The default implementation accepts selected rows if the deletion mask
includes TYPE_TABLE_ROW.
node - the Node that is represented by the table
that holds the row.row - the Row that is checked for deletion.
true if the specified table row should be deleted
or false otherwise.getDeletionMask()
protected boolean acceptNode(Graph2D graph,
Node node)
true if the specified node should be deleted
or false otherwise.
The default implementation accepts selected nodes whose type
(one of TYPE_SIMPLE_NODE, TYPE_GROUP_NODE, and
TYPE_TABLE_NODE) is included in the deletion mask, and in the
case of table nodes
keepingTableNodesOnTableContentDeletion is either
false or neither associated columns nor rows have been
deleted.
graph - the Graph2D that holds the node.node - the Node that is checked for deletion.
true if the specified node should be deleted
or false otherwise.getDeletionMask()
protected void deleteNodeElements(Graph2D graph,
Node node)
acceptXXX methods.
graph - the Graph2D that holds the node.node - the Node to be deleted.- See Also:
acceptNode(Graph2D,y.base.Node),
acceptNodeLabel(y.base.Node,NodeLabel),
acceptTableColumn(y.base.Node,y.view.tabular.TableGroupNodeRealizer.Column),
acceptTableRow(y.base.Node,y.view.tabular.TableGroupNodeRealizer.Row)public void actionPerformed(ActionEvent e)
delete for the view returned by delete.
e - the ActionEvent that triggers the deletion of
graph elements.getView(java.awt.event.ActionEvent),
delete(y.view.Graph2DView)public void delete(Graph2DView view)
acceptXXX
methods. Deleting a node will automatically delete
all edges incident to the deleted node, too, no matter if they are
accepted or not.
This method backs up realizers for undo-/redoability if necessary.
NullPointerException - if the specified view is null.view - the view in which to delete graph elements.acceptBend(y.base.Edge,y.view.Bend),
acceptEdge(y.view.Graph2D,y.base.Edge),
acceptEdgeLabel(y.base.Edge,y.view.EdgeLabel),
acceptNode(y.view.Graph2D,y.base.Node),
acceptNodeLabel(y.base.Node,y.view.NodeLabel),
acceptTableColumn(y.base.Node,y.view.tabular.TableGroupNodeRealizer.Column),
acceptTableRow(y.base.Node,y.view.tabular.TableGroupNodeRealizer.Row)
protected void deleteEdgeElements(Graph2D graph,
Edge edge)
acceptXXX methods.
graph - the Graph2D that holds the edge.edge - the Edge to be deleted.acceptEdge(y.view.Graph2D,y.base.Edge),
acceptEdgeLabel(y.base.Edge,y.view.EdgeLabel),
acceptBend(y.base.Edge,y.view.Bend)protected Graph2DView getView(ActionEvent e)
e - the ActionEvent that triggers the deletion of
graph elements.
actionPerformed(java.awt.event.ActionEvent),
Graph2DViewActions.DeleteSelectionAction(y.view.Graph2DView)
|
© Copyright 2000-2010, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||