org.PingOO.DLAI.lib.PWidget
Class PManager

java.lang.Object
  |
  +--org.PingOO.DLAI.lib.PWidget.PManager
Direct Known Subclasses:
DefaultPManager

public abstract class PManager
extends java.lang.Object

The manager of the PComponent. Used this process to detach the PWidget from the org.PingOO.DLAI.lib.util package, make the PWidget reusable elsewhere without much more (or minimized) changes.
It is up to the implementation of the PManager to find a way to get datas.
Also each PComponent may have a special manager which is not an isntance of DefaultPManager.

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)
See Also:
DefaultPManager

Field Summary
static int BIG_ICON
          Gets a big icon.
static java.lang.String DEFAULT_MODULE
          The default module for a PComponent.
private static DefaultPManager defaultPManager
          Hidden instance of the PManager class.
static int MOUSE_AUTO_FOCUS
          The targeted component automatically gets the focus.
static int MOUSE_FOCUS_ON_CLICK
          The targeted component automatically gets the when the mouse is clicked.
static int SMALL_ICON
          Gets a small icon.
static int WINDOW_AUTO_RAISE
          A window (frame, window or internal frame) automatically raises when getting focus.
static int WINDOW_RAISE_ON_CLICK
          A window (frame, window or internal frame) automatically raises when the mouse is clicked.
 
Constructor Summary
protected PManager()
          Creates a new PManager.
 
Method Summary
abstract  boolean getDebugException()
          Gets the debugging value for exceptions.
abstract  boolean getDebugGraphics()
          Gets the debugging value for painting component.
abstract  javax.swing.JDesktopPane getDesktop()
          Return the default current desktop (if any)
abstract  java.awt.Font getFont()
          Returns the font to use on the current PComponent.
abstract  javax.swing.Icon getIcon(java.lang.String identifier)
          Return the desired icon, using the default set.
abstract  javax.swing.Icon getIcon(java.lang.String identifier, java.lang.String module)
          Return the desired icon, using the given set.
abstract  javax.swing.Icon getIcon(java.lang.String identifier, java.lang.String module, int mode)
          Return the desired icon, using the given set.
abstract  java.awt.Image getImage(javax.swing.Icon icon)
          Return the corresponding image of the given icon.
static PManager getInstance()
          Return the default instance of this class.
abstract  java.util.Locale getLocale()
          Gets the current locale.
abstract  int getMouseFocus()
          Gets the current focus mode.
abstract  java.lang.String getString(java.lang.String stringKey)
          Return the localized text to use with the current component.
abstract  java.lang.String getString(java.lang.String stringKey, java.lang.String module)
          Return the localized text to use with the current component.
abstract  int getWindowRaise()
          Gets the current window raising mode.
abstract  int getXGap()
          Returns the default horizontal gap between components.
abstract  int getXInset()
          Returns the default horizontal inset (left and right border width) of the component.
abstract  int getYGap()
          Returns the default horizontal gap between components.
abstract  int getYInset()
          Returns the default vertical inset (top and bottom border height) of the component.
abstract  javax.swing.Icon toBigIcon(javax.swing.Icon smallIcon)
          Transforms a small icon into a big icon.
abstract  javax.swing.Icon toSmallIcon(javax.swing.Icon bigIcon)
          Transforms a big icon into a small icon.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MOUSE_AUTO_FOCUS

public static final int MOUSE_AUTO_FOCUS
The targeted component automatically gets the focus.

MOUSE_FOCUS_ON_CLICK

public static final int MOUSE_FOCUS_ON_CLICK
The targeted component automatically gets the when the mouse is clicked.

WINDOW_AUTO_RAISE

public static final int WINDOW_AUTO_RAISE
A window (frame, window or internal frame) automatically raises when getting focus.

WINDOW_RAISE_ON_CLICK

public static final int WINDOW_RAISE_ON_CLICK
A window (frame, window or internal frame) automatically raises when the mouse is clicked.

DEFAULT_MODULE

public static final java.lang.String DEFAULT_MODULE
The default module for a PComponent.

BIG_ICON

public static final int BIG_ICON
Gets a big icon.

SMALL_ICON

public static final int SMALL_ICON
Gets a small icon.

defaultPManager

private static final DefaultPManager defaultPManager
Hidden instance of the PManager class.
Constructor Detail

PManager

protected PManager()
Creates a new PManager.
Method Detail

getInstance

public static PManager getInstance()
Return the default instance of this class.
Returns:
The default instance of this class.

getString

public abstract java.lang.String getString(java.lang.String stringKey)
Return the localized text to use with the current component.
Parameters:
stringKey - The key used to retreive the localized string.
Returns:
The localized text to use with the current component, never return null.

getString

public abstract java.lang.String getString(java.lang.String stringKey,
                                           java.lang.String module)
Return the localized text to use with the current component.
Parameters:
stringKey - The key used to retreive the localized string.
module - The set where to look for the localized string.
Returns:
The localized text to use with the current component, never return null.

getFont

public abstract java.awt.Font getFont()
Returns the font to use on the current PComponent.
Returns:
the font to use on the current PComponent, never return null.

getXGap

public abstract int getXGap()
Returns the default horizontal gap between components.
Returns:
The default horizontal gap between components.

getYGap

public abstract int getYGap()
Returns the default horizontal gap between components.
Returns:
The default horizontal gap between components.

getXInset

public abstract int getXInset()
Returns the default horizontal inset (left and right border width) of the component.
Returns:
the default horizontal inset (left and right border width) of the component.

getYInset

public abstract int getYInset()
Returns the default vertical inset (top and bottom border height) of the component.
Returns:
the default verticla inset (top and bottom border height) of the component.

getMouseFocus

public abstract int getMouseFocus()
Gets the current focus mode.
Returns:
MOUSE_FOCUS_ON_CLICK, MOUSE_LAZY_FOCUS, or MOUSE_AUTO_FOCUS.

getWindowRaise

public abstract int getWindowRaise()
Gets the current window raising mode.
Returns:
WINDOW_RAISE_ON_CLICK or WINDOW_AUTO_RAISE.

getDebugGraphics

public abstract boolean getDebugGraphics()
Gets the debugging value for painting component.
Returns:
true if the debug is on, false otherwise.

getDebugException

public abstract boolean getDebugException()
Gets the debugging value for exceptions.
Returns:
true if the debug is on, false otherwise.

getLocale

public abstract java.util.Locale getLocale()
Gets the current locale.
Returns:
the current language.

toSmallIcon

public abstract javax.swing.Icon toSmallIcon(javax.swing.Icon bigIcon)
Transforms a big icon into a small icon.
Parameters:
bigIcon - The icon to reduce.
Returns:
A small version of the big icon.

toBigIcon

public abstract javax.swing.Icon toBigIcon(javax.swing.Icon smallIcon)
Transforms a small icon into a big icon.
Parameters:
smallIcon - The icon to expand.
Returns:
A big version of the small icon.

getIcon

public abstract javax.swing.Icon getIcon(java.lang.String identifier)
Return the desired icon, using the default set.
Parameters:
identifier - The icon's identifier.
Returns:
An icon.

getIcon

public abstract javax.swing.Icon getIcon(java.lang.String identifier,
                                         java.lang.String module)
Return the desired icon, using the given set.
Parameters:
identifier - The icon's identifier.
module - The set where to look for the icon.
Returns:
An icon.

getIcon

public abstract javax.swing.Icon getIcon(java.lang.String identifier,
                                         java.lang.String module,
                                         int mode)
Return the desired icon, using the given set.
Parameters:
identifier - The icon's identifier.
module - The set where to look for the icon.
mode - The mode, either BIG_ICON or SMALL_ICON.
Returns:
An icon.

getImage

public abstract java.awt.Image getImage(javax.swing.Icon icon)
Return the corresponding image of the given icon.
Parameters:
icon - The targeted icon.
Returns:
The image of the icon.

getDesktop

public abstract javax.swing.JDesktopPane getDesktop()
Return the default current desktop (if any)
Returns:
The default current desktop or null.