org.noos.xing.mydoggy.plaf.ui
Interface ResourceManager

All Superinterfaces:
org.noos.xing.mydoggy.Observable
All Known Implementing Classes:
MyDoggyResourceManager

public interface ResourceManager
extends org.noos.xing.mydoggy.Observable

This interface is used to customize not only icons, colors and internationalization but also ui components creation with relative customization and transparency manager.

Since:
1.3.1
Author:
Angelo De Caro (angelo.decaro@gmail.com)

Method Summary
<T extends Component>
T
applyCustomization(String key, T component, Context context)
          Apply the customization using the rule specified by the key param.
<T extends Component>
T
createComponent(String key, Context context)
          Create the component using the rule specified by the key param.
 ComponentUI createComponentUI(String key, Context context)
          Create the component ui using the rule specified by the key param.
<T> T
createInstance(Class<T> clazz, Context context)
          Returns an instance of class clazz using passed args.
 boolean getBoolean(String name, boolean defaultValue)
          Searches for the property with the specified name in the property list.
 Color getColor(String id)
          Returns the color to which this manager maps the specified id.
 List<String> getColors()
          Returns the map that contains all colors definition.
 float getFloat(String name, float defaultValue)
          Searches for the property with the specified name in the property list.
 Icon getIcon(String id)
          Returns the icon to which this manager maps the specified id.
 List<String> getIcons()
          Returns the map that contains all icons definition.
 BufferedImage getImage(String id)
          Returns the buffered image to which this manager maps the specified id.
 int getInt(String name, int defaultValue)
          Searches for the property with the specified name in the property list.
<T> T
getObject(Class<T> clazz, T defaultValue)
          Searches for the object with the specified class in the property list.
 String getProperty(String name)
          Searches for the property with the specified name in the property list.
 ResourceBundle getResourceBundle()
          Returns the resource bundle used for the internationalization of mydoggy.
 String getString(String key)
          This method is equivalent to getResourceBundle().getString(key)
 TransparencyManager<Window> getTransparencyManager()
          Returns the transparency manager for the windows used to manage transparency of toolwindows of FLOATING or FLOATING_FREE type.
 ResourceBundle getUserResourceBundle()
          Returns the resource bundle used for the internationalization of special strings like the the toolwindow id.
 String getUserString(String key)
          This method is equivalent to getUserResourceBundle().getString(key)
 void putBoolean(String name, boolean value)
          Associates a string representing the specified boolean value with the specified name.
 Color putColor(String id, Color color)
          Associates the specified color with the specified id.
 void putFloat(String name, float value)
          Associates a string representing the specified float value with the specified name.
 Icon putIcon(String id, Icon icon)
          Associates the specified icon with the specified id.
 void putInt(String name, int value)
          Associates a string representing the specified int value with the specified name.
 void putObject(Object key, Object value)
          Associates the specified value with the specified key.
 void putProperty(String name, String value)
          Associates the specified value with the specified property name.
 void setClassloader(ClassLoader classloader)
           
 void setLocale(Locale locale)
          Sets the locale of this manager used for the internationalization of the relative toolwindow manager.
 void setTransparencyManager(TransparencyManager<Window> transparencyManager)
          Sets the transparency manager for the windows used to manage transparency of toolwindows of FLOATING or FLOATING_FREE type.
 void setUserBundle(Locale locale, String bundle, ClassLoader classLoader)
          Sets the bundle used for the internationalization of special strings like the the toolwindow id.
 void setUserBundle(ResourceBundle userBundle)
          Sets the bundle used for the internationalization of special strings like the the toolwindow id.
 
Methods inherited from interface org.noos.xing.mydoggy.Observable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 

Method Detail

setClassloader

void setClassloader(ClassLoader classloader)

createInstance

<T> T createInstance(Class<T> clazz,
                     Context context)
Returns an instance of class clazz using passed args.

Parameters:
clazz - the class of the instance to be returned.
context - a context where retrieve arguments.
Returns:
an instance of class clazz using passed args.
Since:
1.4.0

createComponent

<T extends Component> T createComponent(String key,
                                        Context context)
Create the component using the rule specified by the key param.

Parameters:
key - key whose associated rule is used to create the component.
context - a context where retrieve arguments.
Returns:
the component created using the rule specified by the key param.
Since:
1.3.1

createComponentUI

ComponentUI createComponentUI(String key,
                              Context context)
Create the component ui using the rule specified by the key param.

Parameters:
key - key whose associated rule is used to create the component.
context - a context where retrieve arguments.
Returns:
the component ui created using the rule specified by the key param.
Since:
1.3.1

applyCustomization

<T extends Component> T applyCustomization(String key,
                                           T component,
                                           Context context)
Apply the customization using the rule specified by the key param.

Parameters:
key - key whose associated rule is used to customize the component.
component - the component to be customized.
context - a context where retrieve arguments.
Returns:
the component customized.
Since:
1.3.1

getIcon

Icon getIcon(String id)
Returns the icon to which this manager maps the specified id. Returns null if the manager contains no mapping for this id.

Parameters:
id - id whose associated icon is to be returned.
Returns:
the icon to which this manager maps the specified id, or null if the manager contains no mapping for this id.
Since:
1.3.1

putIcon

Icon putIcon(String id,
             Icon icon)
Associates the specified icon with the specified id. If the manager previously contained a mapping for this id, the old icon is replaced by the specified icon.

Parameters:
id - id with which the specified icon is to be associated.
icon - icon to be associated with the specified id.
Returns:
previous icon associated with specified id, or null if there was no mapping for id.
Since:
1.3.1

getColor

Color getColor(String id)
Returns the color to which this manager maps the specified id. Returns null if the manager contains no mapping for this id.

Parameters:
id - id whose associated color is to be returned.
Returns:
the color to which this manager maps the specified id, or null if the manager contains no mapping for this id.
Since:
1.3.1

putColor

Color putColor(String id,
               Color color)
Associates the specified color with the specified id. If the manager previously contained a mapping for this id, the old color is replaced by the specified color.

Parameters:
id - id with which the specified color is to be associated.
color - color to be associated with the specified id.
Returns:
previous color associated with specified id, or null if there was no mapping for id.
Since:
1.3.1

getTransparencyManager

TransparencyManager<Window> getTransparencyManager()
Returns the transparency manager for the windows used to manage transparency of toolwindows of FLOATING or FLOATING_FREE type.

Returns:
the transparency manager for the windows.
Since:
1.3.1

setTransparencyManager

void setTransparencyManager(TransparencyManager<Window> transparencyManager)
Sets the transparency manager for the windows used to manage transparency of toolwindows of FLOATING or FLOATING_FREE type.

Parameters:
transparencyManager - the transparency manager for the windows.
Since:
1.3.1

getImage

BufferedImage getImage(String id)
Returns the buffered image to which this manager maps the specified id. Returns null if the manager contains no mapping for this id.

Parameters:
id - id whose associated buffered image is to be returned.
Returns:
the buffered image to which this manager maps the specified id, or null if the manager contains no mapping for this id.
Since:
1.4.1

setLocale

void setLocale(Locale locale)
Sets the locale of this manager used for the internationalization of the relative toolwindow manager.

Parameters:
locale - the locale to become this manager's locale
Since:
1.3.1

setUserBundle

void setUserBundle(Locale locale,
                   String bundle,
                   ClassLoader classLoader)
Sets the bundle used for the internationalization of special strings like the the toolwindow id.

Parameters:
locale - the locale for which a resource bundle is desired
bundle - the base name of the resource bundle, a fully qualified class name
classLoader - the class loader from which to load the resource bundle
Since:
1.3.1
See Also:
getUserResourceBundle()

setUserBundle

void setUserBundle(ResourceBundle userBundle)
Sets the bundle used for the internationalization of special strings like the the toolwindow id.

Parameters:
userBundle - the ResourceBundle
Since:
1.3.1

getResourceBundle

ResourceBundle getResourceBundle()
Returns the resource bundle used for the internationalization of mydoggy.

Returns:
the resource bundle used for the internationalization of mydoggy.
Since:
1.3.1

getUserResourceBundle

ResourceBundle getUserResourceBundle()
Returns the resource bundle used for the internationalization of special strings like the the toolwindow id.

Returns:
the resource bundle used for the internationalization of special strings like the the toolwindow id.
Since:
1.3.1

getString

String getString(String key)
This method is equivalent to getResourceBundle().getString(key)

Parameters:
key - the key for the desired string
Returns:
the string for the given key
Since:
1.3.1

getUserString

String getUserString(String key)
This method is equivalent to getUserResourceBundle().getString(key)

Parameters:
key - the key for the desired string
Returns:
the string for the given key
Since:
1.3.1

getColors

List<String> getColors()
Returns the map that contains all colors definition.

Returns:
the map that contains all colors definition.
Since:
1.5.0

getIcons

List<String> getIcons()
Returns the map that contains all icons definition.

Returns:
the map that contains all icons definition.
Since:
1.4.0

getProperty

String getProperty(String name)
Searches for the property with the specified name in the property list. The method returns null if the property is not found.

Parameters:
name - the property bame.
Returns:
the value in this property list with the specified key value.
Since:
1.4.0

putProperty

void putProperty(String name,
                 String value)
Associates the specified value with the specified property name.

Parameters:
name - property name with which the specified value is to be associated.
value - value to be associated with the specified name.
Since:
1.4.0

getBoolean

boolean getBoolean(String name,
                   boolean defaultValue)
Searches for the property with the specified name in the property list. The method returns defaultValue if the property is not found.

Parameters:
name - the property name.
defaultValue - the default value if the property is not found.
Returns:
the value in this property list with the specified key value.
Since:
1.4.0

putBoolean

void putBoolean(String name,
                boolean value)
Associates a string representing the specified boolean value with the specified name. The associated string is the one that would be returned if the boolean value were passed to Boolean.toString(boolean).

Parameters:
name - name with which the string form of value is to be associated.
value - value whose string form is to be associated with key.
Throws:
NullPointerException - if key is null.
Since:
1.4.2
See Also:
getBoolean(String, boolean)

getFloat

float getFloat(String name,
               float defaultValue)
Searches for the property with the specified name in the property list. The method returns defaultValue if the property is not found.

Parameters:
name - the property name.
defaultValue - the default value if the property is not found.
Returns:
the value in this property list with the specified key value.
Since:
1.4.2

putFloat

void putFloat(String name,
              float value)
Associates a string representing the specified float value with the specified name. The associated string is the one that would be returned if the float value were passed to Float.toString(float).

Parameters:
name - name with which the string form of value is to be associated.
value - value whose string form is to be associated with key.
Throws:
NullPointerException - if key is null.
Since:
1.4.2
See Also:
getFloat(String, float)

getInt

int getInt(String name,
           int defaultValue)
Searches for the property with the specified name in the property list. The method returns defaultValue if the property is not found.

Parameters:
name - the property name.
defaultValue - the default value if the property is not found.
Returns:
the value in this property list with the specified key value.
Since:
1.4.2

putInt

void putInt(String name,
            int value)
Associates a string representing the specified int value with the specified name. The associated string is the one that would be returned if the int value were passed to Integer.toString(int).

Parameters:
name - name with which the string form of value is to be associated.
value - value whose string form is to be associated with key.
Throws:
NullPointerException - if key is null.
Since:
1.4.2
See Also:
getInt(String, int)

putObject

void putObject(Object key,
               Object value)
Associates the specified value with the specified key.

Parameters:
key - key with which the specified value is to be associated.
value - value to be associated with the specified name.
Since:
1.4.1

getObject

<T> T getObject(Class<T> clazz,
                T defaultValue)
Searches for the object with the specified class in the property list. The method returns defaultValue if the object is not found.

Parameters:
clazz - the object class.
defaultValue - the default value if the object is not found.
Returns:
1.4.1


Copyright © 2012. All Rights Reserved.