|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectColorPair
public final class ColorPair
A background/foreground colour-pair.
Nested Class Summary | |
---|---|
static class |
ColorPair.X
Colour-pair utilities. |
Field Summary | |
---|---|
Color |
background
The background colour. |
Color |
foreground
The foreground colour. |
Constructor Summary | |
---|---|
ColorPair()
Creates a ColorPair, initially with null values. |
|
ColorPair(Color background,
Color foreground)
Creates a ColorPair. |
|
ColorPair(Component component)
Creates a ColorPair, initialized from a component. |
Method Summary | |
---|---|
ColorPair |
clone()
|
boolean |
equals(Object o)
Returns true iff both colours are equal. |
Color |
getBackground()
Returns the background colour. |
Color |
getForeground()
Returns the foreground colour. |
void |
invert()
Interchanges background and foreground. |
void |
setBackground(Color newBackground)
Sets the background colour, per getBackground(). |
void |
setForeground(Color newForeground)
Sets the foreground colour, per getForeground(). |
void |
setFromComponent(Component component)
Sets the colour-pair from the background and foreground of a component. |
void |
setOnComponent(Component component)
Sets the component background and foreground to the colour-pair. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Color background
public Color foreground
Constructor Detail |
---|
public ColorPair()
public ColorPair(Color background, Color foreground)
background
- per getBackground()foreground
- per getForeground()public ColorPair(Component component)
component
- per setFromComponent()Method Detail |
---|
public Color getBackground()
public void setBackground(Color newBackground)
public Color getForeground()
public void setForeground(Color newForeground)
public void invert()
public void setFromComponent(Component component)
public void setOnComponent(Component component)
public ColorPair clone()
clone
in class Object
public boolean equals(Object o)
equals
in class Object
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |