Agent System POND 1.2 (28.2.2002)

FIM.Util.WWW.Form
Class InputImageElement

java.lang.Object
  |
  +--FIM.Util.WWW.Form.FormElement
        |
        +--FIM.Util.WWW.Form.ActionElement
              |
              +--FIM.Util.WWW.Form.InputSubmitElement
                    |
                    +--FIM.Util.WWW.Form.InputImageElement
All Implemented Interfaces:
Element, Serializable

public class InputImageElement
extends InputSubmitElement

Class for the HTML element INPUT with subtype IMAGE. The alternative text is stored as the value of the element. If clicked, the form is submitted and the coordinates within the image submitted. The resulting page and any errors are stored. Invoking it again clears this previous data.

Version:
1.0, 1.7.2000
Author:
Michael Sonntag
See Also:
Serialized Form

Fields inherited from class FIM.Util.WWW.Form.FormElement
attributes, children
 
Constructor Summary
InputImageElement(HTMLDocument doc, Element parent, int startOffs, int endOffs, String name, String alt, String src)
          Creates a new INPUT/IMAGE element.
 
Method Summary
 String getEncoded()
          Retrieve this element in encoded form.
 String getSrc()
          Retrieve the URL for the image to display.
 URL getSrcAsURL()
          Retrieve the URL for the image to display.
 void reset()
          Resets the element.
 void setCoordinates(int x, int y)
          Set the coordinates to pass on when submitting.
 String toString()
          Returns a string representation of the input image element.
 
Methods inherited from class FIM.Util.WWW.Form.InputSubmitElement
doAction, getResult
 
Methods inherited from class FIM.Util.WWW.Form.ActionElement
getValue, match
 
Methods inherited from class FIM.Util.WWW.Form.FormElement
getAttributes, getDocument, getElement, getElementCount, getElementIndex, getEndOffset, getLabel, getName, getParentElement, getStartOffset, isLeaf, setLabel
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputImageElement

public InputImageElement(HTMLDocument doc,
                         Element parent,
                         int startOffs,
                         int endOffs,
                         String name,
                         String alt,
                         String src)
Creates a new INPUT/IMAGE element.
Parameters:
doc - the document this element belongs to
parent - the parent of this element
startOffs - start offset of the element in the document
endOffs - end offset of the element in the document
name - the name of the element
src - the URL of the image
alt - the alternative text for the element (stored in value)
Method Detail

reset

public void reset()
Resets the element. Both coordinates are set to -1.
Overrides:
reset in class ActionElement

getSrcAsURL

public URL getSrcAsURL()
                throws MalformedURLException
Retrieve the URL for the image to display. Parses it in the context of the base-url of the form if specified.
Returns:
the URL of the image

getSrc

public String getSrc()
Retrieve the URL for the image to display.
Returns:
the URL of the image as a string

setCoordinates

public void setCoordinates(int x,
                           int y)
Set the coordinates to pass on when submitting. If negative, this coordinate will not be included.
Parameters:
x - x coordinate the user clicked
y - y coordinate the user clicked

getEncoded

public String getEncoded()
Retrieve this element in encoded form. Returns only the name if both coordinates are negative. Otherwise, .x= and/or .y= are returned.
Overrides:
getEncoded in class ActionElement
Returns:
the name and possibly the coordinates the user clicked in encoded form

toString

public String toString()
Returns a string representation of the input image element.
Overrides:
toString in class InputSubmitElement
Returns:
string representation of the form element

Agent System POND 1.2 (28.2.2002)

Submit a bug

Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.