LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingViewManager

java.lang.Object
  extended by leon.view.LyViewManager
      extended by leon.view.win.swing.LySwingViewManager
All Implemented Interfaces:
java.awt.datatransfer.ClipboardOwner, LyViewManagerInterface, LyActionListener

public class LySwingViewManager
extends LyViewManager
implements LyActionListener, java.awt.datatransfer.ClipboardOwner

This class serves as a layer between the communication controller and the view. It implements remote update notifications.


Field Summary
static java.lang.String __VERSION
           
static java.awt.Frame _frame
          Default Frame used in some parts of the code when a default AWT component is needed (for example to create an image).
static java.awt.Cursor DEFAULT_CURSOR
          Default cursor.
static long START_WAITING_DELAY
          Start waiting delay.
static java.lang.String SYNTH_STYLE_FACTORY
          Defines the style of the Synth look and feel using a factory.
static java.lang.String SYNTH_XML_CLASS_FILE
          Defines a class file used to load the Synth look and feel.
static java.lang.String SYNTH_XML_STYLE_FILE
          Defines the style of the Synth look and feel using an XML description.
static java.awt.Cursor WAIT_CURSOR
          Waiting cursor.
 
Fields inherited from class leon.view.LyViewManager
COMMAND_ALL, COMMAND_CANCEL, COMMAND_CLOSED, COMMAND_HELP, COMMAND_NO, COMMAND_NONE, COMMAND_OK, COMMAND_YES, EMPTY_AREA_HEIGHT, EMPTY_AREA_WIDTH, EMPTY_FORM_FIELD_HEIGHT, EMPTY_FORM_FIELD_WIDTH, EMPTY_FORM_HEIGHT, EMPTY_FORM_WIDTH, EMPTY_LABEL_HEIGHT, EMPTY_LABEL_WIDTH, EMPTY_MENUBAR_HEIGHT, EMPTY_MESSAGES_HEIGHT, EMPTY_MESSAGES_WIDTH, EMPTY_TABLE_HEIGHT, EMPTY_TABLE_WIDTH, EMPTY_TOOLBAR_HEIGHT, EMPTY_TOOLBAR_WIDTH, EMPTY_TOP_AREA_HEIGHT, EMPTY_TOP_AREA_WIDTH, SHOW_LOCATION_PARAMETER_FULL_SCREEN, SHOW_LOCATION_PARAMETER_HEIGHT, SHOW_LOCATION_PARAMETER_WIDTH, SHOW_LOCATION_PARAMETER_X, SHOW_LOCATION_PARAMETER_Y
 
Constructor Summary
LySwingViewManager(LyEnvironment environment)
          Class constructor of a view manager.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 boolean askQuestion(LyComponent source, java.lang.String message)
          Asks a question to the user.
 void askQuestion(LyComponent source, java.lang.String message, LyQuestionAnswerInterface client, java.lang.Object clientData)
          Asks a question to the user.
 void beep()
          (non-Javadoc).
 LyViewComponent buildInternalView(LyComponent component)
          (non-Javadoc).
 void clearTemporaryResources()
          Nothing is done at this level.
 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)
          (non-Javadoc).
 void execGui(java.lang.Runnable runnable, boolean synchronous)
          (non-Javadoc).
 void exit(int code)
          (non-Javadoc).
 void freeImage(java.lang.Object image)
          (non-Javadoc).
 java.lang.Object getColor(LyColor color)
          (non-Javadoc).
static java.awt.Frame getDefaultFrame()
          Returns the default AWT frame.
 java.lang.Object getDefaultImage()
          (non-Javadoc).
static javax.swing.JFrame getDefaultJFrame()
          Returns the default swing frame.
 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).
 java.lang.Object getFont(LyFont font)
          (non-Javadoc).
 int[] getMaxScreenSize()
          Retrieves the viewport size available on the computer.
 int[] getMaxWindowSize()
          Retrieves the maximum size of a window on the computer.
 java.lang.String getMessageWindowClassName()
          Returns the full name of the class that handles messages.
 java.awt.PrintJob getPrintJob(LyView view, java.lang.String jobtitle, java.awt.PageAttributes pageAttributes)
          Builds a printJob instance.
 java.awt.PrintJob getPrintJob(LyView view, java.lang.String jobtitle, java.util.Properties properties)
          Builds a printJob instance.
 LyPrintManager getPrintManager(LyPrintDataInterface printDataInterface, java.util.Properties properties)
          (non-Javadoc).
static java.awt.Frame getRootFrame(java.awt.Component component)
          Returns the top-level frame for the given AWT component.
static java.awt.Window getRootWindow(java.awt.Component component)
          Returns the top-level window for the given AWT component.
 java.lang.Object getScaledInstance(java.lang.Object image, int width, int height)
          (non-Javadoc).
 java.awt.Rectangle getScreenBounds(java.lang.Object component)
          Gets the screen boundaries for the given component.
 int[] getScreenSize(java.lang.Object component)
          (non-Javadoc).
 int[] getSizes(java.lang.Object image)
          (non-Javadoc).
static LySwingSplashScreen getSplashScreen()
          Accessor to current application splashScreen.
 int getStringWidth(LyFont font, java.lang.String text)
          (non-Javadoc).
 java.lang.String getTemporaryLocation()
          Returns the same directory as LyViewManager.getTemporaryDir(), null in this implementation.
 boolean isMultiSession()
          Indicates wether this view manager handles multiple user sessions or not.
 boolean isSameImage(java.lang.Object image1, java.lang.Object image2)
          (non-Javadoc).
 java.lang.Object loadImageFromStream(java.lang.Object component, java.io.InputStream resource)
          (non-Javadoc).
 void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
           
 void prepareGui()
          Prepares the GUI to start by setting its splash screen.
 java.awt.Frame seekParentFrame(LyComponent parent)
          Finds recursively a parent frame for the specified dialog.
 javax.swing.JFrame seekParentJFrame(LyComponent parent)
          Recursive method to find the parent frame of a dialog.
 void setWaiting(boolean status)
          (non-Javadoc).
 void showError(LyComponent source, java.lang.String message)
          (non-Javadoc).
 void showFile(LyComponent source, java.lang.String location)
          Shows a location to the user in a new window.
 void showLocation(LyComponent source, java.lang.String location, boolean newWindow)
          Shows a location to the user.
 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.
 int showMessage(LyComponent source, java.lang.String title, java.lang.String icon, java.lang.String message, java.util.BitSet commands)
          Shows a message to the user.
 int showMessage(LyComponent source, java.lang.String title, java.lang.String icon, java.lang.String message, java.util.BitSet commands, boolean modal, leon.view.LyViewManager._LyMessageAnswerInfo info)
          Shows a message window to the user.
 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)
          Shows a message to the user.
 void showPDFPreview(LyComponent source, java.lang.String location)
          (non-Javadoc).
 void showWarning(LyComponent source, java.lang.String message)
          (non-Javadoc).
 void startGui(LyGuiClientInterface client)
          (non-Javadoc).
 void stopGui(LyGuiClientInterface client)
          Stops GUI.
 void takeSnapshot(LyArea area, java.lang.String file)
          Takes a snapshot of the specified area and stores it in the given file.
 void takeSnapshot(LyView view, java.lang.String file)
          Takes a snapshot of the specified view and stores it in the given file.
 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)
          (non-Javadoc).
 
Methods inherited from class leon.view.LyViewManager
addDemandListener, addView, areViewManagerCompatible, buildChartConverter, buildErrorImage, buildInternalView, buildInternalView, containsView, execGui, findDefinition, free, getControllerStackSize, getCurrentWindowName, getDelay, getDemandTransmitter, getEnvironment, getPdfPrintManager, getPluginId, getPropertiesFromContext, getRootURL, getSlaveSessionClassName, getTemporaryDir, getView, getView, getViewCount, getWaitingCounter, hasPerspective, hasProperty, isPortletMode, isRtlMode, isShared, loadDefinitions, loadDefinitions, messageActionPerformed, moveCursor, processDemand, raiseError, registerDefinition, removeDemandListener, removeView, replay, repostGuiEvents, setCurrentWindowName, setPluginId, shareSession, showComments, showPerspective, swapSession, unregisterDefinition, updateControllersStackList
 
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

SYNTH_XML_STYLE_FILE

public static java.lang.String SYNTH_XML_STYLE_FILE
Defines the style of the Synth look and feel using an XML description. If you use this resource you must feel the LY_SYNTH_XML_CLASS_FILE resource


SYNTH_XML_CLASS_FILE

public static java.lang.String SYNTH_XML_CLASS_FILE
Defines a class file used to load the Synth look and feel. This class must be in the same package than the xml file.


SYNTH_STYLE_FACTORY

public static java.lang.String SYNTH_STYLE_FACTORY
Defines the style of the Synth look and feel using a factory.


WAIT_CURSOR

public static java.awt.Cursor WAIT_CURSOR
Waiting cursor.


DEFAULT_CURSOR

public static java.awt.Cursor DEFAULT_CURSOR
Default cursor.


START_WAITING_DELAY

public static long START_WAITING_DELAY
Start waiting delay. Miminum elapsed time before using waiting cursor + inactivate components.


_frame

public static java.awt.Frame _frame
Default Frame used in some parts of the code when a default AWT component is needed (for example to create an image).

Constructor Detail

LySwingViewManager

public LySwingViewManager(LyEnvironment environment)
Class constructor of a view manager. This view manager takes care of the swing look and feel to use.

Parameters:
environment - the current context environment of this application
Method Detail

getDefaultJFrame

public static javax.swing.JFrame getDefaultJFrame()
Returns the default swing frame.

Returns:
the default frame

buildInternalView

public LyViewComponent buildInternalView(LyComponent component)
(non-Javadoc).

Specified by:
buildInternalView in class LyViewManager
See Also:
LyViewManager.buildInternalView(leon.view.LyComponent)

getMessageWindowClassName

public java.lang.String getMessageWindowClassName()
Returns the full name of the class that handles messages.

Returns:
the String "leon.view.win.swing.LySwingMessageWindow" which handle the messages

seekParentJFrame

public javax.swing.JFrame seekParentJFrame(LyComponent parent)
Recursive method to find the parent frame of a dialog.

Parameters:
parent - the current parent may be null for default frame
Returns:
a root frame. This method never returns null, but may use the default Frame.

exit

public void exit(int code)
(non-Javadoc).

Specified by:
exit in interface LyViewManagerInterface
Specified by:
exit in class LyViewManager
Parameters:
code - exit code of the application.
See Also:
LyViewManager.exit(int)

getDefaultFrame

public static java.awt.Frame getDefaultFrame()
Returns the default AWT frame.

Returns:
the default frame

getRootFrame

public static java.awt.Frame getRootFrame(java.awt.Component component)
Returns the top-level frame for the given AWT component.

Parameters:
component - the AWT component
Returns:
the top-level frame of the given AWT component or the default frame if the component is not in a frame

getRootWindow

public static java.awt.Window getRootWindow(java.awt.Component component)
Returns the top-level window for the given AWT component.

Parameters:
component - the AWT component
Returns:
the top-level window of the given AWT component or null if the component is null

prepareGui

public void prepareGui()
Prepares the GUI to start by setting its splash screen.

Specified by:
prepareGui in interface LyViewManagerInterface
Overrides:
prepareGui in class LyViewManager
See Also:
LyViewManagerInterface.prepareGui()

startGui

public void startGui(LyGuiClientInterface client)
(non-Javadoc).

Specified by:
startGui in interface LyViewManagerInterface
Overrides:
startGui in class LyViewManager
Parameters:
client - the GUI client
See Also:
LyViewManagerInterface.startGui(leon.misc.LyGuiClientInterface)

clearTemporaryResources

public void clearTemporaryResources()
Nothing is done at this level. There is no temporary resources for this swing view manager.

Specified by:
clearTemporaryResources in interface LyViewManagerInterface
Specified by:
clearTemporaryResources in class LyViewManager
See Also:
LyViewManager.clearTemporaryResources()

getTemporaryLocation

public java.lang.String getTemporaryLocation()
Returns the same directory as LyViewManager.getTemporaryDir(), null in this implementation.

Specified by:
getTemporaryLocation in interface LyViewManagerInterface
Specified by:
getTemporaryLocation in class LyViewManager
Returns:
null
See Also:
LyViewManager.getTemporaryLocation()

setWaiting

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

Specified by:
setWaiting in class LyViewManager
See Also:
LyViewManager.setWaiting(boolean)

copyToClipboard

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

Specified by:
copyToClipboard in class LyViewManager
Parameters:
text - the text to be copied to the clipboard.

lostOwnership

public void lostOwnership(java.awt.datatransfer.Clipboard clipboard,
                          java.awt.datatransfer.Transferable contents)
Specified by:
lostOwnership in interface java.awt.datatransfer.ClipboardOwner

showWarning

public void showWarning(LyComponent source,
                        java.lang.String message)
(non-Javadoc).

Specified by:
showWarning in class LyViewManager
Parameters:
source - view element which raises the warning
message - warning message
See Also:
LyViewManager.showWarning(leon.view.LyComponent, java.lang.String)

showError

public void showError(LyComponent source,
                      java.lang.String message)
(non-Javadoc).

Specified by:
showError in class LyViewManager
Parameters:
source - view element which raises the error
message - error message
See Also:
LyViewManager.showError(leon.view.LyComponent, java.lang.String)

askQuestion

public boolean askQuestion(LyComponent source,
                           java.lang.String message)
Asks a question to the user. The method is synchronous and 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
Returns:
the user answer
See Also:
LyViewManager.askQuestion(leon.view.LyComponent, java.lang.String, leon.view.setinterface.LyQuestionAnswerInterface, java.lang.Object)

askQuestion

public void askQuestion(LyComponent source,
                        java.lang.String message,
                        LyQuestionAnswerInterface client,
                        java.lang.Object clientData)
Asks a question to the user. The method is asynchronous and the result is returned to the client in the client attribute.

Specified by:
askQuestion in class LyViewManager
Parameters:
source - view element which asks the question
message - text of the question
client - registered to receive the response
clientData - freely set data which will be returned with the response

showMessage

public 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)
Shows a message to the user. This method is asynchronous and the result is returned in the client attribute.

Specified by:
showMessage in class LyViewManager
Parameters:
source - the source component
title - the title of the message
icon - the icon of the message
message - the message
commands - the commands associated with the message
client - registred to receive the response
clientData - freely set data which will be returned with the response
See Also:
LyViewManager.showMessage(leon.view.LyComponent, java.lang.String, java.lang.String, java.lang.String, java.util.BitSet, leon.view.setinterface.LyMessageAnswerInterface, java.lang.Object)

showMessage

public int showMessage(LyComponent source,
                       java.lang.String title,
                       java.lang.String icon,
                       java.lang.String message,
                       java.util.BitSet commands)
Shows a message to the user. This method is synchronous and will block until validation is done.

Parameters:
source - the source component
title - the title of the message
icon - the icon of the message
message - the message
commands - the commands associated with the message
Returns:
the user answer
See Also:
LyViewManager.showMessage(leon.view.LyComponent, java.lang.String, java.lang.String, java.lang.String, java.util.BitSet, leon.view.setinterface.LyMessageAnswerInterface, java.lang.Object)

showMessage

public int showMessage(LyComponent source,
                       java.lang.String title,
                       java.lang.String icon,
                       java.lang.String message,
                       java.util.BitSet commands,
                       boolean modal,
                       leon.view.LyViewManager._LyMessageAnswerInfo info)
Shows a message window to the user.

Parameters:
source - the source component
title - the title of the message
icon - the icon of the message
message - the message
commands - the commands associated with the message
modal - modality of the window message
info - freely set data which will be returned with the response
Returns:
the user answer
See Also:
LyViewManager.showMessage(leon.view.LyComponent, java.lang.String, java.lang.String, java.lang.String, java.util.BitSet, leon.view.setinterface.LyMessageAnswerInterface, java.lang.Object)

actionPerformed

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

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

showFile

public void showFile(LyComponent source,
                     java.lang.String location)
Shows a location to the user in a new window.

Specified by:
showFile in class LyViewManager
Parameters:
source - view element which raises the location
location - location
See Also:
showLocation(LyComponent, String, boolean), LyViewManager.showFile(LyComponent, String)

showLocation

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

Specified by:
showLocation in class LyViewManager
Parameters:
source - view element which raises the location
location - location
newWindow - This method shows modal windows that are always new. This attribute is not used.
See Also:
LyViewManager.showLocation(LyComponent, String, boolean)

showLocation

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

Specified by:
showLocation in class LyViewManager
Parameters:
source - view element which raises the location
location - location
newWindow - This method shows modal windows that are always new. This attribute is not used.
parameters - list of parameters
See Also:
LyViewManager.showLocation(LyComponent, String, boolean)

showPDFPreview

public void showPDFPreview(LyComponent source,
                           java.lang.String location)
(non-Javadoc).

Specified by:
showPDFPreview in class LyViewManager
Parameters:
source - view element which raises the location
location - location
See Also:
LyViewManager.showPDFPreview(leon.view.LyComponent, java.lang.String)

seekParentFrame

public java.awt.Frame seekParentFrame(LyComponent parent)
Finds recursively a parent frame for the specified dialog.

Parameters:
parent - the current parent, may be null for default frame
Returns:
a root frame, never return null, but may use a default Frame

getScreenSize

public int[] getScreenSize(java.lang.Object component)
(non-Javadoc).

Specified by:
getScreenSize in interface LyViewManagerInterface
Overrides:
getScreenSize in class LyViewManager
Parameters:
component - The component used to retrieve the screen size.
Returns:
The dimension of the screen used for displaying views.
See Also:
LyViewManagerInterface.getScreenSize(java.lang.Object)

getMaxScreenSize

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

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

getMaxWindowSize

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

Overrides:
getMaxWindowSize in class LyViewManager

getScreenBounds

public java.awt.Rectangle getScreenBounds(java.lang.Object component)
Gets the screen boundaries for the given component.

Parameters:
component - a graphic component defining a monitor screen
Returns:
a Rectangle containing the size and location of the screen associated with the given component. If the component does not belong to a graphics device, or if it does not represents a graphical object, and no default device where to be found, then the screen size of the default toolkit is returned, or null if no toolkit is available.

getPrintManager

public LyPrintManager getPrintManager(LyPrintDataInterface printDataInterface,
                                      java.util.Properties properties)
(non-Javadoc).

Overrides:
getPrintManager in class LyViewManager
See Also:
LyViewManager.getPrintManager(leon.view.print.LyPrintDataInterface, java.util.Properties)

getPrintJob

public java.awt.PrintJob getPrintJob(LyView view,
                                     java.lang.String jobtitle,
                                     java.util.Properties properties)
Builds a printJob instance.

Parameters:
view - the view for the print job
jobtitle - the title of the print job
properties - the properties of the printing
Returns:
the print job for the view with the given properties

getPrintJob

public java.awt.PrintJob getPrintJob(LyView view,
                                     java.lang.String jobtitle,
                                     java.awt.PageAttributes pageAttributes)
Builds a printJob instance.

Parameters:
view - the view for the print job
jobtitle - the title of the print job
pageAttributes - the page attributes of the printing
Returns:
the print job for the view with the given properties

isMultiSession

public boolean isMultiSession()
Indicates wether this view manager handles multiple user sessions or not. Current implementation returns false.

Specified by:
isMultiSession in interface LyViewManagerInterface
Specified by:
isMultiSession in class LyViewManager
Returns:
false
See Also:
LyViewManagerInterface.isMultiSession()

beep

public void beep()
(non-Javadoc).

Specified by:
beep in interface LyViewManagerInterface
Overrides:
beep in class LyViewManager
See Also:
LyViewManagerInterface.beep()

getColor

public java.lang.Object getColor(LyColor color)
(non-Javadoc).

Specified by:
getColor in interface LyViewManagerInterface
Specified by:
getColor in class LyViewManager
Parameters:
color - The leonardi color.
Returns:
A reference to the requested color, or null if it could not be found.
See Also:
LyViewManagerInterface.getColor(leon.misc.LyColor)

getFont

public java.lang.Object getFont(LyFont font)
(non-Javadoc).

Specified by:
getFont in interface LyViewManagerInterface
Specified by:
getFont in class LyViewManager
Parameters:
font - The leonardi font.
Returns:
A reference to the requested font, or null if it could not be found.
See Also:
LyViewManagerInterface.getFont(leon.misc.LyFont)

getStringWidth

public int getStringWidth(LyFont font,
                          java.lang.String text)
(non-Javadoc).

Specified by:
getStringWidth in interface LyViewManagerInterface
Specified by:
getStringWidth in class LyViewManager
Parameters:
font - The leonardi font.
text - The string value.
Returns:
The width of given string for given font.
See Also:
LyViewManagerInterface.getStringWidth(leon.misc.LyFont, java.lang.String)

getDefaultImage

public java.lang.Object getDefaultImage()
(non-Javadoc).

Specified by:
getDefaultImage in interface LyViewManagerInterface
Specified by:
getDefaultImage in class LyViewManager
Returns:
the built default image
See Also:
LyViewManagerInterface.getDefaultImage()

getSizes

public int[] getSizes(java.lang.Object image)
(non-Javadoc).

Specified by:
getSizes in interface LyViewManagerInterface
Specified by:
getSizes in class LyViewManager
Parameters:
image - the image
Returns:
Image size (table with 2 entries).
See Also:
LyViewManagerInterface.getSizes(java.lang.Object)

getScaledInstance

public java.lang.Object getScaledInstance(java.lang.Object image,
                                          int width,
                                          int height)
(non-Javadoc).

Specified by:
getScaledInstance in interface LyViewManagerInterface
Specified by:
getScaledInstance in class LyViewManager
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.
See Also:
LyViewManagerInterface.getScaledInstance(java.lang.Object, int, int)

waitForLoading

public void waitForLoading(java.lang.Object component,
                           java.lang.Object image)
                    throws java.lang.InterruptedException
(non-Javadoc).

Specified by:
waitForLoading in interface LyViewManagerInterface
Specified by:
waitForLoading in class LyViewManager
Parameters:
component - The image loading client
image - Image to load.
Throws:
java.lang.InterruptedException - if the wait is interruptued
See Also:
LyViewManagerInterface.waitForLoading(java.lang.Object, java.lang.Object)

loadImageFromStream

public java.lang.Object loadImageFromStream(java.lang.Object component,
                                            java.io.InputStream resource)
                                     throws java.io.IOException
(non-Javadoc).

Specified by:
loadImageFromStream in interface LyViewManagerInterface
Specified by:
loadImageFromStream in class LyViewManager
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
See Also:
LyViewManagerInterface.loadImageFromStream(java.lang.Object, java.io.InputStream)

isSameImage

public boolean isSameImage(java.lang.Object image1,
                           java.lang.Object image2)
                    throws java.lang.InterruptedException
(non-Javadoc).

Specified by:
isSameImage in class LyViewManager
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.
See Also:
LyViewManager.isSameImage(java.lang.Object, java.lang.Object)

freeImage

public void freeImage(java.lang.Object image)
(non-Javadoc).

Specified by:
freeImage in interface LyViewManagerInterface
Specified by:
freeImage in class LyViewManager
Parameters:
image - The image that must be freed.
See Also:
LyViewManagerInterface.freeImage(java.lang.Object)

execGui

public void execGui(java.lang.Runnable runnable,
                    boolean synchronous)
(non-Javadoc).

Specified by:
execGui in interface LyViewManagerInterface
Overrides:
execGui in class LyViewManager
Parameters:
runnable - Code to run on the user-interface thread.
synchronous - True is synchronous, false if asynchronous.
See Also:
LyViewManagerInterface.execGui(java.lang.Runnable, boolean)

encodeImage

public boolean encodeImage(java.lang.Object image,
                           java.lang.String imageDir,
                           java.lang.String imageFile)
(non-Javadoc).

Overrides:
encodeImage in class LyViewManager
Parameters:
image - the image to encode
imageDir - temporary directory (optional)
imageFile - the JPEG File
Returns:
true if the file was generated, false otherwise.
See Also:
LyViewManager.encodeImage(java.lang.Object, java.lang.String, java.lang.String)

takeSnapshot

public void takeSnapshot(LyView view,
                         java.lang.String file)
Takes a snapshot of the specified view and stores it in the given file. The snapshot must be done in a new thread for the popup menu to disappear.

Overrides:
takeSnapshot in class LyViewManager
Parameters:
view - the view to take a snapshot
file - the file to save the snapshot
See Also:
LyViewManager.takeSnapshot(leon.view.LyView, java.lang.String)

takeSnapshot

public void takeSnapshot(LyArea area,
                         java.lang.String file)
Takes a snapshot of the specified area and stores it in the given file. The snapshot must be done in a new thread for the popup menu to disappear.

Overrides:
takeSnapshot in class LyViewManager
Parameters:
area - the area to take a snapshot
file - the file to save the snapshot
See Also:
LyViewManager.takeSnapshot(leon.view.LyArea, java.lang.String)

stopGui

public void stopGui(LyGuiClientInterface client)
Stops GUI.

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

getSplashScreen

public static LySwingSplashScreen getSplashScreen()
Accessor to current application splashScreen.

Returns:
the splashscreen which is an instance of a Swing JWindow

getDownloadAction

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

Specified by:
getDownloadAction in class LyViewManager

useCacheForImage

public final 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
Specified by:
useCacheForImage in class LyViewManager
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

(c) January 2013 - W4 S.A.

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