Compiere Looks 1.2.1

org.compiere.plaf
Class CompiereTheme

java.lang.Object
  |
  +--javax.swing.plaf.metal.MetalTheme
        |
        +--org.compiere.plaf.CompiereTheme

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.9 2002/08/12 01:55:15 danb 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 ColorUIResource mandatory
          Background for mandatory fields
protected static FontUIResource menuFont
          Menu font
static String NAME
           
protected static String P_CompiereColor
           
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  ColorUIResource secondary0
          Black
protected static ColorUIResource secondary1
          Gray 102, 102, 102
protected static ColorUIResource secondary2
          Gray 153, 153, 153
protected static ColorUIResource secondary3
          Gray 204, 204, 204
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
 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
static void load(Properties p)
          Load information from properties
static void load(String fileName)
          Load Data
protected static ColorUIResource parseColor(String info, ColorUIResource stdColor)
          Parse Color.
static void reset(Properties p)
          Reset Info in Properties
static void save(Properties p)
          Save information in Properties
static void save(String fileName)
          Store information as property file
static void setTheme()
          Set Theme to current Metal Theme and copy it
static void setTheme(MetalTheme copyFrom)
          Set Theme to current Metal Theme and copy it
 
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, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

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
Gray 204, 204, 204


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
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

setTheme

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


setTheme

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

Parameters:
copyFrom -

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

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

getSystemTextFont

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

getUserTextFont

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

getMenuTextFont

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

getWindowTitleFont

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

getSubTextFont

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

save

public static void save(String fileName)
Store information as property file

Parameters:
fileName -

load

public static void load(String fileName)
Load Data

Parameters:
fileName -

save

public static void save(Properties p)
Save information in Properties

Parameters:
p -

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


load

public static void load(Properties p)
Load information from properties

Parameters:
p - Properties

reset

public static void reset(Properties p)
Reset Info in Properties

Parameters:
p - Properties

parseColor

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

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

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

Compiere Looks 1.2.1

Copyright (c) 1999-2003 ComPiere, Inc. - Author: Jorg Janke