/** Count the X position of the glyph on the line. */ private int getXPosOfGlyph(int line) { int xPos = numberWidth; if (drawOverLineNumbers) { xPos = getWidth() - glyphWidth; if (cachedCountOfAnnos == -1 || cachedCountOfAnnosForLine != line) { cachedCountOfAnnos = annos.getNumberOfAnnotations(line); cachedCountOfAnnosForLine = line; } if (cachedCountOfAnnos > 1) xPos -= glyphButtonWidth; } return xPos; }
/** Count the X position of the glyph on the line. */ private int getXPosOfGlyph(int line) { if (editorUI == null) return 0; int xPos = numberWidth; if (drawOverLineNumbers) { xPos = getWidth() - glyphWidth; if (cachedCountOfAnnos == -1 || cachedCountOfAnnosForLine != line) { cachedCountOfAnnos = annos.getNumberOfAnnotations(line); cachedCountOfAnnosForLine = line; } if (cachedCountOfAnnos > 1) xPos -= glyphButtonWidth; } return xPos; }
/** Get tooltip text for the mouse position */ // TODO: does not work for asynchronous tooltip texts public String getToolTipText(MouseEvent e) { int line = (int) ((float) e.getY() / (float) lineHeight); if (annos.getNumberOfAnnotations(line) == 0) return null; if (isMouseOverCycleButton(e) && annos.getNumberOfAnnotations(line) > 1) { return java.text.MessageFormat.format(LocaleSupport.getString("cycling-glyph_tooltip"), // NOI18N new Object[] { new Integer(annos.getNumberOfAnnotations(line)) }); } else if (isMouseOverGlyph(e)) { return annos.getActiveAnnotation(line).getShortDescription(); } else return null; }
/** Get tooltip text for the mouse position */ // TODO: does not work for asynchronous tooltip texts public String getToolTipText (MouseEvent e) { if (editorUI == null) return null; int line = getLineFromMouseEvent(e); if (annos.getNumberOfAnnotations(line) == 0) return null; if (isMouseOverCycleButton(e) && annos.getNumberOfAnnotations(line) > 1) { return java.text.MessageFormat.format ( LocaleSupport.getString ("cycling-glyph_tooltip"), //NOI18N new Object[] { new Integer (annos.getNumberOfAnnotations(line)) }); } else if (isMouseOverGlyph(e)) { return annos.getActiveAnnotation(line).getShortDescription(); } else return null; }
int count = annos.getNumberOfAnnotations(line); AnnotationDesc anno = annos.getActiveAnnotation(line);
int count = annos.getNumberOfAnnotations(line); AnnotationDesc anno = annos.getActiveAnnotation(line);