|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindfusion.diagramming.DiagramItem
com.mindfusion.diagramming.Selection
public final class Selection
Represents a selection of multiple items. Each Diagram
has its
own Selection
instance, which can be accessed via the
Diagram.getSelection()
method.
Field Summary |
---|
Fields inherited from class com.mindfusion.diagramming.DiagramItem |
---|
brush, cycleDetected, cycleProtect, modifyDX, modifyDY, modifyHandle, modifying, pen, ptEnd, ptMdfLast, ptOrg, ptSavedEnd, ptSavedOrg, subordinateGroup |
Constructor Summary | |
---|---|
Selection()
Initializes a new Selection instance. |
Method Summary | |
---|---|
void |
addItem(DiagramItem item)
Adds the specified item to the selection. |
protected boolean |
allowCreate(java.awt.geom.Point2D current,
InteractionState ist)
Invoked during interactive creation of items to test whether the operation can be completed in the current context. |
protected boolean |
allowModify(java.awt.geom.Point2D current,
InteractionState ist)
Invoked during interactive modification of items to test whether the operation can be completed in the current context. |
protected void |
cancelModify(InteractionState ist)
Invoked when the interactive modification of this object has been canceled. |
void |
change(DiagramItem item)
Changes the selection to the specified item. |
void |
clear()
Removes all items from the selection. |
protected void |
completeCreate(java.awt.geom.Point2D end)
Invoked when the item creation has been completed. |
protected void |
completeModify(java.awt.geom.Point2D end,
InteractionState ist)
Invoked when the item modification has been completed. |
boolean |
containsPoint(java.awt.geom.Point2D point)
DiagramItem.containsPoint override. |
protected void |
draw(java.awt.Graphics2D g,
RenderOptions options)
|
protected void |
drawShadow(java.awt.Graphics2D g,
RenderOptions options)
|
boolean |
getAllowMultipleSelection()
Gets a value indicating whether users are allowed to select multiple items. |
java.awt.geom.Rectangle2D.Float |
getBounds()
Gets the smallest rectangle that bounds all selected items. |
int |
getHandlesStyle()
Gets a value indicating how multiple selection is drawn on the screen. |
DiagramItemList |
getItems()
Gets a list of all selected items. |
DiagramLinkList |
getLinks()
Gets a list of all selected links. |
DiagramNodeList |
getNodes()
Gets a list of all selected boxes. |
protected java.awt.geom.Rectangle2D |
getRepaintRect(boolean connected)
Gets the repaint region for this item, taking into account factors such as pen, selection handles and shadow. |
boolean |
itemInSelection(DiagramItem item)
Determines whether the specified item is selected. |
void |
readExternal(java.io.ObjectInput in)
Implements Externalizable. |
boolean |
removeItem(DiagramItem item)
Removes the specified item from the selection. |
void |
setAllowMultipleSelection(boolean value)
Sets a value indicating whether users are allowed to select multiple items. |
void |
setHandlesStyle(int value)
Sets a value indicating how multiple selection should be drawn on the screen. |
int |
size()
Returns the number of selected items. |
protected void |
startCreate(java.awt.geom.Point2D org)
Invoked once when the user starts creating a new item interactively. |
protected void |
startModify(java.awt.geom.Point2D org,
int handle,
InteractionState ist)
Invoked when the user starts modifying this item interactively. |
void |
toggle(DiagramItem item)
Toggles the selection state of the specified item. |
protected void |
updateCreate(java.awt.geom.Point2D current)
Invoked during interactive creation of this item. |
protected void |
updateModify(java.awt.geom.Point2D current,
InteractionState ist)
Invoked during interactive modification of this item. |
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Selection()
Method Detail |
---|
protected void startModify(java.awt.geom.Point2D org, int handle, InteractionState ist)
DiagramItem
startModify
in class DiagramItem
org
- Position of the mouse pointer.handle
- Index of the adjustment handle used to modify the item.ist
- An InteractionState
object containing more information about the current state of the operation.protected void updateModify(java.awt.geom.Point2D current, InteractionState ist)
DiagramItem
updateModify
in class DiagramItem
current
- Position of the mouse pointer.ist
- An InteractionState
object containing more information about the current state of the operation.protected void completeModify(java.awt.geom.Point2D end, InteractionState ist)
DiagramItem
completeModify
in class DiagramItem
end
- The mouse pointer position.ist
- An InteractionState
object containing more information about the current state of the operation.protected void startCreate(java.awt.geom.Point2D org)
DiagramItem
startCreate
in class DiagramItem
org
- Position of the mouse pointer.protected void updateCreate(java.awt.geom.Point2D current)
DiagramItem
updateCreate
in class DiagramItem
current
- Position of the mouse pointer.protected void completeCreate(java.awt.geom.Point2D end)
DiagramItem
completeCreate
in class DiagramItem
end
- The mouse pointer position.protected boolean allowModify(java.awt.geom.Point2D current, InteractionState ist)
DiagramItem
allowModify
in class DiagramItem
current
- The current mouse pointer position.ist
- An InteractionState object containing more information about the current state of the operation.
protected void cancelModify(InteractionState ist)
DiagramItem
cancelModify
in class DiagramItem
ist
- An InteractionState object containing more information about the current state of the operation.protected void draw(java.awt.Graphics2D g, RenderOptions options)
draw
in class DiagramItem
protected void drawShadow(java.awt.Graphics2D g, RenderOptions options)
drawShadow
in class DiagramItem
public boolean containsPoint(java.awt.geom.Point2D point)
containsPoint
in class DiagramItem
point
- The point to check.
protected java.awt.geom.Rectangle2D getRepaintRect(boolean connected)
DiagramItem
getRepaintRect
in class DiagramItem
connected
- true if related items should be considered too; otherwise, false.
public int size()
protected boolean allowCreate(java.awt.geom.Point2D current, InteractionState ist)
DiagramItem
allowCreate
in class DiagramItem
current
- The current mouse pointer position.ist
- An InteractionState
object containing more information about the current state of the operation.
public void toggle(DiagramItem item)
item
- An DiagramItem
whose selection state should be toggled.public void change(DiagramItem item)
item
- The DiagramItem
that should be selected.public void addItem(DiagramItem item)
item
- An DiagramItem
that should be added to the multiple selection.public boolean removeItem(DiagramItem item)
item
- The DiagramItem
that should be deselected.
false
if the specified item was not selected,
otherwise true
.public boolean itemInSelection(DiagramItem item)
item
- The DiagramItem
whose selection state to check.
true
if the item is selected,
otherwise false
.public void clear()
public DiagramItemList getItems()
DiagramItemList
containing the selected items.public DiagramLinkList getLinks()
DiagramLinkList
containing the selected links.public DiagramNodeList getNodes()
ShapeNodeList
containing the selected boxes.public int getHandlesStyle()
SelectionStyle
constants.public void setHandlesStyle(int value)
value
- One of the SelectionStyle
constants.public boolean getAllowMultipleSelection()
true
if users are allowed to select
multiple items, otherwise false
.public void setAllowMultipleSelection(boolean value)
value
- true
if users are allowed to select
multiple items, otherwise false
.public java.awt.geom.Rectangle2D.Float getBounds()
getBounds
in class DiagramItem
Rectangle2D.Float
object representing
the rectangle that bounds all selected items.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class DiagramItem
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class DiagramItem
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |