Oracle Data-aware Controls Reference

oracle.dacf.style
Class StyleManager

java.lang.Object
  extended byoracle.dacf.style.StyleManager

public class StyleManager
extends java.lang.Object

The StyleManager is a manager class.

It performs the following tasks.

All attributes and methods of the StyleManager are static. This ensures that there is one and only one instance of the StyleManager running. This also means that you do not need to create a variable for the StyleManager in every class. You import the StyleManager class and use the StyleManager.Method() notation constitantly throughout your application. To instantiate the StyleManger attributes you need to run StyleManager.initialize().

Version:
PUBLIC

Constructor Summary
StyleManager()
           
 
Method Summary
static void addDefaultValue(java.lang.Object object)
          Adds a default value.
static void addError(java.lang.String message)
          convience routine that logs a StyleManager Error to the ErrorManager
static void addStyle(Style style)
          Adds a style to the collection of Styles
static void addStylesUserListener(StylesUserListener stylesUserListener)
          Adds a Listener that wants to be notified when a Style changes.
static void addWarning(java.lang.String message)
          convience routine that logs a StyleManager Warning to the ErrorManager
static void dumpStyles()
           
static void editorStopped()
          should be called by the editor when it finished editing.
static java.lang.Object getDefaultValue(java.lang.Class cls)
          returns a default value.
static EditModeListener getEditModeListener()
          Defines a new EditModeListener
static Style getStyle(java.lang.Object component)
          Returns the Style that is currently used by the given component
static Style getStyle(java.lang.String key)
          Finds a Style that matches a particular key
static StyleEditor getStyleEditor()
           
static Style[] getStyles()
          Retrieves the Style table as an array.
static void initialize()
          Initializes that has to be called, before the StyleManager can be used.
static void initLayers(StyleLayer[] layerSources)
          Initialize the Layers that define this style
static boolean isInialized()
          Returns 'true' if the StyleManager is initialized.
static boolean isPrivileged()
          Returns 'true' if the StyleManager is in privileged mode.
static boolean removeStyle(Style style)
          Removes a style from the collection of Styles
static void removeStylesUserListener(StylesUserListener stylesUserListener)
          Removes a Listener that wants to be notified when a Style changes.
static void resetInitialized()
          routine to set the Initialized status of the styleManager to false.
static void saveStyles()
          Saves the current Styles table and the Default Style definitions.
static void setEditable(boolean mode)
          Sets the editable mode.
static void setPrivileged(boolean prv)
          Sets the Stylemanager's privileged mode.
static void setStyle(java.lang.String styleName, java.lang.Object component)
          Style is linked to a component
static void setStyleEditor(StyleEditor styleEditor)
           
static void startStyleEditor(java.awt.Component component)
          Starts the StyleEditor of that matches the Style of a particular component
 void StyleManager()
           
static void updateStyle(Style style, StyleElement[] styleElements)
          Updates a Style
static void updateStyleOverwrite(Style style, java.awt.Component component, StyleElement[] styleElements)
          Updates a Style Overwrites for a specific component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleManager

public StyleManager()
Method Detail

StyleManager

public void StyleManager()

initialize

public static void initialize()
                       throws StyleIOException
Initializes that has to be called, before the StyleManager can be used.

Throws:
StyleIOException - thrown when initialization fails

saveStyles

public static void saveStyles()
                       throws StyleIOException
Saves the current Styles table and the Default Style definitions.

Throws:
StyleIOException - thrown when initialization fails

getStyle

public static Style getStyle(java.lang.String key)
Finds a Style that matches a particular key

Parameters:
key - the Style name you want to look for
Returns:
Style the requested style

getStyle

public static Style getStyle(java.lang.Object component)
Returns the Style that is currently used by the given component

Parameters:
component - the component you are querying
Returns:
Style the requested style

addStyle

public static void addStyle(Style style)
Adds a style to the collection of Styles

Parameters:
style - the style you want to add

removeStyle

public static boolean removeStyle(Style style)
Removes a style from the collection of Styles

Parameters:
style - the style you want to remove
Returns:
returns false if the Style is not defined in this layer and therefore cannot be removed

updateStyle

public static void updateStyle(Style style,
                               StyleElement[] styleElements)
Updates a Style

Parameters:
style - the style you want to update

updateStyleOverwrite

public static void updateStyleOverwrite(Style style,
                                        java.awt.Component component,
                                        StyleElement[] styleElements)
Updates a Style Overwrites for a specific component

Parameters:
style - the style you want to update
component - the component which override values need updating

addStylesUserListener

public static void addStylesUserListener(StylesUserListener stylesUserListener)
Adds a Listener that wants to be notified when a Style changes.

Parameters:
stylesUserListener - the listener

removeStylesUserListener

public static void removeStylesUserListener(StylesUserListener stylesUserListener)
Removes a Listener that wants to be notified when a Style changes.

Parameters:
stylesUserListener - the listener

isInialized

public static boolean isInialized()
Returns 'true' if the StyleManager is initialized. Returns 'false' if not.

Returns:
boolean that indicates if the StyleManager is initialized

isPrivileged

public static boolean isPrivileged()
Returns 'true' if the StyleManager is in privileged mode. Returns 'false' if not.

Returns:
boolean that indicates if the StyleManager is in privileged mode.

setPrivileged

public static void setPrivileged(boolean prv)
Sets the Stylemanager's privileged mode.

Parameters:
prv - boolean that indicates the new privileged mode

setStyle

public static void setStyle(java.lang.String styleName,
                            java.lang.Object component)
Style is linked to a component

Parameters:
component - the component that want to register for this Style

setEditable

public static void setEditable(boolean mode)
Sets the editable mode. In editable mode the components using styleelements are selectable and you can start the style editor by clicking on a component.

Parameters:
mode - boolean that indicates editable mode or not

getEditModeListener

public static EditModeListener getEditModeListener()
Defines a new EditModeListener

Returns:
the EditModeListener

startStyleEditor

public static void startStyleEditor(java.awt.Component component)
Starts the StyleEditor of that matches the Style of a particular component

Parameters:
component - the component that the user wants to edit

editorStopped

public static void editorStopped()
should be called by the editor when it finished editing. this will deselect the selection


setStyleEditor

public static void setStyleEditor(StyleEditor styleEditor)

getStyleEditor

public static StyleEditor getStyleEditor()

getStyles

public static Style[] getStyles()
Retrieves the Style table as an array. This method is used by the Style editor, it avoids synchrozing slowing down access of the collection and it allows sorting in the StyleEditor

Returns:
array containing all known Styles.

addDefaultValue

public static void addDefaultValue(java.lang.Object object)
Adds a default value.

Parameters:
object - the object you want to use as a default value definition.

getDefaultValue

public static java.lang.Object getDefaultValue(java.lang.Class cls)
returns a default value.

Parameters:
cls - the class you want a default value for.

resetInitialized

public static void resetInitialized()
routine to set the Initialized status of the styleManager to false. This allows you to redefine the layer definition.


initLayers

public static void initLayers(StyleLayer[] layerSources)
Initialize the Layers that define this style

Parameters:
layerSources - the layer. The only type currently supported is java.io.File

addError

public static void addError(java.lang.String message)
convience routine that logs a StyleManager Error to the ErrorManager

Parameters:
message - the error message

addWarning

public static void addWarning(java.lang.String message)
convience routine that logs a StyleManager Warning to the ErrorManager

Parameters:
message - the warning message

dumpStyles

public static void dumpStyles()

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.