public void paint( Graphics g, JComponent c) { int w = tooltip.getWidth(); int h = tooltip.getHeight(); Border bb = tooltip.getBorder(); if ( bb != null ) { w -= bb.getBorderInsets( tooltip).right; h -= bb.getBorderInsets( tooltip).bottom; } g.setColor( tooltip.getBackground()); g.fillRect( 0,0, w,h); super.paint( g, c); } }
bounds.x = loc.x; bounds.y = loc.y; bounds.width = cellTip.getWidth(); bounds.height = cellTip.getHeight();
bounds.x = loc.x; bounds.y = loc.y; bounds.width = cellTip.getWidth(); bounds.height = cellTip.getHeight();
private void showToolTip(MouseEvent e) { Track s = player.getTrack(); if (s != null) { toolTip.setTipText(Util.samplesToTime(progressSlider.getValue() - progressSlider.getMinimum(), s.getTrackData().getSampleRate(), 1)); int x = e.getXOnScreen(); x = Math.max(x, progressSlider.getLocationOnScreen().x); x = Math.min(x, progressSlider.getLocationOnScreen().x + progressSlider.getWidth() - toolTip.getWidth()); popup = popupFactory.getPopup(progressSlider, toolTip, x, progressSlider.getLocationOnScreen().y + 25); popup.show(); } }
bounds.x = loc.x; bounds.y = loc.y; bounds.width = tip.getWidth(); bounds.height = tip.getHeight();
/** * 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); } }