LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingDialog

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingView
              extended by leon.view.win.swing.LySwingDialog
All Implemented Interfaces:
LyActionListener, LyGetBoundsInterface, LyIsVisibleInterface, LyGraphicalComponent, LyGraphicalDialog, LyGraphicalView, LyViewComponent, LyFreeInterface, LyResetContentInterface, LySetBoundsInterface, LySetLabelInterface, LySetVisibleInterface, LySetWaitingInterface, LySwingComponent

public class LySwingDialog
extends LySwingView
implements LySwingComponent, LyGraphicalDialog

This class implements the Dialog object (as described in the dtd) for swing viewer.

A dialog window is, generally, linked to a main window of an application. Unlike the main window, it contains neither a menu, nor a message bar. Its display can be modal (blocking) or not. This type of window is generally used to allow a user to interact with an application: input request, presentation of the results, warning messages, questions, etc.

See Also:
LyDialog

Nested Class Summary
 class LySwingDialog._LyDialogAdapter
          Handle the closing events of this dialog.
 class LySwingDialog._LyWindowSizeListener
          Handle the resizing of this dialog and force its minimum size.
 
Field Summary
static java.lang.String __VERSION
           
static int MAX_SIZE_RATIO
          Maximum ratio, in percent, of the window between its size (with / height) and the screen.
static int SCROLLBAR_WIDTH
          Default reserved width for scrollbars, in pixels.
 
Fields inherited from class leon.view.win.swing.LySwingView
WINDOWS_TASKBAR_HEIGHT
 
Constructor Summary
LySwingDialog(LyDialog dialog)
          Class constructor of a Dialog window object for the Swing target.
 
Method Summary
 void configureDefaultButton()
          Sets the default button.
 java.awt.Dialog createDialog()
          Creates a new Dialog instance for the view and initializes it.
 void free()
          (non-Javadoc).
 java.awt.Component getComponent()
          (non-Javadoc).
 int getMaxSizeRatio()
          Maximum size ratio of the view on the screen in %.
 void initialize()
          (non-Javadoc).
 boolean isResizable()
          (non-Javadoc).
 void repack()
          Sets all the components of this dialog to their preferred size and readjust the size of the dialog.
 void setArea(LyArea area)
          Sets sub-component area.
 void setLabel(java.lang.String label)
          Sets the title bar of the dialog.
 void setLocation(int x, int y)
          Accessor to the location.
 void setVisible(boolean status)
          (non-Javadoc).
 void setWaiting(boolean status)
          Sets the waiting status of this component.
 void setWaiting(boolean status, boolean setCursor)
          Sets the waiting status of this component. and the enabled state of the component.
 void snapshot(java.lang.String file)
          (non-Javadoc).
 void updateMinimumSize(LyComponent child, java.awt.Dimension d)
          Updates the minimum size occupied by this component.
 
Methods inherited from class leon.view.win.swing.LySwingView
actionPerformed, getLocation, getSize, getView, getWindow, isVisible, pack, resetContent, resetContent, setContent, setSize
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getDefaultFrame
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
getViewComponent
 

Field Detail

__VERSION

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

MAX_SIZE_RATIO

public static int MAX_SIZE_RATIO
Maximum ratio, in percent, of the window between its size (with / height) and the screen. Default is 90%.


SCROLLBAR_WIDTH

public static int SCROLLBAR_WIDTH
Default reserved width for scrollbars, in pixels. Defaut value is 25. If scrollbars are needed for height or width, we reserve the size in the other direction.

Constructor Detail

LySwingDialog

public LySwingDialog(LyDialog dialog)
Class constructor of a Dialog window object for the Swing target.

Parameters:
dialog - a DIALOG component defined for every type of view targets. This dialog is initialized and configured specificaly for the Swing view.
Method Detail

initialize

public void initialize()
(non-Javadoc).

Overrides:
initialize in class LySwingView
See Also:
LySwingView.initialize()

free

public void free()
(non-Javadoc).

Specified by:
free in interface LyGraphicalComponent
Specified by:
free in interface LyFreeInterface
Overrides:
free in class LySwingView
See Also:
LyFreeInterface.free()

configureDefaultButton

public void configureDefaultButton()
Sets the default button. At this time no default button is defined in Leonardi, so the policy is to set the first command button as the default button.

Specified by:
configureDefaultButton in class LySwingView

createDialog

public java.awt.Dialog createDialog()
Creates a new Dialog instance for the view and initializes it. May be overriden if needed.

Returns:
a dialog instance

getComponent

public java.awt.Component getComponent()
Description copied from class: LySwingObject
(non-Javadoc).

Specified by:
getComponent in interface LySwingComponent
Overrides:
getComponent in class LySwingObject
Returns:
this Swing view component
See Also:
LySwingComponent.getComponent()

setWaiting

public void setWaiting(boolean status)
Description copied from class: LySwingView
Sets the waiting status of this component.

Specified by:
setWaiting in interface LySetWaitingInterface
Specified by:
setWaiting in class LySwingView
Parameters:
status - the new status for this component
See Also:
LySetWaitingInterface.setWaiting(boolean)

setWaiting

public void setWaiting(boolean status,
                       boolean setCursor)
Sets the waiting status of this component. and the enabled state of the component.

Parameters:
status - sets the waiting property of the given component, false unsets it.
setCursor - sets the waiting image of the cursor (LySwingViewManager.WAIT_CURSOR or LySwingViewManager.DEFAULT_CURSOR)

setLabel

public void setLabel(java.lang.String label)
Sets the title bar of the dialog.

Specified by:
setLabel in interface LyGraphicalDialog
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - the new title bar label
See Also:
LyGraphicalDialog.setLabel(String)

isResizable

public boolean isResizable()
(non-Javadoc).

Specified by:
isResizable in class LySwingView
Returns:
true if the window is resizable, false otherwise
See Also:
LySwingView.isResizable()

setVisible

public void setVisible(boolean status)
(non-Javadoc).

Specified by:
setVisible in interface LySetVisibleInterface
Specified by:
setVisible in class LySwingView
Parameters:
status - new visibility status, if true the component will be shown, if false it will be hiden
See Also:
LySetVisibleInterface.setVisible(boolean)

setArea

public void setArea(LyArea area)
Description copied from interface: LyGraphicalDialog
Sets sub-component area.

Specified by:
setArea in interface LyGraphicalDialog
Parameters:
area - New value of area

updateMinimumSize

public void updateMinimumSize(LyComponent child,
                              java.awt.Dimension d)
Updates the minimum size occupied by this component.

Parameters:
child - child component in this container. This parameter is not used in this implementation.
d - minimum size to use

setLocation

public void setLocation(int x,
                        int y)
Accessor to the location.

Specified by:
setLocation in interface LySetBoundsInterface
Overrides:
setLocation in class LySwingView
See Also:
LySetBoundsInterface.setLocation(int, int)

getMaxSizeRatio

public int getMaxSizeRatio()
Maximum size ratio of the view on the screen in %.

Overrides:
getMaxSizeRatio in class LySwingView
Returns:
90 by default
See Also:
LySwingView.getMaxSizeRatio()

repack

public void repack()
Sets all the components of this dialog to their preferred size and readjust the size of the dialog.


snapshot

public void snapshot(java.lang.String file)
(non-Javadoc).

Specified by:
snapshot in class LySwingView
Parameters:
file - the file that will contain the snapshot
See Also:
LySwingView.snapshot(java.lang.String)

(c) January 2013 - W4 S.A.

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