|
||||||||||
| 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.text.JTextComponent
javax.swing.JTextArea
org.tentackle.ui.FormTextArea
org.tentackle.ui.FormTextAreaTableCellRenderer
public class FormTextAreaTableCellRenderer
A multi line text area table cell renderer.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTextArea |
|---|
JTextArea.AccessibleJTextArea |
| Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
|---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding |
| 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.text.JTextComponent |
|---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
FormTextAreaTableCellRenderer()
Creates a text area table cell renderer. |
|
| Method Summary | |
|---|---|
Color |
getFocusedBackground()
Gets the color for the focused background. |
Color |
getFocusedForeground()
Gets the color for the focused foreground. |
Font |
getRenderingFont()
Gets the rendering default font. |
Color |
getSelectedBackground()
Gets the color for the selected background. |
Color |
getSelectedForeground()
Gets the color for the selected foreground. |
Component |
getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Returns the component used for drawing the cell. |
Color |
getUnselectedBackground()
Gets the color for the unselected background. |
Color |
getUnselectedForeground()
Gets the color for the unselected foreground. |
boolean |
isAutoRowHeight()
Returns whether automatic adjustment of the row height is enabled. |
void |
repaint(long tm,
int x,
int y,
int width,
int height)
Overridden for performance reasons. |
void |
repaint(Rectangle r)
Overridden for performance reasons. |
void |
revalidate()
Overridden for performance reasons. |
void |
setAutoRowHeight(boolean autoRowHeight)
Enables or disables automatic adjustment of the row height. |
void |
setBackground(Color c)
Sets the background color of this component. |
void |
setFocusedBackground(Color c)
Sets the color for the focused background. |
void |
setFocusedForeground(Color c)
Sets the color for the focused foreground. |
void |
setForeground(Color c)
Sets the foreground color of this component. |
void |
setRenderingFont(Font font)
Sets the rendering default font. |
void |
setSelectedBackground(Color c)
Sets the color for the selected background. |
void |
setSelectedForeground(Color c)
Sets the color for the selected foreground. |
void |
setUnselectedBackground(Color c)
Sets the color for the unselected background. |
void |
setUnselectedForeground(Color c)
Sets the color for the unselected foreground. |
void |
updateUI()
Reloads the pluggable UI. |
void |
validate()
Overridden for performance reasons. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.tentackle.ui.FormFieldComponent |
|---|
getBaseline, getCaretPosition, getColumns, getText, setCaretPosition, setColumns, setToolTipText |
| Methods inherited from interface org.tentackle.ui.FormComponent |
|---|
hasFocus |
| Constructor Detail |
|---|
public FormTextAreaTableCellRenderer()
| Method Detail |
|---|
public void setSelectedForeground(Color c)
c - the foreground colorpublic Color getSelectedForeground()
public void setSelectedBackground(Color c)
c - the background colorpublic Color getSelectedBackground()
public void setUnselectedForeground(Color c)
c - the unselected foreground colorpublic Color getUnselectedForeground()
public void setUnselectedBackground(Color c)
c - the unselected background colorpublic Color getUnselectedBackground()
public void setFocusedForeground(Color c)
c - the focused foreground colorpublic Color getFocusedForeground()
public void setFocusedBackground(Color c)
c - the focused background colorpublic Color getFocusedBackground()
public void setRenderingFont(Font font)
font - the fontpublic Font getRenderingFont()
public void setAutoRowHeight(boolean autoRowHeight)
autoRowHeight - true if enabledpublic boolean isAutoRowHeight()
public void setForeground(Color c)
Overridden to assign the unselected-foreground color to the specified color.
setForeground in class JComponentc - the desired foreground ColorComponent.getForeground()public void setBackground(Color c)
JComponent or
ComponentUI implementations. Direct subclasses of
JComponent must override
paintComponent to honor this property.
It is up to the look and feel to honor this property, some may choose to ignore it.
Overridden to assign the unselected-background color to the specified color.
setBackground in class JComponentc - the desired background ColorComponent.getBackground(),
JComponent.setOpaque(boolean)public void updateUI()
getUIClassID(). The type of
the UI is TextUI. invalidate
is called after setting the UI.
Overridden to clear the background anf foreground colors.
updateUI in class JTextComponentJComponent.setUI(javax.swing.plaf.ComponentUI),
UIManager.getLookAndFeel(),
UIManager.getUI(javax.swing.JComponent)
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
javax.swing.table.TableCellRenderer
The TableCellRenderer is also responsible for rendering the
the cell representing the table's current DnD drop location if
it has one. If this renderer cares about rendering
the DnD drop location, it should query the table directly to
see if the given row and column represent the drop location:
JTable.DropLocation dropLocation = table.getDropLocation();
if (dropLocation != null
&& !dropLocation.isInsertRow()
&& !dropLocation.isInsertColumn()
&& dropLocation.getRow() == row
&& dropLocation.getColumn() == column) {
// this cell represents the current drop location
// so render it specially, perhaps with a different color
}
During a printing operation, this method will be called with
isSelected and hasFocus values of
false to prevent selection and focus from appearing
in the printed output. To do other customization based on whether
or not the table is being printed, check the return value from
JComponent.isPaintingForPrint().
getTableCellRendererComponent in interface TableCellRenderertable - the JTable that is asking the
renderer to draw; can be nullvalue - the value of the cell to be rendered. It is
up to the specific renderer to interpret
and draw the value. For example, if
value
is the string "true", it could be rendered as a
string or it could be rendered as a check
box that is checked. null is a
valid valueisSelected - true if the cell is to be rendered with the
selection highlighted; otherwise falsehasFocus - if true, render cell appropriately. For
example, put a special border on the cell, if
the cell can be edited, render in the color used
to indicate editingrow - the row index of the cell being drawn. When
drawing the header, the value of
row is -1column - the column index of the cell being drawnJComponent.isPaintingForPrint()public void validate()
validate in class ContainerContainer.add(java.awt.Component),
Component.invalidate(),
JComponent.revalidate(),
Container.validateTree()public void revalidate()
revalidate in class JComponentComponent.invalidate(),
Container.validate(),
JComponent.isValidateRoot(),
RepaintManager.addInvalidComponent(javax.swing.JComponent)
public void repaint(long tm,
int x,
int y,
int width,
int height)
repaint in class JComponenttm - this parameter is not usedx - the x value of the dirty regiony - the y value of the dirty regionwidth - the width of the dirty regionheight - the height of the dirty regionComponent.isShowing(),
RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int)public void repaint(Rectangle r)
repaint in class JComponentr - a Rectangle containing the dirty regionComponent.isShowing(),
RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||