org.util.xml.renderer.html
Class HTMLObject

java.lang.Object
  extended by org.util.xml.renderer.html.HTMLObject
All Implemented Interfaces:
ParserPolicy
Direct Known Subclasses:
HTMLImage, HTMLText

public class HTMLObject
extends java.lang.Object
implements ParserPolicy


Field Summary
protected  java.awt.Color background_
           
protected  java.awt.Color foreground_
           
protected  double height_
           
protected  java.lang.String html_text
           
protected  boolean init_
           
 boolean is_mouse_over_
           
protected  double margin_bottom_
           
protected  double margin_left_
           
protected  double margin_right_
           
protected  double margin_up_
           
protected  double now_y_
           
protected  double offset_x_
           
protected  double offset_y_
           
protected  double preferred_height_
           
protected  boolean preferred_location_
           
protected  double preferred_width_
           
protected  double preferred_x_
           
protected  double preferred_y_
           
 java.awt.geom.Rectangle2D rect_
           
protected  double width_
           
protected  double write_point_x_
           
protected  double write_point_y_
           
protected  double x_
           
protected  double y_
           
 
Constructor Summary
HTMLObject()
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener listener)
           
static void alert(javax.swing.JComponent parent, java.lang.Object message)
           
static void alert(java.lang.Object message)
           
 Element allowElement(Element element)
          called when element is detected.
 boolean checkEndTag()
          if true, check open tag key and close tag key.
 void debug(java.lang.String message)
           
 void doLayout()
           
 void doRenderer()
           
 void draw(java.awt.Graphics g)
           
 boolean finished()
           
 void fireChanged()
           
 boolean forceEmptyTag(java.lang.String key)
          Basicly, all the tag must open and close.
 double getHeight()
           
 ParserPolicy getInnerPolicy(Element element)
          return handler that handle this element
 double getPreferredHeight()
           
 double getPreferredWidth()
           
 double getPreferredX()
           
 double getPreferredY()
           
 double getWidth()
           
 double getX()
           
 double getY()
           
 boolean hit(double x, double y)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
           
 void paint(java.awt.Graphics g)
           
 java.lang.String selectEncoding(java.lang.String last_tag_key)
          if encoding cannot be detected by first line of document, this method will be called.
 void setBackground(java.awt.Color background)
           
 void setForeground(java.awt.Color foreground)
           
 void setLocation(double x, double y)
           
 void setPreferredLocation(double x, double y)
           
 void setPreferredSize(double width, double height)
           
 void setSize(double width, double height)
           
 Element startElement(Element element)
           
 boolean throwExceptionIfDocumentHasError()
          Throw exception if document has error.
 void write(HTMLObject html_object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

init_

protected boolean init_

preferred_width_

protected double preferred_width_

preferred_height_

protected double preferred_height_

preferred_x_

protected double preferred_x_

preferred_y_

protected double preferred_y_

offset_x_

protected double offset_x_

offset_y_

protected double offset_y_

preferred_location_

protected boolean preferred_location_

width_

protected double width_

height_

protected double height_

x_

protected double x_

y_

protected double y_

background_

protected java.awt.Color background_

foreground_

protected java.awt.Color foreground_

is_mouse_over_

public boolean is_mouse_over_

write_point_x_

protected double write_point_x_

write_point_y_

protected double write_point_y_

margin_up_

protected double margin_up_

margin_bottom_

protected double margin_bottom_

margin_right_

protected double margin_right_

margin_left_

protected double margin_left_

html_text

protected java.lang.String html_text

now_y_

protected double now_y_

rect_

public java.awt.geom.Rectangle2D rect_
Constructor Detail

HTMLObject

public HTMLObject()
Method Detail

alert

public static void alert(java.lang.Object message)

alert

public static void alert(javax.swing.JComponent parent,
                         java.lang.Object message)

hit

public boolean hit(double x,
                   double y)

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener listener)

fireChanged

public void fireChanged()

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)

setBackground

public void setBackground(java.awt.Color background)

setForeground

public void setForeground(java.awt.Color foreground)

setPreferredSize

public void setPreferredSize(double width,
                             double height)

setPreferredLocation

public void setPreferredLocation(double x,
                                 double y)

getPreferredWidth

public double getPreferredWidth()

getPreferredHeight

public double getPreferredHeight()

getPreferredX

public double getPreferredX()

getPreferredY

public double getPreferredY()

getX

public double getX()

getY

public double getY()

getWidth

public double getWidth()

getHeight

public double getHeight()

setLocation

public void setLocation(double x,
                        double y)

setSize

public void setSize(double width,
                    double height)

paint

public void paint(java.awt.Graphics g)

doLayout

public void doLayout()

doRenderer

public void doRenderer()

write

public void write(HTMLObject html_object)

draw

public void draw(java.awt.Graphics g)

debug

public void debug(java.lang.String message)

throwExceptionIfDocumentHasError

public boolean throwExceptionIfDocumentHasError()
Description copied from interface: ParserPolicy
Throw exception if document has error. In case this method returns false, if there are errors, skip some texts and continue parsing.

Specified by:
throwExceptionIfDocumentHasError in interface ParserPolicy

checkEndTag

public boolean checkEndTag()
Description copied from interface: ParserPolicy
if true, check open tag key and close tag key.

Specified by:
checkEndTag in interface ParserPolicy

getInnerPolicy

public ParserPolicy getInnerPolicy(Element element)
Description copied from interface: ParserPolicy
return handler that handle this element

Specified by:
getInnerPolicy in interface ParserPolicy

selectEncoding

public java.lang.String selectEncoding(java.lang.String last_tag_key)
Description copied from interface: ParserPolicy
if encoding cannot be detected by first line of document, this method will be called. while returned null, this method will be called every time that tag detected.

Specified by:
selectEncoding in interface ParserPolicy

forceEmptyTag

public boolean forceEmptyTag(java.lang.String key)
Description copied from interface: ParserPolicy
Basicly, all the tag must open and close. But if this method return true, opentag will be considerd to empty tag. So end tag will disregarded.

Specified by:
forceEmptyTag in interface ParserPolicy

startElement

public Element startElement(Element element)

finished

public boolean finished()
Specified by:
finished in interface ParserPolicy

allowElement

public Element allowElement(Element element)
Description copied from interface: ParserPolicy
called when element is detected.

Specified by:
allowElement in interface ParserPolicy