|
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.JToolTip com.jidesoft.tooltip.BalloonTip
public class BalloonTip
BalloonTip is a special tooltip that has a balloon shape. See below.
You can put any component inside a BalloonTip. It can be done either through the constructor or use setContent method. Then all you need to do is to call show(owner, x, y) to display it. Please note the x and y position is relative to the owner.Different balloon shape
BalloonTip supports different balloon shapes. By default we support several shapes such as rounded rectangle balloon, rectangle balloon, rounded rectangle, rectangle and oval. You can use setBalloonShape method to change it. See below.
You can also define your own shapes by implementing BalloonShape interface or extending one of our existing shapes with overridden methods.
Shadow Style
BalloonTip also support two different kinds of shadows perspective shadow and drop shadow. It can be changed using setShadowStyle. Same as BalloonShape, ShadowStyle is also an interface. You can use one of the existing ShadowStyle we created or you can create your own style. For our default shadow styles, you can adjust various settings.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JToolTip |
---|
JToolTip.AccessibleJToolTip |
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 |
---|
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 | |
---|---|
BalloonTip()
BalloonTip's empty arguments constructor, for java bean specification compatibility. |
|
BalloonTip(Component content)
BalloonTip constructor |
Method Summary | |
---|---|
protected JidePopup |
createPopup()
Creates the JidePopup that is used to show the BalloonTip. |
protected void |
customizePopup(JidePopup popup)
|
Dimension |
getBalloonPreferredSize()
Gets the preferred balloon size. |
BalloonShape |
getBalloonShape()
Get the BalloonTip model. |
Dimension |
getBalloonSize()
Gets the current balloon size. |
Component |
getContent()
Gets the content component. |
Dimension |
getContentSize()
Gets the current content size. |
Point |
getHotSpot()
Gets the position of the arrow vertex. |
ShadowSettings |
getShadowSettings()
Gets the shadow composite. |
Dimension |
getShadowSize()
Gets the current shadow size. |
ShadowStyle |
getShadowStyle()
Gets the shadow style. |
void |
hide()
Hide the BalloonTip if it is visible. |
boolean |
isVisible()
For BalloonTip visibility status query. |
void |
packPopup()
Packs the balloon popup. |
void |
paintBalloonBackground(Graphics2D g2d,
Shape shape)
Paints the balloon background. |
void |
paintBalloonForeground(Graphics2D g2d,
Shape shape)
Paints the balloon foreground. |
void |
setBalloonShape(BalloonShape shape)
Set a different BalloonShape for BalloonTip |
void |
setContent(Component content)
Set the content component of the BalloonTip |
void |
setShadowSettings(ShadowSettings shadowSettings)
Sets the shadow composite. |
void |
setShadowStyle(ShadowStyle shadowStyle)
Set the shadow style of the balloon |
void |
show(JComponent owner,
int x,
int y)
Show the BalloonTip over an owner component. |
void |
updateUI()
Use BalloonTipUI to customize the LAF. |
Methods inherited from class javax.swing.JToolTip |
---|
getAccessibleContext, getComponent, getTipText, getUI, getUIClassID, paramString, setComponent, setTipText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BalloonTip()
public BalloonTip(Component content)
content
- The content component of the BalloonTip.Method Detail |
---|
public void updateUI()
updateUI
in class JToolTip
public Dimension getContentSize()
public Dimension getBalloonSize()
public Dimension getBalloonPreferredSize()
public Point getHotSpot()
public Dimension getShadowSize()
public void setContent(Component content)
content
- The content component of the BalloonTippublic boolean isVisible()
isVisible
in class Component
public void show(JComponent owner, int x, int y)
owner
- The component the BalloonTip will be popup over.x
- The x-axis coordinate where the BalloonTip will be. The coordinate system is that of the owner
component.y
- The y-axis coordinate where the BalloonTip will be. The coordinate system is that of the owner
component.protected JidePopup createPopup()
return new JidePopup() {
public boolean isClickOnPopup(MouseEvent e) {
Point p = e.getPoint();
Point point = SwingUtilities.convertPoint((Component) e.getSource(), p, getContent().getParent());
return getContent().getParent().contains(point);
}
};
protected void customizePopup(JidePopup popup)
public void hide()
hide
in class Component
public BalloonShape getBalloonShape()
public void setBalloonShape(BalloonShape shape)
shape
- the new shape.public Component getContent()
public ShadowStyle getShadowStyle()
public void setShadowStyle(ShadowStyle shadowStyle)
shadowStyle
- the new shadow style.public ShadowSettings getShadowSettings()
public void setShadowSettings(ShadowSettings shadowSettings)
shadowSettings
- the new shadow composite.public void paintBalloonBackground(Graphics2D g2d, Shape shape)
g2d
- the Graphics2D objectshape
- the shape of the balloon. By default, we will fill the shape with the color from getBackground();public void paintBalloonForeground(Graphics2D g2d, Shape shape)
g2d
- the Graphics2D objectshape
- the shape of the balloon. By default, we will draw a line using the shape with the color from
getForeground();public void packPopup()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |