|
||||||||||
| 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.VisualColorList
Class VisualColorList displays the named colors as defined
in class Colors using a square color swatch and a label. The
programmer has some control of the swatch size and pane height. This
class is intended to provide color information not as a GUI control.
| Field Summary |
| 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.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 edu.neu.ccs.gui.Displayable |
DEFAULT_VIEW_STATE, VIEW_STATE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
VisualColorList()
The constructor that creates a VisualColorList using a
swatch size of 20 and a pane height of 720. |
|
VisualColorList(int swatchSize)
The constructor that creates a VisualColorList using a
the given swatch size and a maximum pane height of 720. |
|
VisualColorList(int swatchSize,
int paneHeight)
The constructor that creates a VisualColorList using a
the given swatch size and the given maximum pane height. |
|
| Method Summary | |
static void |
showVisualColorList()
This static convenience method makes a default VisualColorList
panel and displays the panel in a frame. |
| 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, setEnabled, 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 |
| Constructor Detail |
public VisualColorList()
The constructor that creates a VisualColorList using a
swatch size of 20 and a pane height of 720.
Assuming the label font size is not too large, the vertical spacing of the color swatch blocks will be 20 + 10 = 30. This means that 720 / 30 = 24 colors will be visible at one time.
public VisualColorList(int swatchSize)
The constructor that creates a VisualColorList using a
the given swatch size and a maximum pane height of 720.
The swatch size will be forced to the range 20-50 before usage.
Assuming the label font size is not too large, the vertical spacing of the color swatch blocks will be (swatchSize + 10). This means that 720 / (swatchSize + 10) colors will be visible at one time.
In particular, if the swatch size is set to its minimum of 20, then 24 colors will be visible at one time.
swatchSize - the desired swatch size
public VisualColorList(int swatchSize,
int paneHeight)
The constructor that creates a VisualColorList using a
the given swatch size and the given maximum pane height.
The swatch size will be forced to the range 20-50 before usage.
The pane height will be forced to the range 120-720 before usage.
Assuming the label font size is not too large, the vertical spacing of the color swatch blocks will be (swatchSize + 10). This means that paneHeight / (swatchSize + 10) colors will be visible at one time.
swatchSize - the desired swatch sizepaneHeight - the desired pane height| Method Detail |
public static void showVisualColorList()
This static convenience method makes a default VisualColorList
panel and displays the panel in a frame.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||