Class TooltipPainter
- java.lang.Object
-
- com.metsci.glimpse.core.painter.base.GlimpsePainterBase
-
- com.metsci.glimpse.core.painter.info.SimpleTextPainter
-
- com.metsci.glimpse.core.painter.info.TooltipPainter
-
- All Implemented Interfaces:
GlimpsePainter
public class TooltipPainter extends SimpleTextPainter
Displays tool tip text at a specified position.- Author:
- ulman
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.metsci.glimpse.core.painter.info.SimpleTextPainter
SimpleTextPainter.HorizontalPosition, SimpleTextPainter.VerticalPosition
-
-
Constructor Summary
Constructors Constructor Description TooltipPainter()
TooltipPainter(TextureAtlas atlas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TooltipPainter
clear()
int
getBorderSize()
boolean
getBreakOnEol()
Whether to force a break on the end of line characters (\r \f \n).int
getFixedWidth()
float
getIconSize()
float
getIconSpacing()
Insets
getInsets()
int
getLineSpacing()
The spacing between the bottom (descent) of one line of text to the top (ascent) of the next line.int
getTextIconSpacing()
boolean
isFixedWidth()
boolean
isIconSizeFixedToTextHeight()
TooltipPainter
setBorderSize(int size)
TooltipPainter
setBreakIterator(BreakIterator breakIterator)
TooltipPainter
setBreakOnEol(boolean breakOnEol)
void
setClampToScreenEdges(boolean clamp)
TooltipPainter
setFixedWidth(int fixedWidth)
TooltipPainter
setIcon(Object iconId)
Sets the icon to be displayed on the first line of the tool tip.TooltipPainter
setIcons(List<Object> iconIds)
Sets the TooltipPainter to display multiple icons, one per line, down the left hand side of the tooltip window.TooltipPainter
setIcons(List<Object> iconIds, List<float[]> colors)
Sets icons and associated colors.TooltipPainter
setIconSize(float size)
TooltipPainter
setIconSizeFixedToTextHeight(boolean iconSizeFixedToText)
If true, the height of each icon will be set to the height of each line of text.TooltipPainter
setIconSpacing(int i)
TooltipPainter
setInsets(Insets insets)
TooltipPainter
setLineSpacing(int lineSpacing)
TooltipPainter
setLocation(int x, int y)
Sets the location of the upper left corner of the tooltip box in screen/pixel coordinates.TooltipPainter
setLocation(GlimpseMouseEvent e)
TooltipPainter
setLocationAxisCoords(double x, double y)
Sets the location of the upper left corner of the tooltip box in axis coordinates.TooltipPainter
setOffset(int x, int y)
TooltipPainter
setText(String text)
TooltipPainter
setTextIconSpacing(int textIconSpacing)
TooltipPainter
setUnlimitedWidth()
TooltipPainter
setWrapTextAroundIcon(boolean wrap)
-
Methods inherited from class com.metsci.glimpse.core.painter.info.SimpleTextPainter
getHorizontalPadding, getText, getTextBounds, getVerticalPadding, setBackgroundColor, setBackgroundPadding, setBorderColor, setColor, setColor, setFont, setFont, setFont, setFont, setHorizontalLabels, setHorizontalPadding, setHorizontalPosition, setLookAndFeel, setPadding, setPaintBackground, setPaintBorder, setSizeText, setVerticalPadding, setVerticalPosition, xAlign, yAlign
-
Methods inherited from class com.metsci.glimpse.core.painter.base.GlimpsePainterBase
dispose, getAxis1D, getAxis2D, getBounds, getGL3, isDisposed, isVisible, paintTo, requireAxis1D, requireAxis2D, setVisible
-
-
-
-
Constructor Detail
-
TooltipPainter
public TooltipPainter(TextureAtlas atlas)
-
TooltipPainter
public TooltipPainter()
-
-
Method Detail
-
setIcon
public TooltipPainter setIcon(Object iconId)
Sets the icon to be displayed on the first line of the tool tip.- Parameters:
id
- the id of the icon in TooltipPainter's TextureAtlas
-
setIcons
public TooltipPainter setIcons(List<Object> iconIds)
Sets the TooltipPainter to display multiple icons, one per line, down the left hand side of the tooltip window.
-
setIcons
public TooltipPainter setIcons(List<Object> iconIds, List<float[]> colors)
Sets icons and associated colors.- See Also:
setIcons(List)
-
setWrapTextAroundIcon
public TooltipPainter setWrapTextAroundIcon(boolean wrap)
-
setInsets
public TooltipPainter setInsets(Insets insets)
-
setLocation
public TooltipPainter setLocation(int x, int y)
Sets the location of the upper left corner of the tooltip box in screen/pixel coordinates.
-
setLocationAxisCoords
public TooltipPainter setLocationAxisCoords(double x, double y)
Sets the location of the upper left corner of the tooltip box in axis coordinates.
-
setOffset
public TooltipPainter setOffset(int x, int y)
-
setLocation
public TooltipPainter setLocation(GlimpseMouseEvent e)
-
setBorderSize
public TooltipPainter setBorderSize(int size)
-
setFixedWidth
public TooltipPainter setFixedWidth(int fixedWidth)
-
setUnlimitedWidth
public TooltipPainter setUnlimitedWidth()
-
setBreakOnEol
public TooltipPainter setBreakOnEol(boolean breakOnEol)
-
setLineSpacing
public TooltipPainter setLineSpacing(int lineSpacing)
-
setBreakIterator
public TooltipPainter setBreakIterator(BreakIterator breakIterator)
-
setText
public TooltipPainter setText(String text)
- Overrides:
setText
in classSimpleTextPainter
-
setTextIconSpacing
public TooltipPainter setTextIconSpacing(int textIconSpacing)
-
setIconSize
public TooltipPainter setIconSize(float size)
-
setIconSizeFixedToTextHeight
public TooltipPainter setIconSizeFixedToTextHeight(boolean iconSizeFixedToText)
If true, the height of each icon will be set to the height of each line of text.
-
setIconSpacing
public TooltipPainter setIconSpacing(int i)
-
clear
public TooltipPainter clear()
-
getInsets
public Insets getInsets()
-
getBorderSize
public int getBorderSize()
-
setClampToScreenEdges
public void setClampToScreenEdges(boolean clamp)
-
getFixedWidth
public int getFixedWidth()
-
isFixedWidth
public boolean isFixedWidth()
-
isIconSizeFixedToTextHeight
public boolean isIconSizeFixedToTextHeight()
-
getTextIconSpacing
public int getTextIconSpacing()
-
getBreakOnEol
public boolean getBreakOnEol()
Whether to force a break on the end of line characters (\r \f \n).
-
getLineSpacing
public int getLineSpacing()
The spacing between the bottom (descent) of one line of text to the top (ascent) of the next line.
-
getIconSize
public float getIconSize()
-
getIconSpacing
public float getIconSpacing()
-
-