Style Intelligence v12.0

inetsoft.report.painter
Class HTMLSource

java.lang.Object
  extended by inetsoft.report.painter.HTMLSource
All Implemented Interfaces:
inetsoft.report.internal.ExpandablePainter, Painter, Serializable

public class HTMLSource
extends Object
implements inetsoft.report.internal.ExpandablePainter

HTML Painter is not a real painter. It does not define any logic for painting a report area. Instead it contains HTML tag that can be placed in generated HTML output for the reserved area. This can only be used in Style Report/EE HTML viewing mode.

See Also:
Serialized Form

Constructor Summary
HTMLSource()
          Create an empty html painter.
HTMLSource(String html)
          Create a painter for the specified html.
 
Method Summary
 float getHeightAdjustment(ReportElement elem, Dimension pd, float bufy, float bufw, float bufh)
          Get the adjustment on height if the height is adjusted to line boundary.
 String getHTML()
          Get the HTML code to be used in this area.
 int getOriginOffset()
          Get the origin offset.
 Dimension getPreferredSize()
          Return the preferred size of this painter.
 Dimension getPreferredSize(float width)
          Calculate the preferred size of the object representation.
 boolean isExpandable()
          Check if this painter is expandable.
 boolean isScalable()
          HTML source is not scalable.
 void paint(Graphics g, int x, int y, int w, int h)
          Draw an empty box with label HTML Painter
 void paint(Graphics g, int x, int y, int w, int h, float bufy, float bufh)
          Paint contents at the specified location.
 void setContext(ReportElement elem)
          Set the element that is associated with this painter.
 void setHTML(String html)
          Set the HTML code to be used in this area.
 void setOriginOffset(int offset)
          Set the origin offset for rotated painter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLSource

public HTMLSource()
Create an empty html painter. The html should be set using setHTML before this object is used.


HTMLSource

public HTMLSource(String html)
Create a painter for the specified html.

Method Detail

setHTML

public void setHTML(String html)
Set the HTML code to be used in this area.


getHTML

public String getHTML()
Get the HTML code to be used in this area.


isExpandable

public boolean isExpandable()
Check if this painter is expandable. A painter may implement the ExpandablePainter interface but not expandable at rendering time.

Specified by:
isExpandable in interface inetsoft.report.internal.ExpandablePainter

getPreferredSize

public Dimension getPreferredSize()
Return the preferred size of this painter.

Specified by:
getPreferredSize in interface Painter
Returns:
size.

getPreferredSize

public Dimension getPreferredSize(float width)
Calculate the preferred size of the object representation.

Specified by:
getPreferredSize in interface inetsoft.report.internal.ExpandablePainter
Parameters:
width - the maximum width of the painter.
Returns:
preferred size.

paint

public void paint(Graphics g,
                  int x,
                  int y,
                  int w,
                  int h)
Draw an empty box with label HTML Painter

Specified by:
paint in interface Painter
Parameters:
g - graphical context.
x - x coordinate of the left edge of the paint area.
y - y coordinate of the upper edge of the paint area.
w - area width.
h - area height.

paint

public void paint(Graphics g,
                  int x,
                  int y,
                  int w,
                  int h,
                  float bufy,
                  float bufh)
Paint contents at the specified location.

Specified by:
paint in interface inetsoft.report.internal.ExpandablePainter
Parameters:
g - graphical context.
x - x coordinate of the left edge of the paint area.
y - y coordinate of the upper edge of the paint area.
w - area width.
h - area height.
bufy - if the painter is drawn across pages, bufy is the height already consumed in previous pages.
bufh - is the height available on the current page.

getHeightAdjustment

public float getHeightAdjustment(ReportElement elem,
                                 Dimension pd,
                                 float bufy,
                                 float bufw,
                                 float bufh)
Get the adjustment on height if the height is adjusted to line boundary.

Specified by:
getHeightAdjustment in interface inetsoft.report.internal.ExpandablePainter

isScalable

public boolean isScalable()
HTML source is not scalable.

Specified by:
isScalable in interface Painter
Returns:
scalable option.

setContext

public void setContext(ReportElement elem)
Set the element that is associated with this painter.


setOriginOffset

public void setOriginOffset(int offset)
Set the origin offset for rotated painter.


getOriginOffset

public int getOriginOffset()
Get the origin offset.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.