Style Intelligence v12.0

inetsoft.report.painter
Class HeaderPresenter

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

public class HeaderPresenter
extends Object
implements Presenter

The HeaderPresenter displays a header field with two to three labels. The cell rectangle is divided into two or three fields by drawing diagonal lines from top-left to bottom right.

See Also:
Serialized Form

Constructor Summary
HeaderPresenter()
          Create a default header presenter.
 
Method Summary
 Color getBackground()
          Get the background.
 String getDelimitor()
          Get the delimitor used to parse the string into headers.
 String getDisplayName()
          Get the display name of this presenter.
 Font getFont()
          Get the label font.
 Dimension getPreferredSize(Object v)
          Calculate the preferred size of the object representation.
 String[] getValues(Object val)
          Get two or three values from an array or string.
 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 the value.
 void setBackground(Color bg)
          Set the background.
 void setDelimitor(String delim)
          Set the delimitor used to parse the string into headers.
 void setFont(Font font)
          Set the label font.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderPresenter

public HeaderPresenter()
Create a default header presenter.

Method Detail

setFont

public void setFont(Font font)
Set the label font.

Specified by:
setFont in interface Presenter
Parameters:
font - label font.

getFont

public Font getFont()
Get the label font.

Returns:
font.

paint

public void paint(Graphics g,
                  Object v,
                  int x,
                  int y,
                  int w,
                  int h)
Paint the value.

Specified by:
paint in interface Presenter
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

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.

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

getValues

public String[] getValues(Object val)
Get two or three values from an array or string.


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.

getDelimitor

public String getDelimitor()
Get the delimitor used to parse the string into headers.


setDelimitor

public void setDelimitor(String delim)
Set the delimitor used to parse the string into headers.


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.