Search this API

y.option
Class BridgeCalculatorCellRenderer

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

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

ListCellRenderer and TableCellRenderer implementation that renders objects of type BridgeCalculator nicely.

 

Field Summary
static byte STYLE_ALL
          A rendering style that shows all aspects of a BridgeCalculator.
static byte STYLE_CROSSING_MODE
          A rendering style that shows the crossing mode aspects of a BridgeCalculator.
static byte STYLE_CROSSING_STYLE
          A rendering style that shows the crossing style aspects of a BridgeCalculator.
static byte STYLE_CROSSING_STYLE_DOUBLE
          A rendering style that shows the BridgeCalculator.getCrossingStyle() aspects of a BridgeCalculator using two parallel lines highlighting the difference between the SCALED and non-scaled variants of the styles.
 
Constructor Summary
BridgeCalculatorCellRenderer()
          Creates a default BridgeCalculatorCellRenderer with style STYLE_ALL
BridgeCalculatorCellRenderer(byte style)
          Creates a new BridgeCalculatorCellRenderer.
 
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.
 byte getStyle()
          Returns the style of the renderer.
 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.
 void setStyle(byte style)
          Sets the style for the renderer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_ALL

public static final byte STYLE_ALL
A rendering style that shows all aspects of a BridgeCalculator.

See Also:
Constant Field Values

STYLE_CROSSING_STYLE

public static final byte STYLE_CROSSING_STYLE
A rendering style that shows the crossing style aspects of a BridgeCalculator.

See Also:
Constant Field Values

STYLE_CROSSING_MODE

public static final byte STYLE_CROSSING_MODE
A rendering style that shows the crossing mode aspects of a BridgeCalculator.

See Also:
Constant Field Values

STYLE_CROSSING_STYLE_DOUBLE

public static final byte STYLE_CROSSING_STYLE_DOUBLE
A rendering style that shows the BridgeCalculator.getCrossingStyle() aspects of a BridgeCalculator using two parallel lines highlighting the difference between the SCALED and non-scaled variants of the styles.

See Also:
Constant Field Values
Constructor Detail

BridgeCalculatorCellRenderer

public BridgeCalculatorCellRenderer()
Creates a default BridgeCalculatorCellRenderer with style STYLE_ALL


BridgeCalculatorCellRenderer

public BridgeCalculatorCellRenderer(byte style)
Creates a new BridgeCalculatorCellRenderer.

Method Detail

getStyle

public byte getStyle()
Returns the style of the renderer. The default is STYLE_ALL.

Returns:
one of STYLE_ALL, STYLE_CROSSING_MODE, STYLE_CROSSING_STYLE, or STYLE_CROSSING_STYLE_DOUBLE

setStyle

public void setStyle(byte style)
Sets the style for the renderer.

Parameters:
style - one of STYLE_ALL, STYLE_CROSSING_MODE, STYLE_CROSSING_STYLE, or STYLE_CROSSING_STYLE_DOUBLE

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 BridgeCalculator, 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 Arrow.

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 BridgeCalculator, 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 Arrow.

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