|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdevisor2.grid.backend.BaseSelector
devisor2.grid.backend.GridHotspotter
This class adds the hotspotting mechanism to the BaseSelector.
Field Summary | |
static int |
HOTSPOT_BOTTOMCENTER
|
static int |
HOTSPOT_BOTTOMLEFT
|
static int |
HOTSPOT_BOTTOMRIGHT
|
static int |
HOTSPOT_CENTERCENTER
|
static int |
HOTSPOT_CENTERLEFT
|
static int |
HOTSPOT_CENTERRIGHT
|
static int |
HOTSPOT_NONE
constant to indicate that no hotspot has been hit |
static int |
HOTSPOT_TOPCENTER
|
static int |
HOTSPOT_TOPLEFT
constants to indicate the number of the hotspot that has been hit |
static int |
HOTSPOT_TOPRIGHT
|
protected boolean[] |
hotspotMask
this array holds the flags which hotspots are currently active and are therefore to be drawn and have to be sensitive to user input read it top to bottom left to right |
static boolean[] |
MASK_ALL
the hotspot mask for all hotspots |
static boolean[] |
MASK_CIRCLES
the hotspot mask for scaling when circles are involved |
static boolean[] |
MASK_NODES
the hotspot mask for nodes only |
static boolean[] |
MASK_ROTATE
the hotspot mask for rotating |
Fields inherited from class devisor2.grid.backend.BaseSelector |
boundaryNodesOnly, cc, containsCircles, currentRect, da, g, nodesonly, perimeter, previousRectDrawn, rectToDraw, root |
Constructor Summary | |
GridHotspotter(MainFrame mf,
DrawingArea da)
The constructor just sets references correctly and initializes some variables |
Method Summary | |
java.awt.Point |
getCenterHotspot()
|
int |
getClickedHotspot(int x,
int y)
determines what hotspot has been hit (use constants provided). |
java.awt.Point |
getClickedHotspotCoords(int hotspot)
|
boolean[] |
getHotspotMask()
|
java.awt.Point |
getOppositeHotspotCoords(int hotspot)
|
java.awt.Point |
getTopLeftHotspot()
same for the topleft corner |
void |
setHotspotMask(boolean[] mask)
sets the hotspot mask to the given value, please use MASK??? constants provided |
void |
setPerimeter(java.awt.Rectangle peri)
sets the perimeter rectangle used for scaling, rotating and translating, especially for the visual feedback for these operations |
void |
updateHotspots()
updates the hotspot display, as XOR painting is used, this method draws hotspots if there are none, and removes them if they are already visible. |
Methods inherited from class devisor2.grid.backend.BaseSelector |
clearSelectBox, containsCircles, getClickedItem, getSelectBox, getSelectedItems, isBoundaryNodesOnly, isNodesOnly, paintSelectBox, setGraphics, startSelectBox, updateSelectBox |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean[] hotspotMask
public static final int HOTSPOT_NONE
public static final int HOTSPOT_TOPLEFT
public static final int HOTSPOT_TOPCENTER
public static final int HOTSPOT_TOPRIGHT
public static final int HOTSPOT_CENTERLEFT
public static final int HOTSPOT_CENTERCENTER
public static final int HOTSPOT_CENTERRIGHT
public static final int HOTSPOT_BOTTOMLEFT
public static final int HOTSPOT_BOTTOMCENTER
public static final int HOTSPOT_BOTTOMRIGHT
public static final boolean[] MASK_ALL
public static final boolean[] MASK_NODES
public static final boolean[] MASK_ROTATE
public static final boolean[] MASK_CIRCLES
Constructor Detail |
public GridHotspotter(MainFrame mf, DrawingArea da)
mf
- - the MainFrame referenceda
- - the drawing area where the select box will be painted onMethod Detail |
public void setHotspotMask(boolean[] mask)
mask
- - the new gotspot mask, use constants providedpublic boolean[] getHotspotMask()
public void updateHotspots()
setHotspotMask
public java.awt.Point getCenterHotspot()
public java.awt.Point getTopLeftHotspot()
public java.awt.Point getClickedHotspotCoords(int hotspot)
public java.awt.Point getOppositeHotspotCoords(int hotspot)
hotspot
- - the hotspot last clicked on
public void setPerimeter(java.awt.Rectangle peri)
public int getClickedHotspot(int x, int y)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |