Style Intelligence v12.0

inetsoft.report.painter
Class ComponentPainter

java.lang.Object
  extended by inetsoft.report.painter.ComponentPainter
All Implemented Interfaces:
Painter, Serializable

public class ComponentPainter
extends Object
implements Painter

The ComponentPainter wraps around an AWT Component and provides a Painter object that is suitable to be used in the ReportSheet. By default, the painter calls Component.paintAll() for lightweight component to print itself, and calls Component.printAll() for heavyweight component to print itself. However, whether these methods work is dependent on the implementation of the components. If the default method does not work for a component, applications can choose a different printing method by supplying a printing method option. The option specifies always using printAll(), paintAll(), print(), or paint() to paint a component.

See Also:
Serialized Form

Field Summary
static int DEFAULT
          Use default printing method.
static int PAINT
          Use Component.paint() to print component.
static int PAINTALL
          Use Component.paintAll() to print component.
static int PRINT
          Use Component.print() to print component.
static int PRINTALL
          Use Component.printAll() to print component.
static int UPDATE
          Use Component.paint() to print component.
 
Constructor Summary
ComponentPainter(Component comp)
          Create a painter from a component.
ComponentPainter(Component comp, int opt)
          Create a painter from a component.
 
Method Summary
 Color getBackground()
          Get the background.
 Component getComponent()
          Get the component instance.
 Dimension getPreferredSize()
          Return the preferred size of this painter.
 boolean isScalable()
          The component can be scaled.
 void paint(Graphics g, int x, int y, int w, int h)
          Paint contents at the specified location.
 void setBackground(Color bg)
          Set the background.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final int DEFAULT
Use default printing method.

See Also:
Constant Field Values

PRINTALL

public static final int PRINTALL
Use Component.printAll() to print component.

See Also:
Constant Field Values

PAINTALL

public static final int PAINTALL
Use Component.paintAll() to print component.

See Also:
Constant Field Values

PRINT

public static final int PRINT
Use Component.print() to print component.

See Also:
Constant Field Values

PAINT

public static final int PAINT
Use Component.paint() to print component.

See Also:
Constant Field Values

UPDATE

public static final int UPDATE
Use Component.paint() to print component.

See Also:
Constant Field Values
Constructor Detail

ComponentPainter

public ComponentPainter(Component comp)
Create a painter from a component.

Parameters:
comp - component to paint.

ComponentPainter

public ComponentPainter(Component comp,
                        int opt)
Create a painter from a component.

Parameters:
comp - component to paint.
opt - printing method.
Method Detail

getPreferredSize

public Dimension getPreferredSize()
Return the preferred size of this painter.

Specified by:
getPreferredSize in interface Painter
Returns:
size.

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.

isScalable

public boolean isScalable()
The component can be scaled.

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

getComponent

public Component getComponent()
Get the component instance.

Returns:
component.

setBackground

public void setBackground(Color bg)
Set the background.


getBackground

public Color getBackground()
Get the background.


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