Package com.groiss.gui.component
Class Image
java.lang.Object
com.groiss.gui.AbstractComponent
com.groiss.gui.component.Image
- All Implemented Interfaces:
Component
,Serializable
,Cloneable
A HTML image (img) element.
- See Also:
-
Field Summary
Fields inherited from class com.groiss.gui.AbstractComponent
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, parent, parentElem, READONLY, root, viewMode
Fields inherited from interface com.groiss.gui.Component
LABELLEDBY
-
Constructor Summary
ConstructorDescriptionImage()
Constructs a new empty image.Constructor with image urlConstructor with image urlConstructor with image urlConstructor with image url -
Method Summary
Modifier and TypeMethodDescriptionint
int
getText()
int
getWidth()
void
setAltText
(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 imagevoid
setBorder
(int border) sets the thickness of the border around the displayed imagevoid
setContent
(Object o) sets the content of the componentvoid
setSize
(int width, int height) sets the size of the imagevoid
sets the source of the imagevoid
sets the textMethods inherited from class com.groiss.gui.AbstractComponent
addClass, clone, create, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, init, removeAttribute, removeClass, setActionListener, setAttribute, setBrowserMode, setClass, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setName, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toggleClass, toString
-
Constructor Details
-
Image
public Image()Constructs a new empty image. -
Image
Constructor with image url- Parameters:
src
- the image url
-
Image
Constructor with image url- Parameters:
src
- the image urlalt
- the alternative text
-
Image
Constructor with image url- Parameters:
src
- the image urlalt
- the alternative textstyleClass
- the name of a CSS class
-
Image
Constructor with image url- Parameters:
name
-src
-width
-height
-alt
-
-
-
Method Details
-
setSize
public void setSize(int width, int height) sets the size of the image- Parameters:
width
- - the width of the imageheight
- - the height of the image
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
setAltText
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
-
setSource
sets the source of the image- Parameters:
src
- - the sourcepath of the image file
-
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
sets the text- Parameters:
text
- - the text String
-
getText
-
setContent
sets the content of the component- Specified by:
setContent
in interfaceComponent
- Overrides:
setContent
in classAbstractComponent
- Parameters:
o
- any object where the string representation is used for rendering
-
getContent
- Specified by:
getContent
in interfaceComponent
- Overrides:
getContent
in classAbstractComponent
- Returns:
- the content object of the component
-