| 
 | Search this API | ||||||||
| 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_MASKDeletion type mask representing all element types. | 
| static int | NODE_TYPES_MASKDeletion type mask representing all node types. | 
| static int | TYPE_BENDDeletion type mask specifier to consider bends for deletion. | 
| static int | TYPE_EDGEDeletion type mask specifier to consider edges for deletion. | 
| static int | TYPE_EDGE_LABELDeletion type mask specifier to consider edge labels for deletion. | 
| static int | TYPE_GROUP_NODEDeletion type mask specifier to consider group nodes for deletion. | 
| static int | TYPE_NODE_LABELDeletion type mask specifier to consider node labels for deletion. | 
| static int | TYPE_NODE_PORTDeletion type mask specifier to consider node ports for deletion. | 
| static int | TYPE_SIMPLE_NODEDeletion type mask specifier to consider simple nodes for deletion. | 
| static int | TYPE_TABLE_COLUMNDeletion type mask specifier to consider columns of table nodes for deletion. | 
| static int | TYPE_TABLE_NODEDeletion type mask specifier to consider table nodes for deletion. | 
| static int | TYPE_TABLE_ROWDeletion 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()Initializes a new DeleteSelectionActioninstance that has
 no default view, that means if the view cannot be determined from the
 event that triggers a delete action, nothing is deleted. | |
| Graph2DViewActions.DeleteSelectionAction(Graph2DView view)Initializes a new DeleteSelectionActioninstance. | |
| Method Summary | |
|---|---|
| protected  boolean | acceptBend(Edge edge,
           Bend bend)Returns trueif the specified bend should be deleted orfalseotherwise. | 
| protected  boolean | acceptEdge(Graph2D graph,
           Edge edge)Returns trueif the specified edge should be deleted orfalseotherwise. | 
| protected  boolean | acceptEdgeLabel(Edge edge,
                EdgeLabel label)Returns trueif the specified edge label should be deleted orfalseotherwise. | 
| protected  boolean | acceptNode(Graph2D graph,
           Node node)Returns trueif the specified node should be deleted orfalseotherwise. | 
| protected  boolean | acceptNodeLabel(Node node,
                NodeLabel label)Returns trueif the specified node label should be deleted orfalseotherwise. | 
| protected  boolean | acceptNodePort(Node node,
               NodePort port)Returns trueif the specified node port should be deleted orfalseotherwise. | 
| protected  boolean | acceptTableColumn(Node node,
                  TableGroupNodeRealizer.Column column)Returns trueif the specified table column should be deleted orfalseotherwise. | 
| protected  boolean | acceptTableRow(Node node,
               TableGroupNodeRealizer.Row row)Returns trueif the specified table row should be deleted orfalseotherwise. | 
|  void | actionPerformed(java.awt.event.ActionEvent e)Invokes deletefor the view returned bygetView. | 
|  void | delete(Graph2DView view)Deletes graph elements in the specified view. | 
| protected  void | deleteBend(EdgeRealizer er,
           Bend bend)Deletes the specified bend. | 
| protected  void | deleteEdge(Graph2D graph,
           Edge edge)Deletes the specified edge. | 
| 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 acceptXXXmethods. | 
| protected  void | deleteEdgeLabel(EdgeRealizer realizer,
                EdgeLabel label,
                int index)Deletes the specified edge label. | 
| protected  void | deleteNode(Graph2D graph,
           Node node)Deletes the specified node. | 
| 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 acceptXXXmethods. | 
| protected  void | deleteNodeLabel(NodeRealizer realizer,
                NodeLabel label,
                int index)Deletes the specified node label. | 
| protected  void | deleteNodePort(NodeRealizer realizer,
               NodePort port,
               int index)Deletes the specified node port. | 
| protected  void | deleteTableColumn(Node node,
                  TableGroupNodeRealizer.Column column)Deletes the specified table column. | 
| protected  void | deleteTableRow(Node node,
               TableGroupNodeRealizer.Row row)Deletes the specified table row. | 
|  int | getDeletionMask()Returns the bit mask that determines the element types to consider for deletion. | 
| protected  Graph2DView | getView(java.awt.event.ActionEvent e)Determines the view in which to delete graph elements. | 
|  boolean | isKeepingParentGroupNodeSizes()Returns whether or not group nodes with enabled auto bounds feature should keep their size if a child node or one of its labels get deleted. | 
|  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 | setKeepingParentGroupNodeSizes(boolean keepingParentGroupNodeSizes)Specifies whether or not group nodes with enabled auto bounds feature should keep their size if a child node or one of its labels get deleted. | 
|  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 TYPE_NODE_PORT
public 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 instance that has
 no default view, that means 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 instance.
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.public boolean isKeepingParentGroupNodeSizes()
true if group nodes with enabled auto bounds feature should keep their size if a child
 node or one of its labels get deleted; false otherwise.public void setKeepingParentGroupNodeSizes(boolean keepingParentGroupNodeSizes)
keepingParentGroupNodeSizes - true if group nodes with enabled auto bounds feature should keep their size if a child
        node or one of its labels get 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 and edges that connect to node ports that
 will be deleted according to
 acceptNodePort(y.base.Node, NodePort).
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 boolean acceptNodePort(Node node,
                                 NodePort port)
true if the specified node port should be deleted or
 false otherwise.
 The default implementation accepts selected node ports if the deletion
 mask includes TYPE_NODE_PORT.
node - the Node that holds the node port.port - the NodePort that is checked for deletion.
true if the specified node port 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- Nodeto 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(java.awt.event.ActionEvent e)
delete for the view returned by
 getView.
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.
view - the view in which to delete graph elements.
java.lang.NullPointerException - if the specified view is null.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(java.awt.event.ActionEvent e)
e - the ActionEvent that triggers the deletion of graph elements.
actionPerformed(java.awt.event.ActionEvent), 
Graph2DViewActions.DeleteSelectionAction(y.view.Graph2DView)
protected void deleteEdge(Graph2D graph,
                          Edge edge)
 Client code that overwrites this method must ensure that the edge is
 properly removed to prevent inconsistent state with regards to the
 result of the corresponding call to
 acceptEdge(Graph2D, y.base.Edge).
 
graph - the Graph2D that holds the edge.edge - the Edge that is deleted.
protected void deleteEdgeLabel(EdgeRealizer realizer,
                               EdgeLabel label,
                               int index)
 Client code that overwrites this method must ensure that the label is
 properly removed to prevent inconsistent state with regards to the
 result of the corresponding call to
 acceptEdgeLabel(y.base.Edge, EdgeLabel) .
 
realizer - the EdgeRealizer that holds the label.label - the EdgeLabel that is deleted.index - the index of the label in the given realizer's list of
 labels.
protected void deleteBend(EdgeRealizer er,
                          Bend bend)
 Client code that overwrites this method must ensure that the bend is
 properly removed to prevent inconsistent state with regards to the
 result of the corresponding call to
 acceptBend(y.base.Edge, Bend).
 
er - the EdgeRealizer holding the bend.bend - the Bend that is deleted.
protected void deleteNode(Graph2D graph,
                          Node node)
 Client code that overwrites this method must ensure that the node is
 properly removed to prevent inconsistent state with regards to the
 result of the corresponding call to
 acceptNode(Graph2D, y.base.Node).
 
graph - the Graph2D that holds the node.node - the Node that is deleted.
protected void deleteNodeLabel(NodeRealizer realizer,
                               NodeLabel label,
                               int index)
 Client code that overwrites this method must ensure that the label is
 properly removed to prevent inconsistent state with regards to the
 result of the corresponding call to
 acceptNodeLabel(y.base.Node, NodeLabel).
 
realizer - the NodeRealizer that holds the label.label - the NodeLabel that is deleted.index - the index of the label in the given realizer's list of
 labels.
protected void deleteNodePort(NodeRealizer realizer,
                              NodePort port,
                              int index)
 Client code that overwrites this method must ensure that the port is
 properly removed to prevent inconsistent state with regards to the
 result of the corresponding call to
 acceptNodePort(y.base.Node, NodePort).
 
realizer - the NodeRealizer that holds the port.port - the NodePort that is deleted.index - the index of the NodePort in the given
 NodeRealizer's list of ports.
protected void deleteTableColumn(Node node,
                                 TableGroupNodeRealizer.Column column)
 Client code that overwrites this method must ensure that the column is
 properly removed to prevent inconsistent state with regards to the
 result of the corresponding call to
 acceptTableColumn(y.base.Node, y.view.tabular.TableGroupNodeRealizer.Column).
 
node - the Node that is represented by the table that
 holds the row.column - the Column that is deleted.
protected void deleteTableRow(Node node,
                              TableGroupNodeRealizer.Row row)
 Client code that overwrites this method must ensure that the row is
 properly removed to prevent inconsistent state with regards to the
 result of the corresponding call to
 acceptTableRow(y.base.Node, y.view.tabular.TableGroupNodeRealizer.Row).
 
node - the Node that is represented by the table that
 holds the row.row - the Row that is deleted.| 
 | © Copyright 2000-2025, yWorks GmbH. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||