|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--edu.neu.ccs.gui.DisplayPanel
|
+--edu.neu.ccs.gui.ComponentWrapper
Wrapper for a single component
that uses a AlignedLayout and
faithfully respects minimum, maximum, and preferred sizes.
DisplayWrapper,
TypedViewWrapper,
GeneralViewWrapper,
Serialized Form| Field Summary | |
protected edu.neu.ccs.gui.ComponentWrapper.WrappedComponent |
wrapper
The wrapper object which wraps component. |
| Fields inherited from class edu.neu.ccs.gui.DisplayPanel |
background, codec, CODEC |
| 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.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 |
| 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 | |
ComponentWrapper(Component component)
Constructs a wrapper for the given component. |
|
ComponentWrapper(Component component,
int alignment)
Constructs a wrapper for the given component using the given alignment. |
|
| Method Summary | |
int |
getAlignment()
Returns the alignment for this wrapper. |
Dimension |
getMaximumSize()
Returns the maximum size for the wrapped component. |
Dimension |
getMinimumSize()
Returns the minimum size for the wrapped component. |
Dimension |
getPreferredSize()
Returns the preferred size for the wrapped component. |
Component |
getWrappedComponent()
Returns the wrapped component. |
void |
setAbsoluteSize(Dimension size)
Sets the minimum, maximum, and preferred sizes for the wrapped component to the given Dimension. |
void |
setAbsoluteSize(int width,
int height)
Sets the minimum, maximum, and preferred sizes for the wrapped component to the given width and height. |
void |
setAlignment(int alignment)
Sets the alignment for this wrapper to the alignment designated by the given value. |
void |
setEnabled(boolean isEnabled)
Sets whether or not this wrapper and its wrapped component are enabled. |
void |
setMaximumSize(Dimension size)
Sets the maximum size for the wrapped component to a copy of the given Dimension. |
void |
setMaximumSize(int width,
int height)
Sets the maximum size for the wrapped component to the given width and height. |
void |
setMinimumSize(Dimension size)
Sets the minimum size for the wrapped component to a copy of the given Dimension. |
void |
setMinimumSize(int width,
int height)
Sets the minimum size for the wrapped component to the given width and height. |
void |
setPreferredSize(Dimension size)
Sets the preferred size for the wrapped component to the given Dimension. |
void |
setPreferredSize(int width,
int height)
Sets the preferred size for the wrapped component to the given width and height. |
void |
setWrappedComponent(Component component)
Sets the wrapped component to the given component. |
| Methods inherited from class edu.neu.ccs.gui.DisplayPanel |
add, add, add, add, add, addObject, addObject, addObject, addObject, dataMalformed, endAlert, frame, frame, frame, frame, frame, frame, generalDialog, generalDialog, generalDialog, generalDialog, getCodec, getDefaultViewState, getViewState, makeComponent, OKCancelDialog, OKCancelDialog, OKDialog, OKDialog, refreshComponent, remove, remove, removeAll, reset, setCodec, setDefaultViewState, setViewState, startAlert, uniformizeHeight, uniformizeSize, uniformizeWidth, YesNoCancelDialog, YesNoCancelDialog |
| 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 edu.neu.ccs.gui.ComponentWrapper.WrappedComponent wrapper
| Constructor Detail |
public ComponentWrapper(Component component)
component - the component to be wrapped
NullPointerException - if the given component is null
public ComponentWrapper(Component component,
int alignment)
component - the component to be wrappedalignment - the alignment for this wrapper
NullPointerException - if the given component is null| Method Detail |
public void setEnabled(boolean isEnabled)
setEnabled in interface DisplayablesetEnabled in class DisplayPanelisEnabled - whether or not this wrapper
and its wrapped component are enabledDisplayablepublic void setWrappedComponent(Component component)
component - the component to be wrapped
NullPointerException - if the given component is nullgetWrappedComponent()public Component getWrappedComponent()
setWrappedComponent(Component)public void setAbsoluteSize(Dimension size)
Dimension.
If the given Dimension is null,
the current minimum, maximum, and preferred sizes
are not changed.
If either the width or height
of the given Dimension is negative,
it is set to zero.
size - the new minimum, maximum, and preferred sizesetAbsoluteSize(int, int)
public void setAbsoluteSize(int width,
int height)
width - the new minimum, maximum, and preferred widthheight - the new minimum, maximum, and preferred heightsetAbsoluteSize(Dimension)public void setMinimumSize(Dimension size)
Dimension.
If the given Dimension is null,
the minimum size is set to a Dimension
with zero width and height.
If the width or the height of the given minimum size
is greater than the corresponding component of the
maximum size then the maximum size is adjusted.
setMinimumSize in class JComponentsize - the new minimum sizesetMinimumSize(int, int),
getMinimumSize()
public void setMinimumSize(int width,
int height)
width - the new minimum widthheight - the new minimum heightsetMinimumSize(Dimension),
getMinimumSize()public Dimension getMinimumSize()
getMinimumSize in class JComponentsetMinimumSize(int, int),
setMinimumSize(Dimension)public void setMaximumSize(Dimension size)
Dimension.
If the given Dimension is null,
the maximum size is set to a Dimension
with the maximum width and height
representable by int values.
If the width or the height of the given maximum size
is smaller than the corresponding component of the
minimum size then the minimum size is adjusted.
setMaximumSize in class JComponentsize - the new maximum sizesetMaximumSize(int, int),
getMaximumSize()
public void setMaximumSize(int width,
int height)
width - the new maximum widthheight - the new maximum heightsetMaximumSize(Dimension),
getMaximumSize()public Dimension getMaximumSize()
getMaximumSize in class JComponentsetMaximumSize(int, int),
setMaximumSize(Dimension)public void setPreferredSize(Dimension size)
Dimension.
If the given preferred size is null,
the current preferred size is not changed.
The given preferred size will be restricted by the
current minimum and maximum sizes for the wrapped
component when the parent container for this
wrapper is laid out.
setPreferredSize in class JComponentsize - the new preferred sizesetPreferredSize(int, int),
getPreferredSize()
public void setPreferredSize(int width,
int height)
width - the new preferred widthheight - the new preferred heightsetPreferredSize(Dimension),
getPreferredSize()public Dimension getPreferredSize()
getPreferredSize in class JComponentsetPreferredSize(int, int),
setPreferredSize(Dimension)public void setAlignment(int alignment)
AlignedLayout,
this operation does nothing.
alignment - the alignment for this wrappergetAlignment(),
JPTConstants.DEFAULTpublic int getAlignment()
AlignedLayout,
this operation returns -1.
setAlignment(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||