|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdevisor2.grid.backend.BaseSelector
This class is responsible for managing the select box which can be dragged
open on the DrawingArea. All event handling is taken care of in the
GridListener class, here just the neccessary methods for drawing and
changing the select box are provided.
Additionally, this class provides the container for selections (in other
words, the internal selection management) and methods to modify it.
Field Summary | |
protected boolean |
boundaryNodesOnly
|
protected ControlCenter |
cc
|
protected boolean |
containsCircles
|
protected java.awt.Rectangle |
currentRect
|
protected DrawingArea |
da
|
protected java.awt.Graphics2D |
g
|
protected boolean |
nodesonly
|
protected java.awt.Rectangle |
perimeter
|
protected java.awt.Rectangle |
previousRectDrawn
|
protected java.awt.Rectangle |
rectToDraw
|
protected MainFrame |
root
|
Constructor Summary | |
BaseSelector(MainFrame mf,
DrawingArea da)
The constructor just sets references correctly and initializes some variables |
Method Summary | |
void |
clearSelectBox()
clears the gui feedback of the rectangle last drawn |
boolean |
containsCircles()
|
GridItem |
getClickedItem(int x,
int y)
returns the GridItem which is positioned at the given world coords |
java.awt.Rectangle |
getSelectBox()
returns the current SelectBox as a Rectangle object (in screen coordinates, not in world coordinates) |
java.util.Vector |
getSelectedItems(boolean additive,
java.util.Vector previous)
returns all selected GridItems inside the currently used rubber band / lasso. |
boolean |
isBoundaryNodesOnly()
|
boolean |
isNodesOnly()
|
void |
paintSelectBox()
paints the selection box to the drawing area's graphics context |
void |
setGraphics(java.awt.Graphics g)
updates the graphics handle |
void |
startSelectBox(int x,
int y)
starts the rectangle drawing process |
void |
updateSelectBox(int x,
int y)
Update the size of the select box and redraw it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected MainFrame root
protected ControlCenter cc
protected java.awt.Rectangle currentRect
protected java.awt.Rectangle rectToDraw
protected java.awt.Rectangle previousRectDrawn
protected java.awt.Rectangle perimeter
protected DrawingArea da
protected java.awt.Graphics2D g
protected boolean nodesonly
protected boolean containsCircles
protected boolean boundaryNodesOnly
Constructor Detail |
public BaseSelector(MainFrame mf, DrawingArea da)
mf
- - the MainFrame referenceda
- - the drawing area where the select box will be painted onMethod Detail |
public void setGraphics(java.awt.Graphics g)
public boolean containsCircles()
public boolean isBoundaryNodesOnly()
public boolean isNodesOnly()
public java.awt.Rectangle getSelectBox()
public void paintSelectBox()
public void startSelectBox(int x, int y)
public void updateSelectBox(int x, int y)
public void clearSelectBox()
public GridItem getClickedItem(int x, int y)
public java.util.Vector getSelectedItems(boolean additive, java.util.Vector previous)
additive
- - if true, selection is added to ...previous
- - previously selected items
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |