Compiere 3.1

org.compiere.plaf
Class CompiereTheme

java.lang.Object
  extended by javax.swing.plaf.metal.MetalTheme
      extended by org.compiere.plaf.CompiereTheme
Direct Known Subclasses:
CompiereThemeBlueMetal, CompiereThemeIce

public class CompiereTheme
extends MetalTheme

Compiere User definable Theme (if used in Metal L&F). In other Environments, it provides UI extensions (e.g. Error Color)

Version:
$Id: CompiereTheme.java,v 1.4 2006/07/30 00:52:23 jjanke Exp $
Author:
Jorg Janke

Field Summary
protected static ColorUIResource black
          Black
protected static FontUIResource controlFont
          Control font
protected static ColorUIResource error
          Background for fields in error
static String FONT_DEFAULT
          Default Font
static int FONT_SIZE
          Default Font Size
protected static ColorUIResource inactive
          Background for inactive fields
protected static ColorUIResource info
          Background for info fields
protected static Logger log
          Logger
protected static ColorUIResource mandatory
          Background for mandatory fields
protected static FontUIResource menuFont
          Menu font
protected static String P_CompiereColor
          Background Color
protected static ColorUIResource primary0
          Blue 51,51,102
protected static ColorUIResource primary1
          Blue 102, 102, 153
protected static ColorUIResource primary2
          Blue 153, 153, 204
protected static ColorUIResource primary3
          Blue 204, 204, 255
protected static String s_name
          Theme Name
protected static CompiereTheme s_theme
          Active Theme
protected  ColorUIResource secondary0
          Black
protected static ColorUIResource secondary1
          Gray 102, 102, 102
protected static ColorUIResource secondary2
          Gray 153, 153, 153
protected static ColorUIResource secondary3
          BlueGray 214, 224, 234 - background
protected  ColorUIResource secondary4
          White
protected static FontUIResource smallFont
          Small font
protected static FontUIResource systemFont
          System font
protected static ColorUIResource txt_error
          Foreground Text Error
protected static ColorUIResource txt_ok
          Foreground Text OK
protected static FontUIResource userFont
          User font
protected static ColorUIResource white
          White
protected static FontUIResource windowFont
          Window Title font
 
Constructor Summary
CompiereTheme()
          Constructor - nop
 
Method Summary
protected static FontUIResource _getControlTextFont()
          Control Font (plain)
protected static FontUIResource _getMenuTextFont()
          Menu
protected static FontUIResource _getSubTextFont()
          Sub Text
protected static FontUIResource _getSystemTextFont()
          System Font
protected static FontUIResource _getUserTextFont()
          User Font
protected static FontUIResource _getWindowTitleFont()
          Window Title
 ColorUIResource getBlack()
           
static String getColorAsString(Color c)
          Parses Color into String representation.
 FontUIResource getControlTextFont()
           
 FontUIResource getMenuTextFont()
           
 String getName()
          Return Theme Name
 ColorUIResource getPrimary1()
          Get Primary 1 (blue in default Metal Theme)
 ColorUIResource getPrimary2()
           
 ColorUIResource getPrimary3()
           
 ColorUIResource getSecondary0()
          Get Seconary 1 (gray in default Metal Theme)
 ColorUIResource getSecondary1()
           
 ColorUIResource getSecondary2()
           
 ColorUIResource getSecondary3()
           
 ColorUIResource getSecondary4()
           
 FontUIResource getSubTextFont()
           
 FontUIResource getSystemTextFont()
           
 FontUIResource getUserTextFont()
           
 ColorUIResource getWhite()
           
 FontUIResource getWindowTitleFont()
           
static void load()
          Load Properties from Ini
protected static ColorUIResource parseColor(String information, ColorUIResource stdColor)
          Parse Color.
static void reset()
          Reset Info in Properties
static void save()
          Save information in Properties
protected  void setDefault()
          Set Default Colors
static void setTheme()
          Set Theme to current Metal Theme and copy it
static void setTheme(MetalTheme copyFrom, boolean flat)
          Set Theme to current Metal Theme and copy it
 String toString()
          String Representation
 
Methods inherited from class javax.swing.plaf.metal.MetalTheme
addCustomEntriesToTable, getAcceleratorForeground, getAcceleratorSelectedForeground, getControl, getControlDarkShadow, getControlDisabled, getControlHighlight, getControlInfo, getControlShadow, getControlTextColor, getDesktopColor, getFocusColor, getHighlightedTextColor, getInactiveControlTextColor, getInactiveSystemTextColor, getMenuBackground, getMenuDisabledForeground, getMenuForeground, getMenuSelectedBackground, getMenuSelectedForeground, getPrimaryControl, getPrimaryControlDarkShadow, getPrimaryControlHighlight, getPrimaryControlInfo, getPrimaryControlShadow, getSeparatorBackground, getSeparatorForeground, getSystemTextColor, getTextHighlightColor, getUserTextColor, getWindowBackground, getWindowTitleBackground, getWindowTitleForeground, getWindowTitleInactiveBackground, getWindowTitleInactiveForeground
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s_name

protected static String s_name
Theme Name


log

protected static Logger log
Logger


s_theme

protected static CompiereTheme s_theme
Active Theme


primary0

protected static ColorUIResource primary0
Blue 51,51,102


primary1

protected static ColorUIResource primary1
Blue 102, 102, 153


primary2

protected static ColorUIResource primary2
Blue 153, 153, 204


primary3

protected static ColorUIResource primary3
Blue 204, 204, 255


secondary0

protected final ColorUIResource secondary0
Black


secondary1

protected static ColorUIResource secondary1
Gray 102, 102, 102


secondary2

protected static ColorUIResource secondary2
Gray 153, 153, 153


secondary3

protected static ColorUIResource secondary3
BlueGray 214, 224, 234 - background


secondary4

protected final ColorUIResource secondary4
White


black

protected static ColorUIResource black
Black


white

protected static ColorUIResource white
White


mandatory

protected static ColorUIResource mandatory
Background for mandatory fields


error

protected static ColorUIResource error
Background for fields in error


inactive

protected static ColorUIResource inactive
Background for inactive fields


info

protected static ColorUIResource info
Background for info fields


txt_ok

protected static ColorUIResource txt_ok
Foreground Text OK


txt_error

protected static ColorUIResource txt_error
Foreground Text Error


controlFont

protected static FontUIResource controlFont
Control font


systemFont

protected static FontUIResource systemFont
System font


userFont

protected static FontUIResource userFont
User font


smallFont

protected static FontUIResource smallFont
Small font


windowFont

protected static FontUIResource windowFont
Window Title font


menuFont

protected static FontUIResource menuFont
Menu font


FONT_DEFAULT

public static final String FONT_DEFAULT
Default Font

See Also:
Constant Field Values

FONT_SIZE

public static final int FONT_SIZE
Default Font Size

See Also:
Constant Field Values

P_CompiereColor

protected static final String P_CompiereColor
Background Color

See Also:
Constant Field Values
Constructor Detail

CompiereTheme

public CompiereTheme()
Constructor - nop

Method Detail

getName

public String getName()
Return Theme Name

Specified by:
getName in class MetalTheme
Returns:
Theme Name

toString

public String toString()
String Representation

Overrides:
toString in class Object
Returns:
info

setDefault

protected void setDefault()
Set Default Colors


setTheme

public static void setTheme()
Set Theme to current Metal Theme and copy it


setTheme

public static void setTheme(MetalTheme copyFrom,
                            boolean flat)
Set Theme to current Metal Theme and copy it

Parameters:
copyFrom - theme
flat - flat colors

getPrimary1

public ColorUIResource getPrimary1()
Get Primary 1 (blue in default Metal Theme)

Specified by:
getPrimary1 in class MetalTheme
Returns:
color

getPrimary2

public ColorUIResource getPrimary2()
Specified by:
getPrimary2 in class MetalTheme

getPrimary3

public ColorUIResource getPrimary3()
Specified by:
getPrimary3 in class MetalTheme

getSecondary0

public ColorUIResource getSecondary0()
Get Seconary 1 (gray in default Metal Theme)

Returns:
color

getSecondary1

public ColorUIResource getSecondary1()
Specified by:
getSecondary1 in class MetalTheme

getSecondary2

public ColorUIResource getSecondary2()
Specified by:
getSecondary2 in class MetalTheme

getSecondary3

public ColorUIResource getSecondary3()
Specified by:
getSecondary3 in class MetalTheme

getSecondary4

public ColorUIResource getSecondary4()

getBlack

public ColorUIResource getBlack()
Overrides:
getBlack in class MetalTheme

getWhite

public ColorUIResource getWhite()
Overrides:
getWhite in class MetalTheme

_getControlTextFont

protected static FontUIResource _getControlTextFont()
Control Font (plain)

Returns:
font

getControlTextFont

public FontUIResource getControlTextFont()
Specified by:
getControlTextFont in class MetalTheme

_getSystemTextFont

protected static FontUIResource _getSystemTextFont()
System Font

Returns:
font

getSystemTextFont

public FontUIResource getSystemTextFont()
Specified by:
getSystemTextFont in class MetalTheme

_getUserTextFont

protected static FontUIResource _getUserTextFont()
User Font

Returns:
font

getUserTextFont

public FontUIResource getUserTextFont()
Specified by:
getUserTextFont in class MetalTheme

_getMenuTextFont

protected static FontUIResource _getMenuTextFont()
Menu

Returns:
font

getMenuTextFont

public FontUIResource getMenuTextFont()
Specified by:
getMenuTextFont in class MetalTheme

_getWindowTitleFont

protected static FontUIResource _getWindowTitleFont()
Window Title

Returns:
font

getWindowTitleFont

public FontUIResource getWindowTitleFont()
Specified by:
getWindowTitleFont in class MetalTheme

_getSubTextFont

protected static FontUIResource _getSubTextFont()
Sub Text

Returns:
font

getSubTextFont

public FontUIResource getSubTextFont()
Specified by:
getSubTextFont in class MetalTheme

save

public static void save()
Save information in Properties


getColorAsString

public static String getColorAsString(Color c)
Parses Color into String representation. Required as SystemColors and Alpha Colors have different formats

Parameters:
c - Color
Returns:
[r=102,g=102,b=153,a=255]
See Also:
parseColor(java.lang.String, javax.swing.plaf.ColorUIResource)

load

public static void load()
Load Properties from Ini


reset

public static void reset()
Reset Info in Properties


parseColor

protected static ColorUIResource parseColor(String information,
                                            ColorUIResource stdColor)
Parse Color.

Color - [r=102,g=102,b=153,a=0]

Parameters:
information - string information to be parsed
stdColor - color used if info cannot parsed
Returns:
color
See Also:
getColorAsString(java.awt.Color)

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.