org.jfree.ui

Class PaintSample

public class PaintSample extends JComponent

A panel that displays a paint sample.

Author: David Gilbert

Constructor Summary
PaintSample(Paint paint)
Standard constructor - builds a paint sample.
Method Summary
PaintgetPaint()
Returns the current Paint object being displayed in the panel.
DimensiongetPreferredSize()
Returns the preferred size of the component.
voidpaintComponent(Graphics g)
Fills the component with the current Paint.
voidsetPaint(Paint paint)
Sets the Paint object being displayed in the panel.

Constructor Detail

PaintSample

public PaintSample(Paint paint)
Standard constructor - builds a paint sample.

Parameters: paint the paint to display.

Method Detail

getPaint

public Paint getPaint()
Returns the current Paint object being displayed in the panel.

Returns: the paint.

getPreferredSize

public Dimension getPreferredSize()
Returns the preferred size of the component.

Returns: the preferred size.

paintComponent

public void paintComponent(Graphics g)
Fills the component with the current Paint.

Parameters: g the graphics device.

setPaint

public void setPaint(Paint paint)
Sets the Paint object being displayed in the panel.

Parameters: paint the paint.