org.argouml.uml.diagram.ui
Class FigTextGroup

java.lang.Object
  extended by FigGroup
      extended by org.argouml.uml.diagram.ui.ArgoFigGroup
          extended by org.argouml.uml.diagram.ui.FigTextGroup
All Implemented Interfaces:
java.awt.event.MouseListener, java.util.EventListener, ArgoFig

public class FigTextGroup
extends ArgoFigGroup
implements java.awt.event.MouseListener

Custom class to group FigTexts in such a way that they don't overlap and that the group is shrinked to fit (no whitespace in group).


Field Summary
 
Fields inherited from interface org.argouml.uml.diagram.ui.ArgoFig
DEBUG, DEBUG_COLOR, FILL_COLOR, INVISIBLE_LINE_COLOR, LINE_COLOR, LINE_WIDTH, ROWHEIGHT, SOLID_FILL_COLOR, STEREOHEIGHT, TEXT_COLOR, X0, Y0
 
Constructor Summary
FigTextGroup(java.lang.Object owner, DiagramSettings settings)
          Construct a FigGroup with the given render settings.
 
Method Summary
 void addFig(Fig f)
          Adds a FigText to the list with figs.
 void calcBounds()
           
 boolean contains(int x, int y)
          Returns true if the bounds of the group contain the given point.
 void deleteFromModel()
           
 boolean hit(java.awt.Rectangle r)
          Checks to see if the given click point (Rectangle) hits the FigTextGroup.
 void mouseClicked(java.awt.event.MouseEvent me)
          Handle mouse click.
 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 removeFromDiagram()
           
 
Methods inherited from class org.argouml.uml.diagram.ui.ArgoFigGroup
getProject, getSettings, renderingChanged, setOwner, setProject, setSettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FigTextGroup

public FigTextGroup(java.lang.Object owner,
                    DiagramSettings settings)
Construct a FigGroup with the given render settings.

Parameters:
owner - owning UML element
settings - rendering settings.
Method Detail

addFig

public void addFig(Fig f)
Adds a FigText to the list with figs. Makes sure that the figtexts do not overlap.


calcBounds

public void calcBounds()

removeFromDiagram

public void removeFromDiagram()

deleteFromModel

public void deleteFromModel()

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Handle mouse click. If the user double clicks on any part of this FigGroup, pass it down to one of the internal Figs. This allows the user to initiate direct text editing.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

hit

public boolean hit(java.awt.Rectangle r)
Checks to see if the given click point (Rectangle) hits the FigTextGroup. This overrides the FigGroup implementation of hit where the hit rectangle must hit a sub fig. Now, we count a hit if the user clicks anywhere within the outer bounds of the FigTextGroup, see issue 5620. This method is important for registering double clicks to edit text boxes in a FigTextGroup.

Parameters:
r - The hit rectangle.
Returns:
True if the given hit rectangle intersects or is contained by the outer limits of this FigTextGroup.
See Also:
org.tigris.gef.presentation.FigGroup#hit(java.awt.Rectangle)

contains

public boolean contains(int x,
                        int y)
Returns true if the bounds of the group contain the given point. Used to check if a mouse click occurs within the FigTextGroup. Overrides the FigGroup implementation of contains where the x, y point must hit a sub fig. Now we count a hit if the user clicks anywhere within the outer bounds of the FigTextGroup, see issue 5620. This method is important for handling mousePressed events including the start of mouse drags.

Parameters:
x - The x coordinate of the point to test.
y - The y coordinate of the point to test.
Returns:
True if the given point is within the outer limits of this FigTextGroup.
See Also:
org.tigris.gef.presentation.FigGroup#contains(int, int)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook