|
||||||||||
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.JPanel
org.jdesktop.swingx.JXPanel
org.jdesktop.swingx.JXHeader
public class JXHeader
JXHeader is a simple component consisting of a title, a description,
and an icon. An example of such a component can be seen on
Romain Guys ProgX website
JXHeader
is a simple component that is also sufficiently
configurable to be useable. The description area
accepts HTML conforming to version 3.2 of the HTML standard. The icon, title,
and description are all configurable. JXHeader
itself extends
JXPanel
, providing translucency and painting delegates.
If I were to reconstruct the ui shown in the above screenshot, I might
do so like this:
JXHeader header = new JXHeader();
header.setTitle("Timing Framework Spline Editor");
header.setDescription("Drag control points in the display to change the " +
"shape of the spline\n" +
"Click the Copy Code button to generate the corrosponding Java code.");
Icon icon = new ImageIcon(getClass().getResource("tools.png"));
header.setIcon(icon);
Note: The HTML support doesn't exist yet. The UI delegate needs to discover whether
the text supplied is HTML or not, and change the content type of the editor pane
being used. The problem is that if "text/html" is always used, the font is wrong.
This same situation will be found in other parts of the code (JXErrorPane, for instance),
so this needs to be dealt with.
BasicHeaderUI uses the following UI defaults:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
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 | |
---|---|
static String |
uiClassID
JXHeader pluggable UI key HeaderUI |
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 | |
---|---|
JXHeader()
Creates a new instance of JXHeader |
|
JXHeader(String title,
String description)
Creates a new instance of JXHeader. |
|
JXHeader(String title,
String description,
Icon icon)
Creates a new instance of JXHeader. |
Method Summary | |
---|---|
String |
getDescription()
Gets the description. |
Font |
getDescriptionFont()
Gets description font. |
Icon |
getIcon()
Gets the icon. |
String |
getTitle()
Gets the title. |
Font |
getTitleFont()
Gets title font. |
HeaderUI |
getUI()
Returns the look and feel (L&F) object that renders this component. |
String |
getUIClassID()
Returns the name of the L&F class that renders this component. |
void |
setDescription(String description)
Sets the description for this header. |
void |
setFont(Font font)
Sets the font for this component. |
void |
setIcon(Icon icon)
Sets the icon to use for the header. |
void |
setTitle(String title)
Sets the title to use. |
void |
setUI(HeaderUI ui)
Sets the look and feel (L&F) object that renders this component. |
void |
updateUI()
Notification from the UIManager that the L&F has changed. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, paramString, setUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String uiClassID
Constructor Detail |
---|
public JXHeader()
public JXHeader(String title, String description)
title
- specifies the title property for this JXHeaderdescription
- specifies the description property for this JXHeaderpublic JXHeader(String title, String description, Icon icon)
title
- specifies the title property for this JXHeaderdescription
- specifies the description property for this JXHeadericon
- specifies the icon property for this JXHeaderMethod Detail |
---|
public HeaderUI getUI()
javax.swing.JPanel
getUI
in class JPanel
public void setUI(HeaderUI ui)
ui
- the HeaderUI L&F objectUIDefaults.getUI(javax.swing.JComponent)
public String getUIClassID()
getUIClassID
in class JPanel
uiClassID
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
public void updateUI()
UIManager
that the L&F has changed.
Replaces the current UI object with the latest version from the
UIManager
.
updateUI
in class JPanel
JComponent.updateUI()
public void setTitle(String title)
title
- the Title. May be null.public String getTitle()
public void setDescription(String description)
description
- the description. May be null, may be HTML or plain text.public String getDescription()
public void setIcon(Icon icon)
icon
- may be nullpublic Icon getIcon()
public void setFont(Font font)
javax.swing.JComponent
setFont
in class JComponent
font
- the desired Font
for this componentComponent.getFont()
public Font getTitleFont()
public Font getDescriptionFont()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |