Style Intelligence v12.0

inetsoft.report.painter
Class HTMLPresenter

java.lang.Object
  extended by inetsoft.report.painter.HTMLPresenter
All Implemented Interfaces:
inetsoft.report.internal.ExpandablePresenter, Presenter, Serializable

public class HTMLPresenter
extends Object
implements inetsoft.report.internal.ExpandablePresenter

HTML presenters supports displaying of basic html.

See Also:
Serialized Form

Constructor Summary
HTMLPresenter()
           
 
Method Summary
 Color getBackground()
          Get the background.
 String getDisplayName()
          Get the display name of this presenter.
 String getFragment(Object html, float starty, float bufw, float bufh)
          Get the html contents for the specified buffer.
 float getHeightAdjustment(Object html, ReportElement elem, Dimension pd, float starty, float bufw, float bufh)
          Get the adjustment on height if the height is adjusted to line boundary.
 Dimension getPreferredSize(Object v)
          Calculate the preferred size of the object representation.
 Dimension getPreferredSize(Object v, float width)
          Calculate the preferred size of the object representation.
 boolean isFill()
          Check if this presenter should always fill the entire area of a cell.
 boolean isPresenterOf(Class type)
          Check if the presenter can handle this type of objects.
 boolean isPresenterOf(Object obj)
          Check if the presenter can handle this particular object.
 boolean isRawDataRequired()
          Determine if this Presenter requires raw (unformatted) data.
 void paint(Graphics g, Object html, int x, int y, int w, int h)
          Draw an empty box with label HTML Painter
 void paint(Graphics g, Object html, int x, int y, int w, int h, float starty, float bufh)
          Draw the html contents.
 void setBackground(Color bg)
          Set the background.
 void setFont(Font font)
          Set the font to use for this presenter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLPresenter

public HTMLPresenter()
Method Detail

isPresenterOf

public boolean isPresenterOf(Class type)
Check if the presenter can handle this type of objects.

Specified by:
isPresenterOf in interface Presenter
Parameters:
type - object type.
Returns:
true if the presenter can handle this type.

isPresenterOf

public boolean isPresenterOf(Object obj)
Check if the presenter can handle this particular object. Normally a presenter handles a class of objects, which is checked by the isPresenterOf(Class) method. If this presenter does not care about the value in the object, it can just call the isPresenterOf() with the class of the object, e.g.
   if(type == null) {
      return false;
   }
   return isPresenterOf(obj.getClass());
 

Specified by:
isPresenterOf in interface Presenter
Parameters:
obj - object type.
Returns:
true if the presenter can handle this type.

isFill

public boolean isFill()
Check if this presenter should always fill the entire area of a cell.

Specified by:
isFill in interface Presenter

setFont

public void setFont(Font font)
Set the font to use for this presenter. A table calls this function before the cell is printed when a presenter is used.

Specified by:
setFont in interface Presenter

getDisplayName

public String getDisplayName()
Get the display name of this presenter.

Specified by:
getDisplayName in interface Presenter
Returns:
a user-friendly name for this presenter.
Since:
5.1

isRawDataRequired

public boolean isRawDataRequired()
Determine if this Presenter requires raw (unformatted) data.

Specified by:
isRawDataRequired in interface Presenter
Returns:
true if the presenter requires raw data.

getPreferredSize

public Dimension getPreferredSize(Object v)
Calculate the preferred size of the object representation.

Specified by:
getPreferredSize in interface Presenter
Parameters:
v - object value.
Returns:
preferred size.

getPreferredSize

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

Specified by:
getPreferredSize in interface inetsoft.report.internal.ExpandablePresenter
Parameters:
v - object value.
width - the maximum width of the presenter.
Returns:
preferred size.

paint

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

Specified by:
paint in interface Presenter
Parameters:
g - graphical context.
html - object value.
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,
                  Object html,
                  int x,
                  int y,
                  int w,
                  int h,
                  float starty,
                  float bufh)
Draw the html contents.

Specified by:
paint in interface inetsoft.report.internal.ExpandablePresenter
Parameters:
g - target graphics.
html - html string.
x - x position of the drawing area.
y - y position of the drawing area.
w - width of the drawing area.
h - height of the drawing area.
starty - the already consumed height.
bufh - the current drawing buffer height.

getHeightAdjustment

public float getHeightAdjustment(Object html,
                                 ReportElement elem,
                                 Dimension pd,
                                 float starty,
                                 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.ExpandablePresenter

getFragment

public String getFragment(Object html,
                          float starty,
                          float bufw,
                          float bufh)
Get the html contents for the specified buffer.

Parameters:
html - html string.
starty - the already consumed height. param bufw the current drawing buffer width. param bufh the current drawing buffer height.

setBackground

public void setBackground(Color bg)
Set the background.

Specified by:
setBackground in interface Presenter

getBackground

public Color getBackground()
Get the background.


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