Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.eclipse.util
Class ColorFactory  view ColorFactory download ColorFactory.java

java.lang.Object
  extended bycom.port80.eclipse.util.ColorFactory
All Implemented Interfaces:
org.eclipse.swt.events.DisposeListener, java.util.EventListener, com.port80.util.attr.IAttrFactory, org.eclipse.swt.internal.SWTEventListener

public class ColorFactory
extends java.lang.Object
implements com.port80.util.attr.IAttrFactory, org.eclipse.swt.events.DisposeListener


Field Summary
private static boolean DEBUG
           
private static com.port80.util.struct.IntKeyHashMap fCOLORNAMES
           
private  com.port80.util.struct.IntKeyHashMap fColorTable
           
private static com.port80.util.struct.IntValueHashMap fCOLORVALUES
           
private static ColorFactory fDefault
           
private static org.eclipse.swt.widgets.Display fDisplay
           
private static java.lang.String NAME
           
private static boolean VERBOSE
           
 
Constructor Summary
ColorFactory()
           
 
Method Summary
 org.eclipse.swt.graphics.Color create(int value)
           
 org.eclipse.swt.graphics.Color create(java.lang.String name)
           
private  org.eclipse.swt.graphics.Color createColor(int value)
           
 java.lang.Object createObject(java.lang.String attrvalue)
          Convert String representation of an attribute value to the appropriate object for storing in AttrTable.
 org.eclipse.swt.graphics.Color deriveDarkerColor(org.eclipse.swt.graphics.Color color, int delta)
           
 org.eclipse.swt.graphics.Color deriveLighterColor(org.eclipse.swt.graphics.Color color, int delta)
           
 void dispose()
           
private  org.eclipse.swt.graphics.Color getColor(int value)
           
static ColorFactory getDefault()
           
 java.lang.Class getObjectClass()
           
 org.eclipse.swt.graphics.RGB getRGB(java.lang.String name)
           
private static void initRGB(java.lang.String name, int value)
           
private static void initRGB(java.lang.String name, int value, boolean override)
           
private static void initRGBTable()
           
 boolean isValid(java.lang.Object a)
          Check that given object is valid value for this factory.
private static int makeInt(int r, int g, int b)
           
 java.lang.Object promptUser(java.lang.String prompt)
          Prompt user and present a user interface to obtain an attribute value from user.
 java.lang.String toString()
          The String representation of attribute type itself.
 java.lang.String toString(java.lang.Object attr)
          The String representation of an attribute value.
 void widgetDisposed(org.eclipse.swt.events.DisposeEvent e)
          Sent when the widget is disposed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

private static final java.lang.String NAME
See Also:
Constant Field Values

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE

fCOLORVALUES

private static final com.port80.util.struct.IntValueHashMap fCOLORVALUES

fCOLORNAMES

private static final com.port80.util.struct.IntKeyHashMap fCOLORNAMES

fDefault

private static ColorFactory fDefault

fDisplay

private static org.eclipse.swt.widgets.Display fDisplay

fColorTable

private com.port80.util.struct.IntKeyHashMap fColorTable
Constructor Detail

ColorFactory

public ColorFactory()
Method Detail

getDefault

public static ColorFactory getDefault()

getRGB

public org.eclipse.swt.graphics.RGB getRGB(java.lang.String name)

create

public org.eclipse.swt.graphics.Color create(java.lang.String name)

create

public org.eclipse.swt.graphics.Color create(int value)

deriveLighterColor

public org.eclipse.swt.graphics.Color deriveLighterColor(org.eclipse.swt.graphics.Color color,
                                                         int delta)

deriveDarkerColor

public org.eclipse.swt.graphics.Color deriveDarkerColor(org.eclipse.swt.graphics.Color color,
                                                        int delta)

createColor

private org.eclipse.swt.graphics.Color createColor(int value)

getColor

private org.eclipse.swt.graphics.Color getColor(int value)

createObject

public java.lang.Object createObject(java.lang.String attrvalue)
Convert String representation of an attribute value to the appropriate object for storing in AttrTable.

Specified by:
createObject in interface com.port80.util.attr.IAttrFactory

isValid

public boolean isValid(java.lang.Object a)
Description copied from interface: com.port80.util.attr.IAttrFactory
Check that given object is valid value for this factory.

Specified by:
isValid in interface com.port80.util.attr.IAttrFactory

getObjectClass

public java.lang.Class getObjectClass()

toString

public java.lang.String toString(java.lang.Object attr)
The String representation of an attribute value.

Specified by:
toString in interface com.port80.util.attr.IAttrFactory

toString

public java.lang.String toString()
The String representation of attribute type itself.

Specified by:
toString in interface com.port80.util.attr.IAttrFactory

promptUser

public java.lang.Object promptUser(java.lang.String prompt)
Prompt user and present a user interface to obtain an attribute value from user.

Specified by:
promptUser in interface com.port80.util.attr.IAttrFactory

widgetDisposed

public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e)
Description copied from interface: org.eclipse.swt.events.DisposeListener
Sent when the widget is disposed.

Specified by:
widgetDisposed in interface org.eclipse.swt.events.DisposeListener

dispose

public void dispose()

initRGBTable

private static final void initRGBTable()

makeInt

private static final int makeInt(int r,
                                 int g,
                                 int b)

initRGB

private static final void initRGB(java.lang.String name,
                                  int value,
                                  boolean override)

initRGB

private static final void initRGB(java.lang.String name,
                                  int value)