|
||||||||||
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
com.jgoodies.uifextras.panel.HeaderPanel
public class HeaderPanel
A panel that shows a a bold title, a description and an optional icon in front of a gradient background.
Note: The API of this class is work in progress. Likely the visibility of the protected methods will be reduced to private.
TODO: Describe the constraints for the title and description in
this class comment, e.g. pull up the JavaDoc comment from
#setDescription
.
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static com.jgoodies.forms.layout.ConstantSize |
DEFAULT_MINIMUM_HEIGHT
|
static com.jgoodies.forms.layout.ConstantSize |
DEFAULT_MINIMUM_WIDTH
|
static String |
PROPERTYNAME_DESCRIPTION
|
static String |
PROPERTYNAME_ICON
|
static String |
PROPERTYNAME_TITLE
|
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 | |
---|---|
HeaderPanel(String title,
String description)
Constructs a HeaderPanel with the given title and description that has no icon. |
|
HeaderPanel(String title,
String description,
Icon icon)
Constructs a HeaderPanel with the given title, description and icon. |
|
HeaderPanel(String title,
String description,
Icon icon,
com.jgoodies.forms.layout.ConstantSize minimumWidth,
com.jgoodies.forms.layout.ConstantSize minimumHeight)
Constructs a HeaderPanel for the given title, description, icon, and minimum width and minimum height. |
|
HeaderPanel(String title,
String description,
Icon icon,
JComponent backgroundComponent,
com.jgoodies.forms.layout.ConstantSize minimumWidth,
com.jgoodies.forms.layout.ConstantSize minimumHeight)
Constructs a HeaderPanel for the given title, description, icon, and minimum width and minimum height. |
Method Summary | |
---|---|
protected void |
build()
Builds this header panel. |
protected JComponent |
buildBottomComponent()
Builds and returns the bottom component, a separator by default. |
protected JComponent |
buildCenterComponent()
Builds and returns this header's center component. |
protected JComponent |
createDefaultBackgroundComponent()
|
protected JTextComponent |
createDescriptionArea()
Creates and returns the JTextComponent used for the description. |
protected JLabel |
createTitleLabel()
Creates and returns the JLabel used for the title. |
String |
getDescription()
Returns the description text. |
Icon |
getIcon()
Returns this header's optional icon. |
String |
getTitle()
Returns the title text that will be shown in bold. |
void |
setDescription(String newDescription)
Sets this header's description text that will be shown as plain text under the bold title. |
void |
setIcon(Icon icon)
Sets the optional icon that will be shown on the right hand side. |
void |
setTitle(String newTitle)
Sets the title text that will be shown in bold. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTYNAME_TITLE
public static final String PROPERTYNAME_DESCRIPTION
public static final String PROPERTYNAME_ICON
public static final com.jgoodies.forms.layout.ConstantSize DEFAULT_MINIMUM_WIDTH
public static final com.jgoodies.forms.layout.ConstantSize DEFAULT_MINIMUM_HEIGHT
Constructor Detail |
---|
public HeaderPanel(String title, String description)
title
- the short bold titledescription
- the plain text shown under the titlepublic HeaderPanel(String title, String description, Icon icon)
title
- the short bold titledescription
- the plain text shown under the titleicon
- the icon shown in the right-hand sidepublic HeaderPanel(String title, String description, Icon icon, com.jgoodies.forms.layout.ConstantSize minimumWidth, com.jgoodies.forms.layout.ConstantSize minimumHeight)
title
- the short bold titledescription
- the 2-line plain description shown under the titleicon
- the icon shown in the right center of the panelminimumWidth
- the lower bound for this header's widthminimumHeight
- the lower bound for this header's center heightpublic HeaderPanel(String title, String description, Icon icon, JComponent backgroundComponent, com.jgoodies.forms.layout.ConstantSize minimumWidth, com.jgoodies.forms.layout.ConstantSize minimumHeight)
title
- the short bold titledescription
- the 2-line plain description shown under the titleicon
- the icon shown in the right center of the panelminimumWidth
- the lower bound for this header's widthminimumHeight
- the lower bound for this header's center heightMethod Detail |
---|
public String getTitle()
public void setTitle(String newTitle)
newTitle
- new title shown in boldpublic String getDescription()
public void setDescription(String newDescription)
newDescription
- the text shown in plain under the titlepublic Icon getIcon()
public void setIcon(Icon icon)
icon
- the icon to be shown on the right-hand sideprotected JLabel createTitleLabel()
protected JTextComponent createDescriptionArea()
protected JComponent createDefaultBackgroundComponent()
protected void build()
protected JComponent buildCenterComponent()
protected JComponent buildBottomComponent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |