Style Intelligence v12.0

inetsoft.report
Interface Presenter

All Superinterfaces:
Serializable
All Known Implementing Classes:
Abstract2DCodePresenter, AbstractBarcodePresenter, Bar2Presenter, Barcode2of7Presenter, Barcode3of9Presenter, BarcodeCodabarPresenter, BarcodeCode128APresenter, BarcodeCode128BPresenter, BarcodeCode128CPresenter, BarcodeCode128Presenter, BarcodeCode39Presenter, BarcodeEAN128Presenter, BarcodeGTINPresenter, BarcodeMonarchPresenter, BarcodeNW7Presenter, BarcodePDF417Presenter, BarcodeSCC14Presenter, BarcodeSINPresenter, BarcodeSSCC18Presenter, BarcodeUCC128Presenter, BarcodeUSD3Presenter, BarcodeUSD4Presenter, BarcodeUSPSPresenter, BarPresenter, BooleanPresenter, BulletGraphPresenter, ButtonPresenter, CCWRotatePresenter, CWRotatePresenter, HeaderPresenter, HTMLPresenter, IconCounterPresenter, LegendPresenter, QRCodePresenter, RulerPresenter, ShadowPresenter, TrafficLightPresenter

public interface Presenter
extends Serializable

Presenter interface defines the API for rendering an object into a graphical presentation. The two main function of a presenter is to calculate the size requirement of an object, and draw a graphical representation of the object. A Presenter can be registered for a class of objects, by calling the ReportSheet.addPresenter() function. Or a Presenter can be register with a column in a table, by calling the setPresenter() method on a table lens (table lens derived from AttributeTableLens).

If a presenter is found for an object, the presenter is used in rendering the object during printing.


Method Summary
 String getDisplayName()
          Get the display name of this presenter.
 Dimension getPreferredSize(Object v)
          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 v, int x, int y, int w, int h)
          Paint an object at the specified location.
 void setBackground(Color bg)
          Set the background to use for this presenter.
 void setFont(Font font)
          Set the font to use for this presenter.
 

Method Detail

paint

void paint(Graphics g,
           Object v,
           int x,
           int y,
           int w,
           int h)
Paint an object at the specified location.

Parameters:
g - graphical context.
v - 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.

getPreferredSize

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

Parameters:
v - object value.
Returns:
preferred size.

isPresenterOf

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

Parameters:
type - object type.
Returns:
true if the presenter can handle this type.

isPresenterOf

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());
 

Parameters:
obj - object type.
Returns:
true if the presenter can handle this type.

isFill

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


setFont

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.


setBackground

void setBackground(Color bg)
Set the background to use for this presenter. A table calls this function before the cell is printed when a presenter is used.


getDisplayName

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

Returns:
a user-friendly name for this presenter.
Since:
5.1

isRawDataRequired

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

Returns:
true if the presenter requires raw data.

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