org.PingOO.DLAI.lib.PWidget
Class DefaultPManager

java.lang.Object
  |
  +--org.PingOO.DLAI.lib.PWidget.PManager
        |
        +--org.PingOO.DLAI.lib.PWidget.DefaultPManager

public class DefaultPManager
extends PManager

Default manager implementation for PComponents.
This class is (supposed to be) the only one to access the org.PingOO.DLAI.lib.util package.

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

Field Summary
static java.lang.String DEFAULT_MODULE
          The default module for a PComponent.
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 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.
 
Fields inherited from class org.PingOO.DLAI.lib.PWidget.PManager
BIG_ICON, DEFAULT_MODULE, defaultPManager, MOUSE_AUTO_FOCUS, MOUSE_FOCUS_ON_CLICK, SMALL_ICON, WINDOW_AUTO_RAISE, WINDOW_RAISE_ON_CLICK
 
Constructor Summary
DefaultPManager()
          Creates a new default PManager;
 
Method Summary
 boolean getDebugException()
          Gets the debugging value for exceptions.
 boolean getDebugGraphics()
          Gets the debugging value for painting component.
 javax.swing.JDesktopPane getDesktop()
          Return the default current desktop (if any)
 java.awt.Font getFont()
          Returns the font to use on the current PComponent.
 javax.swing.Icon getIcon(java.lang.String identifier)
          Return the desired icon, using the default set.
 javax.swing.Icon getIcon(java.lang.String identifier, java.lang.String module)
          Return the desired icon, using the given set.
 javax.swing.Icon getIcon(java.lang.String identifier, java.lang.String module, int mode)
          Return the desired icon, using the given set.
 java.awt.Image getImage(javax.swing.Icon icon)
          Return the corresponding image of the given icon.
 java.util.Locale getLocale()
          Gets the current locale.
 int getMouseFocus()
          Gets the current focus mode.
 java.lang.String getString(java.lang.String stringKey)
          Return the localized text to use with the current component.
 java.lang.String getString(java.lang.String stringKey, java.lang.String module)
          Return the localized text to use with the current component.
 int getWindowRaise()
          Gets the current window raising mode.
 int getXGap()
          Returns the default horizontal gap between components.
 int getXInset()
          Returns the default horizontal inset (left and right border width) of the component.
 int getYGap()
          Returns the default horizontal gap between components.
 int getYInset()
          Returns the default vertical inset (top and bottom border height) of the component.
 javax.swing.Icon toBigIcon(javax.swing.Icon smallIcon)
          Transforms a small icon into a big icon.
 javax.swing.Icon toSmallIcon(javax.swing.Icon bigIcon)
          Transforms a big icon into a small icon.
 
Methods inherited from class org.PingOO.DLAI.lib.PWidget.PManager
getInstance
 
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.
Constructor Detail

DefaultPManager

public DefaultPManager()
Creates a new default PManager;
Method Detail

getString

public 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.
Overrides:
getString in class PManager

getString

public 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.
Overrides:
getString in class PManager

getFont

public 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.
Overrides:
getFont in class PManager

getXGap

public int getXGap()
Returns the default horizontal gap between components.
Returns:
The default horizontal gap between components.
Overrides:
getXGap in class PManager

getYGap

public int getYGap()
Returns the default horizontal gap between components.
Returns:
The default horizontal gap between components.
Overrides:
getYGap in class PManager

getXInset

public 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.
Overrides:
getXInset in class PManager

getYInset

public 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.
Overrides:
getYInset in class PManager

getMouseFocus

public int getMouseFocus()
Gets the current focus mode.
Returns:
MOUSE_FOCUS_ON_CLICK, MOUSE_LAZY_FOCUS, or MOUSE_AUTO_FOCUS.
Overrides:
getMouseFocus in class PManager

getWindowRaise

public int getWindowRaise()
Gets the current window raising mode.
Returns:
WINDOW_RAISE_ON_CLICK or WINDOW_AUTO_RAISE.
Overrides:
getWindowRaise in class PManager

getDebugGraphics

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

getDebugException

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

getLocale

public java.util.Locale getLocale()
Gets the current locale.
Returns:
the current language.
Overrides:
getLocale in class PManager

toSmallIcon

public 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.
Overrides:
toSmallIcon in class PManager

toBigIcon

public 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.
Overrides:
toBigIcon in class PManager

getIcon

public 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.
Overrides:
getIcon in class PManager

getIcon

public 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.
Overrides:
getIcon in class PManager

getIcon

public 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.
Overrides:
getIcon in class PManager

getImage

public 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.
Overrides:
getImage in class PManager

getDesktop

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