org.greenstone.gs3client
Class ColourCombo

java.lang.Object
  extended by org.greenstone.gs3client.ColourCombo

public class ColourCombo
extends java.lang.Object

Background and selection color combinations for the Java-Client's interface. Stores Greenstone, Fedora and default colour combinations and has methods for converting colours of items.

Author:
ak19

Nested Class Summary
static interface ColourCombo.ColourChangeable
          Interface ColourChangeable defines one method, changeUIColour(), which classes whose user-interface colours can change may implement.
 
Field Summary
(package private) static java.awt.Color background
          Fixed background colour for textareas, editorPanes (html)
(package private) static java.awt.Color blue
          Fedora dark background colour
protected static ColourCombo current
          The colour combination currently being used in the interface
 java.awt.Color dark
          background colours for panels, labels
static ColourCombo defaultColors
          System default greys
static ColourCombo fedoraColors
          Fedora's colour combinations of blue
(package private) static java.awt.Color green
          Greenstone dark background colour
static ColourCombo greenstoneColors
          Greenstone greens
(package private) static java.awt.Color grey
          Default background colour
 java.awt.Color light
          background colours for comboboxes, lists, textfields, textareas
(package private) static java.awt.Color lightBlue
          Fedora light background colour
(package private) static java.awt.Color lightGreen
          Greenstone light background colour
(package private) static java.awt.Color transparent
          Greenstone transparent background colour.
(package private) static java.awt.Color yellow
          Selection colour for Fedora and Greenstone
 
Constructor Summary
ColourCombo(java.awt.Color dark, java.awt.Color light)
          Constructor to create a ColourCombo combination of colours
 
Method Summary
static void changeAncestorColor(java.awt.Component c)
          Given a component, sets its ancestors to the dark colour setting.
static void changeColor(java.awt.Component c)
          Given a Component, sets its background colours to a dark or light colour setting as appropriate.
static void changeColor(java.awt.Component[] leafComponents)
          Given an array of components, sets their background colours to a dark or light colour setting as appropriate.
static ColourCombo getCurrentCombo()
           
protected static boolean isLightColor(java.awt.Component c)
           
static void setColour(int DL)
          Sets the active colour combination based on the value of DL.
static void setCurrentCombo(ColourCombo c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transparent

static final java.awt.Color transparent
Greenstone transparent background colour. Useful for trees' text backgrounds which otherwise default to white even when the tree background is not white. Alpha value=0 for transparency


green

static final java.awt.Color green
Greenstone dark background colour


lightGreen

static final java.awt.Color lightGreen
Greenstone light background colour


blue

static final java.awt.Color blue
Fedora dark background colour


lightBlue

static final java.awt.Color lightBlue
Fedora light background colour


yellow

static final java.awt.Color yellow
Selection colour for Fedora and Greenstone


grey

static final java.awt.Color grey
Default background colour


background

static final java.awt.Color background
Fixed background colour for textareas, editorPanes (html)


dark

public final java.awt.Color dark
background colours for panels, labels


light

public final java.awt.Color light
background colours for comboboxes, lists, textfields, textareas


defaultColors

public static final ColourCombo defaultColors
System default greys


greenstoneColors

public static final ColourCombo greenstoneColors
Greenstone greens


fedoraColors

public static final ColourCombo fedoraColors
Fedora's colour combinations of blue


current

protected static ColourCombo current
The colour combination currently being used in the interface

Constructor Detail

ColourCombo

public ColourCombo(java.awt.Color dark,
                   java.awt.Color light)
Constructor to create a ColourCombo combination of colours

Parameters:
dark - is the colour to set JPanels to.
light - is the colour to set comboboxes, lists and non-editable textfields to.
Method Detail

getCurrentCombo

public static ColourCombo getCurrentCombo()

setCurrentCombo

public static void setCurrentCombo(ColourCombo c)

setColour

public static void setColour(int DL)
Sets the active colour combination based on the value of DL.

Parameters:
DL - represents the current digital library. Values can be GS3JavaClient.GREENSTONE, GS3JavaClient.FEDORA, GS3JavaClient.SELECT. Anything else and it defaults to GS3JavaClient.SELECT as well.

isLightColor

protected static boolean isLightColor(java.awt.Component c)
Parameters:
c - is the Component for which it is to be determined whether it should be a lighter or darker colour.
Returns:
true if Component c should be a lighter colour (returns true for non-editable JTextFields)

changeColor

public static void changeColor(java.awt.Component[] leafComponents)
Given an array of components, sets their background colours to a dark or light colour setting as appropriate.

Parameters:
leafComponents - is the array of components whose background colours are to change.

changeColor

public static void changeColor(java.awt.Component c)
Given a Component, sets its background colours to a dark or light colour setting as appropriate.

Parameters:
c - is the component whose background colours are to change.

changeAncestorColor

public static void changeAncestorColor(java.awt.Component c)
Given a component, sets its ancestors to the dark colour setting.

Parameters:
c - is the component whose ancestors' background colours are to be set.