|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.jfimagine.jfdraw.draw.Selection
Selection class. Used as a collection if user 'picked-up' some shapes.
| Constructor Summary | |
Selection(DrawCanvas drawCanvas)
Constructor for ObjectList |
|
| Method Summary | |
int |
add(AbstractObject obj)
Add a new object at the end of the list. |
int |
add(java.util.List objList)
Add an object list at the end of the list. |
Port |
addPort(double x,
double y)
Add a new port to this selection. |
void |
alignObjects(int ALIGNMENTTYPE)
Align all the shapes in this list. |
void |
clear()
Clear all objects in list. |
boolean |
contains(AbstractObject obj)
If this selection has already contains such an object. |
void |
dragLabel(double lastx,
double lasty,
double newx,
double newy,
java.awt.Graphics g)
Drag current label. |
void |
dragNode(double x,
double y,
java.awt.Graphics g)
Drag current node and draw its relational lines. |
void |
draw(java.awt.Graphics g,
boolean isXorMode)
Draw current object on graphic canvas. |
void |
drawPicked(java.awt.Graphics g,
boolean ifRotate)
Draw picked state of current object on graphic canvas. |
void |
finishDragNode(double x,
double y,
java.awt.Graphics g)
finish dragging current node and draw its relational lines. |
double |
flipObjects()
Flip objects of current selection. |
Arrow |
getArrow()
Get all the arrow format of objects in this selection. |
Rect |
getBounds()
Get the bounds of this selection. |
Rect |
getBounds(boolean avoidUnrotatable)
Get the bounds of this selection. |
Node |
getDraggingNode()
get current dragging node of current shape. |
FillFormat |
getFillFormat()
Get all the fill format of objects in this selection. |
AbstractShape |
getFirstObj()
get first object in selection. |
FontFormat |
getFontFormat()
Get all the font format of objects in this selection. |
JFPoint |
getLastPoint()
Get last point. |
LineFormat |
getLineFormat()
Get all the line format of objects in this selection. |
ObjectList |
getList()
Get an objectList encapsulates shape Objects |
Label |
getMoveLabel()
get current moving label of current shape. |
JFPoint |
getMovePos(double oldx,
double oldy,
double newx,
double newy)
Get a move offset(x,y) from source position to destination position. |
JFPoint |
getOriginalCenter()
Get original center. |
JFPoint |
getOriginalPoint()
Get original point. |
boolean |
hasQuadrant()
if current selection has quadrant |
AbstractObject |
intersects(JFPoint pnt)
Get which shape in the selection that intersects with point pnt. |
boolean |
isDraggingPortAlso()
When dragging node of current shape, if a relational port is also dragged. |
Label |
labelIntersects(java.awt.Graphics g,
JFPoint pnt)
Get internal label of one shape in the selection that intersects with point pnt. |
double |
mirrorObjects()
Mirror objects of current selection. |
boolean |
modifyLabel(java.awt.Container c,
JFOperationManager manager)
Modify label string of one object. |
void |
moveBy(double x,
double y)
Move current selection by a new offset. |
void |
moveRelationalPorts()
Move all the relational ports of this selection. |
void |
moveTo(double x,
double y,
java.awt.Graphics g)
Move current selection at a new position |
Node |
nodeIntersects(JFPoint pnt,
int usage)
Get which node of one shape in the selection that intersects with point pnt. |
Port |
pickPort(double x,
double y)
Pick a port that is on the selection, according to the current x,y position |
void |
remove(AbstractObject obj)
Remove an object in object list. |
boolean |
removePort(Port port)
Remove a port from this selection. |
void |
rotateObjects(double x,
double y,
java.awt.Graphics g)
Rotate current objects by moving a rotating point. |
void |
setArrow(Arrow arrow)
Set all the arrow format of object in this selection. |
void |
setDraggingNode(Node draggingNode)
set current dragging node of current shape. |
void |
setFillFormat(FillFormat fillFormat)
Set the fill format of objects in this selection. |
void |
setFontFormat(FontFormat fontFormat)
Set the font format of objects in this selection. |
void |
setLastPoint(JFPoint pnt)
Set last point. |
void |
setLineFormat(LineFormat lineFormat)
Set the line format of objects in this selection. |
void |
setMoveLabel(Label moveLabel)
set current moving label of current shape. |
void |
setOriginalPoint()
Set original center point by currently selected objects. |
void |
setOriginalPoint(JFPoint pnt)
Set original point. |
int |
size()
Get the number of AbstractObject in list. |
java.lang.String |
toString()
Convert this list to String |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Selection(DrawCanvas drawCanvas)
| Method Detail |
public ObjectList getList()
public boolean contains(AbstractObject obj)
obj - A new AbstractObject.
public int add(AbstractObject obj)
obj - A new AbstractObject.
public int add(java.util.List objList)
objList - A new AbstractObject list.
public void remove(AbstractObject obj)
obj - An object to be removed.public void clear()
public int size()
public Rect getBounds()
public Rect getBounds(boolean avoidUnrotatable)
avoidUnrotatable - To avoid caculating the bounds of unrotatable objects.
public JFPoint getOriginalPoint()
public JFPoint getOriginalCenter()
public void setOriginalPoint()
public void setOriginalPoint(JFPoint pnt)
pnt - A new original point.public JFPoint getLastPoint()
public void setLastPoint(JFPoint pnt)
pnt - A new last point.public Node getDraggingNode()
public void setDraggingNode(Node draggingNode)
draggingNode - A new dragging node of current shape.public Label getMoveLabel()
public void setMoveLabel(Label moveLabel)
moveLabel - Current moving label.public boolean isDraggingPortAlso()
public Port addPort(double x,
double y)
public Port pickPort(double x,
double y)
public boolean removePort(Port port)
port - A port to be removed.public Arrow getArrow()
public void setArrow(Arrow arrow)
arrow - A new arrow format object.public LineFormat getLineFormat()
public void setLineFormat(LineFormat lineFormat)
lineFormat - A new line format.public FillFormat getFillFormat()
public void setFillFormat(FillFormat fillFormat)
fillFormat - A new fill format.public FontFormat getFontFormat()
public void setFontFormat(FontFormat fontFormat)
fontFormat - A new font format.public double flipObjects()
public double mirrorObjects()
public void moveBy(double x,
double y)
public JFPoint getMovePos(double oldx,
double oldy,
double newx,
double newy)
public void moveTo(double x,
double y,
java.awt.Graphics g)
g - Graphics context to draw selections.public AbstractShape getFirstObj()
public Label labelIntersects(java.awt.Graphics g,
JFPoint pnt)
pnt - A JFPoint used to test intersection.g - A graphics text used necessary in label intersection operation.
public void dragLabel(double lastx,
double lasty,
double newx,
double newy,
java.awt.Graphics g)
g - Graphics context to draw selections.
public Node nodeIntersects(JFPoint pnt,
int usage)
pnt - A JFPoint used to test intersection.usage - Purpose to get a node intersected, e.g. move or rotate.
public AbstractObject intersects(JFPoint pnt)
pnt - A JFPoint used to test intersection.
public void dragNode(double x,
double y,
java.awt.Graphics g)
g - Graphics context to draw selections.
public void rotateObjects(double x,
double y,
java.awt.Graphics g)
g - Graphics context to draw selections.public void alignObjects(int ALIGNMENTTYPE)
public void finishDragNode(double x,
double y,
java.awt.Graphics g)
g - Graphics context to draw selections.public void moveRelationalPorts()
public boolean modifyLabel(java.awt.Container c,
JFOperationManager manager)
c - A container that used to place modifier objects.manager - An opeation manager used to register the text's change.
public java.lang.String toString()
toString in class java.lang.Object
public void draw(java.awt.Graphics g,
boolean isXorMode)
g - A graphic canvas.isXorMode - If is in xor mode now.
public void drawPicked(java.awt.Graphics g,
boolean ifRotate)
g - A graphic canvas.ifRotate - If user's operation or other actions force objects to be rotated.public boolean hasQuadrant()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||