de.muntjak.tinylookandfeel.util
Class SBReference

java.lang.Object
  extended by de.muntjak.tinylookandfeel.util.SBReference
Direct Known Subclasses:
HSBReference

public class SBReference
extends java.lang.Object

SBReference describes a (mutable) color, specified by a reference color and values for brightness and saturation.


Field Summary
static int ABS_COLOR
           
protected static de.muntjak.tinylookandfeel.util.SBReference.ColorIcon absoluteIcon
           
static int BACK_COLOR
           
protected  int bri
           
protected  javax.swing.plaf.ColorUIResource color
           
static int DIS_COLOR
           
static int FRAME_COLOR
           
protected  de.muntjak.tinylookandfeel.util.SBReference.ColorIcon icon
           
protected  boolean locked
           
static int MAIN_COLOR
           
protected  int ref
           
protected  javax.swing.plaf.ColorUIResource referenceColor
           
protected  int sat
           
static int SUB1_COLOR
           
static int SUB2_COLOR
           
static int SUB3_COLOR
           
static int SUB4_COLOR
           
static int SUB5_COLOR
           
static int SUB6_COLOR
           
static int SUB7_COLOR
           
static int SUB8_COLOR
           
 
Constructor Summary
SBReference()
          Constructor for font colors and super constructor for HSBReferences.
SBReference(boolean dummy)
          Super constructor for HSBReference copy constructor.
SBReference(java.awt.Color c, int sat, int bri, int ref)
          Called from Theme.initData()
SBReference(java.awt.Color c, int sat, int bri, int ref, boolean locked)
          Constructor for our 4 locked color references.
SBReference(SBReference other)
          Copy constructor.
 
Method Summary
 SBReference copy()
          Returns a copy of this SBReference and additionally stores the color reference (if any).
 javax.swing.Icon getAbsoluteIcon()
           
 int getBrightness()
           
 javax.swing.plaf.ColorUIResource getColor()
           
 javax.swing.Icon getIcon()
           
static int getNumReferences(int ref)
           
 int getReference()
           
 javax.swing.plaf.ColorUIResource getReferenceColor()
           
static javax.swing.plaf.ColorUIResource getReferencedColor(int ref)
           
 java.lang.String getReferenceString()
           
 int getSaturation()
           
 boolean isAbsoluteColor()
           
 boolean isLocked()
           
 boolean isReferenceColor()
           
 void load(java.io.DataInputStream in)
           
static void loadDummyData(java.io.DataInputStream in)
           
static void printReferences(int ref)
           
 void reset()
           
 void save(java.io.DataOutputStream out)
           
 void setBrightness(int newBri)
           
 void setColor(java.awt.Color newColor)
           
 void setColor(int sat, int bri)
           
 void setLocked(boolean newLocked)
           
 void setReference(int newRef)
           
 void setSaturation(int newSat)
           
 java.lang.String toString()
           
 javax.swing.plaf.ColorUIResource update()
           
 void update(java.awt.Color c)
           
 void update(java.awt.Color c, int sat, int bri, int ref)
           
 void update(SBReference sb)
          Called if user pastes parameters via Copy-Paste popup.
 void update(SBReference other, java.util.Vector referenceColors)
          Updates this SBReference from values of other argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ABS_COLOR

public static final int ABS_COLOR
See Also:
Constant Field Values

MAIN_COLOR

public static final int MAIN_COLOR
See Also:
Constant Field Values

BACK_COLOR

public static final int BACK_COLOR
See Also:
Constant Field Values

DIS_COLOR

public static final int DIS_COLOR
See Also:
Constant Field Values

FRAME_COLOR

public static final int FRAME_COLOR
See Also:
Constant Field Values

SUB1_COLOR

public static final int SUB1_COLOR
See Also:
Constant Field Values

SUB2_COLOR

public static final int SUB2_COLOR
See Also:
Constant Field Values

SUB3_COLOR

public static final int SUB3_COLOR
See Also:
Constant Field Values

SUB4_COLOR

public static final int SUB4_COLOR
See Also:
Constant Field Values

SUB5_COLOR

public static final int SUB5_COLOR
See Also:
Constant Field Values

SUB6_COLOR

public static final int SUB6_COLOR
See Also:
Constant Field Values

SUB7_COLOR

public static final int SUB7_COLOR
See Also:
Constant Field Values

SUB8_COLOR

public static final int SUB8_COLOR
See Also:
Constant Field Values

color

protected javax.swing.plaf.ColorUIResource color

referenceColor

protected javax.swing.plaf.ColorUIResource referenceColor

sat

protected int sat

bri

protected int bri

ref

protected int ref

locked

protected boolean locked

icon

protected de.muntjak.tinylookandfeel.util.SBReference.ColorIcon icon

absoluteIcon

protected static de.muntjak.tinylookandfeel.util.SBReference.ColorIcon absoluteIcon
Constructor Detail

SBReference

public SBReference()
Constructor for font colors and super constructor for HSBReferences. SBReference will be added to instances vector.


SBReference

public SBReference(boolean dummy)
Super constructor for HSBReference copy constructor. This SBReference will not be added to instances vector.

Parameters:
dummy - ignored

SBReference

public SBReference(java.awt.Color c,
                   int sat,
                   int bri,
                   int ref)
Called from Theme.initData()

Parameters:
c -
sat -
bri -
ref -

SBReference

public SBReference(java.awt.Color c,
                   int sat,
                   int bri,
                   int ref,
                   boolean locked)
Constructor for our 4 locked color references.

Parameters:
c -
sat -
bri -
ref -
locked -

SBReference

public SBReference(SBReference other)
Copy constructor.

Parameters:
other -
Method Detail

copy

public SBReference copy()
Returns a copy of this SBReference and additionally stores the color reference (if any). Called if user copies parameters via Copy-Paste popup.

Returns:

getNumReferences

public static int getNumReferences(int ref)

printReferences

public static void printReferences(int ref)

update

public void update(java.awt.Color c,
                   int sat,
                   int bri,
                   int ref)

update

public void update(SBReference sb)
Called if user pastes parameters via Copy-Paste popup.

Parameters:
cr -

update

public void update(SBReference other,
                   java.util.Vector referenceColors)
Updates this SBReference from values of other argument. If the current reference color differs from the one stored in referenceColors vector, this SBReference will switch to absolute color mode.

Parameters:
other -
referenceColors -

update

public void update(java.awt.Color c)

reset

public void reset()

getColor

public javax.swing.plaf.ColorUIResource getColor()

getSaturation

public int getSaturation()

getBrightness

public int getBrightness()

getReference

public int getReference()

getReferenceColor

public javax.swing.plaf.ColorUIResource getReferenceColor()

getReferencedColor

public static javax.swing.plaf.ColorUIResource getReferencedColor(int ref)

getReferenceString

public java.lang.String getReferenceString()

setColor

public void setColor(java.awt.Color newColor)

setSaturation

public void setSaturation(int newSat)

setBrightness

public void setBrightness(int newBri)

setReference

public void setReference(int newRef)

setColor

public void setColor(int sat,
                     int bri)

update

public javax.swing.plaf.ColorUIResource update()

isAbsoluteColor

public boolean isAbsoluteColor()

isReferenceColor

public boolean isReferenceColor()

setLocked

public void setLocked(boolean newLocked)

isLocked

public boolean isLocked()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getIcon

public javax.swing.Icon getIcon()

getAbsoluteIcon

public javax.swing.Icon getAbsoluteIcon()

save

public void save(java.io.DataOutputStream out)
          throws java.io.IOException
Throws:
java.io.IOException

load

public void load(java.io.DataInputStream in)
          throws java.io.IOException
Throws:
java.io.IOException

loadDummyData

public static void loadDummyData(java.io.DataInputStream in)
                          throws java.io.IOException
Throws:
java.io.IOException