LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view
Class LyViewManager

java.lang.Object
  extended by leon.view.LyViewManager
All Implemented Interfaces:
LyViewManagerInterface
Direct Known Subclasses:
LySwingViewManager, LyWebViewManager

public abstract class LyViewManager
extends java.lang.Object
implements LyViewManagerInterface

Communication control layer --> View Will implement remote update notifications.


Field Summary
static java.lang.String __VERSION
           
static short COMMAND_ALL
          For message window : existence of the associated button.
static short COMMAND_CANCEL
          For message window : existence of the associated button.
static short COMMAND_CLOSED
          For message window : window closed (no button pressed).
static short COMMAND_HELP
          For message window : existence of the associated button.
static short COMMAND_NO
          For message window : existence of the associated button.
static short COMMAND_NONE
          For message window : existence of the associated button.
static short COMMAND_OK
          For message window : existence of the associated button.
static short COMMAND_YES
          For message window : existence of the associated button.
static int EMPTY_AREA_HEIGHT
          Height of an empty area when displayed in the graphical builder.
static int EMPTY_AREA_WIDTH
          Width of an empty area when displayed in the graphical builder.
static int EMPTY_FORM_FIELD_HEIGHT
          Height of an empty form field when displayed in the graphical builder.
static int EMPTY_FORM_FIELD_WIDTH
          Width of an empty form field when displayed in the graphical builder.
static int EMPTY_FORM_HEIGHT
          Height of an empty form when displayed in the graphical builder.
static int EMPTY_FORM_WIDTH
          Width of an empty form when displayed in the graphical builder.
static int EMPTY_LABEL_HEIGHT
          Height of an empty label when displayed in the graphical builder.
static int EMPTY_LABEL_WIDTH
          Width of an empty label when displayed in the graphical builder.
static int EMPTY_MENUBAR_HEIGHT
          Height of an empty menubar when displayed in the graphical builder.
static int EMPTY_MESSAGES_HEIGHT
          Height of an empty messages when displayed in the graphical builder.
static int EMPTY_MESSAGES_WIDTH
          Width of an empty messages when displayed in the graphical builder.
static int EMPTY_TABLE_HEIGHT
          Height of an empty table when displayed in the graphical builder.
static int EMPTY_TABLE_WIDTH
          Width of an empty table when displayed in the graphical builder.
static int EMPTY_TOOLBAR_HEIGHT
          Height of an empty toolbar when displayed in the graphical builder.
static int EMPTY_TOOLBAR_WIDTH
          Width of an empty toolbar when displayed in the graphical builder.
static int EMPTY_TOP_AREA_HEIGHT
          Height of an empty area with no parent area when displayed in the graphical builder.
static int EMPTY_TOP_AREA_WIDTH
          Width of an empty area with no parent area when displayed in the graphical builder.
static short SHOW_LOCATION_PARAMETER_FULL_SCREEN
          For show location : indicates whether newly opened window must be full screen.
static short SHOW_LOCATION_PARAMETER_HEIGHT
          For show location : height of the newly opened window.
static short SHOW_LOCATION_PARAMETER_WIDTH
          For show location : width of the newly opened window.
static short SHOW_LOCATION_PARAMETER_X
          For show location : x position of the newly opened window.
static short SHOW_LOCATION_PARAMETER_Y
          For show location : y position of the newly opened window.
 
Constructor Summary
LyViewManager(LyEnvironment environment)
          Constructor.
 
Method Summary
 void addDemandListener(LyDemandListener listener)
          Adds the specified demand listener to receive demands (events) from this component.
 void addView(LyView view)
          Add a view.
 boolean areViewManagerCompatible(LyViewManager otherViewManager)
          Check if this view manager is compatible with the given view manager.
abstract  void askQuestion(LyComponent source, java.lang.String message, LyQuestionAnswerInterface client, java.lang.Object clientData)
          Ask a question to the user The method is asynchronous and the result is returned to the client in messageAnswer.
 void beep()
          Emits a brief sound signal.
 LyChartConverter buildChartConverter(LyChart chart)
          Build an instance of LyChartConverter corresponding to the internal view of the specified chart.
 java.lang.String buildErrorImage(java.lang.String imageKey, short errorLevel)
          Generate a valid error image for the object The image is added into the environment.
abstract  LyViewComponent buildInternalView(LyComponent component)
          Build internal view.
 LyViewComponent buildInternalView(java.lang.String viewClassName, LyComponent component)
          Build internal view.
 LyViewComponent buildInternalView(java.lang.String packageName, java.lang.String prefixName, LyComponent component)
          Build internal view.
abstract  void clearTemporaryResources()
          Clear all the temporary resources used by the viewManager Implemented in subclasses.
 boolean containsView(LyView view)
          Checks if a view is still known or was freed.
abstract  void copyToClipboard(java.lang.String text)
          Copy a given text to the system clipboard.
 boolean encodeImage(java.lang.Object image, java.lang.String imageDir, java.lang.String imageFile)
          Encodes an image to JPEG format.
 void execGui(java.lang.Runnable runnable)
          Causes the run() method of the given runnable to be invoked by the user-interface thread asynchronously.
 void execGui(java.lang.Runnable runnable, boolean synchronous)
          Causes the run() method of the given runnable to be invoked by the user-interface thread either synchronously or asynchronously.
abstract  void exit(int code)
          To exit an application.
 LyComponent findDefinition(java.lang.String componentId)
          Retrieve a registered component by its id.
 void free()
          Free the view manager.
abstract  void freeImage(java.lang.Object image)
          Free the resources of the image if not in the cache.
abstract  java.lang.Object getColor(LyColor color)
          Retrieves a Color object from a LyColor.
 int getControllerStackSize(java.lang.String stackName)
          Returns the stack size (number of controller) for the given stack (or null for default).
 java.lang.String getCurrentWindowName()
          Accessor to the target popup window name if using popup.This is stored on a per-thread basis Default mplementation always return null (used for web modes).
abstract  java.lang.Object getDefaultImage()
          Constructs a default image.
 int getDelay()
          Gets delay between plays.
 LyDemandTransmitter getDemandTransmitter()
          Retrieves the DemandTransmitter which is a gateway between control and presentation layers.
abstract  java.lang.String getDownloadAction()
          Return the action that allow to download temporary resources but dependant from the viewer type (for ex: url / partial url for web).
 LyEnvironment getEnvironment()
          Gets the current environment.
abstract  java.lang.Object getFont(LyFont font)
          Retrieves a Font object from a LyFont.
 int[] getMaxScreenSize()
          Retrieves the viewport size available on the computer.
 int[] getMaxWindowSize()
          Retrieves the maximum size of a window on the computer.
 LyPrintManager getPdfPrintManager(LyPrintDataInterface printDataInterface, java.io.OutputStream output)
          Gets PDF print manager.
 java.lang.String getPluginId()
          Gets the plugin id.
 LyPrintManager getPrintManager(LyPrintDataInterface printDataInterface, java.util.Properties properties)
          Gets print manager.
 java.util.Properties getPropertiesFromContext(java.lang.String prefix)
          Accessor to the properties file or parameter if specified in constructor.
 java.lang.String getRootURL()
          Gets web root URL.
abstract  java.lang.Object getScaledInstance(java.lang.Object image, int width, int height)
          Creates a scaled version of the given image.
 int[] getScreenSize(java.lang.Object component)
          Retrieves the screen size.
abstract  int[] getSizes(java.lang.Object image)
          Gets images sizes.
 java.lang.String getSlaveSessionClassName()
          Returns the name of the Java class that must be used to instanciate a new slave session.
abstract  int getStringWidth(LyFont font, java.lang.String text)
          Retrieves the width of a string for a given LyFont.
 java.lang.String getTemporaryDir()
          Return the temporary directory used to store temporary resources.
abstract  java.lang.String getTemporaryLocation()
          Return the temporary directory used to store temporary resources but dependant from the viewer type (for ex: url / partial url for web).
 LyView getView(int idx)
          Get a view from a specified index.
 LyView getView(java.lang.String id)
          Get a view from a specified index.
 int getViewCount()
          Retrieve a view.
 int getWaitingCounter()
          Gets waiting counter.
 boolean hasPerspective()
          Indicates if the view manager handles perspectives.
 boolean hasProperty(java.lang.String property)
          Checks if the view manager has the given property.
abstract  boolean isMultiSession()
          Indicates wether this view manager handles multiple user sessions or not.
 boolean isPortletMode()
          Indicates whether this view manager is in portlet mode.
 boolean isRtlMode()
          Indicates whether RTL (right to left) mode is activated
abstract  boolean isSameImage(java.lang.Object image1, java.lang.Object image2)
          Compare two images pixel by pixel.
 boolean isShared()
          Indicates whether current view manager is being shared.
 java.util.Vector<LyComponent> loadDefinitions(java.io.InputStream xmlStream)
          Load external definitions that can be used as templates for new components.
 java.util.Vector<LyComponent> loadDefinitions(java.lang.String xmlFile)
          Load external definitions that can be used as templates for new components.
abstract  java.lang.Object loadImageFromStream(java.lang.Object component, java.io.InputStream resource)
          Retrieves an image from a Stream.
 LyAnswerInterface messageActionPerformed(java.lang.Object message, int cmdResult)
          Method used to call back the listener of the specified message window for the specified result.
 void moveCursor(LyComponent component)
          Moves mouse on component.
 void prepareGui()
          Prepares GUI to start.
 void processDemand(java.lang.String listenerId, LyDemand demand)
          Processes demands on this component.
 void raiseError(java.lang.String message)
          Shows en error message to the end-user.
 void registerDefinition(LyComponent component)
          Register component as definition.
 void removeDemandListener(LyDemandListener listener)
          Removes the specified demand listener to receive demands from this component.
 void removeView(LyView view)
          Removes a view.
 boolean replay()
          Plays next item in test file.
 boolean repostGuiEvents()
          Method for checking if events on data need to be reposted in GUI event queue.
 void setCurrentWindowName(java.lang.String name)
          Accessor to the target popup window name if using popup.This is stored on a per-thread basis Default mplementation always return null (used for web modes).
 void setPluginId(java.lang.String pluginId)
          Sets the plugin id.
abstract  void setWaiting(boolean status)
          Set Waiting status for all view of the application Implemented in subclasses.
 void shareSession(java.lang.Object sharedSession, java.util.Vector<java.lang.Object> oldSession, java.lang.String applicationId)
          Share a session with other sessions.
 void showComments(java.lang.String comments)
          Show given comments to end-user.
abstract  void showError(LyComponent source, java.lang.String message)
          Shows a warning message to the user.
abstract  void showFile(LyComponent source, java.lang.String location)
          Shows a file to the user.
abstract  void showLocation(LyComponent source, java.lang.String location, boolean newWindow)
          Shows a location to the user.
abstract  void showLocation(LyComponent source, java.lang.String location, boolean newWindow, java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
          Shows a location to the user.
abstract  void showMessage(LyComponent source, java.lang.String title, java.lang.String icon, java.lang.String message, java.util.BitSet commands, LyMessageAnswerInterface client, java.lang.Object clientData)
          Show a message to the user and return the selection code.
abstract  void showPDFPreview(LyComponent source, java.lang.String location)
          Shows a PDF file to the user.
 void showPerspective(java.lang.String moduleId, java.lang.String perspectiveId)
          Show the perspective corresponding to the perspectiveId.
abstract  void showWarning(LyComponent source, java.lang.String message)
          Shows a warning message to the user.
 void startGui(LyGuiClientInterface client)
          Starts GUI.
 void stopGui(LyGuiClientInterface client)
          Stops GUI.
 void swapSession(java.lang.Object newSession, java.lang.Object oldSession, java.lang.String applicationId)
          Swap two sessions.
 void takeSnapshot(LyArea area, java.lang.String file)
           
 void takeSnapshot(LyView view, java.lang.String file)
           
 LyComponent unregisterDefinition(LyComponent component)
          Unregister component definition.
 void updateControllersStackList(java.util.Hashtable<java.lang.String,java.util.Stack<LyViewController>> controllersStackList)
          Updates the _controllerStackList parameter with the count of controllers from the controllersStackList parameter. controllersStackList must contain names of controller stacks as keys and stack of controllers as values.
abstract  boolean useCacheForImage(java.lang.String path, java.lang.Object image)
          Indicates whether given image may be cached.
abstract  void waitForLoading(java.lang.Object component, java.lang.Object image)
          Waits for the image loaging.
 
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

COMMAND_CLOSED

public static final short COMMAND_CLOSED
For message window : window closed (no button pressed).

See Also:
Constant Field Values

COMMAND_OK

public static final short COMMAND_OK
For message window : existence of the associated button.

See Also:
Constant Field Values

COMMAND_YES

public static final short COMMAND_YES
For message window : existence of the associated button.

See Also:
Constant Field Values

COMMAND_ALL

public static final short COMMAND_ALL
For message window : existence of the associated button.

See Also:
Constant Field Values

COMMAND_NONE

public static final short COMMAND_NONE
For message window : existence of the associated button.

See Also:
Constant Field Values

COMMAND_NO

public static final short COMMAND_NO
For message window : existence of the associated button.

See Also:
Constant Field Values

COMMAND_CANCEL

public static final short COMMAND_CANCEL
For message window : existence of the associated button.

See Also:
Constant Field Values

COMMAND_HELP

public static final short COMMAND_HELP
For message window : existence of the associated button.

See Also:
Constant Field Values

EMPTY_AREA_WIDTH

public static int EMPTY_AREA_WIDTH
Width of an empty area when displayed in the graphical builder.


EMPTY_AREA_HEIGHT

public static int EMPTY_AREA_HEIGHT
Height of an empty area when displayed in the graphical builder.


EMPTY_TOP_AREA_WIDTH

public static int EMPTY_TOP_AREA_WIDTH
Width of an empty area with no parent area when displayed in the graphical builder.


EMPTY_TOP_AREA_HEIGHT

public static int EMPTY_TOP_AREA_HEIGHT
Height of an empty area with no parent area when displayed in the graphical builder.


EMPTY_FORM_WIDTH

public static int EMPTY_FORM_WIDTH
Width of an empty form when displayed in the graphical builder.


EMPTY_FORM_HEIGHT

public static int EMPTY_FORM_HEIGHT
Height of an empty form when displayed in the graphical builder.


EMPTY_FORM_FIELD_WIDTH

public static int EMPTY_FORM_FIELD_WIDTH
Width of an empty form field when displayed in the graphical builder.


EMPTY_FORM_FIELD_HEIGHT

public static int EMPTY_FORM_FIELD_HEIGHT
Height of an empty form field when displayed in the graphical builder.


EMPTY_LABEL_WIDTH

public static int EMPTY_LABEL_WIDTH
Width of an empty label when displayed in the graphical builder.


EMPTY_LABEL_HEIGHT

public static int EMPTY_LABEL_HEIGHT
Height of an empty label when displayed in the graphical builder.


EMPTY_MESSAGES_WIDTH

public static int EMPTY_MESSAGES_WIDTH
Width of an empty messages when displayed in the graphical builder.


EMPTY_MESSAGES_HEIGHT

public static int EMPTY_MESSAGES_HEIGHT
Height of an empty messages when displayed in the graphical builder.


EMPTY_TABLE_WIDTH

public static int EMPTY_TABLE_WIDTH
Width of an empty table when displayed in the graphical builder.


EMPTY_TABLE_HEIGHT

public static int EMPTY_TABLE_HEIGHT
Height of an empty table when displayed in the graphical builder.


EMPTY_TOOLBAR_WIDTH

public static int EMPTY_TOOLBAR_WIDTH
Width of an empty toolbar when displayed in the graphical builder.


EMPTY_TOOLBAR_HEIGHT

public static int EMPTY_TOOLBAR_HEIGHT
Height of an empty toolbar when displayed in the graphical builder.


EMPTY_MENUBAR_HEIGHT

public static int EMPTY_MENUBAR_HEIGHT
Height of an empty menubar when displayed in the graphical builder.


SHOW_LOCATION_PARAMETER_X

public static final short SHOW_LOCATION_PARAMETER_X
For show location : x position of the newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_Y

public static final short SHOW_LOCATION_PARAMETER_Y
For show location : y position of the newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_WIDTH

public static final short SHOW_LOCATION_PARAMETER_WIDTH
For show location : width of the newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_HEIGHT

public static final short SHOW_LOCATION_PARAMETER_HEIGHT
For show location : height of the newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_FULL_SCREEN

public static final short SHOW_LOCATION_PARAMETER_FULL_SCREEN
For show location : indicates whether newly opened window must be full screen.

See Also:
Constant Field Values
Constructor Detail

LyViewManager

public LyViewManager(LyEnvironment environment)
Constructor.

Method Detail

free

public void free()
Free the view manager. Clears all

Specified by:
free in interface LyViewManagerInterface

prepareGui

public void prepareGui()
Prepares GUI to start.

Specified by:
prepareGui in interface LyViewManagerInterface

startGui

public void startGui(LyGuiClientInterface client)
Starts GUI.

Specified by:
startGui in interface LyViewManagerInterface
Parameters:
client - the GUI client

stopGui

public void stopGui(LyGuiClientInterface client)
Stops GUI.

Specified by:
stopGui in interface LyViewManagerInterface
Parameters:
client - the GUI client

execGui

public void execGui(java.lang.Runnable runnable,
                    boolean synchronous)
Causes the run() method of the given runnable to be invoked by the user-interface thread either synchronously or asynchronously. If asynchronous, the caller of this method continues to run in parallel, and is not notified when the runnable has completed. Otherwise, the thread which calls this method is suspended until the runnable completes.

Specified by:
execGui in interface LyViewManagerInterface
Parameters:
runnable - Code to run on the user-interface thread.
sychronous - True is synchronous, false if asynchronous.

execGui

public final void execGui(java.lang.Runnable runnable)
Causes the run() method of the given runnable to be invoked by the user-interface thread asynchronously. The caller of this method continues to run in parallel, and is not notified when the runnable has completed.

Specified by:
execGui in interface LyViewManagerInterface
Parameters:
runnable - Code to run on the user-interface thread.

buildInternalView

public abstract LyViewComponent buildInternalView(LyComponent component)
Build internal view.


buildInternalView

public LyViewComponent buildInternalView(java.lang.String packageName,
                                         java.lang.String prefixName,
                                         LyComponent component)
Build internal view.


buildInternalView

public LyViewComponent buildInternalView(java.lang.String viewClassName,
                                         LyComponent component)
Build internal view.


addView

public void addView(LyView view)
Add a view.


removeView

public void removeView(LyView view)
Removes a view.


containsView

public boolean containsView(LyView view)
Checks if a view is still known or was freed.


getView

public LyView getView(int idx)
Get a view from a specified index.

Parameters:
idx - index of the view
Returns:
the view or null if out of bounds (getViewCount)

getView

public LyView getView(java.lang.String id)
Get a view from a specified index.

Parameters:
idx - index of the view
Returns:
the view

getViewCount

public int getViewCount()
Retrieve a view.


updateControllersStackList

public void updateControllersStackList(java.util.Hashtable<java.lang.String,java.util.Stack<LyViewController>> controllersStackList)
Updates the _controllerStackList parameter with the count of controllers from the controllersStackList parameter. controllersStackList must contain names of controller stacks as keys and stack of controllers as values. _controllerStackList must contain names of controller stacks as keys and stack of controllers as values.

Parameters:
controllersStackList -

getControllerStackSize

public int getControllerStackSize(java.lang.String stackName)
Returns the stack size (number of controller) for the given stack (or null for default).

Parameters:
stackName - the name of the controller stack or null if default stack is considered
Returns:
the number of controllers or null if stack is empty.

hasProperty

public boolean hasProperty(java.lang.String property)
Description copied from interface: LyViewManagerInterface
Checks if the view manager has the given property.

Specified by:
hasProperty in interface LyViewManagerInterface
Parameters:
property - the property to find
Returns:
true is the view manager has the property, false otherwise

getEnvironment

public LyEnvironment getEnvironment()
Description copied from interface: LyViewManagerInterface
Gets the current environment.

Specified by:
getEnvironment in interface LyViewManagerInterface
Returns:
the environment

buildChartConverter

public LyChartConverter buildChartConverter(LyChart chart)
Build an instance of LyChartConverter corresponding to the internal view of the specified chart.

Parameters:
chart - the chart to convert
Returns:
an instance of chart converter corresponding to the internal view of the specified chart.

clearTemporaryResources

public abstract void clearTemporaryResources()
Clear all the temporary resources used by the viewManager Implemented in subclasses.

Specified by:
clearTemporaryResources in interface LyViewManagerInterface

getTemporaryLocation

public abstract java.lang.String getTemporaryLocation()
Return the temporary directory used to store temporary resources but dependant from the viewer type (for ex: url / partial url for web).

Specified by:
getTemporaryLocation in interface LyViewManagerInterface
Returns:
the temporary directory

getDownloadAction

public abstract java.lang.String getDownloadAction()
Return the action that allow to download temporary resources but dependant from the viewer type (for ex: url / partial url for web).


setWaiting

public abstract void setWaiting(boolean status)
Set Waiting status for all view of the application Implemented in subclasses.


showWarning

public abstract void showWarning(LyComponent source,
                                 java.lang.String message)
Shows a warning message to the user.

Parameters:
source - view element which raises the warning
message - warning message

raiseError

public final void raiseError(java.lang.String message)
Shows en error message to the end-user.

Specified by:
raiseError in interface LyViewManagerInterface
Parameters:
message - error message

showError

public abstract void showError(LyComponent source,
                               java.lang.String message)
Shows a warning message to the user.

Parameters:
source - view element which raises the error
message - error message

askQuestion

public abstract void askQuestion(LyComponent source,
                                 java.lang.String message,
                                 LyQuestionAnswerInterface client,
                                 java.lang.Object clientData)
Ask a question to the user The method is asynchronous and the result is returned to the client in messageAnswer. This method will block untill validation is done A timeout may also be implemented by subclasses.

Parameters:
source - view element which asks the question
message - text of the question
client - registred to receive the response.
clientData - freely set data which will be returned with the response.

showMessage

public abstract void showMessage(LyComponent source,
                                 java.lang.String title,
                                 java.lang.String icon,
                                 java.lang.String message,
                                 java.util.BitSet commands,
                                 LyMessageAnswerInterface client,
                                 java.lang.Object clientData)
Show a message to the user and return the selection code.

Parameters:
source - view element which asks the question
title - title of the message window
icon - icon shown in the message window
message - text of the message
commands - bitset which contains COMMAND_xxx values
client - registred to receive the response.
clientData - freely set data which will be returned with the response.

showLocation

public abstract void showLocation(LyComponent source,
                                  java.lang.String location,
                                  boolean newWindow)
Shows a location to the user.

Parameters:
source - view element which raises the location
location - location
newWindow - indicates whether a new window must be opened

showLocation

public abstract void showLocation(LyComponent source,
                                  java.lang.String location,
                                  boolean newWindow,
                                  java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
Shows a location to the user.

Parameters:
source - view element which raises the location
location - location
newWindow - indicates whether a new window must be opened
parameters - list of parameters

showFile

public abstract void showFile(LyComponent source,
                              java.lang.String location)
Shows a file to the user.

Parameters:
source - view element which raises the location
location - location

showPDFPreview

public abstract void showPDFPreview(LyComponent source,
                                    java.lang.String location)
Shows a PDF file to the user.
This makes a preview for printings.

Parameters:
source - view element which raises the location
location - location

exit

public abstract void exit(int code)
To exit an application.

Specified by:
exit in interface LyViewManagerInterface
Parameters:
code - exit code of the application.

copyToClipboard

public abstract void copyToClipboard(java.lang.String text)
Copy a given text to the system clipboard.

Parameters:
text - the text to be copied to the clipboard.

getScreenSize

public int[] getScreenSize(java.lang.Object component)
Retrieves the screen size.

Specified by:
getScreenSize in interface LyViewManagerInterface
Parameters:
component - The component used to retrieve the screen size.
Returns:
The dimension of the screen used for displaying views.

getMaxScreenSize

public int[] getMaxScreenSize()
Retrieves the viewport size available on the computer.

Specified by:
getMaxScreenSize in interface LyViewManagerInterface
Returns:
The addition of all screen sizes.

getMaxWindowSize

public int[] getMaxWindowSize()
Retrieves the maximum size of a window on the computer.


isMultiSession

public abstract boolean isMultiSession()
Indicates wether this view manager handles multiple user sessions or not.

Specified by:
isMultiSession in interface LyViewManagerInterface
Returns:
true if the view manager uses multiple user sessions (like web server)

beep

public void beep()
Emits a brief sound signal.

Specified by:
beep in interface LyViewManagerInterface

getColor

public abstract java.lang.Object getColor(LyColor color)
Retrieves a Color object from a LyColor.

Specified by:
getColor in interface LyViewManagerInterface
Parameters:
key - The leonardi color.
Returns:
A reference to the requested color, or null if it could not be found.
See Also:
LyColors

getFont

public abstract java.lang.Object getFont(LyFont font)
Retrieves a Font object from a LyFont.

Specified by:
getFont in interface LyViewManagerInterface
Parameters:
key - The leonardi font.
Returns:
A reference to the requested font, or null if it could not be found.
See Also:
LyColors

getStringWidth

public abstract int getStringWidth(LyFont font,
                                   java.lang.String text)
Retrieves the width of a string for a given LyFont.

Specified by:
getStringWidth in interface LyViewManagerInterface
Parameters:
font - The leonardi font.
text - The string value.
Returns:
The width of given string for given font.

getDefaultImage

public abstract java.lang.Object getDefaultImage()
Constructs a default image.

Specified by:
getDefaultImage in interface LyViewManagerInterface
Returns:
the built default image

getSizes

public abstract int[] getSizes(java.lang.Object image)
Gets images sizes.

Specified by:
getSizes in interface LyViewManagerInterface
Parameters:
image - the image
Returns:
Image size (table with 2 entries).

getScaledInstance

public abstract java.lang.Object getScaledInstance(java.lang.Object image,
                                                   int width,
                                                   int height)
Creates a scaled version of the given image.

Specified by:
getScaledInstance in interface LyViewManagerInterface
Parameters:
image - The image to scale.
width - The width to which to scale the image.
height - The height to which to scale the image.
Returns:
A scaled version of the image.

waitForLoading

public abstract void waitForLoading(java.lang.Object component,
                                    java.lang.Object image)
                             throws java.lang.InterruptedException
Waits for the image loaging.

Specified by:
waitForLoading in interface LyViewManagerInterface
Parameters:
image - Image to load.
component - The image loading client
Throws:
java.lang.InterruptedException - if the wait is interruptued

loadImageFromStream

public abstract java.lang.Object loadImageFromStream(java.lang.Object component,
                                                     java.io.InputStream resource)
                                              throws java.io.IOException
Retrieves an image from a Stream.

Specified by:
loadImageFromStream in interface LyViewManagerInterface
Parameters:
component - The client of the image creation.
resource - stream inputStream to the image data
Returns:
the image or null if an error occurs
Throws:
java.io.IOException - if something is wrong during the process

isSameImage

public abstract boolean isSameImage(java.lang.Object image1,
                                    java.lang.Object image2)
                             throws java.lang.InterruptedException
Compare two images pixel by pixel.

Parameters:
image1 - first image to compare
image2 - second image to compare
Returns:
true if images are identical.
Throws:
java.lang.InterruptedException - exception if problems on grabber or loading.

freeImage

public abstract void freeImage(java.lang.Object image)
Free the resources of the image if not in the cache. If the image is in the cache, this method does nothing.

Specified by:
freeImage in interface LyViewManagerInterface
Parameters:
image - The image that must be freed.

useCacheForImage

public abstract boolean useCacheForImage(java.lang.String path,
                                         java.lang.Object image)
Indicates whether given image may be cached. Default implementation returns true.

Specified by:
useCacheForImage in interface LyViewManagerInterface
Parameters:
path - The path of image that may be cached.
image - The image that may be cached.
Returns:
true if image may be cached, false otherwise

getCurrentWindowName

public java.lang.String getCurrentWindowName()
Accessor to the target popup window name if using popup.This is stored on a per-thread basis Default mplementation always return null (used for web modes).

Returns:
the window name or null for default main browser window

setCurrentWindowName

public void setCurrentWindowName(java.lang.String name)
Accessor to the target popup window name if using popup.This is stored on a per-thread basis Default mplementation always return null (used for web modes).


getPrintManager

public LyPrintManager getPrintManager(LyPrintDataInterface printDataInterface,
                                      java.util.Properties properties)
Gets print manager.


getPdfPrintManager

public LyPrintManager getPdfPrintManager(LyPrintDataInterface printDataInterface,
                                         java.io.OutputStream output)
Gets PDF print manager.


buildErrorImage

public java.lang.String buildErrorImage(java.lang.String imageKey,
                                        short errorLevel)
Generate a valid error image for the object The image is added into the environment.

Parameters:
imageKey - the key to the image without error
errorLevel - current error level.
Returns:
the new key fot the image or imageKey if unchanged.

showPerspective

public void showPerspective(java.lang.String moduleId,
                            java.lang.String perspectiveId)
Show the perspective corresponding to the perspectiveId. Default implementation always does nothing (used for eclipse mode).

Parameters:
moduleId - The id of the module which demands this display.
perspectiveId - The id of the perspective to display.

hasPerspective

public boolean hasPerspective()
Indicates if the view manager handles perspectives.

Returns:
true if the view manager handles perspectives, false otherwise.

encodeImage

public boolean encodeImage(java.lang.Object image,
                           java.lang.String imageDir,
                           java.lang.String imageFile)
Encodes an image to JPEG format.

Parameters:
image - the image to encode
imageDir - temporary directory (optional)
imageFile - the JPEG File
Returns:
true if the file was generated, false otherwise.

repostGuiEvents

public boolean repostGuiEvents()
Method for checking if events on data need to be reposted in GUI event queue.

Specified by:
repostGuiEvents in interface LyViewManagerInterface
Returns:
True if the event need to be reposted, false otherwise.

messageActionPerformed

public LyAnswerInterface messageActionPerformed(java.lang.Object message,
                                                int cmdResult)
Method used to call back the listener of the specified message window for the specified result.

Parameters:
messageWindow -
cmdResult -

getDemandTransmitter

public LyDemandTransmitter getDemandTransmitter()
Retrieves the DemandTransmitter which is a gateway between control and presentation layers.

Returns:
The LyDemandTransmitter instance associated with the environment or the one associated with the parent if the environment does not have a view manager.

replay

public boolean replay()
Plays next item in test file.


getDelay

public int getDelay()
Gets delay between plays.


takeSnapshot

public void takeSnapshot(LyView view,
                         java.lang.String file)

takeSnapshot

public void takeSnapshot(LyArea area,
                         java.lang.String file)

getPluginId

public java.lang.String getPluginId()
Gets the plugin id.

Specified by:
getPluginId in interface LyViewManagerInterface
Returns:
The plugin id.

setPluginId

public void setPluginId(java.lang.String pluginId)
Sets the plugin id.

Specified by:
setPluginId in interface LyViewManagerInterface
Parameters:
The - plugin id.

addDemandListener

public void addDemandListener(LyDemandListener listener)
Adds the specified demand listener to receive demands (events) from this component. (LyDemandTransmitter interface)

Parameters:
listener - client for the demand

removeDemandListener

public void removeDemandListener(LyDemandListener listener)
Removes the specified demand listener to receive demands from this component. (LyDemandTransmitter interface)

Parameters:
listener - client for the demand

processDemand

public void processDemand(java.lang.String listenerId,
                          LyDemand demand)
Processes demands on this component.

Parameters:
controllerId - the demand is sent to the specified listener (LyDemandTransmitter interface)

moveCursor

public void moveCursor(LyComponent component)
Moves mouse on component.


showComments

public void showComments(java.lang.String comments)
Show given comments to end-user.


swapSession

public void swapSession(java.lang.Object newSession,
                        java.lang.Object oldSession,
                        java.lang.String applicationId)
Swap two sessions.

Parameters:
newSession - the new session
oldSession - the old session
applicationId - the application id

shareSession

public void shareSession(java.lang.Object sharedSession,
                         java.util.Vector<java.lang.Object> oldSession,
                         java.lang.String applicationId)
Share a session with other sessions.

Parameters:
sharedSession - the shared session
sharingSessions - the list of sessions sharing the shared session
applicationId - the application id

isShared

public boolean isShared()
Indicates whether current view manager is being shared.

Returns:
true if current view manager is being shared, false otherwise.

areViewManagerCompatible

public boolean areViewManagerCompatible(LyViewManager otherViewManager)
Check if this view manager is compatible with the given view manager.

Parameters:
otherViewManager - the other view manager
Returns:
true if both view manager are compatible

getRootURL

public java.lang.String getRootURL()
Gets web root URL.

Specified by:
getRootURL in interface LyViewManagerInterface

loadDefinitions

public java.util.Vector<LyComponent> loadDefinitions(java.io.InputStream xmlStream)
Load external definitions that can be used as templates for new components.

Parameters:
xmlStream - An xml stream that contains the templates definitions.
Returns:
List of components loaded on parsing given XML file.

loadDefinitions

public java.util.Vector<LyComponent> loadDefinitions(java.lang.String xmlFile)
Load external definitions that can be used as templates for new components.

Parameters:
xmlFile - File path of the XML file that contains the templates definitions.
Returns:
List of components loaded on parsing given XML file.

registerDefinition

public void registerDefinition(LyComponent component)
Register component as definition.

Parameters:
component - Component to register in definitions list.
Throws:
java.lang.IllegalArgumentException - If a definition with given id was already registered.

unregisterDefinition

public LyComponent unregisterDefinition(LyComponent component)
Unregister component definition.

Parameters:
component - Component to unregister from definitions list.
Returns:
The unregistered component if found, false otherwise.

findDefinition

public LyComponent findDefinition(java.lang.String componentId)
Retrieve a registered component by its id.

Parameters:
Id - of the searched component.
Returns:
The definition corresponding to the given id if found, false otherwise.
Throws:
java.lang.IllegalArgumentException - If no definition found with given id.

getWaitingCounter

public int getWaitingCounter()
Gets waiting counter. Each call to setWaiting(true) increments counter, each call to setWaiting(false) decrements it (until 0 is reached).

Returns:
The waiting counter.

getPropertiesFromContext

public java.util.Properties getPropertiesFromContext(java.lang.String prefix)
Accessor to the properties file or parameter if specified in constructor.

Specified by:
getPropertiesFromContext in interface LyViewManagerInterface
Parameters:
prefix - Prefix used for properties files name.
Returns:
the properties.

getTemporaryDir

public java.lang.String getTemporaryDir()
Return the temporary directory used to store temporary resources.

Specified by:
getTemporaryDir in interface LyViewManagerInterface
Returns:
the directory

isRtlMode

public boolean isRtlMode()
Indicates whether RTL (right to left) mode is activated

Specified by:
isRtlMode in interface LyViewManagerInterface
Returns:
true is RTL mode is activated, false otherwise.

isPortletMode

public boolean isPortletMode()
Indicates whether this view manager is in portlet mode.

Returns:
true if portlet mode is activated, false otherwise.

getSlaveSessionClassName

public java.lang.String getSlaveSessionClassName()
Returns the name of the Java class that must be used to instanciate a new slave session.

Returns:
null if default session class must be used, a full java path otherwise.

(c) January 2013 - W4 S.A.

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