org.argouml.uml.diagram.ui
Class SelectionWButtons
java.lang.Object
|
+--org.tigris.gef.base.Selection
|
+--org.tigris.gef.base.SelectionResize
|
+--org.argouml.uml.diagram.ui.SelectionNodeClarifiers
|
+--org.argouml.uml.diagram.ui.SelectionWButtons
- All Implemented Interfaces:
- java.util.EventListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable
- Direct Known Subclasses:
- SelectionActionState, SelectionActor, SelectionClass, SelectionClassifierRole, SelectionComponent, SelectionComponentInstance, SelectionInterface, SelectionNode, SelectionNodeInstance, SelectionObject, SelectionSeqObject, SelectionState, SelectionUseCase
- public abstract class SelectionWButtons
- extends SelectionNodeClarifiers
- See Also:
- Serialized Form
Fields inherited from class org.tigris.gef.base.Selection |
_content, BORDER_WIDTH, HAND_SIZE |
Constructor Summary |
SelectionWButtons(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(org.tigris.gef.graph.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(org.tigris.gef.graph.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(org.tigris.gef.graph.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(org.tigris.gef.graph.MutableGraphModel gm)
Subclasses should override this method if they want to provide a quickbutton for
selfassociation. |
protected java.lang.Object |
createEdgeUnder(org.tigris.gef.graph.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()
|
protected abstract java.lang.Object |
getNewNode(int buttonCode)
Implementors should return a new node for adding via the buttons. |
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)
|
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)
|
protected boolean |
placeFig(org.tigris.gef.presentation.Fig figToPlace,
org.tigris.gef.base.LayerPerspective layerToPlaceOn,
int x,
int y,
java.awt.Rectangle bumpRect)
Places a fig on the canvas in the correct position. |
static void |
toggleShowRapidButtons()
|
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, startTrans, stuffBounds, translate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IMAGE_SIZE
public static final int IMAGE_SIZE
MARGIN
public static final int MARGIN
PRESSED_COLOR
public static final java.awt.Color PRESSED_COLOR
Num_Button_Clicks
public static int Num_Button_Clicks
_showRapidButtons
public static boolean _showRapidButtons
_paintButtons
protected boolean _paintButtons
_pressedButton
protected int _pressedButton
SelectionWButtons
public SelectionWButtons(org.tigris.gef.presentation.Fig f)
- Construct a new SelectionWButtons for the given Fig
toggleShowRapidButtons
public static void toggleShowRapidButtons()
hitAbove
public boolean hitAbove(int x,
int y,
int w,
int h,
java.awt.Rectangle r)
hitBelow
public boolean hitBelow(int x,
int y,
int w,
int h,
java.awt.Rectangle r)
hitLeft
public boolean hitLeft(int x,
int y,
int w,
int h,
java.awt.Rectangle r)
hitRight
public boolean hitRight(int x,
int y,
int w,
int h,
java.awt.Rectangle r)
intersectsRect
public boolean intersectsRect(java.awt.Rectangle r,
int x,
int y,
int w,
int h)
paint
public void paint(java.awt.Graphics g)
- Paint the handles at the four corners and midway along each edge
of the bounding box.
- Overrides:
paint
in class SelectionNodeClarifiers
paintButtons
public abstract void paintButtons(java.awt.Graphics g)
paintButtonAbove
public void paintButtonAbove(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
paintButtonBelow
public void paintButtonBelow(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
paintButtonLeft
public void paintButtonLeft(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
paintButtonRight
public void paintButtonRight(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
paintButton
public void paintButton(javax.swing.Icon i,
java.awt.Graphics g,
int x,
int y,
int hi)
getBounds
public java.awt.Rectangle getBounds()
- Overrides:
getBounds
in class org.tigris.gef.base.Selection
hideButtons
public void hideButtons()
- Dont show buttons while the user is moving the Class. Called
from FigClass when it is translated.
buttonClicked
public void buttonClicked(int buttonCode)
mousePressed
public void mousePressed(java.awt.event.MouseEvent me)
- Overrides:
mousePressed
in class org.tigris.gef.base.Selection
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent me)
- Overrides:
mouseReleased
in class org.tigris.gef.base.Selection
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent me)
- Overrides:
mouseEntered
in class org.tigris.gef.base.Selection
mouseExited
public void mouseExited(java.awt.event.MouseEvent me)
- Overrides:
mouseExited
in class org.tigris.gef.base.Selection
placeFig
protected boolean placeFig(org.tigris.gef.presentation.Fig figToPlace,
org.tigris.gef.base.LayerPerspective layerToPlaceOn,
int x,
int y,
java.awt.Rectangle bumpRect)
- Places a fig on the canvas in the correct position. Takes a coordinate pair
x,y and a rectangle that should be avoided because there can be other
figures. If the place action results in x.y coordinates for the fig to place
that are not allowed (beyond the borders of the diagram), the operation is
repeated with corrected parameters. If it is not possible to add the fig
because there are allready to many figs, false is returned and the fig is
not added.
- Parameters:
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.- Returns:
- boolean false if the fig is not placed.
getNewNode
protected abstract java.lang.Object getNewNode(int buttonCode)
- Implementors should return a new node for adding via the buttons.
createEdgeAbove
protected java.lang.Object createEdgeAbove(org.tigris.gef.graph.MutableGraphModel gm,
java.lang.Object newNode)
- Subclasses should override this method if they want to provide a quickbutton above
the _content fig. This method returns the edge (modelelement) that should be drawn in the
case such a quickbutton was pressed.
- Parameters:
gm
- newNode
- The node (modelelement) created by pressing the quickbutton- Returns:
- Object The new edge
createEdgeLeft
protected java.lang.Object createEdgeLeft(org.tigris.gef.graph.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. This method returns the edge (modelelement) that should be drawn in the
case such a quickbutton was pressed.
- Parameters:
gm
- newNode
- The node (modelelement) created by pressing the quickbutton- Returns:
- Object The new edge
createEdgeRight
protected java.lang.Object createEdgeRight(org.tigris.gef.graph.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. This method returns the edge (modelelement) that should be drawn in the
case such a quickbutton was pressed.
- Parameters:
gm
- newNode
- The node (modelelement) created by pressing the quickbutton- Returns:
- Object The new edge
createEdgeUnder
protected java.lang.Object createEdgeUnder(org.tigris.gef.graph.MutableGraphModel gm,
java.lang.Object newNode)
- Subclasses should override this method if they want to provide a quickbutton under
the _content fig. This method returns the edge (modelelement) that should be drawn in the
case such a quickbutton was pressed.
- Parameters:
gm
- newNode
- The node (modelelement) created by pressing the quickbutton- Returns:
- Object The new edge
createEdgeToSelf
protected java.lang.Object createEdgeToSelf(org.tigris.gef.graph.MutableGraphModel gm)
- Subclasses should override this method if they want to provide a quickbutton for
selfassociation. This method returns the edge (modelelement) that should be drawn in the
case such a quickbutton was pressed.
- Parameters:
gm
- - Returns:
- Object The new edge