|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
javax.swing.table.DefaultTableCellRenderer
com.citra.renderers.DefaultRenderer
com.citra.renderers.BooleanRenderer
public class BooleanRenderer
BooleanRenderer is a TableCellRenderer suitable for rendering Boolean objects.
BooleanRenderer uses an internal JCheckBox object to render the Boolean objects.
By default, the checkbox is aligned to the center of the cell.
The appearance of the cell can be controlled by modifying the properties of the internal
JCheckBox, an instance of which can be acquired with getCheckBox
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
DefaultTableCellRenderer.UIResource |
Nested classes/interfaces inherited from class javax.swing.JLabel |
---|
JLabel.AccessibleJLabel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected JCheckBox |
checkBox
The checkbox instance |
Fields inherited from class com.citra.renderers.DefaultRenderer |
---|
evenColor, oddColor, space, spacing |
Fields inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
noFocusBorder |
Fields inherited from class javax.swing.JLabel |
---|
labelFor |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
BooleanRenderer()
Constructs a BooleanRenderer. |
|
BooleanRenderer(JCheckBox checkBox)
Constructs a BooleanRenderer having checkBox as the
internal JCheckBox object that renders the cell. |
Method Summary | |
---|---|
JCheckBox |
getCheckBox()
Returns the internal JCheckBox object used to render the Boolean values. |
Component |
getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Overriden in order to return the internal JCheckBox instance after configuring it appropriately. |
void |
setCheckBox(JCheckBox checkBox)
Assigns a new JCheckBox object. |
void |
updateUI()
Overriden in order to update the JCheckBox's UI. |
Methods inherited from class com.citra.renderers.DefaultRenderer |
---|
getEvenColor, getOddColor, getSpacing, setEvenColor, setOddColor, setSpaces, setSpacing, setText |
Methods inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
firePropertyChange, firePropertyChange, isOpaque, repaint, repaint, revalidate, setBackground, setForeground, setValue, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected JCheckBox checkBox
Constructor Detail |
---|
public BooleanRenderer()
public BooleanRenderer(JCheckBox checkBox)
checkBox
as the
internal JCheckBox object that renders the cell.
The internal JCheckBox is initialized to be opaque and not focus painted.
Method Detail |
---|
public JCheckBox getCheckBox()
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
Returns the component used for drawing the cell. This method is used to configure the renderer appropriately before drawing.
getTableCellRendererComponent
in interface TableCellRenderer
getTableCellRendererComponent
in class DefaultRenderer
table
- the JTable
value
- the value to assign to the cell at
[row, column]
isSelected
- true if cell is selectedhasFocus
- true if cell has focusrow
- the row of the cell to rendercolumn
- the column of the cell to render
public void setCheckBox(JCheckBox checkBox)
checkBox
- the JCheckBox object to assignpublic void updateUI()
Notification from the UIManager
that the look and feel
[L&F] has changed.
Replaces the current UI object with the latest version from the
UIManager
.
updateUI
in class DefaultTableCellRenderer
JComponent.updateUI()
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |