org.jfree.ui
Class StrokeSample
JComponent
org.jfree.ui.StrokeSample
- ListCellRenderer
extends JComponent
implements ListCellRenderer
A panel that displays a stroke sample.
StrokeSample(Stroke stroke) - Creates a StrokeSample for the specified stroke.
|
Component | getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) - Returns a list cell renderer for the stroke, so the sample can be displayed in a list or
combo.
|
Dimension | getPreferredSize() - Returns the preferred size of the component.
|
Stroke | getStroke() - Returns the current Stroke object being displayed.
|
void | paintComponent(Graphics g) - Draws a line using the sample stroke.
|
void | setStroke(Stroke stroke) - Sets the Stroke object being displayed.
|
StrokeSample
public StrokeSample(Stroke stroke)
Creates a StrokeSample for the specified stroke.
stroke
- the sample stroke.
getListCellRendererComponent
public Component getListCellRendererComponent(JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
Returns a list cell renderer for the stroke, so the sample can be displayed in a list or
combo.
list
- the list.value
- the value.index
- the index.isSelected
- selected?cellHasFocus
- focussed?
- the component for rendering.
getPreferredSize
public Dimension getPreferredSize()
Returns the preferred size of the component.
- the preferred size of the component.
getStroke
public Stroke getStroke()
Returns the current Stroke object being displayed.
paintComponent
public void paintComponent(Graphics g)
Draws a line using the sample stroke.
setStroke
public void setStroke(Stroke stroke)
Sets the Stroke object being displayed.