|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.neu.ccs.gui.DisplayPanel
edu.neu.ccs.gui.ZooContainer
edu.neu.ccs.gui.ZooGroup
Associative collection of components contained
within a .
Groups may be nested to an arbitrary depth.Zoo
By default, a group has a transparent background and its bounds are determined by the union of the bounds for the components it groups. When a group is resized, its contained components are scaled accordingly so that they maintain the same relative size and location within the group. The minimum and maximum sizes for a group are determined by minimum and maximum scaling factors that can be applied to the contained components without violating the minimum and maximum sizes for any of the contained components.
This panel assumes an AbsoluteLayout.
Behavior is undefined if this panel is set to have a layout
other than an AbsoluteLayout.
A grouped component resized through direct manipulation will appear to scale in size as the group is resized, whether or not the component will actually scale in size when the resize is completed. If the parent container for the grouped component does not scale its contents, the grouped component will snap back to its original size when the resize is completed.
Zoo,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
protected Dimension |
oldSize
Previous size of the group before a direct manipulation resize was initiated. |
protected AffineTransform |
transform
Temporary transform applied to the graphics context for this group during a direct manipulation resize. |
| Fields inherited from class edu.neu.ccs.gui.DisplayPanel |
background, codec, CODEC |
| Fields inherited from class javax.swing.JPanel |
|
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface edu.neu.ccs.gui.Displayable |
DEFAULT_VIEW_STATE, VIEW_STATE |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
ZooGroup(Vector v)
Creates a new group containing the given vector of components. |
|
| Method Summary | |
void |
addNotify()
Called when the native peer for this group is created. |
protected Dimension |
calculateMaximumSize()
Returns the minimum size for this group, calculated from its current size and the smallest ratio of maximum size to current size among the contained components. |
protected Dimension |
calculateMinimumSize()
Returns the minimum size for this group, calculated from its current size and the largest ratio of minimum size to current size among the contained components. |
(package private) void |
endResize()
Completes a direct manipulation resize. |
private Rectangle |
getBoundingBox(Component[] c)
Returns the union of the bounds of the given components. |
void |
paint(Graphics g)
Paints this group to the given graphics context. |
private void |
revalidate(Component c)
Revalidates the given component, if appropriate. |
void |
setBounds(int x,
int y,
int width,
int height)
Sets the bounds of this group to the given position, width and height. |
void |
setBounds(Rectangle bounds)
Sets the bounds of this group to the given rectangle. |
private void |
setBoundsImpl(int x,
int y,
int width,
int height)
Resizes this group and its contained components. |
void |
setLocation(int x,
int y)
Sets the location of this group to the given position. |
void |
setLocation(Point p)
Sets the location of this group to the given point. |
void |
setSize(Dimension size)
Sets the size of this group to the given dimension. |
void |
setSize(int width,
int height)
Sets the size of this group to the given width and height. |
(package private) void |
startResize()
Initiates a direct manipulation resize. |
private void |
updateBoundsRestrictions()
Updates the stored minimum and maximum sizes for this group. |
| Methods inherited from class edu.neu.ccs.gui.ZooContainer |
addChildItem, addChildItem, bringToFront, findChildItemAt, findChildItemAt, findItemAt, findItemAt, getAncestorZoo, getChildItem, getChildItemCount, getChildItems, getItem, getItemCount, getItems, getParentContainer, getRootZoo, group, inverseGetChildItem, inverseGetItem, isFocusTraversable, isManagingFocus, moveDown, moveToZOrder, moveUp, nextDeeperInZOrder, nextHigherInZOrder, removeAllItems, removeChildItem, removeChildItem, sendToBack, ungroup |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Dimension oldSize
protected AffineTransform transform
| Constructor Detail |
public ZooGroup(Vector v)
v - a vector of components to group| Method Detail |
public void setLocation(int x,
int y)
x - the x-coordinate of the desired positiony - the y-coordinate of the desired positionsetLocation(Point)public void setLocation(Point p)
p - the desired pointsetLocation(int, int)
public void setSize(int width,
int height)
width - the width of the desired sizeheight - the height of the desired sizesetSize(Dimension)public void setSize(Dimension size)
size - the desired sizesetSize(int, int)
public void setBounds(int x,
int y,
int width,
int height)
x - the x-coordinate of the desired positiony - the y-coordinate of the desired positionwidth - the width of the desired sizeheight - the height of the desired sizesetBounds(Rectangle)public void setBounds(Rectangle bounds)
bounds - the desired boundssetBounds(int, int, int, int)public void addNotify()
public void paint(Graphics g)
g - the graphics context to which to paintprotected Dimension calculateMinimumSize()
calculateMaximumSize()protected Dimension calculateMaximumSize()
calculateMinimumSize()void startResize()
void endResize()
private void updateBoundsRestrictions()
private void setBoundsImpl(int x,
int y,
int width,
int height)
private Rectangle getBoundingBox(Component[] c)
private void revalidate(Component c)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||