|
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.SelectAllAction
public static class Graph2DViewActions.SelectAllAction
Action that selects elements of predefined types.
| Field Summary | |
|---|---|
static int |
ALL_TYPES_MASK
Selection type mask representing all element types. |
static int |
TYPE_BEND
Selection type specifier to consider bends for selection. |
static int |
TYPE_EDGE
Selection type specifier to consider edges for selection. |
static int |
TYPE_EDGE_LABEL
Selection type specifier to consider edge labels for selection. |
static int |
TYPE_NODE
Selection type specifier to consider nodes for selection. |
static int |
TYPE_NODE_LABEL
Selection type specifier to consider node labels for selection. |
static int |
TYPE_NODE_PORT
Selection type specifier to consider node ports for selection. |
static int |
TYPE_TABLE_COLUMN
Selection type specifier to consider TableGroupNodeRealizer.Column for selection. |
static int |
TYPE_TABLE_ROW
Selection type specifier to consider TableGroupNodeRealizer.Row for selection. |
| Fields inherited from class javax.swing.AbstractAction |
|---|
changeSupport, enabled |
| Fields inherited from interface javax.swing.Action |
|---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
|---|---|
Graph2DViewActions.SelectAllAction()
Initializes a new SelectAllAction 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. |
|
Graph2DViewActions.SelectAllAction(Graph2DView view)
Initializes a new SelectAllAction instance. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Invokes select for the view returned by
getView. |
protected int |
adjustTypes(int typeMask)
Determines which types of graph elements have to be selected. |
int |
getEmptyMask()
Returns the bit mask that determines which elements to select if this action is used to select elements in a graph in which the selection state of all elements is false. |
protected int |
getSelectedEdgeTypes(Graph2D graph,
Edge edge)
Determines whether the specified edge and/or any graph elements related to the specified edge (that is edge labels and/or bends) are selected. |
protected int |
getSelectedNodeTypes(Graph2D graph,
Node node)
Determines whether the specified node and/or any graph elements related to the specified node (that is node labels and/or node ports) are selected. |
protected int |
getSelectedTypes(Graph2D graph)
Determines the types of graph elements that are selected in the specified graph. |
int |
getSelectionMask()
Returns the bit mask that determines the types of elements that are recognized by this action. |
protected Graph2DView |
getView(ActionEvent e)
Determines the view in which to select graph elements. |
boolean |
isMixedSelectionEnabled()
Determines whether or not this action supports selecting different types of graph elements at once. |
protected boolean |
isSelected(Graph2D graph,
Bend bend)
Returns true if the specified bend is currently selected;
false otherwise. |
protected boolean |
isSelected(Graph2D graph,
Edge edge)
Returns true if the specified edge is currently selected;
false otherwise. |
protected boolean |
isSelected(Graph2D graph,
Node node)
Returns true if the specified node is currently selected;
false otherwise. |
protected boolean |
isSelected(Graph2D graph,
NodePort port)
Returns true if the specified port is currently selected;
false otherwise. |
protected boolean |
isSelected(Graph2D graph,
TableGroupNodeRealizer.Column column)
Returns true if the specified column is currently selected;
false otherwise. |
protected boolean |
isSelected(Graph2D graph,
TableGroupNodeRealizer.Row row)
Returns true if the specified row is currently selected;
false otherwise. |
protected boolean |
isSelected(Graph2D graph,
YLabel label)
Returns true if the specified label is currently selected;
false otherwise. |
void |
select(Graph2DView view)
Selects elements in the specified view. |
protected void |
selectEdgeTypes(Graph2D graph,
Edge edge,
int typeMask)
Selects the specified edge and/or related graph elements (that is edge labels and bends) depending on the specified type bit mask. |
protected void |
selectNodeTypes(Graph2D graph,
Node node,
int typeMask)
Selects the specified node and/or related graph elements (that is node labels, node ports, table columns, and table rows) depending on specified type bit mask. |
protected void |
selectTypes(Graph2D graph,
int typeMask)
Selects the specified types of graph elements. |
void |
setEmptyMask(int typeMask)
Specifies the bit mask that determines which elements to select if this action is used to select elements in a graph in which the selection state of all elements is false. |
void |
setMixedSelectionEnabled(boolean enabled)
Specifies whether or not this action supports selecting different types of graph elements at once. |
protected void |
setSelected(Graph2D graph,
Bend bend,
boolean flag)
Sets the specified selection state for the specified bend. |
protected void |
setSelected(Graph2D graph,
Edge edge,
boolean flag)
Sets the specified selection state for the specified edge. |
protected void |
setSelected(Graph2D graph,
Node node,
boolean flag)
Sets the specified selection state for the specified node. |
protected void |
setSelected(Graph2D graph,
NodePort port,
boolean flag)
Sets the specified selection state for the specified node port. |
protected void |
setSelected(Graph2D graph,
TableGroupNodeRealizer.Column column,
boolean flag)
Sets the specified selection state for the specified column. |
protected void |
setSelected(Graph2D graph,
TableGroupNodeRealizer.Row row,
boolean flag)
Sets the specified selection state for the specified row. |
protected void |
setSelected(Graph2D graph,
YLabel label,
boolean flag)
Sets the specified selection state for the specified label. |
void |
setSelectionMask(int typeMask)
Specifies the bit mask that determines the types of elements that are recognized by this action. |
| 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_NODE
public static final int TYPE_EDGE
public static final int TYPE_BEND
public static final int TYPE_NODE_LABEL
public static final int TYPE_EDGE_LABEL
public static final int TYPE_NODE_PORT
public static final int TYPE_TABLE_COLUMN
TableGroupNodeRealizer.Column for selection.
public static final int TYPE_TABLE_ROW
TableGroupNodeRealizer.Row for selection.
public static final int ALL_TYPES_MASK
| Constructor Detail |
|---|
public Graph2DViewActions.SelectAllAction()
SelectAllAction 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 SelectAllAction(null)
public Graph2DViewActions.SelectAllAction(Graph2DView view)
SelectAllAction 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 getEmptyMask()
false.
setEmptyMask(int),
TYPE_BEND,
TYPE_EDGE,
TYPE_EDGE_LABEL,
TYPE_NODE,
TYPE_NODE_LABEL,
TYPE_NODE_PORT,
TYPE_TABLE_COLUMN,
TYPE_TABLE_ROWpublic void setEmptyMask(int typeMask)
false.
typeMask - the bit mask specifying the elements to select
if there are currently no selected elements.getEmptyMask(),
TYPE_BEND,
TYPE_EDGE,
TYPE_EDGE_LABEL,
TYPE_NODE,
TYPE_NODE_LABEL,
TYPE_NODE_PORT,
TYPE_TABLE_COLUMN,
TYPE_TABLE_ROWpublic int getSelectionMask()
setSelectionMask(int),
TYPE_BEND,
TYPE_EDGE,
TYPE_EDGE_LABEL,
TYPE_NODE,
TYPE_NODE_LABEL,
TYPE_NODE_PORT,
TYPE_TABLE_COLUMN,
TYPE_TABLE_ROWpublic void setSelectionMask(int typeMask)
typeMask - the bit mask that determines the types of elements that
are recognized by this action.getSelectionMask(),
TYPE_BEND,
TYPE_EDGE,
TYPE_EDGE_LABEL,
TYPE_NODE,
TYPE_NODE_LABEL,
TYPE_NODE_PORT,
TYPE_TABLE_COLUMN,
TYPE_TABLE_ROWpublic boolean isMixedSelectionEnabled()
By default, this property is set to false.
Note: Nodes and bends will be selected at the same time independent of the value of this property.
true if this action supports selecting different
types of graph elements at once; false otherwise.setMixedSelectionEnabled(boolean)public void setMixedSelectionEnabled(boolean enabled)
By default, this property is set to false.
enabled - if true if this action supports selecting
different types of graph elements at once; otherwise only one type
of graph elements will be selected.isMixedSelectionEnabled()public void actionPerformed(ActionEvent e)
select for the view returned by
getView.
e - the ActionEvent that triggers the selection of
graph elements.getView(java.awt.event.ActionEvent),
select(y.view.Graph2DView)public void select(Graph2DView view)
adjustTypes is queried for the appropriate types
of elements to select based upon the already selected types.
NullPointerException - if the specified view is null.view - the view in which to select graph elements.adjustTypes(int),
getSelectedTypes(Graph2D),
selectTypes(Graph2D, int)protected int adjustTypes(int typeMask)
select(Graph2DView).
typeMask - bit mask specifying the types of graph elements that
are already selected.
getSelectedTypes(Graph2D),
selectTypes(Graph2D, int),
TYPE_BEND,
TYPE_EDGE,
TYPE_EDGE_LABEL,
TYPE_NODE,
TYPE_NODE_LABEL,
TYPE_NODE_PORT,
TYPE_TABLE_COLUMN,
TYPE_TABLE_ROW
protected void selectTypes(Graph2D graph,
int typeMask)
select(Graph2DView).
The default implementation delegates selecting elements to
selectEdgeTypes(Graph2D, y.base.Edge, int) and
selectNodeTypes(Graph2D, y.base.Node, int) for each edge and
each node in the graph.
graph - the graph whose elements are selected.typeMask - a bit mask specifying which types of elements to select.adjustTypes(int),
getSelectedTypes(Graph2D),
TYPE_BEND,
TYPE_EDGE,
TYPE_EDGE_LABEL,
TYPE_NODE,
TYPE_NODE_LABEL,
TYPE_NODE_PORT,
TYPE_TABLE_COLUMN,
TYPE_TABLE_ROW
protected void selectEdgeTypes(Graph2D graph,
Edge edge,
int typeMask)
graph - the graph to which the specified edge belongs.edge - the edge to select.typeMask - a bit mask specifying which types of elements to select.selectTypes(Graph2D, int),
selectNodeTypes(Graph2D, y.base.Node, int)
protected void selectNodeTypes(Graph2D graph,
Node node,
int typeMask)
graph - the graph to which the specified node belongs.node - the node to select.typeMask - a bit mask specifying which types of elements to select.selectTypes(Graph2D, int),
selectEdgeTypes(Graph2D, y.base.Edge, int)protected int getSelectedTypes(Graph2D graph)
select(Graph2DView).
The default implementation queries
getSelectedEdgeTypes(Graph2D, y.base.Edge) for each edge if
selectionMask includes edges, edge labels, and/or bends and
getSelectedNodeTypes(Graph2D, y.base.Node) for each node if
selectionMask includes nodes, node labels, node ports,
table columns, and/or table rows in the graph to determine the types of
selected elements in the graph.
graph - the graph whose elements have to be checked.
true.adjustTypes(int),
selectTypes(Graph2D, int),
getSelectionMask(),
setSelectionMask(int),
TYPE_BEND,
TYPE_EDGE,
TYPE_EDGE_LABEL,
TYPE_NODE,
TYPE_NODE_LABEL,
TYPE_NODE_PORT,
TYPE_TABLE_COLUMN,
TYPE_TABLE_ROW
protected int getSelectedEdgeTypes(Graph2D graph,
Edge edge)
graph - the graph to which the specified edge belongs.edge - the edge to check.
true.getSelectedTypes(Graph2D),
getSelectedNodeTypes(Graph2D, y.base.Node)
protected int getSelectedNodeTypes(Graph2D graph,
Node node)
graph - the graph to which the specified node belongs.node - the node to check.
true.getSelectedTypes(Graph2D),
getSelectedEdgeTypes(Graph2D, y.base.Edge)
protected void setSelected(Graph2D graph,
NodePort port,
boolean flag)
graph - the graph the specified port's associated node resides in.port - the node port whose selection state has to be changed.flag - the new selection state for the specified node port.
protected void setSelected(Graph2D graph,
Node node,
boolean flag)
graph - the graph the specified node resides in.node - the node whose selection state has to be changed.flag - the new selection state for the specified node.
protected void setSelected(Graph2D graph,
Edge edge,
boolean flag)
graph - the graph the specified edge resides in.edge - the edge whose selection state has to be changed.flag - the new selection state for the specified edge.
protected void setSelected(Graph2D graph,
YLabel label,
boolean flag)
graph - the graph the specified label's associated node or edge
resides in.label - the label whose selection state has to be changed.flag - the new selection state for the specified label.
protected void setSelected(Graph2D graph,
Bend bend,
boolean flag)
graph - the graph the specified bend's associated edge resides in.bend - the bend whose selection state has to be changed.flag - the new selection state for the specified bend.
protected void setSelected(Graph2D graph,
TableGroupNodeRealizer.Column column,
boolean flag)
graph - the graph the specified column's associated node resides in.column - the table column whose selection state has to be changed.flag - the new selection state for the specified column.
protected void setSelected(Graph2D graph,
TableGroupNodeRealizer.Row row,
boolean flag)
graph - the graph the specified row's associated node resides in.row - the table row whose selection state has to be changed.flag - the new selection state for the specified row.
protected boolean isSelected(Graph2D graph,
Bend bend)
true if the specified bend is currently selected;
false otherwise.
graph - the graph that holds the specified bend's associated edge.bend - the bend whose selection state is checked.
true if the specified bend is currently selected;
false otherwise.
protected boolean isSelected(Graph2D graph,
YLabel label)
true if the specified label is currently selected;
false otherwise.
graph - the graph that holds the specified label's associated edge
or node.label - the label whose selection state is checked.
true if the specified label is currently selected;
false otherwise.
protected boolean isSelected(Graph2D graph,
Edge edge)
true if the specified edge is currently selected;
false otherwise.
graph - the graph that holds the specified edge.edge - the edge whose selection state is checked.
true if the specified edge is currently selected;
false otherwise.
protected boolean isSelected(Graph2D graph,
Node node)
true if the specified node is currently selected;
false otherwise.
graph - the graph that holds the specified node.node - the node whose selection state is checked.
true if the specified node is currently selected;
false otherwise.
protected boolean isSelected(Graph2D graph,
NodePort port)
true if the specified port is currently selected;
false otherwise.
graph - the graph that holds the specified port's associated node.port - the node port whose selection state is checked.
true if the specified port is currently selected;
false otherwise.
protected boolean isSelected(Graph2D graph,
TableGroupNodeRealizer.Column column)
true if the specified column is currently selected;
false otherwise.
graph - the graph that holds the specified column's associated node.column - the table column whose selection state is checked.
true if the specified column is currently selected;
false otherwise.
protected boolean isSelected(Graph2D graph,
TableGroupNodeRealizer.Row row)
true if the specified row is currently selected;
false otherwise.
graph - the graph that holds the specified row's associated node.row - the table row whose selection state is checked.
true if the specified row is currently selected;
false otherwise.protected Graph2DView getView(ActionEvent e)
e - the ActionEvent that triggers the selection of
graph elements.
actionPerformed(java.awt.event.ActionEvent),
Graph2DViewActions.SelectAllAction(y.view.Graph2DView)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||