Style Intelligence v12.0

inetsoft.report.painter
Class PresenterPainter

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

public class PresenterPainter
extends Object
implements inetsoft.report.internal.ExpandablePainter, Cloneable

The PersenterPainter combines a Presenter object with an object the presenter presents into a self-contained painter object.

See Also:
Serialized Form

Constructor Summary
PresenterPainter(Object v, Presenter p)
          Create a painter from a presenter and a value it presents.
PresenterPainter(Presenter p)
          Create a painter from a presenter and a value it presents.
 
Method Summary
 Object clone()
          Clone the painter.
 boolean equals(Object obj)
          Check if equals another object
 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.
 Object getObject()
          Get the object to render in this painter.
 Dimension getPreferredSize()
          Return the preferred size of this painter.
 Dimension getPreferredSize(float width)
          Calculate the preferred size of the object representation.
 Presenter getPresenter()
          Get the presenter used in this painter.
 int hashCode()
          Get hash code of the presenter painter.
 boolean isExpandable()
          Check if this painter is expandable.
 boolean isPresenterOf(Class type)
          Check if the presenter can handle this type of objects.
 boolean isScalable()
          Presenter can be scaled.
 boolean isScaleImage()
          Presenter can be scaled when write image on the portal side.
 void paint(Graphics g, int x, int y, int w, int h)
          Paint contents at the specified location.
 void paint(Graphics g, int x, int y, int w, int h, float bufy, float bufh)
          Paint contents at the specified location.
 void setObject(Object v)
          Set the object to render in this painter.
 String toString()
          This is necessary if the presenter is used in the header row so the original value would be returned as a string.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PresenterPainter

public PresenterPainter(Presenter p)
Create a painter from a presenter and a value it presents.

Parameters:
p - presenter defaults how the value is painted.

PresenterPainter

public PresenterPainter(Object v,
                        Presenter p)
Create a painter from a presenter and a value it presents.

Parameters:
v - value to paint.
p - presenter defaults how the value is painted.
Method Detail

getPresenter

public Presenter getPresenter()
Get the presenter used in this painter.


setObject

public void setObject(Object v)
Set the object to render in this painter.


getObject

public Object getObject()
Get the object to render in this painter.


isPresenterOf

public 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.

paint

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

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

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.

isScalable

public boolean isScalable()
Presenter can be scaled.

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

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

clone

public Object clone()
Clone the painter.

Overrides:
clone in class Object

toString

public String toString()
This is necessary if the presenter is used in the header row so the original value would be returned as a string.

Overrides:
toString in class Object

hashCode

public int hashCode()
Get hash code of the presenter painter.

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Check if equals another object

Overrides:
equals in class Object

isScaleImage

public boolean isScaleImage()
Presenter can be scaled when write image on the portal side.


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