|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.dialog.BannerPanel
public class BannerPanel
BannerPanel
is a panel that can show title, subtitle and icon with title on top, subtitle on the bottom
and icon on the left. You can use ImageIcon as the icon but you can also use your own component as the icon component
by using setIconComponent(javax.swing.JComponent)
.
BannerPanel
can be placed on top of any dialog or any panel to show some help information or display a
product logo.
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 | |
---|---|
protected Paint |
_backgroundPaint
|
protected Color |
_endColor
|
protected boolean |
_isVertical
|
protected PropertyChangeListener |
_propertyListener
|
protected Color |
_startColor
|
protected String |
_subtitle
Subtitle or description of the banner panel. |
protected Color |
_subTitleColor
|
protected Font |
_subTitleFont
|
protected int |
_subTitleIndent
|
JPanel |
_textPanel
|
protected String |
_title
Title of the banner panel. |
protected Color |
_titleColor
|
protected Font |
_titleFont
|
protected ImageIcon |
_titleIcon
Icon for the banner panel. |
static String |
ICON_COMPONENT_PROPERTY
|
static String |
ICON_PROPERTY
|
static String |
PROPERTY_SUBTITLE_FONT
|
static String |
PROPERTY_TITLE_FONT
|
static String |
PROPERTY_TITLE_ICON_LOCATION
|
static String |
SUBTITLE_PROPERTY
|
static String |
TITLE_PROPERTY
|
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 | |
---|---|
BannerPanel()
Creates an empty BannerPanel. |
|
BannerPanel(String title)
Creates a BannerPanel with title and subtitle. |
|
BannerPanel(String title,
String subtitle)
Creates a BannerPanel with title and subtitle. |
|
BannerPanel(String title,
String subtitle,
ImageIcon titleIcon)
Creates a BannerPanel with title, subtitle and icon. |
|
BannerPanel(String title,
String subtitle,
JComponent iconComponent)
Creates a BannerPanel with title, subtitle and component. |
Method Summary | |
---|---|
protected JComponent |
createSubtitleLabel()
Creates the subtitle label. |
Paint |
getBackgroundPaint()
Gets the Paint used to paint the background of the BannerPanel. |
Color |
getEndColor()
|
JComponent |
getIconComponent()
Gets the icon component. |
Color |
getStartColor()
|
String |
getSubtitle()
Gets the subtitle. |
Color |
getSubTitleColor()
Gets the subtitle color. |
Font |
getSubTitleFont()
Gets the font of the subtitle. |
int |
getSubTitleIndent()
Gets the subtitle indent. |
JComponent |
getSubtitleLabel()
Gets the component for the subtitle. |
String |
getTitle()
Gets the title. |
Color |
getTitleColor()
Gets the title color. |
Font |
getTitleFont()
Gets the font of the title. |
ImageIcon |
getTitleIcon()
Gets the title icon. |
int |
getTitleIconLocation()
Gets the title icon location. |
JComponent |
getTitleLabel()
Gets the component for the title. |
boolean |
isVertical()
|
void |
lazyInitialize()
|
protected void |
paintComponent(Graphics g)
Paints the background. |
protected ImageIcon |
prepareTitleIcon(ImageIcon icon)
Prepares the title icon. |
void |
setBackground(Color bg)
|
void |
setBackgroundPaint(Paint backgroundPaint)
Sets the Paint used to paint the background of the BannerPanel. |
void |
setEndColor(Color endColor)
|
void |
setForeground(Color fg)
|
void |
setGradientPaint(Color startColor,
Color endColor,
boolean isVertical)
This method allows you to use gradient background without using setBackgroundPaint(java.awt.Paint)
method. |
void |
setIconComponent(JComponent iconComponent)
Sets the icon component. |
void |
setStartColor(Color startColor)
|
void |
setSubtitle(String subtitle)
Sets the subtitle. |
void |
setSubTitleColor(Color subTitleColor)
Sets the subtitle color. |
void |
setSubTitleFont(Font subTitleFont)
Sets the font for the subtitle. |
void |
setSubTitleIndent(int subTitleIndent)
Sets the subtitle indent. |
void |
setTitle(String title)
Sets the title. |
void |
setTitleColor(Color titleColor)
Sets the title color. |
void |
setTitleFont(Font titleFont)
Sets the font for the title. |
void |
setTitleIcon(ImageIcon titleIcon)
Sets the title icon. |
void |
setTitleIconLocation(int titleIconLocation)
Sets the title icon location. |
void |
setVertical(boolean vertical)
|
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 |
---|
protected String _title
protected String _subtitle
protected ImageIcon _titleIcon
public static final String TITLE_PROPERTY
public static final String SUBTITLE_PROPERTY
public static final String ICON_PROPERTY
public static final String ICON_COMPONENT_PROPERTY
public static final String PROPERTY_TITLE_FONT
public static final String PROPERTY_SUBTITLE_FONT
public static final String PROPERTY_TITLE_ICON_LOCATION
protected int _subTitleIndent
protected Font _titleFont
protected Color _titleColor
protected Font _subTitleFont
protected Color _subTitleColor
protected Paint _backgroundPaint
protected PropertyChangeListener _propertyListener
protected Color _startColor
protected Color _endColor
protected boolean _isVertical
public JPanel _textPanel
Constructor Detail |
---|
public BannerPanel()
public BannerPanel(String title)
title
- the title.public BannerPanel(String title, String subtitle)
title
- the title.subtitle
- the sub title.public BannerPanel(String title, String subtitle, ImageIcon titleIcon)
title
- the title.subtitle
- the sub title.titleIcon
- the icon.public BannerPanel(String title, String subtitle, JComponent iconComponent)
title
- the title.subtitle
- the sub title.iconComponent
- the icon component. It will appear where the icon is if using constructor BannerPanel(String,String,javax.swing.ImageIcon)
.Method Detail |
---|
public void lazyInitialize()
protected JComponent createSubtitleLabel()
protected ImageIcon prepareTitleIcon(ImageIcon icon)
icon
- the input icon fro setTitleIcon(icon).
public Paint getBackgroundPaint()
public void setBackgroundPaint(Paint backgroundPaint)
backgroundPaint
- the background paint.public void setGradientPaint(Color startColor, Color endColor, boolean isVertical)
setBackgroundPaint(java.awt.Paint)
method. You can use GradientPaint to do the same thing. However if you use this method, it will use fast gradient
paint defined in JideSwingUtilities to do the painting.
startColor
- start color of the gradientendColor
- end color of the gradientisVertical
- vertical or notprotected void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- the Graphicspublic String getTitle()
public void setTitle(String title)
title
- the new title.public String getSubtitle()
public void setSubtitle(String subtitle)
subtitle
- the new subtitle.public ImageIcon getTitleIcon()
public void setTitleIcon(ImageIcon titleIcon)
titleIcon
- the new titleIcon.public JComponent getIconComponent()
BannerPanel(String,String,javax.swing.ImageIcon)
, the
icon component will be a JLabel with the icon in the 3rd parameter. If you use the constructor BannerPanel(String,String,javax.swing.JComponent)
, it will return the component as in the 3rd parameter.
public void setIconComponent(JComponent iconComponent)
iconComponent
- the component that is used as the icon.public Font getSubTitleFont()
public void setSubTitleFont(Font subTitleFont)
subTitleFont
- the new font for the subtitle.public Font getTitleFont()
public void setTitleFont(Font titleFont)
titleFont
- the new font for the title.public int getSubTitleIndent()
public void setSubTitleIndent(int subTitleIndent)
subTitleIndent
- the new index.public Color getTitleColor()
public void setTitleColor(Color titleColor)
titleColor
- the text color for the title.public Color getSubTitleColor()
public void setSubTitleColor(Color subTitleColor)
subTitleColor
- the text color for the subtitle.public void setBackground(Color bg)
setBackground
in class JComponent
public void setForeground(Color fg)
setForeground
in class JComponent
public Color getStartColor()
public void setStartColor(Color startColor)
public Color getEndColor()
public void setEndColor(Color endColor)
public boolean isVertical()
public void setVertical(boolean vertical)
public int getTitleIconLocation()
public void setTitleIconLocation(int titleIconLocation)
titleIconLocation
- the title icon location.public JComponent getTitleLabel()
public JComponent getSubtitleLabel()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |