LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingView

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

public abstract class LySwingView
extends LySwingObject
implements LyGraphicalView, LyActionListener, LySetVisibleInterface, LyIsVisibleInterface, LyResetContentInterface, LyGetBoundsInterface, LySetBoundsInterface, LySetWaitingInterface

This class implements the common behavior of the View object (as described in the dtd) for swing viewer.

See Also:
LyView

Field Summary
static java.lang.String __VERSION
           
static int WINDOWS_TASKBAR_HEIGHT
          Deprecated.  
 
Constructor Summary
LySwingView(LyView view)
          Class constructor of a View object for the Swing target.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
abstract  void configureDefaultButton()
          Sets the default button.
 void free()
          Free all resources used by this dialog view.
 int[] getLocation()
          Gets the view window position in its parent component.
 int getMaxSizeRatio()
          Maximum size ratio of the view on the screen, in %.
 int[] getSize()
          Gets the current size of the view window.
 LyView getView()
          Gets the view component.
 java.awt.Window getWindow()
          Gets the window component.
 void initialize()
          Initializes the view.
abstract  boolean isResizable()
          Checks if window is resizable or not.
 boolean isVisible()
          Checks if the view window component is visible or not.
 void pack()
          Packs the current window content and repaints it.
 void resetContent()
          (non-Javadoc).
 void resetContent(boolean full)
          (non-Javadoc).
 void setContent()
          Sets the content of this view and registers its event listeners.
 void setLocation(int x, int y)
          (non-Javadoc).
 void setSize(int width, int height)
          Sets the size of the view window at the specified width and height.
abstract  void setVisible(boolean status)
          (non-Javadoc).
abstract  void setWaiting(boolean status)
          Sets the waiting status of this component.
abstract  void snapshot(java.lang.String file)
          Takes a snapshot of the current view.
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getComponent, 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

WINDOWS_TASKBAR_HEIGHT

public static int WINDOWS_TASKBAR_HEIGHT
Deprecated. 
Height of Windows task bar.

Constructor Detail

LySwingView

public LySwingView(LyView view)
Class constructor of a View object for the Swing target.

Parameters:
view - a Leonardi view defined for every type of view targets.
Method Detail

initialize

public void initialize()
Initializes the view. This method is called by the methods that extend this one.


getView

public final LyView getView()
Gets the view component.

Returns:
the view component

getWindow

public final java.awt.Window getWindow()
Gets the window component.

Returns:
the window component

setContent

public void setContent()
Sets the content of this view and registers its event listeners.


setLocation

public void setLocation(int x,
                        int y)
(non-Javadoc).

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

getLocation

public int[] getLocation()
Gets the view window position in its parent component.

Specified by:
getLocation in interface LyGetBoundsInterface
Returns:
the position of the window, or null in none
See Also:
setLocation(int, int), LyGetBoundsInterface.getLocation()

isResizable

public abstract boolean isResizable()
Checks if window is resizable or not.

Returns:
true if the window is resizable, false otherwise

setSize

public void setSize(int width,
                    int height)
Sets the size of the view window at the specified width and height. Sets the _resized attribute.

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

getSize

public int[] getSize()
Gets the current size of the view window.

Specified by:
getSize in interface LyGetBoundsInterface
Returns:
the size of the window, or null if none
See Also:
setSize(int, int), LyGetBoundsInterface.getSize()

resetContent

public void resetContent()
(non-Javadoc).

Specified by:
resetContent in interface LyResetContentInterface
See Also:
LyResetContentInterface.resetContent()

resetContent

public void resetContent(boolean full)
(non-Javadoc).

Specified by:
resetContent in interface LyResetContentInterface
Parameters:
full - indicates whether old components must be removed from graphical view.
See Also:
LyResetContentInterface.resetContent()

actionPerformed

public void actionPerformed(LyActionEvent actionEvent)
(non-Javadoc).

Specified by:
actionPerformed in interface LyActionListener
See Also:
LyActionListener.actionPerformed(leon.view.event.LyActionEvent)

setVisible

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

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

isVisible

public boolean isVisible()
Checks if the view window component is visible or not.

Specified by:
isVisible in interface LyIsVisibleInterface
Returns:
true if the component is showing, false if not or if there is no window
See Also:
LySetVisibleInterface.setVisible(boolean)

setWaiting

public abstract void setWaiting(boolean status)
Sets the waiting status of this component.

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

pack

public void pack()
Packs the current window content and repaints it.


configureDefaultButton

public abstract 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.


free

public void free()
Free all resources used by this dialog view. Unshows the window then removes its listeners before disposing it.

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

getMaxSizeRatio

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

Returns:
100 (100%)

snapshot

public abstract void snapshot(java.lang.String file)
Takes a snapshot of the current view.

Parameters:
file - the file that will contain the snapshot

(c) January 2013 - W4 S.A.

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