com.groiss.gui.component
Class Image

java.lang.Object
  extended by com.groiss.gui.AbstractComponent
      extended by com.groiss.gui.component.Image
All Implemented Interfaces:
Component, java.io.Serializable, java.lang.Cloneable

public class Image
extends AbstractComponent

A HTML image (img) element.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.groiss.gui.AbstractComponent
actions, ACTIVE, browserMode, DEFAULT, ID, IE, INVISIBLE, isSensitive, label, NS, ON_BLUR, ON_CHANGE, ON_CLICK, ON_DBLCLICK, ON_FOCUS, ON_KEY_DOWN, ON_KEY_PRESS, ON_KEY_UP, ON_LOAD, ON_MOUSE_DOWN, ON_MOUSE_MOVE, ON_MOUSE_OUT, ON_MOUSE_UP, ON_RESET, ON_SELECT, ON_SUBMIT, ON_UNLOAD, outputter, parent, parentElem, READONLY, root, viewMode
 
Constructor Summary
Image()
          Constructs a new empty image.
Image(java.lang.String src)
          Constructor with image url
Image(java.lang.String src, java.lang.String alt)
          Constructor with image url
Image(java.lang.String name, java.lang.String src, int width, int height, java.lang.String alt)
          Constructor with image url
Image(java.lang.String src, java.lang.String alt, java.lang.String styleClass)
          Constructor with image url
 
Method Summary
 java.lang.String getAltText()
           
 int getBorder()
           
 java.lang.Object getContent()
           
 int getHeight()
           
 java.lang.String getSource()
           
 java.lang.String getText()
           
 int getWidth()
           
 void setAltText(java.lang.String alt)
          sets the alternative text - attribute "title" if image is rendered this text is the tooltip text else it is the alternative text instead of the image
 void setBorder(int border)
          sets the thickness of the border around the displayed image
 void setContent(java.lang.Object o)
          sets the content of the component
 void setSize(int width, int height)
          sets the size of the image
 void setSource(java.lang.String src)
          sets the source of the image
 void setText(java.lang.String text)
          sets the text
 
Methods inherited from class com.groiss.gui.AbstractComponent
clone, create, getActionListener, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, init, removeAttribute, setActionListener, setAttribute, setBrowserMode, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setName, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Image

public Image()
Constructs a new empty image.


Image

public Image(java.lang.String src)
Constructor with image url

Parameters:
src - the image url

Image

public Image(java.lang.String src,
             java.lang.String alt)
Constructor with image url

Parameters:
src - the image url
alt - the alternative text

Image

public Image(java.lang.String src,
             java.lang.String alt,
             java.lang.String styleClass)
Constructor with image url

Parameters:
src - the image url
alt - the alternative text
styleClass - the name of a CSS class

Image

public Image(java.lang.String name,
             java.lang.String src,
             int width,
             int height,
             java.lang.String alt)
Constructor with image url

Parameters:
name -
src -
width -
height -
alt -
Method Detail

setSize

public void setSize(int width,
                    int height)
sets the size of the image

Parameters:
width - - the width of the image
height - - the height of the image

getWidth

public int getWidth()

getHeight

public int getHeight()

setAltText

public void setAltText(java.lang.String alt)
sets the alternative text - attribute "title" if image is rendered this text is the tooltip text else it is the alternative text instead of the image

Parameters:
alt - - the alternative text

getAltText

public java.lang.String getAltText()

setSource

public void setSource(java.lang.String src)
sets the source of the image

Parameters:
src - - the sourcepath of the image file

getSource

public java.lang.String getSource()

setBorder

public void setBorder(int border)
sets the thickness of the border around the displayed image

Parameters:
border - - the thickness of the border

getBorder

public int getBorder()

setText

public void setText(java.lang.String text)
sets the text

Parameters:
text - - the text String

getText

public java.lang.String getText()

setContent

public void setContent(java.lang.Object o)
sets the content of the component

Specified by:
setContent in interface Component
Overrides:
setContent in class AbstractComponent
Parameters:
o - any object where the string representation is used for rendering

getContent

public java.lang.Object getContent()
Specified by:
getContent in interface Component
Overrides:
getContent in class AbstractComponent
Returns:
the content object of the component


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.