PamView
Class PamColors

java.lang.Object
  extended by PamView.PamColors
All Implemented Interfaces:
PamSettings

public class PamColors
extends java.lang.Object
implements PamSettings

Author:
Doug Gillespie Some standard colours to use for various bits of a view.

Ultimately, it should bepossible to set these dynamically during operation or have night / day settings, etc.

Any bit of the display can register with a single instance of PamColors and it will then receive notifications whenever any of the colours change.


Nested Class Summary
(package private)  class PamColors.menuColorDay
           
(package private)  class PamColors.menuColorNight
           
static class PamColors.PamColor
           
 
Field Summary
private  java.awt.Color axis
           
private static java.awt.Font boldFont
           
private  java.awt.Color[] channelColors
           
private  ColorSettings colorSettings
           
private  MenuItemEnabler dayMenuEnabler
           
private  java.awt.Color grid
           
private  java.awt.Color[] lineColors
           
private  java.awt.Color mapColor
           
private  MenuItemEnabler nightMenuEnabler
           
 int NWHALECOLORS
           
private  java.awt.Color pamBorder
           
private  java.awt.Color pamPlotWindow
           
private  java.awt.Color pamWarningBorder
           
private  java.awt.Color plain
           
private static PamColors singleInstance
           
private  java.awt.Color[] whaleColors
           
 
Constructor Summary
private PamColors()
           
 
Method Summary
 java.awt.Font getBoldFont()
           
 java.awt.Color getChannelColor(int iChan)
           
 java.awt.Color getColor(PamColors.PamColor col)
           
 ColorSettings getColorSettings()
           
 java.awt.Color getForegroudColor(PamColors.PamColor col)
           
static PamColors getInstance()
           
 javax.swing.JMenuItem getMenu()
           
 java.io.Serializable getSettingsReference()
           
 long getSettingsVersion()
           
 java.lang.String getUnitName()
           
 java.lang.String getUnitType()
           
 java.awt.Color getWhaleColor(int col)
           
private  void notifyAllComponents()
           
 void notifyContianer(java.awt.Container container)
          Tells a container to set it's colour and the colour of all it's components if they implement the ColorManaged interface.
 void notifyModelChanged(int changeType)
           
 boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
           
 void setColor(java.awt.Component component, PamColors.PamColor col)
          Color a component immediately.
private  void setColorManagedColor(java.awt.Component c)
           
 void setColors()
           
 void setDayTime()
           
 void setNightTime()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleInstance

private static PamColors singleInstance

pamBorder

private java.awt.Color pamBorder

pamWarningBorder

private java.awt.Color pamWarningBorder

pamPlotWindow

private java.awt.Color pamPlotWindow

plain

private java.awt.Color plain

axis

private java.awt.Color axis

grid

private java.awt.Color grid

channelColors

private java.awt.Color[] channelColors

lineColors

private java.awt.Color[] lineColors

mapColor

private java.awt.Color mapColor

NWHALECOLORS

public final int NWHALECOLORS
See Also:
Constant Field Values

whaleColors

private java.awt.Color[] whaleColors

nightMenuEnabler

private MenuItemEnabler nightMenuEnabler

dayMenuEnabler

private MenuItemEnabler dayMenuEnabler

colorSettings

private ColorSettings colorSettings

boldFont

private static java.awt.Font boldFont
Constructor Detail

PamColors

private PamColors()
Method Detail

getMenu

public javax.swing.JMenuItem getMenu()

setNightTime

public void setNightTime()

setDayTime

public void setDayTime()

getInstance

public static PamColors getInstance()

notifyModelChanged

public void notifyModelChanged(int changeType)

setColors

public void setColors()

notifyAllComponents

private void notifyAllComponents()

notifyContianer

public void notifyContianer(java.awt.Container container)
Tells a container to set it's colour and the colour of all it's components if they implement the ColorManaged interface.

Generally this should be called initially for each frame to start the iteration through all the swing components.

Parameters:
container - container / or frame to start searching from

setColorManagedColor

private void setColorManagedColor(java.awt.Component c)

setColor

public void setColor(java.awt.Component component,
                     PamColors.PamColor col)
Color a component immediately.

Parameters:
component -
col -

getColor

public java.awt.Color getColor(PamColors.PamColor col)

getForegroudColor

public java.awt.Color getForegroudColor(PamColors.PamColor col)

getWhaleColor

public java.awt.Color getWhaleColor(int col)

getChannelColor

public java.awt.Color getChannelColor(int iChan)

getBoldFont

public java.awt.Font getBoldFont()

getSettingsReference

public java.io.Serializable getSettingsReference()
Specified by:
getSettingsReference in interface PamSettings
Returns:
The serialisable object that will be stored

getSettingsVersion

public long getSettingsVersion()
Specified by:
getSettingsVersion in interface PamSettings
Returns:
An integer version number for the settings

getUnitName

public java.lang.String getUnitName()
Specified by:
getUnitName in interface PamSettings
Returns:
A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.

getUnitType

public java.lang.String getUnitType()
Specified by:
getUnitType in interface PamSettings
Returns:
A Name specific to the type, e.g. Glick detector

restoreSettings

public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
Specified by:
restoreSettings in interface PamSettings
Returns:
true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required

getColorSettings

public ColorSettings getColorSettings()