LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.misc
Interface LyViewManagerInterface

All Known Implementing Classes:
LyJQViewManager, LyMobileViewManager, LyStrutsViewManager, LySwingViewManager, LyViewManager, LyWebViewManager

public interface LyViewManagerInterface

Interface for view managers.


Field Summary
static java.lang.String __VERSION
           
 
Method Summary
 void beep()
          Emits a brief sound signal.
 void clearTemporaryResources()
          Clears all temporary resources used by the view manager.
 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.
 void exit(int code)
          To exit an application.
 void free()
          Frees the view manager.
 void freeImage(java.lang.Object image)
          Free resources of the image if not in the cache else does nothing.
 java.lang.Object getColor(LyColor color)
          Retrieves a Color object from a LyColor.
 java.lang.Object getDefaultImage()
          Builds a default image.
 LyEnvironment getEnvironment()
          Gets the current environment.
 java.lang.Object getFont(LyFont font)
          Retrieves a Font object from a LyFont.
 int[] getMaxScreenSize()
          Retrieves the viewport size available on the computer.
 java.lang.String getPluginId()
          Gets the plugin id.
 java.util.Properties getPropertiesFromContext(java.lang.String prefix)
          Accessor to the properties file.
 java.lang.String getRootURL()
          Gets web root URL.
 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.
 int[] getSizes(java.lang.Object image)
          Gets images sizes.
 int getStringWidth(LyFont font, java.lang.String text)
          Retrieves the width of a string for a given LyFont.
 java.lang.String getTemporaryDir()
          Gets the temporary directory used to store temporary resources.
 java.lang.String getTemporaryLocation()
          Gets the temporary location used to store temporary resources dependently of the viewer type (e.g.
 boolean hasProperty(java.lang.String property)
          Checks if the view manager has the given property.
 boolean isMultiSession()
          Indicates if the view manager is multi session or not.
 boolean isRtlMode()
          Indicates whether RTL (right to left) mode is activated
 java.lang.Object loadImageFromStream(java.lang.Object component, java.io.InputStream resource)
          Retrieves an image from a Stream.
 void prepareGui()
          Prepares GUI to start.
 void raiseError(java.lang.String message)
          Shows an error message to the end-user.
 boolean repostGuiEvents()
          Checks if events on data need to be reposted in GUI event queue.
 void setPluginId(java.lang.String pluginId)
          Sets the plugin id.
 void startGui(LyGuiClientInterface client)
          Starts GUI.
 void stopGui(LyGuiClientInterface client)
          Stops GUI.
 boolean useCacheForImage(java.lang.String path, java.lang.Object image)
          Indicates whether given image may be cached.
 void waitForLoading(java.lang.Object component, java.lang.Object image)
          Waits for the image loading.
 

Field Detail

__VERSION

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

free

void free()
Frees the view manager. Clears all.


prepareGui

void prepareGui()
Prepares GUI to start.


startGui

void startGui(LyGuiClientInterface client)
Starts GUI.

Parameters:
client - the GUI client

stopGui

void stopGui(LyGuiClientInterface client)
Stops GUI.

Parameters:
client - the GUI client

execGui

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.

Parameters:
runnable - Code to run on the user-interface thread.
synchronous - True is synchronous, false if asynchronous.

execGui

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.

Parameters:
runnable - Code to run on the user-interface thread.

hasProperty

boolean hasProperty(java.lang.String property)
Checks if the view manager has the given property.

Parameters:
property - the property to find
Returns:
true is the view manager has the property, false otherwise

getEnvironment

LyEnvironment getEnvironment()
Gets the current environment.

Returns:
the environment

clearTemporaryResources

void clearTemporaryResources()
Clears all temporary resources used by the view manager.
This method must be implemented by sub classes.


getTemporaryDir

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

Returns:
the directory

getTemporaryLocation

java.lang.String getTemporaryLocation()
Gets the temporary location used to store temporary resources dependently of the viewer type (e.g. URL or relative URL for web).

Returns:
the temporary directory

exit

void exit(int code)
To exit an application.

Parameters:
code - exit code of the application.

repostGuiEvents

boolean repostGuiEvents()
Checks if events on data need to be reposted in GUI event queue.

Returns:
True if the event need to be reposted, false otherwise.

isMultiSession

boolean isMultiSession()
Indicates if the view manager is multi session or not.

Returns:
true if the view manager is multi session, false otherwise

getColor

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

Parameters:
color - The leonardi color.
Returns:
A reference to the requested color if it is found, null otherwise
See Also:
LyColor

getFont

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

Parameters:
font - The leonardi font.
Returns:
A reference to the requested font if it is found, null otherwise
See Also:
LyFont

getStringWidth

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

Parameters:
font - The leonardi font.
text - The string value.
Returns:
The width of given string for given font.

getDefaultImage

java.lang.Object getDefaultImage()
Builds a default image.

Returns:
the built default image

getSizes

int[] getSizes(java.lang.Object image)
Gets images sizes. The result is given in an array where position 0 is the width and at position 1 the height.

Parameters:
image - the image
Returns:
Image size (table with 2 entries).

getScaledInstance

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

Parameters:
image - the image to scale.
width - the width to scale the image.
height - the height to scale the image.
Returns:
A scaled version of the image.

getScreenSize

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

Parameters:
component - the component used to retrieve the screen size
Returns:
the dimension of the screen used to display views

getMaxScreenSize

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

Returns:
The addition of all screen sizes.

beep

void beep()
Emits a brief sound signal.


raiseError

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

Parameters:
message - error message

waitForLoading

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

Parameters:
component - The image loading client
image - the image to load
Throws:
java.lang.InterruptedException - if the wait is interruptued

loadImageFromStream

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

Parameters:
component - The image creation client.
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

freeImage

void freeImage(java.lang.Object image)
Free resources of the image if not in the cache else does nothing.

Parameters:
image - The image that must be freed.

useCacheForImage

boolean useCacheForImage(java.lang.String path,
                         java.lang.Object image)
Indicates whether given image may be cached.

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

getPluginId

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

Returns:
The plugin id.

setPluginId

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

Parameters:
pluginId - the new plugin id

getRootURL

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


getPropertiesFromContext

java.util.Properties getPropertiesFromContext(java.lang.String prefix)
Accessor to the properties file.

Parameters:
prefix - Prefix used for properties files name.
Returns:
the properties.

isRtlMode

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

Returns:
true is RTL mode is activated, false otherwise.

(c) January 2013 - W4 S.A.

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