public class RichTooltip
extends java.lang.Object
In its most basic form, the rich tooltip has a title and one (possible multiline) description text:
+--------------------------------+ | Title | | Some description text | +--------------------------------+
The addDescriptionSection(String) can be used to add multiple
sections to the description:
+--------------------------------+ | Title | | First multiline | | description section | | | | Second multiline | | description section | | | | Third multiline | | description section | +--------------------------------+
The setMainImage(Image) can be used to place an image below the
title and to the left of the description sections:
+--------------------------------+ | Title | | ******* First multiline | | *image* description section | | ******* | | Second multiline | | description section | +--------------------------------+
The addFooterSection(String) can be used to add (possibly) multiple
footer sections that will be shown below a horizontal separator:
+--------------------------------+ | Title | | First multiline | | description section | | | | Second multiline | | description section | |--------------------------------| | A multiline footer section | | placed below a separator | +--------------------------------+
The setFooterImage(Image) can be used to place an image to the left
of the footer sections:
+--------------------------------+ | Title | | First multiline | | description section | | | | Second multiline | | description section | |--------------------------------| | ******* A multiline | | *image* footer section | | ******* | +--------------------------------+
Here is a fully fledged rich tooltip that shows all these APIs in action:
+--------------------------------+ | Title | | ******* First multiline | | *image* description section | | ******* | | Second multiline | | description section | |--------------------------------| | ******* First multiline | | *image* footer section | | ******* | | Second multiline | | footer section | +--------------------------------+
| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.List<java.lang.String> |
descriptionSections |
The description sections of this tooltip.
|
protected java.awt.Image |
footerImage |
The footer image of this tooltip.
|
protected java.util.List<java.lang.String> |
footerSections |
The footer sections of this tooltip.
|
protected java.awt.Image |
mainImage |
The main image of this tooltip.
|
protected java.lang.String |
title |
The main title of this tooltip.
|
| Constructor | Description |
|---|---|
RichTooltip() |
Creates an empty tooltip.
|
RichTooltip(java.lang.String title,
java.lang.String descriptionSection) |
Creates a tooltip with the specified title and description section.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addDescriptionSection(java.lang.String section) |
Adds the specified description section to this tooltip.
|
void |
addFooterSection(java.lang.String section) |
Adds the specified footer section to this tooltip.
|
java.util.List<java.lang.String> |
getDescriptionSections() |
Returns an unmodifiable list of description sections of this tooltip.
|
java.awt.Image |
getFooterImage() |
Returns the footer image of this tooltip.
|
java.util.List<java.lang.String> |
getFooterSections() |
Returns an unmodifiable list of footer sections of this tooltip.
|
java.awt.Image |
getMainImage() |
Returns the main image of this tooltip.
|
java.lang.String |
getTitle() |
Returns the main title of this tooltip.
|
void |
setFooterImage(java.awt.Image image) |
Sets the footer image for this tooltip.
|
void |
setMainImage(java.awt.Image image) |
Sets the main image for this tooltip.
|
void |
setTitle(java.lang.String title) |
Sets the title for this tooltip.
|
protected java.lang.String title
RichTooltip(String, String),
setTitle(String),
getTitle()protected java.awt.Image mainImage
null.getMainImage(),
setMainImage(Image)protected java.util.List<java.lang.String> descriptionSections
protected java.awt.Image footerImage
null.getFooterImage(),
setFooterImage(Image)protected java.util.List<java.lang.String> footerSections
addFooterSection(String),
getFooterSections()public RichTooltip()
public RichTooltip(java.lang.String title,
java.lang.String descriptionSection)
title - Tooltip title.descriptionSection - Tooltip main description section.public void setTitle(java.lang.String title)
title - The new tooltip title.public void setMainImage(java.awt.Image image)
image - The main image for this tooltip.getMainImage(),
addDescriptionSection(String)public void addDescriptionSection(java.lang.String section)
section - The description section to add.getDescriptionSections(),
setMainImage(Image),
setTitle(String)public void setFooterImage(java.awt.Image image)
image - The footer image for this tooltip.getFooterImage(),
addFooterSection(String)public void addFooterSection(java.lang.String section)
section - The footer section to add.getFooterSections(),
setFooterImage(Image)public java.lang.String getTitle()
RichTooltip(String, String),
setTitle(String)public java.awt.Image getMainImage()
null.setMainImage(Image),
getDescriptionSections()public java.util.List<java.lang.String> getDescriptionSections()
null list.RichTooltip(String, String),
addDescriptionSection(String),
getTitle(),
getMainImage()public java.awt.Image getFooterImage()
null.setFooterImage(Image),
getFooterSections()public java.util.List<java.lang.String> getFooterSections()
null list.addFooterSection(String),
getFooterImage()