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

Paint
getPaint()
Returns the current Paint object being displayed in the panel.
Dimension
getPreferredSize()
Returns the preferred size of the component.
void
paintComponent(Graphics g)
Fills the component with the current Paint.
void
setPaint(Paint paint)
Sets the Paint object being displayed in the panel.

Constructor Details

PaintSample

public PaintSample(Paint paint)
Standard constructor - builds a paint sample.
Parameters:
paint - the paint to display.

Method Details

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.