|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.LyViewManager
leon.view.win.swing.LySwingViewManager
public class LySwingViewManager
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. |
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 java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static java.lang.String SYNTH_XML_STYLE_FILE
public static java.lang.String SYNTH_XML_CLASS_FILE
public static java.lang.String SYNTH_STYLE_FACTORY
public static java.awt.Cursor WAIT_CURSOR
public static java.awt.Cursor DEFAULT_CURSOR
public static long START_WAITING_DELAY
public static java.awt.Frame _frame
Constructor Detail |
---|
public LySwingViewManager(LyEnvironment environment)
environment
- the current context environment of this applicationMethod Detail |
---|
public static javax.swing.JFrame getDefaultJFrame()
public LyViewComponent buildInternalView(LyComponent component)
buildInternalView
in class LyViewManager
LyViewManager.buildInternalView(leon.view.LyComponent)
public java.lang.String getMessageWindowClassName()
"leon.view.win.swing.LySwingMessageWindow"
which handle the
messagespublic javax.swing.JFrame seekParentJFrame(LyComponent parent)
parent
- the current parent may be null
for default frame
null
, but may use the default
Frame.public void exit(int code)
exit
in interface LyViewManagerInterface
exit
in class LyViewManager
code
- exit code of the application.LyViewManager.exit(int)
public static java.awt.Frame getDefaultFrame()
public static java.awt.Frame getRootFrame(java.awt.Component component)
component
- the AWT component
public static java.awt.Window getRootWindow(java.awt.Component component)
component
- the AWT component
null
if the component
is null
public void prepareGui()
prepareGui
in interface LyViewManagerInterface
prepareGui
in class LyViewManager
LyViewManagerInterface.prepareGui()
public void startGui(LyGuiClientInterface client)
startGui
in interface LyViewManagerInterface
startGui
in class LyViewManager
client
- the GUI clientLyViewManagerInterface.startGui(leon.misc.LyGuiClientInterface)
public void clearTemporaryResources()
clearTemporaryResources
in interface LyViewManagerInterface
clearTemporaryResources
in class LyViewManager
LyViewManager.clearTemporaryResources()
public java.lang.String getTemporaryLocation()
LyViewManager.getTemporaryDir()
, null
in this
implementation.
getTemporaryLocation
in interface LyViewManagerInterface
getTemporaryLocation
in class LyViewManager
null
LyViewManager.getTemporaryLocation()
public void setWaiting(boolean status)
setWaiting
in class LyViewManager
LyViewManager.setWaiting(boolean)
public void copyToClipboard(java.lang.String text)
copyToClipboard
in class LyViewManager
text
- the text to be copied to the clipboard.public void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
lostOwnership
in interface java.awt.datatransfer.ClipboardOwner
public void showWarning(LyComponent source, java.lang.String message)
showWarning
in class LyViewManager
source
- view element which raises the warningmessage
- warning messageLyViewManager.showWarning(leon.view.LyComponent, java.lang.String)
public void showError(LyComponent source, java.lang.String message)
showError
in class LyViewManager
source
- view element which raises the errormessage
- error messageLyViewManager.showError(leon.view.LyComponent, java.lang.String)
public boolean askQuestion(LyComponent source, java.lang.String message)
source
- view element which asks the questionmessage
- text of the question
LyViewManager.askQuestion(leon.view.LyComponent, java.lang.String, leon.view.setinterface.LyQuestionAnswerInterface, java.lang.Object)
public void askQuestion(LyComponent source, java.lang.String message, LyQuestionAnswerInterface client, java.lang.Object clientData)
askQuestion
in class LyViewManager
source
- view element which asks the questionmessage
- text of the questionclient
- registered to receive the responseclientData
- freely set data which will be returned with the responsepublic 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)
showMessage
in class LyViewManager
source
- the source componenttitle
- the title of the messageicon
- the icon of the messagemessage
- the messagecommands
- the commands associated with the messageclient
- registred to receive the responseclientData
- freely set data which will be returned with the responseLyViewManager.showMessage(leon.view.LyComponent, java.lang.String,
java.lang.String, java.lang.String, java.util.BitSet,
leon.view.setinterface.LyMessageAnswerInterface, java.lang.Object)
public int showMessage(LyComponent source, java.lang.String title, java.lang.String icon, java.lang.String message, java.util.BitSet commands)
source
- the source componenttitle
- the title of the messageicon
- the icon of the messagemessage
- the messagecommands
- the commands associated with the message
LyViewManager.showMessage(leon.view.LyComponent, java.lang.String, java.lang.String, java.lang.String, java.util.BitSet, leon.view.setinterface.LyMessageAnswerInterface, java.lang.Object)
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)
source
- the source componenttitle
- the title of the messageicon
- the icon of the messagemessage
- the messagecommands
- the commands associated with the messagemodal
- modality of the window messageinfo
- freely set data which will be returned with the response
LyViewManager.showMessage(leon.view.LyComponent, java.lang.String, java.lang.String, java.lang.String, java.util.BitSet, leon.view.setinterface.LyMessageAnswerInterface, java.lang.Object)
public void actionPerformed(LyActionEvent actionEvent)
actionPerformed
in interface LyActionListener
LyActionListener.actionPerformed(leon.view.event.LyActionEvent)
public void showFile(LyComponent source, java.lang.String location)
showFile
in class LyViewManager
source
- view element which raises the locationlocation
- locationshowLocation(LyComponent, String, boolean)
,
LyViewManager.showFile(LyComponent, String)
public void showLocation(LyComponent source, java.lang.String location, boolean newWindow)
showLocation
in class LyViewManager
source
- view element which raises the locationlocation
- locationnewWindow
- This method shows modal windows that are always new. This attribute is not
used.LyViewManager.showLocation(LyComponent, String, boolean)
public void showLocation(LyComponent source, java.lang.String location, boolean newWindow, java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
showLocation
in class LyViewManager
source
- view element which raises the locationlocation
- locationnewWindow
- This method shows modal windows that are always new. This attribute is not
used.parameters
- list of parametersLyViewManager.showLocation(LyComponent, String, boolean)
public void showPDFPreview(LyComponent source, java.lang.String location)
showPDFPreview
in class LyViewManager
source
- view element which raises the locationlocation
- locationLyViewManager.showPDFPreview(leon.view.LyComponent, java.lang.String)
public java.awt.Frame seekParentFrame(LyComponent parent)
parent
- the current parent, may be null
for default frame
null
, but may use a default Framepublic int[] getScreenSize(java.lang.Object component)
getScreenSize
in interface LyViewManagerInterface
getScreenSize
in class LyViewManager
component
- The component used to retrieve the screen size.
LyViewManagerInterface.getScreenSize(java.lang.Object)
public int[] getMaxScreenSize()
getMaxScreenSize
in interface LyViewManagerInterface
getMaxScreenSize
in class LyViewManager
public int[] getMaxWindowSize()
getMaxWindowSize
in class LyViewManager
public java.awt.Rectangle getScreenBounds(java.lang.Object component)
component
- a graphic component defining a monitor screen
public LyPrintManager getPrintManager(LyPrintDataInterface printDataInterface, java.util.Properties properties)
getPrintManager
in class LyViewManager
LyViewManager.getPrintManager(leon.view.print.LyPrintDataInterface,
java.util.Properties)
public java.awt.PrintJob getPrintJob(LyView view, java.lang.String jobtitle, java.util.Properties properties)
view
- the view for the print jobjobtitle
- the title of the print jobproperties
- the properties of the printing
public java.awt.PrintJob getPrintJob(LyView view, java.lang.String jobtitle, java.awt.PageAttributes pageAttributes)
view
- the view for the print jobjobtitle
- the title of the print jobpageAttributes
- the page attributes of the printing
public boolean isMultiSession()
false
.
isMultiSession
in interface LyViewManagerInterface
isMultiSession
in class LyViewManager
false
LyViewManagerInterface.isMultiSession()
public void beep()
beep
in interface LyViewManagerInterface
beep
in class LyViewManager
LyViewManagerInterface.beep()
public java.lang.Object getColor(LyColor color)
getColor
in interface LyViewManagerInterface
getColor
in class LyViewManager
color
- The leonardi color.
LyViewManagerInterface.getColor(leon.misc.LyColor)
public java.lang.Object getFont(LyFont font)
getFont
in interface LyViewManagerInterface
getFont
in class LyViewManager
font
- The leonardi font.
LyViewManagerInterface.getFont(leon.misc.LyFont)
public int getStringWidth(LyFont font, java.lang.String text)
getStringWidth
in interface LyViewManagerInterface
getStringWidth
in class LyViewManager
font
- The leonardi font.text
- The string value.
LyViewManagerInterface.getStringWidth(leon.misc.LyFont, java.lang.String)
public java.lang.Object getDefaultImage()
getDefaultImage
in interface LyViewManagerInterface
getDefaultImage
in class LyViewManager
LyViewManagerInterface.getDefaultImage()
public int[] getSizes(java.lang.Object image)
getSizes
in interface LyViewManagerInterface
getSizes
in class LyViewManager
image
- the image
LyViewManagerInterface.getSizes(java.lang.Object)
public java.lang.Object getScaledInstance(java.lang.Object image, int width, int height)
getScaledInstance
in interface LyViewManagerInterface
getScaledInstance
in class LyViewManager
image
- The image to scale.width
- The width to which to scale the image.height
- The height to which to scale the image.
LyViewManagerInterface.getScaledInstance(java.lang.Object, int, int)
public void waitForLoading(java.lang.Object component, java.lang.Object image) throws java.lang.InterruptedException
waitForLoading
in interface LyViewManagerInterface
waitForLoading
in class LyViewManager
component
- The image loading clientimage
- Image to load.
java.lang.InterruptedException
- if the wait is interruptuedLyViewManagerInterface.waitForLoading(java.lang.Object, java.lang.Object)
public java.lang.Object loadImageFromStream(java.lang.Object component, java.io.InputStream resource) throws java.io.IOException
loadImageFromStream
in interface LyViewManagerInterface
loadImageFromStream
in class LyViewManager
component
- The client of the image creation.resource
- stream inputStream to the image data
java.io.IOException
- if something is wrong during the processLyViewManagerInterface.loadImageFromStream(java.lang.Object,
java.io.InputStream)
public boolean isSameImage(java.lang.Object image1, java.lang.Object image2) throws java.lang.InterruptedException
isSameImage
in class LyViewManager
image1
- first image to compareimage2
- second image to compare
java.lang.InterruptedException
- exception if problems on grabber or loading.LyViewManager.isSameImage(java.lang.Object, java.lang.Object)
public void freeImage(java.lang.Object image)
freeImage
in interface LyViewManagerInterface
freeImage
in class LyViewManager
image
- The image that must be freed.LyViewManagerInterface.freeImage(java.lang.Object)
public void execGui(java.lang.Runnable runnable, boolean synchronous)
execGui
in interface LyViewManagerInterface
execGui
in class LyViewManager
runnable
- Code to run on the user-interface thread.synchronous
- True is synchronous, false if asynchronous.LyViewManagerInterface.execGui(java.lang.Runnable, boolean)
public boolean encodeImage(java.lang.Object image, java.lang.String imageDir, java.lang.String imageFile)
encodeImage
in class LyViewManager
image
- the image to encodeimageDir
- temporary directory (optional)imageFile
- the JPEG File
LyViewManager.encodeImage(java.lang.Object, java.lang.String,
java.lang.String)
public void takeSnapshot(LyView view, java.lang.String file)
takeSnapshot
in class LyViewManager
view
- the view to take a snapshotfile
- the file to save the snapshotLyViewManager.takeSnapshot(leon.view.LyView, java.lang.String)
public void takeSnapshot(LyArea area, java.lang.String file)
takeSnapshot
in class LyViewManager
area
- the area to take a snapshotfile
- the file to save the snapshotLyViewManager.takeSnapshot(leon.view.LyArea, java.lang.String)
public void stopGui(LyGuiClientInterface client)
stopGui
in interface LyViewManagerInterface
stopGui
in class LyViewManager
client
- the GUI clientpublic static LySwingSplashScreen getSplashScreen()
public java.lang.String getDownloadAction()
getDownloadAction
in class LyViewManager
public final boolean useCacheForImage(java.lang.String path, java.lang.Object image)
useCacheForImage
in interface LyViewManagerInterface
useCacheForImage
in class LyViewManager
path
- The path of image that may be cached.image
- The image that may be cached.
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |