org.millstone.base.ui
Class Embedded

java.lang.Object
  |
  +--org.millstone.base.ui.AbstractComponent
        |
        +--org.millstone.base.ui.Embedded
All Implemented Interfaces:
Component, java.util.EventListener, MethodEventSource, Paintable, Sizeable, VariableOwner

public class Embedded
extends AbstractComponent
implements Sizeable

Component for embedding external objects.

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd.

Nested Class Summary
 
Nested classes inherited from class org.millstone.base.ui.Component
Component.Event, Component.Listener
 
Nested classes inherited from class org.millstone.base.terminal.Paintable
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener
 
Field Summary
static int TYPE_IMAGE
          Image types
static int TYPE_OBJECT
          General object type
 
Fields inherited from interface org.millstone.base.terminal.Sizeable
UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
Embedded()
          Creates a new empty Embedded object.
Embedded(java.lang.String caption)
          Creates a new empty Embedded object with caption.
Embedded(java.lang.String caption, Resource source)
          Creates a new Embedded object whose contents is loaded from given resource.
 
Method Summary
 java.lang.String getArchive()
          Returns the archive attribute.
 java.lang.String getClassId()
          Returns the classId attribute.
 java.lang.String getCodebase()
          Returns the codebase, the root-path used to access resources with relative paths.
 java.lang.String getCodetype()
          Returns the MIME-Type of the code.
 int getHeight()
          Returns the visual height of the object.
 int getHeightUnits()
          Get height property units.
 java.lang.String getMimeType()
          Returns the MIME-Type of the object
 java.lang.String getParameter(java.lang.String name)
          Get the value of an object parameter.
 java.util.Iterator getParameterNames()
          Get embedded object parameter names.
 Resource getSource()
          Get the resource contained in the embedded object.
 java.lang.String getStandby()
          Returns the standby text displayed when the object is loading.
 java.lang.String getTag()
          Get component UIDL tag.
 int getType()
          Get the type of the embedded object.
 int getWidth()
          Returns the visual width of the object.
 int getWidthUnits()
          Get width property units.
 void paintContent(PaintTarget target)
          Invoked when the component state should be painted
 void removeParameter(java.lang.String name)
          Remove an object parameter from the list.
 void setArchive(java.lang.String archive)
          Sets the archive attribute.
 void setClassId(java.lang.String classId)
          Sets the classId attribute.
 void setCodebase(java.lang.String codebase)
          Sets the codebase, the root-path used to access resources with relative paths.
 void setCodetype(java.lang.String codetype)
          Sets the codetype, the MIME-Type of the code.
 void setHeight(int height)
          Sets the visual height of the object.
 void setHeightUnits(int units)
          Set height property units.
 void setMimeType(java.lang.String mimeType)
          Sets the mimeType, the MIME-Type of the object.
 void setParameter(java.lang.String name, java.lang.String value)
          Set an object parameter.
 void setSource(Resource source)
          Set the object source resource.
 void setStandby(java.lang.String standby)
          Sets the standby, the text to display while loading the object.
 void setType(int type)
          Sets the object type.
 void setWidth(int width)
          Sets the visual width of the object.
 void setWidthUnits(int units)
          Set width property units.
 
Methods inherited from class org.millstone.base.ui.AbstractComponent
addListener, addListener, addListener, addListener, attach, changeVariables, childRequestedRepaint, dependsOn, detach, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getDescription, getDirectDependencies, getErrorMessage, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setReadOnly, setStyle, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_OBJECT

public static final int TYPE_OBJECT
General object type

See Also:
Constant Field Values

TYPE_IMAGE

public static final int TYPE_IMAGE
Image types

See Also:
Constant Field Values
Constructor Detail

Embedded

public Embedded()
Creates a new empty Embedded object.


Embedded

public Embedded(java.lang.String caption)
Creates a new empty Embedded object with caption.


Embedded

public Embedded(java.lang.String caption,
                Resource source)
Creates a new Embedded object whose contents is loaded from given resource. The dimensions are assumed if possible. The type is guessed from resource.

Method Detail

getTag

public java.lang.String getTag()
Get component UIDL tag.

Specified by:
getTag in class AbstractComponent
Returns:
Component UIDL tag as string.

paintContent

public void paintContent(PaintTarget target)
                  throws PaintException
Invoked when the component state should be painted

Overrides:
paintContent in class AbstractComponent
Parameters:
target - target UIDL stream where the component should paint itself to
Throws:
PaintException - if the operation failed

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Set an object parameter. Parameters are optional information, and they are passed to the instantiated object. Parameters are are stored as name value pairs. This overrides the previous value assigned to this parameter.

Parameters:
name - - The name of the parameter.
value - - The value of the parameter.

getParameter

public java.lang.String getParameter(java.lang.String name)
Get the value of an object parameter. Parameters are optional information, and they are passed to the instantiated object. Parameters are are stored as name value pairs.

Returns:
Value of parameter or null if not found.

removeParameter

public void removeParameter(java.lang.String name)
Remove an object parameter from the list.

Parameters:
name - - The name of the parameter to remove.

getParameterNames

public java.util.Iterator getParameterNames()
Get embedded object parameter names.

Returns:
Iterator of parameters names.

getCodebase

public java.lang.String getCodebase()
Returns the codebase, the root-path used to access resources with relative paths.

Returns:
String

getCodetype

public java.lang.String getCodetype()
Returns the MIME-Type of the code.

Returns:
String

getMimeType

public java.lang.String getMimeType()
Returns the MIME-Type of the object

Returns:
String

getStandby

public java.lang.String getStandby()
Returns the standby text displayed when the object is loading.

Returns:
String

setCodebase

public void setCodebase(java.lang.String codebase)
Sets the codebase, the root-path used to access resources with relative paths.

Parameters:
codebase - The codebase to set

setCodetype

public void setCodetype(java.lang.String codetype)
Sets the codetype, the MIME-Type of the code.

Parameters:
codetype - The codetype to set

setMimeType

public void setMimeType(java.lang.String mimeType)
Sets the mimeType, the MIME-Type of the object.

Parameters:
mimeType - The mimeType to set

setStandby

public void setStandby(java.lang.String standby)
Sets the standby, the text to display while loading the object.

Parameters:
standby - The standby to set

getHeight

public int getHeight()
Returns the visual height of the object. Default height is -1, which is interpreted as "unspecified".

Specified by:
getHeight in interface Sizeable
Returns:
The height in units specified by heightUnits property.

getWidth

public int getWidth()
Returns the visual width of the object. Default width is -1, which is interpreted as "unspecified".

Specified by:
getWidth in interface Sizeable
Returns:
The width in units specified by widthUnits property.

setHeight

public void setHeight(int height)
Sets the visual height of the object. Default height is -1, which is interpreted as "unspecified".

Specified by:
setHeight in interface Sizeable
Parameters:
height - The height in units specified by heightUnits property.

setWidth

public void setWidth(int width)
Sets the visual width of the object. Default width is -1, which is interpreted as "unspecified".

Specified by:
setWidth in interface Sizeable
Parameters:
width - The width in units specified by widthUnits property.

getClassId

public java.lang.String getClassId()
Returns the classId attribute.

Returns:
String

setClassId

public void setClassId(java.lang.String classId)
Sets the classId attribute.

Parameters:
classId - The classId to set

getSource

public Resource getSource()
Get the resource contained in the embedded object.

Returns:
Resource

getType

public int getType()
Get the type of the embedded object.

This can be one of the following:

Returns:
int

setSource

public void setSource(Resource source)
Set the object source resource. The dimensions are assumed if possible. The type is guessed from resource.

Parameters:
source - The source to set

setType

public void setType(int type)
Sets the object type.

This can be one of the following:

Parameters:
type - The type to set

getArchive

public java.lang.String getArchive()
Returns the archive attribute.

Returns:
String

setArchive

public void setArchive(java.lang.String archive)
Sets the archive attribute.

Parameters:
archive - The archive string to set

getHeightUnits

public int getHeightUnits()
Get height property units. Default units are Sizeable.UNITS_PIXELS.

Specified by:
getHeightUnits in interface Sizeable
Returns:
units used in height property.
See Also:
Sizeable.getHeightUnits()

getWidthUnits

public int getWidthUnits()
Get width property units. Default units are Sizeable.UNITS_PIXELS.

Specified by:
getWidthUnits in interface Sizeable
Returns:
units used in width property.
See Also:
Sizeable.getWidthUnits()

setHeightUnits

public void setHeightUnits(int units)
Set height property units.

Specified by:
setHeightUnits in interface Sizeable
Parameters:
units - units used in height property.
See Also:
Sizeable.setHeightUnits(int)

setWidthUnits

public void setWidthUnits(int units)
Set width property units.

Specified by:
setWidthUnits in interface Sizeable
Parameters:
units - units used in width property.
See Also:
Sizeable.setWidthUnits(int)


Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.