LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.mobile
Class LyMobileViewManager

java.lang.Object
  extended by leon.view.LyViewManager
      extended by leon.view.web.LyWebViewManager
          extended by leon.view.mobile.LyMobileViewManager
All Implemented Interfaces:
LyViewManagerInterface

public class LyMobileViewManager
extends LyWebViewManager


Field Summary
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 int MAX_HEADERS
           
static java.lang.String MOBILE_ONLY_PROPERTY
           
static int WAIT_COUNTER
          The wait counter.
 
Fields inherited from class leon.view.web.LyWebViewManager
__VERSION, _mobileStartUrl, _root_url, BROWSER_CHROME, BROWSER_CHROME_ID, BROWSER_FIREFOX, BROWSER_FIREFOX_ID, BROWSER_MSIE, BROWSER_MSIE_ID, BROWSER_NETSCAPE, BROWSER_NETSCAPE_ID, BROWSER_OPERA, BROWSER_OPERA_ID, BROWSER_OTHER, CACHED_IMAGE_MAX_SIZE, DEFAULT_POPUP_HEIGHT, DEFAULT_POPUP_WIDTH, OPTIMIZE_TABLE_GENERATION, PARAMETERS, REGISTER_PAGE_WRITERS, SEP_PW_ID, SHOW_LOCATION_PARAMETER_DIRECTORIES, SHOW_LOCATION_PARAMETER_LOCATION, SHOW_LOCATION_PARAMETER_MENUBAR, SHOW_LOCATION_PARAMETER_NAME, SHOW_LOCATION_PARAMETER_RESIZABLE, SHOW_LOCATION_PARAMETER_SCROLLBARS, SHOW_LOCATION_PARAMETER_STATUSBAR, SHOW_LOCATION_PARAMETER_TOOLBAR, TYPE_ALERT, TYPE_LOCATION, TYPE_LOCATION_NEW_WINDOW, TYPE_NO, TYPE_QUESTION, TYPE_SHOW_FILE, WEB_FILE_NEW_WINDOW
 
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
LyMobileViewManager(LyEnvironment environment)
           
 
Method Summary
 LyViewComponent buildInternalView(LyComponent component)
          Build internal view.
 void copyToClipboard(java.lang.String text)
          Copy a given text to the system clipboard.
 void freeImage(java.lang.Object image)
          Free the resources of the image if not in the cache.
 java.lang.String getApplicationName()
           
 java.lang.Object getColor(LyColor color)
          (non-Javadoc).
static java.awt.Frame getDefaultFrame()
          Creates and gets the default frame.
 java.lang.Object getDefaultImage()
          Construct a default image.
 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 getMin(java.lang.String actionId)
           
 java.lang.String getPartialURL(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> parameters, boolean encodeAmpersand)
          Get the partial URL for a context relative url.
 java.lang.String getRealRootURL()
           
 java.lang.Object getScaledInstance(java.lang.Object image, int width, int height)
          Creates a scaled version of the given image.
 int[] getSizes(java.lang.Object image)
          Gets images sizes.
 int getStringWidth(LyFont font, java.lang.String text)
          (non-Javadoc).
 java.lang.String getUrl()
           
 LyWebViewManager getWebViewManager()
           
 boolean hasUrl()
           
 boolean is_sessionSwapped()
           
 boolean isSameImage(java.lang.Object image1, java.lang.Object image2)
          Compare two images pixel by pixel.
 java.lang.Object loadImageFromStream(java.lang.Object component, java.io.InputStream resource)
          Retrieves an image from a Stream.
 void set_sessionSwapped(boolean _sessionSwapped)
           
 void setApplicationName(java.lang.String name)
           
 void setRootURL(java.lang.String rootUrl)
          Sets servlet root URL.
 void setSession(LySession session)
           
 void setUrl(java.lang.String url)
           
 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.
 void swapSession(java.lang.Object newSession, java.lang.Object oldSession, java.lang.String applicationId)
          Swap two sessions.
 void waitForLoading(java.lang.Object component, java.lang.Object image)
          Waits for the image loading if the headless mode is null or set to true.
 
Methods inherited from class leon.view.web.LyWebViewManager
activateAdditionalRefreshScriptsBuffer, addAdditionalRefreshScripts, addAdditionalRefreshScripts, addNewWindowScript, addPageWriter, addPopupViewMapping, addRefreshingView, addReloadFrame, addReloadFrame, answerMessage, answerMessage, askQuestion, buildWebDecoration, clearAdditionalRefreshScripts, clearRefreshingView, clearReloadFrame, clearReloadFrames, clearTemporaryResources, encodeImage, encodeString, exit, forceScrolling, free, generateScriptsInclusion, getAdditionalRefreshScripts, getAdditionalRefreshScripts, getBrowser, getBrowserVersion, getClose, getCurrentWindowName, getDecoration, getDefaultPageResource, getLastPopupViewController, getMainTargetFrame, getMessage, getMessage, getMessage, getMessageAnswerURL, getMobileStartURL, getNewWindowScripts, getPageWriter, getPageWriter, getPopupViewMapping, getPropertiesFromContext, getRefreshRate, getReloadFrames, getRootURL, getScriptsDir, getScriptsDocDir, getTargetCode, getTemporaryLocation, hideView, isBrowserSupported, isMultipleSession, isMultiSession, isReload, messageActionPerformed, needsUpdate, removeMessageAnswer, removePageWriter, setBrowser, setClose, setCurrentWindowName, setDecoration, setMessage, setMessage, setMessageAnswerUrl, setMobileStartURL, setPageWriter, setReload, setTargetCode, setWaiting, showError, showFile, showLocation, showMessage, showPDFPreview, showView, showWarning, updateControllersStackList, useCacheForImage, usePopupView, writeDivs
 
Methods inherited from class leon.view.LyViewManager
addDemandListener, addView, areViewManagerCompatible, beep, buildChartConverter, buildErrorImage, buildInternalView, buildInternalView, containsView, execGui, execGui, findDefinition, getControllerStackSize, getDelay, getDemandTransmitter, getEnvironment, getMaxScreenSize, getMaxWindowSize, getPdfPrintManager, getPluginId, getPrintManager, getScreenSize, getSlaveSessionClassName, getTemporaryDir, getView, getView, getViewCount, getWaitingCounter, hasPerspective, hasProperty, isPortletMode, isRtlMode, isShared, loadDefinitions, loadDefinitions, moveCursor, prepareGui, processDemand, raiseError, registerDefinition, removeDemandListener, removeView, replay, repostGuiEvents, setPluginId, shareSession, showComments, showPerspective, startGui, stopGui, takeSnapshot, takeSnapshot, unregisterDefinition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_HEADERS

public static int MAX_HEADERS

MOBILE_ONLY_PROPERTY

public static final java.lang.String MOBILE_ONLY_PROPERTY
See Also:
Constant Field Values

WAIT_COUNTER

public static int WAIT_COUNTER
The wait counter.


_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

LyMobileViewManager

public LyMobileViewManager(LyEnvironment environment)
Method Detail

getDefaultFrame

public static java.awt.Frame getDefaultFrame()
Creates and gets the default frame.

Returns:
The default frame.

buildInternalView

public LyViewComponent buildInternalView(LyComponent component)
Description copied from class: LyViewManager
Build internal view.

Overrides:
buildInternalView in class LyWebViewManager

getDownloadAction

public java.lang.String getDownloadAction()
Description copied from class: LyViewManager
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

getRealRootURL

public java.lang.String getRealRootURL()

getPartialURL

public java.lang.String getPartialURL(java.lang.String url,
                                      java.util.Map<java.lang.String,java.lang.String> parameters,
                                      boolean encodeAmpersand)
                               throws java.net.MalformedURLException
Get the partial URL for a context relative url.

Parameters:
url - A context relative URL.
parameters - The parameters used to build the query String.
encodeAmpersand - Tells if the "&" character should be encoded.
Returns:
an absolute URL (scheme + server + port + context path + url + "?" + param1=value1 + "&" + param2=value2, etc...).
Throws:
java.net.MalformedURLException - if the URL is not well formed

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.

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()
Construct a default image.

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

getSizes

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

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:
LyImageUtils.getSizes(Image), LyViewManagerInterface.getSizes(Object)

getScaledInstance

public 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
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:
LyImageUtils.getScaledInstance(Image, int, int), LyViewManagerInterface.getScaledInstance(Object, int, int)

waitForLoading

public void waitForLoading(java.lang.Object component,
                           java.lang.Object image)
                    throws java.lang.InterruptedException
Waits for the image loading if the headless mode is null or set to true.

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:
LyImageUtils.waitForLoading(Component, Image), LyViewManagerInterface.waitForLoading(Object, Object)

loadImageFromStream

public 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
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:
LyImageUtils.loadImageFromStream(Component, InputStream), LyViewManagerInterface.loadImageFromStream(Object, InputStream)

isSameImage

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

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:
LyImageUtils.isSameImage(Image, Image), LyViewManager.isSameImage(java.lang.Object, java.lang.Object)

freeImage

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

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

setSession

public void setSession(LySession session)

setRootURL

public void setRootURL(java.lang.String rootUrl)
Description copied from class: LyWebViewManager
Sets servlet root URL. This URL is built by server : application should never sets URL directly.

Overrides:
setRootURL in class LyWebViewManager
Parameters:
rootUrl - the new root URL
See Also:
LyWebViewManager.getRootURL()

getWebViewManager

public LyWebViewManager getWebViewManager()

getMin

public int getMin(java.lang.String actionId)

swapSession

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

Overrides:
swapSession in class LyViewManager
Parameters:
newSession - the new session
oldSession - the old session
applicationId - the application id

showLocation

public void showLocation(LyComponent source,
                         java.lang.String location,
                         boolean newWindow,
                         java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
Description copied from class: LyViewManager
Shows a location to the user.

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

setUrl

public void setUrl(java.lang.String url)

getUrl

public java.lang.String getUrl()

hasUrl

public boolean hasUrl()

setApplicationName

public void setApplicationName(java.lang.String name)

getApplicationName

public java.lang.String getApplicationName()

is_sessionSwapped

public boolean is_sessionSwapped()

set_sessionSwapped

public void set_sessionSwapped(boolean _sessionSwapped)

(c) January 2013 - W4 S.A.

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