LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyAbstractBooleanPanelManager

java.lang.Object
  extended by leon.view.win.swing.component.LyAbstractBooleanPanelManager
Direct Known Subclasses:
LyJBooleanPanel._LyBooleanCanvasManager

public abstract class LyAbstractBooleanPanelManager
extends java.lang.Object

This component handles a checkbox with two or three states.

When optional, the mode is three states: BOOLEAN_CHECKED, BOOLEAN_UNCHECKED and BOOLEAN_EMPTY.

When not optional, there is only two states: CHECKED and UNCHECKED


Field Summary
static java.lang.String __VERSION
           
static int BOOLEAN_CHECKED
          Checked status.
static int BOOLEAN_EMPTY
          Empty status.
static int BOOLEAN_UNCHECKED
          Unchecked status.
 
Constructor Summary
LyAbstractBooleanPanelManager(java.awt.Component comp)
          Class constructor of a boolean panel manager.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Registers a new listener on this component.
 java.awt.Component getComponent()
          Gets the component linked to this manager.
abstract  java.awt.Image getImageOffScreen(java.awt.Dimension offScreenSize)
          Returns the offscreen image if any.
 java.awt.Dimension getPreferredSize()
          The size of this component.
abstract  java.awt.Graphics getTargetGraphics(java.awt.Image offScreenImage, java.awt.Graphics defaultGraphics)
          Returns the graphics context of the specified offscreen image or the default graphics context if none is available.
 java.lang.Boolean getValue()
          Returns the status of the component.
 boolean isEnabled()
          Returns the enabled status of this component.
 boolean isOptional()
          Returns the optional status of the component.
 void nextStatus()
          Cycles through the different status of this component.
 void paintCommon(java.awt.Graphics g)
          Draws the title panel in this graphics.
abstract  void paintOnScreen(java.awt.Image offScreenImage, java.awt.Graphics onScreenGraphics)
          Paints the specified offscreen image to the onscreen graphics context.
 void redraw()
          Redraws the component.
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes a previously registered listener on this component.
 void setEnabled(boolean enabled)
          Enables this component.
 void setImages(java.awt.Image background, java.awt.Image hoover, java.awt.Image selectEmpty, java.awt.Image selectFalse, java.awt.Image selectTrue)
          Sets the images for this component.
 void setLabels(java.lang.String emptyLabel, java.lang.String checkedLabel, java.lang.String uncheckedLabel)
          Sets the labels of this component.
 void setOptional(boolean optional)
          Sets the optional parameter of this component.
 void setValue(java.lang.Boolean status)
          Sets the current status of the component and redraws it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

BOOLEAN_EMPTY

public static final int BOOLEAN_EMPTY
Empty status. Nothin is selected.

See Also:
Constant Field Values

BOOLEAN_CHECKED

public static final int BOOLEAN_CHECKED
Checked status.

See Also:
Constant Field Values

BOOLEAN_UNCHECKED

public static final int BOOLEAN_UNCHECKED
Unchecked status.

See Also:
Constant Field Values
Constructor Detail

LyAbstractBooleanPanelManager

public LyAbstractBooleanPanelManager(java.awt.Component comp)
Class constructor of a boolean panel manager.

Parameters:
comp - the panel component that is initialized
Method Detail

setImages

public void setImages(java.awt.Image background,
                      java.awt.Image hoover,
                      java.awt.Image selectEmpty,
                      java.awt.Image selectFalse,
                      java.awt.Image selectTrue)
Sets the images for this component.

Parameters:
background - the background image of this component
hoover - the hoover image used for this component
selectEmpty - the image used when BOOLEAN_EMPTY status is selected
selectFalse - the image used when BOOLEAN_FALSE status is selected
selectTrue - the image used when BOOLEAN_TRUE status is selected

setLabels

public void setLabels(java.lang.String emptyLabel,
                      java.lang.String checkedLabel,
                      java.lang.String uncheckedLabel)
Sets the labels of this component.

Parameters:
emptyLabel - label displayed when the selection is empty
checkedLabel - label displayed when the selection is checked
uncheckedLabel - label displayed when the selection is unchecked
See Also:
setLabels(String, String, String)

redraw

public void redraw()
Redraws the component.


getValue

public java.lang.Boolean getValue()
Returns the status of the component.

Returns:
the status of the component
See Also:
setValue(Boolean)

setValue

public void setValue(java.lang.Boolean status)
Sets the current status of the component and redraws it.

Parameters:
status - the new status
See Also:
getValue()

isEnabled

public boolean isEnabled()
Returns the enabled status of this component.

Returns:
true if the component is enabled, false otherwise

isOptional

public boolean isOptional()
Returns the optional status of the component.

Returns:
true if the component is optional, false otherwise

setEnabled

public void setEnabled(boolean enabled)
Enables this component.

Parameters:
enabled - true to enable this component

setOptional

public void setOptional(boolean optional)
Sets the optional parameter of this component. When this component is not optional, the status BOOLEAN_EMPTY is not available.

Parameters:
optional - the optional status of the component

getPreferredSize

public java.awt.Dimension getPreferredSize()
The size of this component. This is computed as follow:

Returns:
the preferred size of this component.

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Registers a new listener on this component.

Parameters:
listener - a new listener
See Also:
removeActionListener(ActionListener)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes a previously registered listener on this component.

Parameters:
listener - the listener to remove
See Also:
addActionListener(ActionListener)

nextStatus

public void nextStatus()
Cycles through the different status of this component.


getComponent

public java.awt.Component getComponent()
Gets the component linked to this manager.

Returns:
the associated component

getImageOffScreen

public abstract java.awt.Image getImageOffScreen(java.awt.Dimension offScreenSize)
Returns the offscreen image if any.

Parameters:
offScreenSize - size of the offscreen image
Returns:
the offscreen image

getTargetGraphics

public abstract java.awt.Graphics getTargetGraphics(java.awt.Image offScreenImage,
                                                    java.awt.Graphics defaultGraphics)
Returns the graphics context of the specified offscreen image or the default graphics context if none is available.

Parameters:
offScreenImage - the image to get its graphics context
defaultGraphics - the default graphics context if the image doesn't have one
Returns:
a graphics context to use

paintOnScreen

public abstract void paintOnScreen(java.awt.Image offScreenImage,
                                   java.awt.Graphics onScreenGraphics)
Paints the specified offscreen image to the onscreen graphics context.

Parameters:
offScreenImage - the offscreen image to paint on the onscreen context
onScreenGraphics - the graphics context to paint the offscreen image on

paintCommon

public void paintCommon(java.awt.Graphics g)
Draws the title panel in this graphics.

Parameters:
g - the graphics context to paint the images on

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com