com.yospace.yae.yogi
Class YogiImageComponent

java.lang.Object
  |
  +--com.yospace.yae.yogi.YogiComponent
        |
        +--com.yospace.yae.yogi.YogiImageComponent
All Implemented Interfaces:
RendererFactory
Direct Known Subclasses:
YogiLabel

public class YogiImageComponent
extends YogiComponent
implements RendererFactory

A basic graphical image component. Wraps a MIDP Image in such a way that it can be used as a YogiComponent. Additionally allows YogiImageComponents to be loaded over an HTTP connection as well as from the local resources in the jar.


Field Summary
static int PROPERTY_IMAGE
          Constant for the image property
 
Fields inherited from class com.yospace.yae.yogi.YogiComponent
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, BORDER_DOTTED, BORDER_NONE, BORDER_PLAIN, BORDER_ROUNDED, BORDER_SOLID, COLOR_BACKGROUND, COLOR_BORDER, COLOR_FOREGROUND, FOCUS_DEFAULT, FOCUS_OFF, FOCUS_ON, PROPERTY_ALIGN, PROPERTY_BORDER_STYLE, PROPERTY_BOUNDS, PROPERTY_COLOR, PROPERTY_CONTEXT_ENABLED, PROPERTY_ENABLED, PROPERTY_FOCUS, PROPERTY_FOCUS_INDEX, PROPERTY_FOCUS_TRAVERSABLE, PROPERTY_FONT, PROPERTY_HOTKEY, PROPERTY_LOCATION, PROPERTY_OPAQUE, PROPERTY_SIZE, PROPERTY_VISIBLE, PROPERTY_X_INSET, PROPERTY_Y_INSET
 
Constructor Summary
YogiImageComponent()
          Default constructor simply sets the image name to be null (thus forcing the UIDelegate to render nothing).
YogiImageComponent(Image theImage)
          Create a new YogiImageComponent with the given Image.
YogiImageComponent(java.lang.String theImageName)
          Create a new YogiImageComponent with the Image identified by the given String.
 
Method Summary
 YogiComponent getCellRendererComponent(AbstractTable table, java.lang.Object value, boolean isSelected, boolean cellHasFocus)
          Provided to implement the RendererFactory interface.
 Image getImage()
          Get the Image currently associated with the YogiImageComponent.
 java.lang.String getImageName()
          Get the name of the Image currently associated with the YogiImageComponent.
 void setImage(Image theImage)
          Set the current Image directly for this YogiImageComponent.
 void setImage(java.lang.String name)
          Set the name identifying the YogiImageComponent.
 
Methods inherited from class com.yospace.yae.yogi.YogiComponent
_debugPrintComponents, add, addPropertyChangeListener, bringForwards, bringInFrontOf, bringToFront, contains, containsComponent, ensureVisible, ensureVisible, findComponentAt, findCurrentFocus, findFirstFocus, findFocusDomainRoot, findFocusDomainRootImpl, findHotkeyComponent, findNextFocus, fireActionPerformedEvent, firePropertyChangeEvent, getAlign, getBorderStyle, getBounds, getColor, getColors, getComponent, getComponent, getComponentCount, getComponentIndex, getComponents, getFocusBounds, getFocusIndex, getFont, getGlobalLocation, getHeight, getHotkey, getId, getParent, getParent, getTreeLock, getUI, getWidth, getX, getXInset, getY, getYInset, hasFocus, isActive, isContextEnabled, isEnabled, isFocusDomainRoot, isFocusTraversable, isOpaque, isVisible, keyPressed, keyReleased, keyRepeated, paint, paintBackground, paintBorder, paintForeground, pointerDragged, pointerPressed, pointerReleased, remove, remove, removeAll, removePropertyChangeListener, repaint, repaint, repaintAfterRebounding, requestFocus, requestFocus, sendBackwards, sendBehind, sendToBack, setActionListener, setActive, setAlign, setBorderStyle, setBounds, setColor, setColors, setContextEnabled, setDefaultColor, setEnabled, setFocusDomainRoot, setFocusIndex, setFocusTraversable, setFont, setHotkey, setId, setLocation, setNoFocus, setOpaque, setProperty, setSize, setUI, setVisible, setXInset, setYInset, updateUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_IMAGE

public static final int PROPERTY_IMAGE
Constant for the image property
Constructor Detail

YogiImageComponent

public YogiImageComponent()
Default constructor simply sets the image name to be null (thus forcing the UIDelegate to render nothing).

YogiImageComponent

public YogiImageComponent(Image theImage)
Create a new YogiImageComponent with the given Image.
Parameters:
theImage - the image.

YogiImageComponent

public YogiImageComponent(java.lang.String theImageName)
Create a new YogiImageComponent with the Image identified by the given String.
Parameters:
theImageName - the name of the image to create.
Method Detail

getImage

public Image getImage()
Get the Image currently associated with the YogiImageComponent.
Returns:
the Image.

getImageName

public java.lang.String getImageName()
Get the name of the Image currently associated with the YogiImageComponent.
Returns:
the String that is the name of the Image.

setImage

public void setImage(java.lang.String name)
Set the name identifying the YogiImageComponent. This causes an attempted load of an image stored in the current MIDlet suite with that identifier to be performed. Thus the name must be the fully qualified name of an image stored within the current MIDlet suite.
Parameters:
name - the Image's name, as passable to lcdui.Image.createImage(name).

setImage

public void setImage(Image theImage)
Set the current Image directly for this YogiImageComponent. Note that this setter method is not currently exposed to the property system. setImage(String name) should be used there instead.
Parameters:
theImage - the Image to set as this component's current.

getCellRendererComponent

public YogiComponent getCellRendererComponent(AbstractTable table,
                                              java.lang.Object value,
                                              boolean isSelected,
                                              boolean cellHasFocus)
Provided to implement the RendererFactory interface. Returns a YogiImageComponent customised to the arguments passed from the AbstractTable subclass.
Specified by:
getCellRendererComponent in interface RendererFactory
Parameters:
table - The table for which the check box is rendering.
value - The object to be custom rendererd.
isSelected - The selected state of the object to be custom rendererd.
cellHasFocus - The focus state of the object to be custom rendererd.
Returns:
the custom rendered YogiImageComponent.

Copyright 2002 Yospace Holdings Ltd. All Rights Reserved.