Class FocusableTip
- java.lang.Object
-
- org.nuiton.jaxx.widgets.extra.tooltip.FocusableTip
-
public class FocusableTip extends Object
A focusable tool tip, similar to those found in Eclipse. The user can click in the tip and it becomes a "real," resizable window.- Version:
- 1.0
- Author:
- Robert Futrell
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FocusableTip.AttachedComponentListener
-
Field Summary
Fields Modifier and Type Field Description protected JComponent
attachedComponent
protected FocusableTip.AttachedComponentListener
attachedComponentListener
static String
DUMMY_TOOL_TIP
protected int
height
Height with default value.protected HyperlinkListener
hyperlinkListener
protected URL
imageBase
protected Component
lastComponent
protected String
lastText
protected static int
MARGIN
Margin from mouse cursor at which to draw focusable tip.protected boolean
showCopyContextMenu
protected Rectangle
tipVisibleBounds
The screen bounds in which the mouse has to stay for the currently displayed tip to stay visible.protected TipWindow
tipWindow
protected int
width
Width with default value.
-
Constructor Summary
Constructors Constructor Description FocusableTip(JComponent attachedComponent)
FocusableTip constructorFocusableTip(JComponent attachedComponent, boolean showCopyContextMenu)
FocusableTip constructorFocusableTip(JComponent attachedComponent, HyperlinkListener listener)
FocusableTip constructorFocusableTip(JComponent attachedComponent, HyperlinkListener listener, boolean showCopyContextMenu)
FocusableTip constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
computeTipVisibleBounds()
Compute the bounds in which the user can move the mouse without the tip window disappearing.protected void
createAndShowTipWindow(MouseEvent e, Component component, String text)
URL
getImageBase()
Returns the base URL to use when loading images in this focusable tip.TipWindow
getTipWindows()
GetTipWindow
displayedvoid
possiblyDisposeOfTipWindow()
Disposes of the focusable tip currently displayed, if any.protected void
setAttachedComponent(JComponent attachedComponent)
void
setImageBase(URL url)
Sets the base URL to use when loading images in this focusable tip.void
setSize(int width, int height)
Change tip size.void
toolTipRequested(MouseEvent e, Component component)
void
toolTipRequested(MouseEvent e, String text)
-
-
-
Field Detail
-
DUMMY_TOOL_TIP
public static final String DUMMY_TOOL_TIP
- See Also:
- Constant Field Values
-
attachedComponent
protected JComponent attachedComponent
-
tipWindow
protected TipWindow tipWindow
-
imageBase
protected URL imageBase
-
attachedComponentListener
protected FocusableTip.AttachedComponentListener attachedComponentListener
-
hyperlinkListener
protected HyperlinkListener hyperlinkListener
-
lastText
protected String lastText
-
lastComponent
protected Component lastComponent
-
showCopyContextMenu
protected boolean showCopyContextMenu
-
width
protected int width
Width with default value.
-
height
protected int height
Height with default value.
-
tipVisibleBounds
protected Rectangle tipVisibleBounds
The screen bounds in which the mouse has to stay for the currently displayed tip to stay visible.
-
MARGIN
protected static final int MARGIN
Margin from mouse cursor at which to draw focusable tip.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FocusableTip
public FocusableTip(JComponent attachedComponent)
FocusableTip constructor- Parameters:
attachedComponent
- component to attach
-
FocusableTip
public FocusableTip(JComponent attachedComponent, HyperlinkListener listener)
FocusableTip constructor- Parameters:
attachedComponent
- component to attachlistener
- hyper link listener to add
-
FocusableTip
public FocusableTip(JComponent attachedComponent, boolean showCopyContextMenu)
FocusableTip constructor- Parameters:
attachedComponent
- component to attachshowCopyContextMenu
- to show copy context menu
-
FocusableTip
public FocusableTip(JComponent attachedComponent, HyperlinkListener listener, boolean showCopyContextMenu)
FocusableTip constructor- Parameters:
attachedComponent
- component to attachlistener
- hyper link listener to addshowCopyContextMenu
- to show copy context menu
-
-
Method Detail
-
setSize
public void setSize(int width, int height)
Change tip size.- Parameters:
width
- widthheight
- height
-
computeTipVisibleBounds
protected void computeTipVisibleBounds()
Compute the bounds in which the user can move the mouse without the tip window disappearing.
-
createAndShowTipWindow
protected void createAndShowTipWindow(MouseEvent e, Component component, String text)
-
getImageBase
public URL getImageBase()
Returns the base URL to use when loading images in this focusable tip.- Returns:
- The base URL to use.
- See Also:
setImageBase(URL)
-
possiblyDisposeOfTipWindow
public void possiblyDisposeOfTipWindow()
Disposes of the focusable tip currently displayed, if any.
-
setImageBase
public void setImageBase(URL url)
Sets the base URL to use when loading images in this focusable tip.- Parameters:
url
- The base URL to use.- See Also:
getImageBase()
-
setAttachedComponent
protected void setAttachedComponent(JComponent attachedComponent)
-
toolTipRequested
public void toolTipRequested(MouseEvent e, String text)
-
toolTipRequested
public void toolTipRequested(MouseEvent e, Component component)
-
-