Search this API

y.option
Class StrokeCellRenderer

java.lang.Object
  extended by y.option.StrokeCellRenderer
All Implemented Interfaces:
javax.swing.ListCellRenderer, javax.swing.table.TableCellRenderer

public class StrokeCellRenderer
extends java.lang.Object
implements javax.swing.ListCellRenderer, javax.swing.table.TableCellRenderer

ListCellRenderer and TableCellRenderer implementation that renders objects of type Stroke nicely. This renderer can be used to display objects of type LineType.

 
Your browser does not support SVG content.

Constructor Summary
StrokeCellRenderer()
          Creates a new StrokeCellRenderer.
 
Method Summary
 java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean hasFocus)
          Returns a component that has been configured to display the specified value.
 java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
          Returns a component that has been configured to display the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrokeCellRenderer

public StrokeCellRenderer()
Creates a new StrokeCellRenderer.

Method Detail

getListCellRendererComponent

public java.awt.Component getListCellRendererComponent(javax.swing.JList list,
                                                       java.lang.Object value,
                                                       int index,
                                                       boolean isSelected,
                                                       boolean hasFocus)
Returns a component that has been configured to display the specified value. If value is not of type Stroke, the component may display nothing at all.

Specified by:
getListCellRendererComponent in interface javax.swing.ListCellRenderer
Parameters:
list - the JList that is asking the renderer to draw
value - the value to be rendered
index - the cells index
isSelected - true if the specified cell was selected
hasFocus - true if the specified cell has the focus
Returns:
A component whose paint() method will render values of type Stroke.

getTableCellRendererComponent

public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
                                                        java.lang.Object value,
                                                        boolean isSelected,
                                                        boolean hasFocus,
                                                        int row,
                                                        int column)
Returns a component that has been configured to display the specified value. If value is not of type Stroke, the component may display nothing at all.

Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer
Parameters:
table - the JTable that is asking the renderer to draw; can be null
value - the value to be rendered
isSelected - true if the specified cell was selected
hasFocus - true if the specified cell has the focus
row - the row index of the cell being drawn
column - the column index of the cell being drawn
Returns:
A component whose paint() method will render values of type Stroke.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.