EchoPoint API - 3.0.0b5
App Webcontainer

echopoint
Class ImageIcon

java.lang.Object
  extended by nextapp.echo.app.Component
      extended by echopoint.internal.AbstractContainer
          extended by echopoint.internal.AbstractImage
              extended by echopoint.ImageIcon
All Implemented Interfaces:
Serializable, RenderIdSupport

public class ImageIcon
extends AbstractImage

The ImageIcon class provides an component that displays an ImageReference. A height and width value can be specified to overide what may be defined in the ImageReference itself. This allows images to be "scaled" to different dimensions.

The advantage of ImageIcon over using a Label is that you can scale ImageReference objects that you may not know the dimensions of, and it can be clicked on like a Button.

The following code shows sample usage of this component.

   import echopoint.ImageIcon;

     ...
     final ImageIcon icon = new ImageIcon( "image/imagemap.gif" );
     icon.setWidth( 500 );
     icon.setHeight( 300 );
     icon.setActionCommand( "iconClicked" );
     icon.addActionListener( ... );

     final Column column = new Columnn();
     column.add( icon );
 

Version:
$Id: ImageIcon.java 262 2009-12-18 21:29:16Z sptrakesh $
Author:
Rakesh Vidyadharan 2008-10-20
See Also:
Serialized Form

Field Summary
 
Fields inherited from class echopoint.internal.AbstractImage
PROPERTY_ACTION_COMMAND, PROPERTY_CURSOR, PROPERTY_IMAGE, PROPERTY_TEXT, PROPERTY_TOOL_TIP_TEXT
 
Fields inherited from class echopoint.internal.AbstractContainer
ACTION_COMMAND_PROPERTY, ACTION_LISTENERS_CHANGED_PROPERTY, INPUT_ACTION, PROPERTY_ALIGNMENT, PROPERTY_BACKGROUND_IMAGE, PROPERTY_BORDER, PROPERTY_HEIGHT, PROPERTY_INSETS, PROPERTY_WIDTH
 
Fields inherited from class nextapp.echo.app.Component
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_NEXT_ID_CHANGED_PROPERTY, FOCUS_PREVIOUS_ID_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
ImageIcon()
          Default constructor.
ImageIcon(ImageReference icon)
          Create a new instance using the specified image reference.
ImageIcon(String url)
          Create a new instance using an image from the specified HTTP URI.
 
Method Summary
 ImageReference getIcon()
          Deprecated. Use AbstractImage.getImage() instead.
 void setIcon(ImageReference icon)
          Deprecated. Use AbstractImage.setImage(nextapp.echo.app.ImageReference) instead.
 
Methods inherited from class echopoint.internal.AbstractImage
addActionListener, fireActionPerformed, getActionCommand, getCursor, getImage, getText, getToolTipText, hasActionListeners, processInput, removeActionListener, setActionCommand, setBackgroundImage, setCursor, setImage, setImage, setText, setToolTipText
 
Methods inherited from class echopoint.internal.AbstractContainer
fireActionPerformed, getAlignment, getBackgroundImage, getBorder, getHeight, getInsets, getWidth, setAlignment, setBorder, setHeight, setInsets, setWidth
 
Methods inherited from class nextapp.echo.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusNextId, getFocusPreviousId, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusNextId, setFocusPreviousId, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageIcon

public ImageIcon()
Default constructor.


ImageIcon

public ImageIcon(ImageReference icon)
Create a new instance using the specified image reference.

Parameters:
icon - The icon to associate with this component.

ImageIcon

public ImageIcon(String url)
Create a new instance using an image from the specified HTTP URI.

Parameters:
url - The URI for the image resource.
Method Detail

getIcon

@Deprecated
public ImageReference getIcon()
Deprecated. Use AbstractImage.getImage() instead.

Return the value of AbstractImage.PROPERTY_IMAGE property.

Returns:
The image reference for the icon.

setIcon

@Deprecated
public void setIcon(ImageReference icon)
Deprecated. Use AbstractImage.setImage(nextapp.echo.app.ImageReference) instead.

Set the value of AbstractImage.PROPERTY_IMAGE property.

Parameters:
icon - The image reference to set.

EchoPoint API - 3.0.0b5
App Webcontainer