LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.graphic
Class LyGraphicalObject

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
All Implemented Interfaces:
LyGraphicalComponent, LyViewComponent, LyFreeInterface
Direct Known Subclasses:
LyMobileObject, LySwingObject, LyWebObject

public abstract class LyGraphicalObject
extends java.lang.Object
implements LyGraphicalComponent

The LyGraphicalObject class implements root object for all win components.


Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LyGraphicalObject(LyComponent viewComponent)
          Constructs abstract graphical component.
 
Method Summary
 java.lang.String expand(java.lang.String text)
          Replaces within a given String some $properties$ found in the environment.
 void free()
          Free resources allocated to this component.
 int[] getBounds(LyComponent parent)
          Returns the position and size of current component relatively to given component.
 int[] getChildrenBounds(LyComponent children)
          Returns the position and size of given sub component relatively to current component.
 java.lang.String getController()
          Retrieves controller id of this graphical component.
 java.lang.String getEnv(java.lang.String key)
          Retrieves a value from the contextual environment.
 LyEnvironment getEnvironment()
          Gets environment of this graphical object.
 java.lang.String getIdCode()
          Internal code used as identifier for web components.
 int getIntResource(java.lang.String key)
          Retrieves an integer resource from the application environment.
 java.lang.String getMessage(java.lang.String key)
          Convenient routine to get a formated message without argument.
 java.lang.String getMessage(java.lang.String key, java.lang.Object[] arguments)
          Convenient routine to get a formated message with given arguments.
 java.lang.String getResource(java.lang.String key)
          Retrieves a resource from the application environment.
 java.lang.String getString(java.lang.String key)
          Convenient routine to get a formated message without argument.
 java.lang.String getString(java.lang.String key, java.lang.Object argument)
          Convenient routine to get a formated message without a single argument.
 java.lang.String getString(java.lang.String key, java.lang.Object[] arguments)
          Constructs a string from a key and an array of arguments.
 LyComponent getViewComponent()
          Gets view component corresponding to this graphical object.
 LyViewManager getViewManager()
          Gets current view manager.
 boolean isFreed()
          Checks if graphical object was freed or not.
 boolean isFreeing()
          Checks if graphical object is freeing or not.
 boolean isImageAnimated(java.lang.String key)
          Checks if an image is animated.
 void processDemand(LyDemand demand)
          Processes demands on this component.
 void processDemand(java.lang.String controller, LyDemand demand)
          Processes demands on this component.
 boolean testResource(java.lang.String key)
          Checks if a resource is set to true or 1.
 java.lang.String translate(java.lang.String key)
          Translates the given key to a String that may be shown to the user.
 
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
Constructor Detail

LyGraphicalObject

public LyGraphicalObject(LyComponent viewComponent)
Constructs abstract graphical component.

Method Detail

free

public void free()
Free resources allocated to this component.

Specified by:
free in interface LyGraphicalComponent
Specified by:
free in interface LyFreeInterface
See Also:
LyFreeInterface.free()

getIdCode

public java.lang.String getIdCode()
Internal code used as identifier for web components.

Returns:
Internal code as a string.

isFreeing

public boolean isFreeing()
Checks if graphical object is freeing or not.

Returns:
True if freed, false otherwise.

isFreed

public boolean isFreed()
Checks if graphical object was freed or not.

Returns:
True if freed, false otherwise.

getViewComponent

public final LyComponent getViewComponent()
Gets view component corresponding to this graphical object.

Specified by:
getViewComponent in interface LyGraphicalComponent
Returns:
The view component for this graphical component.

getBounds

public int[] getBounds(LyComponent parent)
Returns the position and size of current component relatively to given component.

Parameters:
parentComponent - the component used to compute relative position of current component. If null, position of current component is computed with the top-left corner of the screen as the origin.
Returns:
an array of 4 integers (x position, y position, width, height) representing the position and size of current component.

getChildrenBounds

public int[] getChildrenBounds(LyComponent children)
Returns the position and size of given sub component relatively to current component.

Parameters:
childrenComponent - the sub component whose relative position must be returned.
Returns:
an array of 4 integers (x position, y position, width, height) representing the position and size of given sub component.

getController

public java.lang.String getController()
Retrieves controller id of this graphical component. Warning ! This method may be overridden in sub-classes to redirect on parent controller for example.

Returns:
The controller id of this component, may be null.

getEnvironment

public final LyEnvironment getEnvironment()
Gets environment of this graphical object.

Returns:
The environment of this graphical object.

getViewManager

public final LyViewManager getViewManager()
Gets current view manager.

Returns:
The current view manager.

getEnv

public final java.lang.String getEnv(java.lang.String key)
Retrieves a value from the contextual environment.

Parameters:
The - key associated with the environment parameter.
Returns:
The environment variable or null if the value could not be found.
See Also:
LyEnvironment.getEnv(java.lang.String)

getString

public final java.lang.String getString(java.lang.String key)
Convenient routine to get a formated message without argument.

See Also:
LyEnvironment.getString(String)

getString

public final java.lang.String getString(java.lang.String key,
                                        java.lang.Object argument)
Convenient routine to get a formated message without a single argument.

See Also:
LyEnvironment.getString(String,Object)

getString

public final java.lang.String getString(java.lang.String key,
                                        java.lang.Object[] arguments)
Constructs a string from a key and an array of arguments.

Parameters:
key - The key to be translated.
argument - The array of arguments used to construct the string.
Returns:
The string formated with the arguments.
See Also:
LyEnvironment.getString(String,Object[])

getMessage

public final java.lang.String getMessage(java.lang.String key)
Convenient routine to get a formated message without argument.

See Also:
LyEnvironment.getMessage(java.lang.String)

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.lang.Object[] arguments)
Convenient routine to get a formated message with given arguments.

See Also:
LyEnvironment.getMessage(java.lang.String)

getResource

public final java.lang.String getResource(java.lang.String key)
Retrieves a resource from the application environment.

Parameters:
key - The resource name (key).
Returns:
The value of the requested resource, or null if it could not be found.
See Also:
LyEnvironment.getResource(leon.misc.LyEnvironment.ResourceType, java.lang.String)

testResource

public final boolean testResource(java.lang.String key)
Checks if a resource is set to true or 1.

Parameters:
key - The resource name (key).
Returns:
True if the resource exits and is set to true or 1, false otherwise.
See Also:
LyEnvironment.testResource(String)

getIntResource

public final int getIntResource(java.lang.String key)
Retrieves an integer resource from the application environment.

Parameters:
key - The resource name (key).
Returns:
The value of the requested resource, or -1 if it could not be found.
See Also:
LyEnvironment.getResource(leon.misc.LyEnvironment.ResourceType, java.lang.String)

translate

public final java.lang.String translate(java.lang.String key)
Translates the given key to a String that may be shown to the user.

Parameters:
key - The key to be translated.
Returns:
The translated key if found in local dictionary. If not found, the key is returned 'as is'.
See Also:
LyEnvironment.translate(java.lang.String)

expand

public java.lang.String expand(java.lang.String text)
Replaces within a given String some $properties$ found in the environment.

Parameters:
text - The original string, before any substitution.
Returns:
The string after all substitutions.
See Also:
LyString.expand(java.lang.String, java.lang.String)

isImageAnimated

public final boolean isImageAnimated(java.lang.String key)
Checks if an image is animated.

Parameters:
key - The resource name (key) of the image.
Returns:
True if the image is animated, false otherwise.
See Also:
LyEnvironment#isAnimated

processDemand

public final void processDemand(LyDemand demand)
Processes demands on this component.

Parameters:
demand - the demand to process.

processDemand

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

Parameters:
controllerId - the demand is sent to the specified controller.
demand - the demand to process.

(c) January 2013 - W4 S.A.

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