org.jdesktop.swingx.renderer
Class DefaultVisuals<T extends javax.swing.JComponent>
- java.lang.Object
-
- org.jdesktop.swingx.renderer.DefaultVisuals<T>
-
- All Implemented Interfaces:
- java.io.Serializable
public class DefaultVisuals<T extends javax.swing.JComponent> extends java.lang.Object implements java.io.SerializableEncapsulates the default visual configuration of renderering components, respecting the state of the passed-inCellContext. It's basically re-usable across all types of renderees (JTable, JList, JTree).Guarantees to completely configure the default visual properties (listed below) of a given component. As a consequence, client code (f.i. in
Highlighters) can safely change them without long-lasting visual artefacts.- foreground and background, depending on selected and focused state
- border
- font
- Painter (if applicable)
- enabled
- componentOrientation
- toolTipText
- minimum-, maximum-, preferredSize
- name
PENDING: allow mutators for overruling the
CellContexts defaults? Would prefer not to, as in the context of SwingX visual config on the renderer level is discouraged (the way to go areHighlighters.PENDING: not yet quite decided whether the toolTipText property belongs into the visual default config. Doing so gives client code the choice to set it either in a Highlighter or a custom ComponentProvider.
- See Also:
CellContext, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DefaultVisuals()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidconfigureVisuals(T renderingComponent, CellContext context)Configures all default visual state of the rendering component from the given cell context.voidsetBackground(java.awt.Color c)Sets the renderer's unselected-background color to the specified color.voidsetForeground(java.awt.Color c)Sets the renderer's unselected-foreground color to the specified color.
-
-
-
Method Detail
-
setForeground
public void setForeground(java.awt.Color c)
Sets the renderer's unselected-foreground color to the specified color. Ifnot nullthis color will overrule the default color of the CellContext.- Parameters:
c- set the foreground color to this value
-
setBackground
public void setBackground(java.awt.Color c)
Sets the renderer's unselected-background color to the specified color. Ifnot nullthis color will overrule the default color of the CellContext.- Parameters:
c- set the background color to this value
-
configureVisuals
public void configureVisuals(T renderingComponent, CellContext context)
Configures all default visual state of the rendering component from the given cell context.- Parameters:
renderingComponent- the component to configure, must not be nullcontext- the cell context to configure from, must not be null- Throws:
java.lang.NullPointerException- if either renderingComponent or cellContext is null
-
-
DataMelt 3.0 © DataMelt by jWork.ORG