JHotDraw 7.1

org.jhotdraw.draw
Class GroupFigure

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.draw.AbstractFigure
          extended by org.jhotdraw.draw.AbstractCompositeFigure
              extended by org.jhotdraw.draw.GroupFigure
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CompositeFigure, Figure, DOMStorable
Direct Known Subclasses:
ODGGroupFigure, SVGGroupFigure

public class GroupFigure
extends AbstractCompositeFigure

A Figure that groups a collection of figures.

Version:
2.0 2006-01-14 Changed to support double precison coordinates.
1.0 2003-12-01 Derived from JHotDraw 5.4b1.
Author:
Werner Randelshofer
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jhotdraw.draw.AbstractCompositeFigure
AbstractCompositeFigure.EventHandler
 
Field Summary
 
Fields inherited from class org.jhotdraw.draw.AbstractCompositeFigure
cachedBounds, cachedDrawingArea, children, eventHandler, layouter
 
Fields inherited from class org.jhotdraw.draw.AbstractFigure
changingDepth, listenerList
 
Fields inherited from class org.jhotdraw.beans.AbstractBean
propertySupport
 
Fields inherited from interface org.jhotdraw.draw.CompositeFigure
LAYOUT_INSETS
 
Constructor Summary
GroupFigure()
          Creates a new instance.
 
Method Summary
 boolean canConnect()
          Checks if this figure can be connected.
 java.awt.geom.Point2D.Double chop(java.awt.geom.Point2D.Double from)
          This is a default implementation that chops the point at the rectangle returned by getBounds() of the figure.
 
Methods inherited from class org.jhotdraw.draw.AbstractCompositeFigure
add, add, addAll, addAll, addCompositeFigureListener, addNotify, basicAdd, basicAdd, basicAddAll, basicRemove, basicRemoveAll, basicRemoveAllChildren, basicRemoveChild, clone, contains, contains, createEventHandler, createHandles, draw, findChild, findChildIndex, findFigureInside, fireFigureAdded, fireFigureRemoved, getAttribute, getAttributes, getAttributesRestoreData, getBounds, getChild, getChildCount, getChildren, getChildrenFrontToBack, getDecomposition, getDrawingArea, getLayouter, getPreferredSize, getTransformRestoreData, indexOf, invalidate, layout, read, remove, removeAll, removeAllChildren, removeChild, removeCompositeFigureListener, removeNotify, restoreAttributesTo, restoreTransformTo, sendToBack, sendToFront, setAttribute, setBounds, setLayouter, transform, validate, write
 
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, basicClone, changed, findCompatibleConnector, findConnector, fireAreaInvalidated, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureHandlesChanged, fireFigureRemoved, fireFigureRequestRemove, fireUndoableEditHappened, getActions, getChangingDepth, getConnectors, getCursor, getDrawing, getEndPoint, getFontRenderContext, getLayer, getLock, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isChanging, isRemovable, isSelectable, isTransformable, isVisible, remap, remap, removeFigureListener, requestRemove, setBounds, setRemovable, setSelectable, setTransformable, setVisible, toString, willChange
 
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jhotdraw.draw.Figure
addFigureListener, changed, findCompatibleConnector, findConnector, getActions, getConnectors, getCursor, getEndPoint, getLayer, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, requestRemove, willChange
 

Constructor Detail

GroupFigure

public GroupFigure()
Creates a new instance.

Method Detail

canConnect

public boolean canConnect()
Description copied from class: AbstractFigure
Checks if this figure can be connected. By default AbstractFigures can be connected.

Specified by:
canConnect in interface Figure
Overrides:
canConnect in class AbstractFigure

chop

public java.awt.geom.Point2D.Double chop(java.awt.geom.Point2D.Double from)
This is a default implementation that chops the point at the rectangle returned by getBounds() of the figure.

Figures which have a non-rectangular shape need to override this method.

FIXME Invoke chop on each child and return the closest point.


Copyright 1996-2007 (c) JHotDraw.org.
Some rights reserved.