java.lang.Object
com.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
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
ColorFactory
public ColorFactory()
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)