LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingFrame

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.LySwingFrame
All Implemented Interfaces:
LyActionListener, LyGetBoundsInterface, LyIsVisibleInterface, LyGraphicalComponent, LyGraphicalFrame, LyGraphicalView, LyViewComponent, LyFreeInterface, LyResetContentInterface, LySetBoundsInterface, LySetLabelInterface, LySetVisibleInterface, LySetWaitingInterface, LySwingComponent

public class LySwingFrame
extends LySwingView
implements LySwingComponent, LyGraphicalFrame

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

The root of an XML file describing a complete Leonardi view is an element of main window or dialog window type.

See Also:
LyFrame

Nested Class Summary
 class LySwingFrame._LyWindowSizeListener
          This class ensures that the minimum size of the dialog is correct.
 
Field Summary
static java.lang.String __VERSION
           
static int MAX_SIZE_RATIO
          Maximum ratio in percent of the window between its size (width/height) and the screen.
 
Fields inherited from class leon.view.win.swing.LySwingView
WINDOWS_TASKBAR_HEIGHT
 
Constructor Summary
LySwingFrame(LyFrame frame)
          Class constructor of a frame object for the Swing target.
 
Method Summary
 void configureDefaultButton()
          Sets the default button.
 java.awt.Frame createFrame()
          Creates the frame.
 void free()
          Free this frame and all its sub-components.
 java.awt.Component getComponent()
          (non-Javadoc).
 int getMaxSizeRatio()
          Maximum size ratio of this frame on the screen (in %).
 void initialize()
          (non-Javadoc).
 boolean isResizable()
          (non-Javadoc).
 void registerWindowEvents()
          Registers the opening and closing window events.
 void repack()
          Sets all the components of this frame to their preferred size and readjust the size of the frame.
 void setArea(java.awt.Component area)
          Sets the client area in the frame.
 void setContent()
          Sets the content of this frame.
 void setIcon(java.awt.Image icon)
          Sets the icon of the frame.
 void setLabel(java.lang.String label)
          Sets the title bar of the frame.
 void setMenuBar(java.lang.Object menuBar)
          Sets the menu bar in the frame.
 void setMessages(java.awt.Component messages)
          Sets the message bar in the frame.
 void setMessages(LyMessages messages)
          Sets sub-component messages.
 void setResizable(boolean resizable)
          Allows the frame to be resizable or not.
 void setSize(int width, int height)
          Sets the width and height of this frame.
 void setVisible(boolean status)
          (non-Javadoc).
 void setWaiting(boolean status)
          Sets the waiting status of this frame.
 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, setLocation
 
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 (width/height) and the screen. Default is 100%.

Constructor Detail

LySwingFrame

public LySwingFrame(LyFrame frame)
Class constructor of a frame object for the Swing target.

Parameters:
frame - a FRAME component defined for every type of view targets. The frame component is initialized and configured.
Method Detail

initialize

public void initialize()
(non-Javadoc).

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

setContent

public void setContent()
Sets the content of this frame. This comprises the frame's menubar, a window icon, an area content and messages components.

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

setMessages

public void setMessages(LyMessages messages)
Sets sub-component messages.

Specified by:
setMessages in interface LyGraphicalFrame
Parameters:
messages - New value of messages

getComponent

public java.awt.Component getComponent()
(non-Javadoc).

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

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

registerWindowEvents

public void registerWindowEvents()
Registers the opening and closing window events.


createFrame

public java.awt.Frame createFrame()
Creates the frame.

Returns:
a new frame

setMenuBar

public void setMenuBar(java.lang.Object menuBar)
Sets the menu bar in the frame.

Parameters:
menuBar - menu bar of the frame

setMessages

public void setMessages(java.awt.Component messages)
Sets the message bar in the frame.

Parameters:
messages - message bar of the frame

setArea

public void setArea(java.awt.Component area)
Sets the client area in the frame.

Parameters:
area - the component to set
See Also:
LySwingView.setArea(Component)

setWaiting

public void setWaiting(boolean status)
Sets the waiting status of this frame. This method changes the cursor image and enables or disables the frame's menubar.

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

repack

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


setLabel

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

Specified by:
setLabel in interface LyGraphicalFrame
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - New value of label.
See Also:
LySetLabelInterface.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()

setResizable

public void setResizable(boolean resizable)
Allows the frame to be resizable or not.

Parameters:
resizable - set the resizable property of the frame

setIcon

public void setIcon(java.awt.Image icon)
Sets the icon of the frame.

Parameters:
icon - the icon to be displayed in minimized state

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)

setSize

public void setSize(int width,
                    int height)
Sets the width and height of this frame.

Specified by:
setSize in interface LySetBoundsInterface
Overrides:
setSize in class LySwingView
Parameters:
width - the new width of the window
height - the new height of the window
See Also:
LySetBoundsInterface.setSize(int, int)

free

public void free()
Free this frame and all its sub-components.

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

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

getMaxSizeRatio

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

Overrides:
getMaxSizeRatio in class LySwingView
Returns:
MAX_SIZE_RATIO (100% by default)
See Also:
LySwingView.getMaxSizeRatio()

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