Java Code Examples for javax.swing.JToolTip#getInsets()
The following examples show how to use
javax.swing.JToolTip#getInsets() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SeaGlassToolTipUI.java From seaglass with Apache License 2.0 | 6 votes |
/** * Paints the specified component. * * @param context * context for the component being painted * @param g * the {@code Graphics} object used for painting * @see #update(Graphics,JComponent) */ protected void paint(SynthContext context, Graphics g) { JToolTip tip = (JToolTip) context.getComponent(); Insets insets = tip.getInsets(); View v = (View) tip.getClientProperty(BasicHTML.propertyKey); if (v != null) { Rectangle paintTextR = new Rectangle(insets.left, insets.top, tip.getWidth() - (insets.left + insets.right), tip.getHeight() - (insets.top + insets.bottom)); v.paint(g, paintTextR); } else { g.setColor(context.getStyle().getColor(context, ColorType.TEXT_FOREGROUND)); g.setFont(style.getFont(context)); context.getStyle().getGraphicsUtils(context).paintText(context, g, tip.getTipText(), insets.left, insets.top, -1); } }
Example 2
Source File: TooltipImageTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private static void checkSize(JToolTip tip, int width, int height) { Dimension d = tip.getPreferredSize(); Insets insets = tip.getInsets(); //6 seems to be the extra width being allocated for some reason //for a tooltip window. if (!((d.width - insets.right - insets.left - 6) == width) && !((d.height - insets.top - insets.bottom) == height)) { throw new RuntimeException("Test case fails: Expected width, height is " + width + ", " + height + " whereas actual width, height are " + (d.width - insets.right - insets.left - 6) + " " + (d.height - insets.top - insets.bottom)); } }
Example 3
Source File: TooltipImageTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private static void checkSize(JToolTip tip, int width, int height) { Dimension d = tip.getPreferredSize(); Insets insets = tip.getInsets(); //6 seems to be the extra width being allocated for some reason //for a tooltip window. if (!((d.width - insets.right - insets.left - 6) == width) && !((d.height - insets.top - insets.bottom) == height)) { throw new RuntimeException("Test case fails: Expected width, height is " + width + ", " + height + " whereas actual width, height are " + (d.width - insets.right - insets.left - 6) + " " + (d.height - insets.top - insets.bottom)); } }
Example 4
Source File: TooltipImageTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private static void checkSize(JToolTip tip, int width, int height) { Dimension d = tip.getPreferredSize(); Insets insets = tip.getInsets(); //6 seems to be the extra width being allocated for some reason //for a tooltip window. if (!((d.width - insets.right - insets.left - 6) == width) && !((d.height - insets.top - insets.bottom) == height)) { throw new RuntimeException("Test case fails: Expected width, height is " + width + ", " + height + " whereas actual width, height are " + (d.width - insets.right - insets.left - 6) + " " + (d.height - insets.top - insets.bottom)); } }
Example 5
Source File: TooltipImageTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private static void checkSize(JToolTip tip, int width, int height) { Dimension d = tip.getPreferredSize(); Insets insets = tip.getInsets(); //6 seems to be the extra width being allocated for some reason //for a tooltip window. if (!((d.width - insets.right - insets.left - 6) == width) && !((d.height - insets.top - insets.bottom) == height)) { throw new RuntimeException("Test case fails: Expected width, height is " + width + ", " + height + " whereas actual width, height are " + (d.width - insets.right - insets.left - 6) + " " + (d.height - insets.top - insets.bottom)); } }