|
||||||||||
| 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.TablePanel
edu.neu.ccs.gui.SwatchNamePair
Class SwatchNamePair provides a component with a
paint swatch and its name. The swatch has the default size and
border.
This class extends TablePanel for implementation
reasons only. The user should not add or remove items from this
table or change its settings in any way.
| 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 | |
private JLabel |
label
The label. |
private String |
name
The paint name. |
private Paint |
paint
The paint. |
private PaintSwatch |
swatch
The paint swatch. |
| Fields inherited from class edu.neu.ccs.gui.TablePanel |
DEFAULT_ALIGNMENT, DEFAULT_ORIENTATION, tg |
| 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 | |
SwatchNamePair(Paint paint,
String name)
This constructor provides the paint to define the swatch and its name. |
|
SwatchNamePair(String name)
This constructor provides a color name and locates the corresponding color using the method Colors.getColorFromName. |
|
| Method Summary | |
private void |
initialize(Paint paint,
String name)
Private initialization method. |
Paint |
toPaint()
Returns the encapsulated paint. |
String |
toString()
Returns the encapsulated paint name. |
PaintSwatch |
toSwatch()
Returns the encapsulated paint swatch. |
| 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 |
private Paint paint
private String name
private PaintSwatch swatch
private JLabel label
| Constructor Detail |
public SwatchNamePair(String name)
Colors.getColorFromName.
Throws NullPointerException if the given name
is null or if the value returned from the method
Colors.getColorFromName is null.
name - the name of the color from the Colors
class
public SwatchNamePair(Paint paint,
String name)
Throws NullPointerException if the given paint
or the given name is null.
paint - the paint to define the swatchname - the name of the paint| Method Detail |
private void initialize(Paint paint,
String name)
null parameters
public Paint toPaint()
Returns the encapsulated paint.
public String toString()
Returns the encapsulated paint name.
public PaintSwatch toSwatch()
Returns the encapsulated paint swatch.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||