/**
* Positions tool tips to be aligned in the text component,so that the
* displayed content is shown (almost) exactly where it would be in the
* editor.
*
* @param e The mouse location.
*/
@Override
public Point getToolTipLocation(MouseEvent e) {
// ToolTipManager requires both location and text to be null to hide
// a currently-visible tool tip window. If text is null but location
// has some value,it will show a tool tip with empty content,the size
// of its border (!).
String text = getToolTipText(e);
if (text==null) {
return null;
}
// Try to overlap the tip's text directly over the code
Point p = e.getPoint();
p.y = (p.y/textArea.getLineHeight()) * textArea.getLineHeight();
p.x = getWidth() + textArea.getMargin().left;
Gutter gutter = getGutter();
int gutterMargin = gutter.getInsets().right;
p.x += gutterMargin;
JToolTip tempTip = createtoolTip();
p.x -= tempTip.getInsets().left;
p.y += 16;
return p;
}
项目:incubator-netbeans
文件:Outline.java
@Override
public JToolTip createtoolTip() {
JToolTip t = toolTip;
toolTip = null;
if (t != null) {
t.addMouseMotionListener(new MouseMotionAdapter() { // #233642
boolean initialized = false;
@Override
public void mouseMoved(MouseEvent e) {
if (!initialized) {
initialized = true; // ignore the first event
} else {
// hide the tooltip if mouse moves over it
ToolTipManager.sharedInstance().mousepressed(e);
}
}
});
return t;
} else {
return super.createtoolTip();
}
}
/**
* Overridden to use the editor's background if it's detected that the
* user isn't using white as the editor bg,but the system's tool tip
* background is yellow-ish.
*
* @return The tool tip.
*/
@Override
public JToolTip createtoolTip() {
JToolTip tip = super.createtoolTip();
Color textAreaBG = textArea.getBackground();
if (textAreaBG!=null && !Color.white.equals(textAreaBG)) {
Color bg = TipUtil.getToolTipBackground();
// If current L&F's tool tip color is close enough to "yellow",// and we're not using the default text background of white,use
// the editor background as the tool tip background.
if (bg.getRed()>=240 && bg.getGreen()>=240 && bg.getBlue()>=200) {
tip.setBackground(textAreaBG);
}
}
return tip;
}
项目:hearthstone
文件:DeckBack.java
private void showToolTip(boolean flag) {
try {
if (flag) {
int qtd = heroi.getDeck().size();
String txt = (qtd == 0 ? "Nenhum card" : qtd == 1
? "1 card" : qtd + " cards");
Point p = getLocationOnScreen();
JToolTip tip = createtoolTip();
tip.setTipText(txt);
PopupFactory popupFactory = PopupFactory.getSharedInstance();
tooltip = popupFactory.getPopup(this,tip,p.x + 10,p.y + 10);
tooltip.show();
} else {
tooltip.hide();
}
} catch (Exception ex) {
//ignorar
}
}
项目:hearthstone
文件:MaoBack.java
private void showToolTip(boolean flag) {
try {
if (flag) {
int qtd = heroi.getMao().size();
String txt = (qtd == 0 ? "Nenhum card" : qtd == 1
? "1 card" : qtd + " cards");
Point p = getLocationOnScreen();
JToolTip tip = createtoolTip();
tip.setTipText(txt);
PopupFactory popupFactory = PopupFactory.getSharedInstance();
tooltip = popupFactory.getPopup(this,p.y + 10);
tooltip.show();
} else {
tooltip.hide();
}
} catch (Exception ex) {
//ignorar
}
}
项目:openjdk-jdk10
文件:JComponentOperator.java
public JToolTipwindowFinder() {
ppFinder = new ComponentChooser() {
@Override
public boolean checkComponent(Component comp) {
return (comp.isShowing()
&& comp.isVisible()
&& comp instanceof JToolTip);
}
@Override
public String getDescription() {
return "A tool tip";
}
@Override
public String toString() {
return "JComponentOperator.JToolTipwindowFinder.ComponentChooser{description = " + getDescription() + '}';
}
};
}
项目:FreeCol
文件:FreeColToolTipUI.java
@Override
public Dimension getPreferredSize(JComponent c) {
String tipText = ((JToolTip)c).getTipText();
if (tipText == null || tipText.isEmpty()) {
return new Dimension(0,0);
}
float x = 0f;
float y = 0f;
for (String line : lineBreak.split(tipText)) {
if (line.isEmpty()) {
y += LEADING;
continue;
}
AttributedCharacterIterator styledText
= new AttributedString(line).getIterator();
LineBreakMeasurer measurer = new LineBreakMeasurer(styledText,frc);
while (measurer.getPosition() < styledText.getEndindex()) {
TextLayout layout = measurer.nextLayout(maximumWidth);
x = Math.max(x,layout.getVisibleAdvance());
y += layout.getAscent() + layout.getDescent() + layout.getLeading();
}
}
return new Dimension((int) (x + 2 * margin),(int) (y + 2 * margin));
}
项目:oxygen-git-plugin
文件:CommitPanel.java
@Override
public Component getListCellRendererComponent(JList<?> list,Object value,int index,boolean isSelected,boolean cellHasFocus) {
JLabel comp = (JLabel) super.getListCellRendererComponent(list,value,index,isSelected,cellHasFocus);
if (value != null) {
JToolTip createtoolTip = comp.createtoolTip();
Font font = createtoolTip.getFont();
FontMetrics fontMetrics = getFontMetrics(font);
int length = fontMetrics.stringWidth((String) value);
if (length < MAX_TOOLTIP_WIDTH) {
comp.setToolTipText("<html><p width=\"" + length + "\">" + value + "</p></html>");
} else {
comp.setToolTipText("<html><p width=\"" + MAX_TOOLTIP_WIDTH + "\">" + value + "</p></html>");
}
}
return comp;
}
项目:openjdk9
文件:JComponentOperator.java
public JToolTipwindowFinder() {
ppFinder = new ComponentChooser() {
@Override
public boolean checkComponent(Component comp) {
return (comp.isShowing()
&& comp.isVisible()
&& comp instanceof JToolTip);
}
@Override
public String getDescription() {
return "A tool tip";
}
@Override
public String toString() {
return "JComponentOperator.JToolTipwindowFinder.ComponentChooser{description = " + getDescription() + '}';
}
};
}
/**
* Overridden to use the editor's background if it's detected that the
* user isn't using white as the editor bg,use
// the editor background as the tool tip background.
if (bg.getRed()>=240 && bg.getGreen()>=240 && bg.getBlue()>=200) {
tip.setBackground(textAreaBG);
}
}
return tip;
}
/**
* Positions tool tips to be aligned in the text component,the size
// of its border (!).
String text = getToolTipText(e);
if (text==null) {
return null;
}
// Try to overlap the tip's text directly over the code
Point p = e.getPoint();
p.y = (p.y/textArea.getLineHeight()) * textArea.getLineHeight();
p.x = getWidth() + textArea.getMargin().left;
Gutter gutter = getGutter();
int gutterMargin = gutter.getInsets().right;
p.x += gutterMargin;
JToolTip tempTip = createtoolTip();
p.x -= tempTip.getInsets().left;
p.y += 16;
return p;
}
项目:SweetHome3D
文件:SwingTools.java
private static boolean isToolTipShowing(Container container)
{
if (container instanceof Window)
{
for (Window window : ((Window) container).getownedWindows())
{
if (isToolTipShowing(window))
{
return true;
}
}
}
for (int i = 0; i < container.getComponentCount(); i++)
{
Component child = container.getComponent(i);
if (child instanceof JToolTip && child.isShowing()
|| child instanceof Container && isToolTipShowing((Container) child))
{
return true;
}
}
return false;
}
项目:javify
文件:BasicToolTipUI.java
/**
* This method returns the preferred size of the given JComponent.
*
* @param c The JComponent to find a preferred size for.
*
* @return The preferred size.
*/
public Dimension getPreferredSize(JComponent c)
{
JToolTip tip = (JToolTip) c;
String str = tip.getTipText();
FontMetrics fm = c.getFontMetrics(c.getFont());
Insets i = c.getInsets();
Dimension d = new Dimension(i.left + i.right,i.top + i.bottom);
if (str != null && ! str.equals(""))
{
View view = (View) c.getClientProperty(BasicHTML.propertyKey);
if (view != null)
{
d.width += (int) view.getPreferredSpan(View.X_AXIS);
d.height += (int) view.getPreferredSpan(View.Y_AXIS);
}
else
{
d.width += fm.stringWidth(str) + 6;
d.height += fm.getHeight();
}
}
return d;
}
项目:SBOLDesigner
文件:AddressBar.java
private JButton createButton(final ComponentDeFinition comp) {
JButton button = new JButton(comp.getdisplayId(),ICON) {
public JToolTip createtoolTip() {
Image image = (Image) getClientProperty("overview");
JToolTipwithIcon tip = new JToolTipwithIcon(new ImageIcon(image));
tip.setComponent(this);
return tip;
}
};
button.putClientProperty("comp",comp);
// Todo this is broken
// button.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent event) {
// try {
// design.focusOut(comp);
// } catch (SBOLValidationException e) {
// JOptionPane.showMessageDialog(null,"There was an error: " +
// e.getMessage());
// e.printstacktrace();
// }
// }
// });
Buttons.setStyle(button);
return button;
}
项目:mars-sim
文件:ToolButton.java
/**
* Constructs a ToolButton object.
* @param toolName the name of the tool
* @param imageName the name of the tool button image
*/
public ToolButton(String toolName,String imageName) {
// Use JButton constructor
super(ImageLoader.getIcon(imageName));
// Initialize toolName
this.toolName = toolName;
// Initialize tool tip for button
toolButtonTip = new JToolTip();
toolButtonTip.setBackground(Color.white);
toolButtonTip.setBorder(new LineBorder(Color.yellow));
setToolTipText(toolName);
// Prepare default tool button values
setAlignmentX(.5F);
setAlignmentY(.5F);
}
项目:jvm-stm
文件:BasicToolTipUI.java
/**
* This method returns the preferred size of the given JComponent.
*
* @param c The JComponent to find a preferred size for.
*
* @return The preferred size.
*/
public Dimension getPreferredSize(JComponent c)
{
JToolTip tip = (JToolTip) c;
String str = tip.getTipText();
FontMetrics fm = c.getFontMetrics(c.getFont());
Insets i = c.getInsets();
Dimension d = new Dimension(i.left + i.right,i.top + i.bottom);
if (str != null && ! str.equals(""))
{
View view = (View) c.getClientProperty(BasicHTML.propertyKey);
if (view != null)
{
d.width += (int) view.getPreferredSpan(View.X_AXIS);
d.height += (int) view.getPreferredSpan(View.Y_AXIS);
}
else
{
d.width += fm.stringWidth(str) + 6;
d.height += fm.getHeight();
}
}
return d;
}
项目:WorldGrower
文件:CustomPopupFactory.java
public static void setPopupFactory() {
PopupFactory.setSharedInstance(new PopupFactory() {
@Override
public Popup getPopup(Component owner,Component contents,int x,int y) throws IllegalArgumentException {
if (contents instanceof JToolTip) {
JToolTip toolTip = (JToolTip)contents;
int width = (int) toolTip.getPreferredSize().getWidth();
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
int screenWidth = gd.getdisplayMode().getWidth();
// if there is enough room,move tooltip to the right to have enough room
// for large tooltips.
// this way they don't hinder mouse movement and make it possible to easily
// view multiple tooltips of items.
if (x + width + TOOLTIP_X_OFFSET < screenWidth) {
x += TOOLTIP_X_OFFSET;
}
}
return super.getPopup(owner,contents,x,y);
}
});
}
public Dimension getPreferredSize(JComponent c) {
Font font = c.getFont();
String tipText = ((JToolTip) c).getTipText();
JToolTip mtt = (JToolTip) c;
FontMetrics fontMetrics = mtt.getFontMetrics(font);
int fontHeight = fontMetrics.getHeight();
if (tipText == null)
return new Dimension(0,0);
String lines[] = tipText.split("\n");
int num_lines = lines.length;
int width,height,onewidth;
height = num_lines * fontHeight;
width = 0;
for (int i = 0; i < num_lines; i++) {
onewidth = fontMetrics.stringWidth(lines[i]);
width = Math.max(width,onewidth);
}
return new Dimension(width + inset * 2,height + inset * 2);
}
public void paint(Graphics g,JComponent c) {
Font font = c.getFont();
JToolTip mtt = (JToolTip) c;
FontMetrics fontMetrics = mtt.getFontMetrics(font);
Dimension dimension = c.getSize();
int fontHeight = fontMetrics.getHeight();
int fontAscent = fontMetrics.getAscent();
String tipText = ((JToolTip) c).getTipText();
if (tipText == null)
return;
String lines[] = tipText.split("\n");
int num_lines = lines.length;
int height;
int i;
g.setColor(c.getBackground());
g.fillRect(0,dimension.width,dimension.height);
g.setColor(c.getForeground());
for (i = 0,height = 2 + fontAscent; i < num_lines; i++,height += fontHeight) {
g.drawString(lines[i],inset,height);
}
}
/**
* Overridden to use the editor's background if it's detected that the
* user isn't using white as the editor bg,use
// the editor background as the tool tip background.
if (bg.getRed()>=240 && bg.getGreen()>=240 && bg.getBlue()>=200) {
tip.setBackground(textAreaBG);
}
}
return tip;
}
/**
* Positions tool tips to be aligned in the text component,the size
// of its border (!).
String text = getToolTipText(e);
if (text==null) {
return null;
}
// Try to overlap the tip's text directly over the code
Point p = e.getPoint();
p.y = (p.y/textArea.getLineHeight()) * textArea.getLineHeight();
p.x = getWidth() + textArea.getMargin().left;
Gutter gutter = getGutter();
int gutterMargin = gutter.getInsets().right;
p.x += gutterMargin;
JToolTip tempTip = createtoolTip();
p.x -= tempTip.getInsets().left;
p.y += 16;
return p;
}
项目:openwonderland
文件:HUDWindow.java
private HUDComponent showPopup(Component component,int y) {
// sometimes we are given a tooltip with no text that doesn't close.
// just ignore it
if (component instanceof JToolTip &&
(((JToolTip) component).getTipText() == null ||
((JToolTip) component).getTipText().isEmpty()))
{
return null;
}
HUDComponent hc = new HUDPopup2D((JComponent) component,this,y);
hc.setDecoratable(false);
hud.addComponent(hc);
hc.setVisible(true);
return hc;
}
/**
* A hack to prepare HTML-based Swing components: size initialization is called inside paint method.
* @param g a non-null Graphics object
* @param component an HTML-based component that needs to be initialized
* @param cellRect a space where the component should be painted
*/
public static void htmlHack( Graphics g,Component component,Rectangle cellRect ) {
String text;
if ( component instanceof JLabel )
text = ( ( JLabel )component ).getText();
else if ( component instanceof AbstractButton )
text = ( ( AbstractButton )component ).getText();
else if ( component instanceof JToolTip )
text = ( ( JToolTip )component ).getTipText();
else
text = null;
if ( !BasicHTML.isHTMLString( text ) )
return;
component.setBounds( cellRect );
Graphics gg = g.create( -cellRect.width,-cellRect.height,cellRect.width,cellRect.height );
try {
component.paint( gg );
} catch ( NullPointerException e ) {
// Thrown on applet reinitialization.
} finally {
gg.dispose();
}
}
项目:javamelody
文件:CounterRequestTable.java
@Override
public void paint(Graphics g,JComponent c) {
try {
final String tipText = ((JToolTip) c).getTipText();
final BufferedImage image = getRequestChartByRequestName(tipText);
// on affiche que l'image et pas le text dans le tooltip
// FontMetrics metrics = c.getFontMetrics(g.getFont());
// g.setColor(c.getForeground());
// g.drawString(tipText,1,1);
if (image != null) {
g.drawImage(image,c);
} else {
super.paint(g,c);
}
} catch (final IOException e) {
// s'il y a une erreur dans la récupération de l'image tant pis
super.paint(g,c);
}
}
/**
* 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,-1);
}
}
/**
* @inheritDoc
*/
@Override
public Dimension getPreferredSize(JComponent c) {
SeaGlassContext context = getContext(c);
Insets insets = c.getInsets();
Dimension prefSize = new Dimension(insets.left + insets.right,insets.top + insets.bottom);
String text = ((JToolTip) c).getTipText();
if (text != null) {
View v = (c != null) ? (View) c.getClientProperty("html") : null;
if (v != null) {
prefSize.width += (int) v.getPreferredSpan(View.X_AXIS);
prefSize.height += (int) v.getPreferredSpan(View.Y_AXIS);
} else {
Font font = context.getStyle().getFont(context);
FontMetrics fm = c.getFontMetrics(font);
prefSize.width += context.getStyle().getGraphicsUtils(context).computeStringWidth(context,font,fm,text);
prefSize.height += fm.getHeight();
}
}
context.dispose();
return prefSize;
}
/**
* @inheritDoc
*/
@Override
public void propertyChange(PropertyChangeEvent e) {
if (SeaGlassLookAndFeel.shouldUpdateStyle(e)) {
updateStyle((JToolTip) e.getSource());
}
String name = e.getPropertyName();
if (name.equals("tiptext") || "font".equals(name) || "foreground".equals(name)) {
// remove the old html view client property if one
// existed,and install a new one if the text installed
// into the JLabel is html source.
JToolTip tip = ((JToolTip) e.getSource());
String text = tip.getTipText();
BasicHTML.updateRenderer(tip,text);
}
}
项目:DataCleaner
文件:HelpIcon.java
@Override
public JToolTip createtoolTip() {
final DCPanel panel = new DCPanel();
panel.setopaque(true);
panel.setBackground(WidgetUtils.BG_COLOR_DARK);
panel.setLayout(new BorderLayout());
panel.add(new JLabel(_tooltipIcon),BorderLayout.WEST);
final DCLabel descriptionLabel = DCLabel.brightMultiLine(_helpMessage);
panel.add(descriptionLabel,BorderLayout.CENTER);
final Border border = new CompoundBorder(WidgetUtils.BORDER_THIN,WidgetUtils.BORDER_EMPTY);
panel.setBorder(border);
panel.setPreferredSize(300,130);
return new DCToolTip(this,panel);
}
项目:JamVM-PH
文件:BasicToolTipUI.java
/**
* This method returns the preferred size of the given JComponent.
*
* @param c The JComponent to find a preferred size for.
*
* @return The preferred size.
*/
public Dimension getPreferredSize(JComponent c)
{
JToolTip tip = (JToolTip) c;
String str = tip.getTipText();
FontMetrics fm = c.getFontMetrics(c.getFont());
Insets i = c.getInsets();
Dimension d = new Dimension(i.left + i.right,i.top + i.bottom);
if (str != null && ! str.equals(""))
{
View view = (View) c.getClientProperty(BasicHTML.propertyKey);
if (view != null)
{
d.width += (int) view.getPreferredSpan(View.X_AXIS);
d.height += (int) view.getPreferredSpan(View.Y_AXIS);
}
else
{
d.width += fm.stringWidth(str) + 6;
d.height += fm.getHeight();
}
}
return d;
}
/**
* This method returns the preferred size of the given JComponent.
*
* @param c The JComponent to find a preferred size for.
*
* @return The preferred size.
*/
public Dimension getPreferredSize(JComponent c)
{
JToolTip tip = (JToolTip) c;
String str = tip.getTipText();
FontMetrics fm = c.getFontMetrics(c.getFont());
Insets i = c.getInsets();
Dimension d = new Dimension(i.left + i.right,i.top + i.bottom);
if (str != null && ! str.equals(""))
{
View view = (View) c.getClientProperty(BasicHTML.propertyKey);
if (view != null)
{
d.width += (int) view.getPreferredSpan(View.X_AXIS);
d.height += (int) view.getPreferredSpan(View.Y_AXIS);
}
else
{
d.width += fm.stringWidth(str) + 6;
d.height += fm.getHeight();
}
}
return d;
}
项目:SOEN6471-FreeCol
文件:FreeColToolTipUI.java
public Dimension getPreferredSize(JComponent c) {
String tipText = ((JToolTip)c).getTipText();
if (tipText == null) {
return new Dimension(0,0);
}
float x = 0f;
float y = 0f;
for (String line : lineBreak.split(((JToolTip) c).getTipText())) {
AttributedCharacterIterator styledText
= new AttributedString(line).getIterator();
LineBreakMeasurer measurer = new LineBreakMeasurer(styledText,(int) (y + 2 * margin));
}
/**
* Positions tool tips to be aligned in the text component,so that the
* displayed content is shown (almost) exactly where it would be in the
* editor.
*
* @param e The mouse location.
*/
public Point getToolTipLocation(MouseEvent e) {
// ToolTipManager requires both location and text to be null to hide
// a currently-visible tool tip window. If text is null but location
// has some value,the size
// of its border (!).
String text = getToolTipText(e);
if (text==null) {
return null;
}
// Try to overlap the tip's text directly over the code
Point p = e.getPoint();
p.y = (p.y/textArea.getLineHeight()) * textArea.getLineHeight();
p.x = getWidth() + textArea.getMargin().left;
Gutter gutter = getGutter();
int gutterMargin = gutter.getInsets().right;
p.x += gutterMargin;
JToolTip tempTip = createtoolTip();
p.x -= tempTip.getInsets().left;
p.y += 16;
return p;
}
@Override
public Dimension getPreferredSize(JComponent c) {
Font font = c.getFont();
Insets insets = c.getInsets();
Dimension prefSize = new Dimension(insets.left + insets.right,insets.top + insets.bottom);
String text = ((JToolTip) c).getTipText();
if ((text == null) || text.equals("")) {
text = "";
} else {
View v = (c != null) ? (View) c.getClientProperty("html") : null;
if (v != null) {
// fix for 302 - add extra pixels for the HTML view as well
prefSize.width += (int) (v.getPreferredSpan(View.X_AXIS) + 6);
prefSize.height += (int) (v.getPreferredSpan(View.Y_AXIS) + 2);
} else {
FontMetrics fm = c.getFontMetrics(font);
prefSize.width += fm.stringWidth(text) + 6;
prefSize.height += fm.getHeight() + 2;
}
}
return prefSize;
}
项目:osp
文件:LibraryTreePanel.java
/**
* Creates the tree.
*
* @param root the root node
*/
protected void createTree(LibraryTreeNode root) {
treeModel = new DefaultTreeModel(root);
tree = new JTree(treeModel) {
public JToolTip createtoolTip() {
return new JMultiLinetoolTip();
}
};
if (root.createChildNodes()) {
LibraryTreeNode lastNode = (LibraryTreeNode)root.getLastChild();
TreePath path = new TreePath(lastNode.getPath());
tree.scrollPathToVisible(path);
}
treeNodeRenderer = new LibraryTreeNodeRenderer();
tree.setCellRenderer(treeNodeRenderer);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
ToolTipManager.sharedInstance().registerComponent(tree);
// listen for tree selections and display the contents
tree.addTreeSelectionListener(treeSelectionListener);
// listen for mouse events to display node info and inform propertychangelisteners
tree.addMouseListener(treeMouseListener);
// put tree in scroller
treeScroller.setViewportView(tree);
}
@Override
public Dimension getPreferredSize(JComponent c) {
String tipText = ((JToolTip)c).getTipText();
if (tipText==null)
return new Dimension(0,0);
textArea = new JTextArea(tipText);
textArea.setBorder(BorderFactory.createEmptyBorder(0,2,2));
rendererPane.removeAll();
rendererPane.add(textArea);
textArea.setWrapStyleWord(true);
textArea.setLineWrap(false);
Dimension dim = textArea.getPreferredSize();
dim.height += 2;
dim.width += 2;
return dim;
}
项目:incubator-netbeans
文件:FlashingIcon.java
@Override
public Point getToolTipLocation(MouseEvent event) {
JToolTip tip = createtoolTip();
tip.setTipText(getToolTipText());
Dimension d = tip.getPreferredSize();
Point retValue = new Point(getWidth() - d.width,-d.height);
return retValue;
}
项目:incubator-netbeans
文件:TooltipLabel.java
项目:incubator-netbeans
文件:OutlineView.java
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。