EchoPoint
2.1.0rc4

echopointng
Class ImageIcon

java.lang.Object
  extended bynextapp.echo2.app.Component
      extended byechopointng.ComponentEx
          extended byechopointng.AbleComponent
              extended byechopointng.ImageIcon
All Implemented Interfaces:
AccessKeyable, Attributeable, Borderable, Delegateable, Heightable, Insetable, MouseCursorable, nextapp.echo2.app.RenderIdSupport, java.io.Serializable, Sizeable, ToolTipable, Widthable

public class ImageIcon
extends AbleComponent

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 nextapp.echo.LabelEx is that you can scale ImageReference objects that you may not know the dimensions of, and it can be clicked on like a ButtonEx.

See Also:
Serialized Form

Field Summary
static nextapp.echo2.app.Style DEFAULT_STYLE
           
static java.lang.String PROPERTY_ACTION_COMMAND
           
static java.lang.String PROPERTY_ICON
           
 
Fields inherited from class echopointng.ComponentEx
PROPERTY_HIDDEN
 
Fields inherited from class nextapp.echo2.app.Component
CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_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
 
Fields inherited from interface echopointng.able.AccessKeyable
PROPERTY_ACCESS_KEY
 
Fields inherited from interface echopointng.able.Borderable
PROPERTY_BORDER
 
Fields inherited from interface echopointng.able.MouseCursorable
CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, PROPERTY_MOUSE_CURSOR, PROPERTY_MOUSE_CURSOR_URI
 
Fields inherited from interface echopointng.able.Insetable
DEFAULT_INSETS, DEFAULT_OUTSETS, PROPERTY_INSETS, PROPERTY_OUTSETS
 
Fields inherited from interface echopointng.able.Widthable
PROPERTY_WIDTH
 
Fields inherited from interface echopointng.able.Heightable
PROPERTY_HEIGHT
 
Fields inherited from interface echopointng.able.ToolTipable
PROPERTY_TOOL_TIP_TEXT
 
Constructor Summary
ImageIcon()
          Constructs a ImageIcon with a null ImageReference.
ImageIcon(nextapp.echo2.app.ImageReference imageRef)
          Constructs a ImageIcon and sets the width and height to be that of the ImageReference.
ImageIcon(nextapp.echo2.app.ImageReference imageRef, nextapp.echo2.app.Extent width, nextapp.echo2.app.Extent height)
          Constructs a ImageIcon with the specified width and height
ImageIcon(nextapp.echo2.app.ImageReference imageRef, int width, int height)
          Constructs a ImageIcon with the specified width and height
 
Method Summary
 void addActionListener(nextapp.echo2.app.event.ActionListener l)
          Adds an ActionListener.
 void fireActionPerformed()
          Notifies all listeners that have registered for this event type.
 java.lang.String getActionCommand()
          Returns the action command for this ImageIcon.
 nextapp.echo2.app.Extent getHeight()
          Retutns the height extent of the Heightable.
 nextapp.echo2.app.ImageReference getIcon()
          Returns the ImageReference within.
 nextapp.echo2.app.Extent getWidth()
          Returns the width extent of the Widthable.
 boolean hasActionListeners()
          Determines if the ImageIcon has any ActionListeners registered.
 void processInput(java.lang.String inputName, java.lang.Object inputValue)
           
 void removeActionListener(nextapp.echo2.app.event.ActionListener l)
          Removes an ActionListener.
 void setActionCommand(java.lang.String newValue)
          Sets the ImageIcon's action command.
 void setHeight(nextapp.echo2.app.Extent newValue)
          Sets the height extent of the Heightable.
 void setIcon(nextapp.echo2.app.ImageReference newValue)
          Sets the ImageReference used by the ImageIcon.
 void setWidth(nextapp.echo2.app.Extent newValue)
          Sets the width extent of the Widthable.
 
Methods inherited from class echopointng.AbleComponent
getAccessKey, getBorder, getInsets, getMouseCursor, getMouseCursorUri, getOutsets, getToolTipText, setAccessKey, setBorder, setInsets, setMouseCursor, setMouseCursorUri, setOutsets, setToolTipText
 
Methods inherited from class echopointng.ComponentEx
getAttribute, getAttributeNames, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, isHidden, setAttribute, setHidden, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty
 
Methods inherited from class nextapp.echo2.app.Component
add, add, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, 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
 
Methods inherited from interface echopointng.able.Delegateable
getRenderProperty, getRenderProperty
 

Field Detail

PROPERTY_ACTION_COMMAND

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

PROPERTY_ICON

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

DEFAULT_STYLE

public static final nextapp.echo2.app.Style DEFAULT_STYLE
Constructor Detail

ImageIcon

public ImageIcon()
Constructs a ImageIcon with a null ImageReference. The width and height are set to DEFAULT_WIDTH and/or DEFAULT_HEIGHT.


ImageIcon

public ImageIcon(nextapp.echo2.app.ImageReference imageRef)
Constructs a ImageIcon and sets the width and height to be that of the ImageReference.

Parameters:
imageRef -

ImageIcon

public ImageIcon(nextapp.echo2.app.ImageReference imageRef,
                 nextapp.echo2.app.Extent width,
                 nextapp.echo2.app.Extent height)
Constructs a ImageIcon with the specified width and height

Parameters:
imageRef - - the ImageReference to display
width - - the width to scale it to
height - - the height to scale it to

ImageIcon

public ImageIcon(nextapp.echo2.app.ImageReference imageRef,
                 int width,
                 int height)
Constructs a ImageIcon with the specified width and height

Parameters:
imageRef - - the ImageReference to display
width - - the width in pixels to scale it to
height - - the height in pixels to scale it to
Method Detail

processInput

public void processInput(java.lang.String inputName,
                         java.lang.Object inputValue)
See Also:
Component.processInput(java.lang.String, java.lang.Object)

addActionListener

public void addActionListener(nextapp.echo2.app.event.ActionListener l)
Adds an ActionListener.

Parameters:
l - The ActionListener to be added.

fireActionPerformed

public void fireActionPerformed()
Notifies all listeners that have registered for this event type.


getActionCommand

public java.lang.String getActionCommand()
Returns the action command for this ImageIcon.

Returns:
The action command for this button.

getIcon

public nextapp.echo2.app.ImageReference getIcon()
Returns the ImageReference within.

Returns:
ImageReference - the ImageReference within.

removeActionListener

public void removeActionListener(nextapp.echo2.app.event.ActionListener l)
Removes an ActionListener.

Parameters:
l - The ActionListener to be removed.

hasActionListeners

public boolean hasActionListeners()
Determines if the ImageIcon has any ActionListeners registered.

Returns:
true if any action listeners are registered

setActionCommand

public void setActionCommand(java.lang.String newValue)
Sets the ImageIcon's action command.

Parameters:
newValue - The new action command for this ImageIcon.

setIcon

public void setIcon(nextapp.echo2.app.ImageReference newValue)
Sets the ImageReference used by the ImageIcon.

Parameters:
newValue -

getHeight

public nextapp.echo2.app.Extent getHeight()
Description copied from interface: Heightable
Retutns the height extent of the Heightable.

Specified by:
getHeight in interface Heightable
Overrides:
getHeight in class AbleComponent
See Also:
Heightable.getHeight()

getWidth

public nextapp.echo2.app.Extent getWidth()
Description copied from interface: Widthable
Returns the width extent of the Widthable.

Specified by:
getWidth in interface Widthable
Overrides:
getWidth in class AbleComponent
See Also:
Widthable.getWidth()

setHeight

public void setHeight(nextapp.echo2.app.Extent newValue)
Description copied from interface: Heightable
Sets the height extent of the Heightable.

Specified by:
setHeight in interface Heightable
Overrides:
setHeight in class AbleComponent
See Also:
Heightable.setHeight(nextapp.echo2.app.Extent)

setWidth

public void setWidth(nextapp.echo2.app.Extent newValue)
Description copied from interface: Widthable
Sets the width extent of the Widthable.

Specified by:
setWidth in interface Widthable
Overrides:
setWidth in class AbleComponent
See Also:
Widthable.setWidth(nextapp.echo2.app.Extent)

EchoPoint
2.1.0rc4