com.aelitis.azureus.ui.swt.skin
Class SWTSkinPropertiesClone

java.lang.Object
  extended by com.aelitis.azureus.ui.swt.skin.SWTSkinPropertiesClone
All Implemented Interfaces:
SkinProperties, SWTSkinProperties, SWTSkinPropertiesParam

public class SWTSkinPropertiesClone
extends Object
implements SWTSkinPropertiesParam

Simple extension of SWTSkinProperties that first checks the original cloning id before checking the keys that it's cloning.

Cloned Skin Objects will be calling this class with a Config ID of "" plus whatever property name string they add on.

Author:
TuxPaper

Constructor Summary
SWTSkinPropertiesClone(SWTSkinProperties properties, String sCloneConfigID, String[] sCloneParams)
          Initialize
 
Method Summary
 void addProperty(String name, String value)
          Add a property key/value pair to the list
 void addResourceBundle(ResourceBundle subBundle, String skinPath)
           
 void addResourceBundle(ResourceBundle subBundle, String skinPath, ClassLoader loader)
           
 void clearCache()
           
 boolean getBooleanValue(String name, boolean def)
           
 ClassLoader getClassLoader()
           
 org.eclipse.swt.graphics.Color getColor(String name)
          Retrieve a color property in as a SWT Color
 org.eclipse.swt.graphics.Color getColor(String name, org.eclipse.swt.graphics.Color def)
           
 int[] getColorValue(String name)
           
 SWTColorWithAlpha getColorWithAlpha(String name)
           
 int getEmHeightPX()
           
 int getIntValue(String name, int def)
          Retrieve a property's int value
 SWTSkinProperties getOriginalProperties()
           
 String[] getParamValues()
           
 int getPxValue(String name, int def)
          Get value in px, adjusted for dpi
 String getReferenceID(String name)
           
 String[] getStringArray(String name)
           
 String[] getStringArray(String name, String[] params)
           
 String getStringValue(String name)
          Retrieve a string value
 String getStringValue(String name, String def)
           
 String getStringValue(String name, String[] params)
           
 String getStringValue(String name, String[] params, String def)
           
 boolean hasKey(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWTSkinPropertiesClone

public SWTSkinPropertiesClone(SWTSkinProperties properties,
                              String sCloneConfigID,
                              String[] sCloneParams)
Initialize

Parameters:
properties - Where to read properties from
sCloneConfigID - The config key that told us to clone something
Method Detail

addProperty

public void addProperty(String name,
                        String value)
Description copied from interface: SkinProperties
Add a property key/value pair to the list

Specified by:
addProperty in interface SkinProperties
Parameters:
name - Name of Property
value - Value of Property

getColorWithAlpha

public SWTColorWithAlpha getColorWithAlpha(String name)
Specified by:
getColorWithAlpha in interface SWTSkinProperties
Returns:

getColor

public org.eclipse.swt.graphics.Color getColor(String name)
Description copied from interface: SWTSkinProperties
Retrieve a color property in as a SWT Color

Specified by:
getColor in interface SWTSkinProperties
Parameters:
name - Property Name
Returns:
a Color, or null

getColorValue

public int[] getColorValue(String name)
Specified by:
getColorValue in interface SkinProperties

getIntValue

public int getIntValue(String name,
                       int def)
Description copied from interface: SkinProperties
Retrieve a property's int value

Specified by:
getIntValue in interface SkinProperties
Parameters:
name - Name of property
def - Default value if property not found
Returns:
value

getStringArray

public String[] getStringArray(String name)
Specified by:
getStringArray in interface SkinProperties

getStringValue

public String getStringValue(String name,
                             String def)
Specified by:
getStringValue in interface SkinProperties

getStringValue

public String getStringValue(String name)
Description copied from interface: SkinProperties
Retrieve a string value

Specified by:
getStringValue in interface SkinProperties
Parameters:
name - Name of property
Returns:
the String value, or null if not found

getStringArray

public String[] getStringArray(String name,
                               String[] params)
Specified by:
getStringArray in interface SkinProperties

getStringValue

public String getStringValue(String name,
                             String[] params,
                             String def)
Specified by:
getStringValue in interface SkinProperties

getStringValue

public String getStringValue(String name,
                             String[] params)
Specified by:
getStringValue in interface SkinProperties

getOriginalProperties

public SWTSkinProperties getOriginalProperties()

getParamValues

public String[] getParamValues()
Specified by:
getParamValues in interface SWTSkinPropertiesParam
Returns:

getBooleanValue

public boolean getBooleanValue(String name,
                               boolean def)
Specified by:
getBooleanValue in interface SkinProperties

clearCache

public void clearCache()
Specified by:
clearCache in interface SkinProperties

hasKey

public boolean hasKey(String name)
Specified by:
hasKey in interface SkinProperties
Returns:

getColor

public org.eclipse.swt.graphics.Color getColor(String name,
                                               org.eclipse.swt.graphics.Color def)
Specified by:
getColor in interface SWTSkinProperties

getEmHeightPX

public int getEmHeightPX()
Specified by:
getEmHeightPX in interface SkinProperties
Returns:

getPxValue

public int getPxValue(String name,
                      int def)
Description copied from interface: SWTSkinProperties
Get value in px, adjusted for dpi

Specified by:
getPxValue in interface SWTSkinProperties

getReferenceID

public String getReferenceID(String name)
Specified by:
getReferenceID in interface SkinProperties
Returns:

addResourceBundle

public void addResourceBundle(ResourceBundle subBundle,
                              String skinPath)
Specified by:
addResourceBundle in interface SkinProperties
skinPath - TODO

addResourceBundle

public void addResourceBundle(ResourceBundle subBundle,
                              String skinPath,
                              ClassLoader loader)
Specified by:
addResourceBundle in interface SkinProperties

getClassLoader

public ClassLoader getClassLoader()
Specified by:
getClassLoader in interface SkinProperties
Returns: