Style Intelligence v12.0

inetsoft.report.painter
Class BulletGraphPresenter

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

public class BulletGraphPresenter
extends Object
implements Presenter

This presenter is an implementation of bullet graph. It is similar to a gauge but has a simpler look-and-feel and smaller foot print.

See Also:
Serialized Form

Constructor Summary
BulletGraphPresenter()
           
 
Method Summary
 boolean equals(Object obj)
          Check if equals another object.
 Color getBackground()
          Get the background.
 Color getBarColor()
          Get the bar color.
 Color getColor1()
          Get the range 1 color.
 Color getColor2()
          Get the range 2 color.
 Color getColor3()
          Get the range 3 color.
 Color getColor4()
          Get the range 4 color.
 String getDisplayName()
          Get the display name of this presenter.
 double getMaximum()
          Get the maximum value.
 double getMinimum()
          Get the minimum value.
 Dimension getPreferredSize(Object v)
          Calculate the preferred size of the object representation.
 double getRange1()
          Get the range 1 value.
 double getRange2()
          Get the range 2 value.
 double getRange3()
          Get the range 3 value.
 double getTarget()
          Get the target value.
 int hashCode()
          Get the presenter's hash code.
 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.
 void setBarColor(Color color)
          Set the bar color.
 void setColor1(Color color1)
          Set the range 1 color.
 void setColor2(Color color2)
          Set the range 2 color.
 void setColor3(Color color3)
          Set the range 3 color.
 void setColor4(Color color4)
          Set the range 4 color.
 boolean setFill(boolean fill)
          Set the property to fill the entire area of the cell.
 void setFont(Font font)
          Set the font to use for this presenter.
 void setMaximum(double max)
          Set the maximum value.
 void setMinimum(double min)
          Set the minimum value.
 void setPreferredSize(Dimension psize)
          Change the preferred size of the presenter.
 void setRange1(double range1)
          Set the range 1 value.
 void setRange2(double range2)
          Set the range 2 value.
 void setRange3(double range3)
          Set the range 3 value.
 void setTarget(double target)
          Set the target value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BulletGraphPresenter

public BulletGraphPresenter()
Method Detail

getMaximum

public double getMaximum()
Get the maximum value.


setMaximum

public void setMaximum(double max)
Set the maximum value.


getMinimum

public double getMinimum()
Get the minimum value.


setMinimum

public void setMinimum(double min)
Set the minimum value.


getTarget

public double getTarget()
Get the target value.


setTarget

public void setTarget(double target)
Set the target value.


getRange1

public double getRange1()
Get the range 1 value.


setRange1

public void setRange1(double range1)
Set the range 1 value. This defines the 1st range to be from minimum to range1.


getRange2

public double getRange2()
Get the range 2 value.


setRange2

public void setRange2(double range2)
Set the range 2 value. This defines the 2nd range to be from minimum to range2.


getRange3

public double getRange3()
Get the range 3 value.


setRange3

public void setRange3(double range3)
Set the range 3 value. This defines the 3rd range to be from minimum to range3.


getColor1

public Color getColor1()
Get the range 1 color.


setColor1

public void setColor1(Color color1)
Set the range 1 color.


getColor2

public Color getColor2()
Get the range 2 color.


setColor2

public void setColor2(Color color2)
Set the range 2 color.


getColor3

public Color getColor3()
Get the range 3 color.


setColor3

public void setColor3(Color color3)
Set the range 3 color.


getColor4

public Color getColor4()
Get the range 4 color.


setColor4

public void setColor4(Color color4)
Set the range 4 color.


getBarColor

public Color getBarColor()
Get the bar color.


setBarColor

public void setBarColor(Color color)
Set the bar color.


paint

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

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.

setPreferredSize

public void setPreferredSize(Dimension psize)
Change the preferred size of the presenter.


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

setFill

public boolean setFill(boolean fill)
Set the property to fill the entire area of the cell.

Parameters:
fill - true to fill the cell area.

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.

equals

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

Overrides:
equals in class Object
Parameters:
obj - the specified object
Returns:
true if equals, false otherwise

hashCode

public int hashCode()
Get the presenter's hash code.

Overrides:
hashCode in class Object
Returns:
hash code

isRawDataRequired

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

Specified by:
isRawDataRequired in interface Presenter
Returns:
true.

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.