|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tigris.gef.base.Selection
org.tigris.gef.base.SelectionResize
org.tigris.gef.base.SelectionButtons
Field Summary |
Fields inherited from class org.tigris.gef.base.Selection |
_content, BORDER_WIDTH, HAND_SIZE |
Constructor Summary | |
SelectionButtons(org.tigris.gef.presentation.Fig f)
Construct a new SelectionWButtons for the given Fig. |
Method Summary | |
void |
buttonClicked(int buttonCode)
|
protected java.lang.Object |
createEdgeAbove(MutableGraphModel gm,
java.lang.Object newNode)
Subclasses should override this method if they want to provide a quickbutton above the _content fig. |
protected java.lang.Object |
createEdgeLeft(MutableGraphModel gm,
java.lang.Object newNode)
Subclasses should override this method if they want to provide a quickbutton at the left of the _content fig. |
protected java.lang.Object |
createEdgeRight(MutableGraphModel gm,
java.lang.Object newNode)
Subclasses should override this method if they want to provide a quickbutton at the right of the _content fig. |
protected java.lang.Object |
createEdgeToSelf(MutableGraphModel gm)
Subclasses should override this method if they want to provide a quickbutton for selfassociation. |
protected java.lang.Object |
createEdgeUnder(MutableGraphModel gm,
java.lang.Object newNode)
Subclasses should override this method if they want to provide a quickbutton under the _content fig. |
java.awt.Rectangle |
getBounds()
The bounding box of the selection is the bbox of the contained Fig. |
protected abstract java.lang.Object |
getNewNode(int buttonCode)
Implementors should return a new node for adding via the buttons. |
protected int |
getPressedButton()
|
void |
hideButtons()
Dont show buttons while the user is moving the Class. |
boolean |
hitAbove(int x,
int y,
int w,
int h,
java.awt.Rectangle r)
|
boolean |
hitBelow(int x,
int y,
int w,
int h,
java.awt.Rectangle r)
|
boolean |
hitLeft(int x,
int y,
int w,
int h,
java.awt.Rectangle r)
|
boolean |
hitRight(int x,
int y,
int w,
int h,
java.awt.Rectangle r)
|
boolean |
intersectsRect(java.awt.Rectangle r,
int x,
int y,
int w,
int h)
|
protected boolean |
isPaintButtons()
|
void |
mouseEntered(java.awt.event.MouseEvent me)
|
void |
mouseExited(java.awt.event.MouseEvent me)
|
void |
mousePressed(java.awt.event.MouseEvent me)
|
void |
mouseReleased(java.awt.event.MouseEvent me)
|
void |
paint(java.awt.Graphics g)
Paint the handles at the four corners and midway along each edge of the bounding box. |
void |
paintButton(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
|
void |
paintButtonAbove(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
|
void |
paintButtonBelow(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
|
void |
paintButtonLeft(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
|
void |
paintButtonRight(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
|
abstract void |
paintButtons(java.awt.Graphics g)
Paint the handles at the four corners and midway along each edge of the bounding box. |
protected boolean |
placeFig(org.tigris.gef.presentation.Fig figToPlace,
LayerPerspective layerToPlaceOn,
int x,
int y,
java.awt.Rectangle bumpRect)
Places a fig on the canvas in the correct position. |
protected void |
setPaintButtons(boolean paint)
|
protected void |
setPressedButton(int pressed)
|
static void |
toggleShowRapidButtons()
Toggle ShowRapidButtons. |
Methods inherited from class org.tigris.gef.base.SelectionResize |
dragHandle, hitHandle |
Methods inherited from class org.tigris.gef.base.Selection |
contains, contains, contains, damage, delete, dispose, endTrans, getContent, getContentBounds, getLocation, getLocked, hit, hitHandle, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseMoved, print, reorder, setcontent, stuffBounds, translate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SelectionButtons(org.tigris.gef.presentation.Fig f)
f
- The given Fig.Method Detail |
public static void toggleShowRapidButtons()
public boolean hitAbove(int x, int y, int w, int h, java.awt.Rectangle r)
x
- x of the selection button icony
- y of the selection button iconw
- width of the selection button iconh
- height of the selection button iconr
- outer rectangle of the fig
public boolean hitBelow(int x, int y, int w, int h, java.awt.Rectangle r)
x
- x of the selection button icony
- y of the selection button iconw
- width of the selection button iconh
- height of the selection button iconr
- outer rectangle of the fig
public boolean hitLeft(int x, int y, int w, int h, java.awt.Rectangle r)
x
- x of the selection button icony
- y of the selection button iconw
- width of the selection button iconh
- height of the selection button iconr
- outer rectangle of the fig
public boolean hitRight(int x, int y, int w, int h, java.awt.Rectangle r)
x
- x of the selection button icony
- y of the selection button iconw
- width of the selection button iconh
- height of the selection button iconr
- outer rectangle of the fig
public boolean intersectsRect(java.awt.Rectangle r, int x, int y, int w, int h)
x
- x of rectangle 2y
- y of rectangle 2w
- width of rectangle 2h
- height of rectangle 2r
- rectangle 1
public void paint(java.awt.Graphics g)
paint
in class SelectionResize
g
- The Graphics where we paint this.public abstract void paintButtons(java.awt.Graphics g)
g
- The Graphics where to paint the buttons.public void paintButtonAbove(javax.swing.Icon i, java.awt.Graphics g, int x, int y, int hi)
i
- the icon to be paintedg
- the graphics to draw onx
- x for the icony
- y for the iconhi
- the button identifierpublic void paintButtonBelow(javax.swing.Icon i, java.awt.Graphics g, int x, int y, int hi)
i
- the icon to be paintedg
- the graphics to draw onx
- x for the icony
- y for the iconhi
- the button identifierpublic void paintButtonLeft(javax.swing.Icon i, java.awt.Graphics g, int x, int y, int hi)
i
- the icon to be paintedg
- the graphics to draw onx
- x for the icony
- y for the iconhi
- the button identifierpublic void paintButtonRight(javax.swing.Icon i, java.awt.Graphics g, int x, int y, int hi)
i
- the icon to be paintedg
- the graphics to draw onx
- x for the icony
- y for the iconhi
- the button identifierpublic void paintButton(javax.swing.Icon i, java.awt.Graphics g, int x, int y, int hi)
i
- the icon to be paintedg
- the graphics to draw onx
- x for the icony
- y for the iconhi
- the button identifierpublic java.awt.Rectangle getBounds()
Selection
getBounds
in class Selection
Selection.getBounds()
public void hideButtons()
public void buttonClicked(int buttonCode)
buttonCode
- the button identifierpublic void mousePressed(java.awt.event.MouseEvent me)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class Selection
MouseListener.mousePressed(java.awt.event.MouseEvent)
public void mouseReleased(java.awt.event.MouseEvent me)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class Selection
MouseListener.mouseReleased(java.awt.event.MouseEvent)
public void mouseEntered(java.awt.event.MouseEvent me)
mouseEntered
in interface java.awt.event.MouseListener
mouseEntered
in class Selection
MouseListener.mouseEntered(java.awt.event.MouseEvent)
public void mouseExited(java.awt.event.MouseEvent me)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class Selection
MouseListener.mouseExited(java.awt.event.MouseEvent)
protected boolean placeFig(org.tigris.gef.presentation.Fig figToPlace, LayerPerspective layerToPlaceOn, int x, int y, java.awt.Rectangle bumpRect)
figToPlace
- The figure one wishes to place on a diagramlayerToPlaceOn
- The layer that contains the figsx
- The x coordinate where one wishes to place the figy
- The y coordinate where one wishes to place the figbumpRect
- The rectangle that should be avoided since
there can be other figs.
protected abstract java.lang.Object getNewNode(int buttonCode)
buttonCode
- the code (identifier) for the selection button
that was hit
protected java.lang.Object createEdgeAbove(MutableGraphModel gm, java.lang.Object newNode)
gm
- the graphmodelnewNode
- The node (modelelement) created by pressing the
quickbutton
protected java.lang.Object createEdgeLeft(MutableGraphModel gm, java.lang.Object newNode)
gm
- the graphmodelnewNode
- The node (modelelement) created by pressing the
quickbutton
protected java.lang.Object createEdgeRight(MutableGraphModel gm, java.lang.Object newNode)
gm
- the graphmodelnewNode
- The node (modelelement) created by pressing the
quickbutton
protected java.lang.Object createEdgeUnder(MutableGraphModel gm, java.lang.Object newNode)
gm
- the graphmodelnewNode
- The node (modelelement) created by pressing the
quickbutton
protected java.lang.Object createEdgeToSelf(MutableGraphModel gm)
gm
- the graphmodel
protected void setPaintButtons(boolean paint)
paint
- The _paintButtons to set.protected boolean isPaintButtons()
protected void setPressedButton(int pressed)
pressed
- the identifier for the pressed Buttonprotected int getPressedButton()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |