/** Getter for offset of this annotation */ public int getOffset() { return delegate.getOffset(); }
/** Getter for offset of this annotation */ public int getOffset() { return delegate.getOffset(); }
public AnnotationCombination(String type, AnnotationDesc delegate) { super(delegate.getOffset(), delegate.getLength()); this.delegate = delegate; this.type = type; updateAnnotationType(); list = new LinkedList(); list.add(delegate); }
public AnnotationCombination(String type, AnnotationDesc delegate) { super(delegate.getOffset(), delegate.getLength()); this.delegate = delegate; this.type = type; updateAnnotationType(); list = new LinkedList(); list.add(delegate); }
public String toString() { return "Annotation: type='" + getAnnotationType() + "', line=" + getLine() + // NOI18N ", offset=" + getOffset() + ", length=" + length + // NOI18N ", coloring=" + getColoring(); // NOI18N }
public String toString() { return "Annotation: type='" + getAnnotationType() + "', line=" + getLine() + // NOI18N ", offset=" + getOffset() + ", length=" + length + // NOI18N ", coloring=" + getColoring(); // NOI18N }
/** Remove annotation */ public void removeAnnotation(AnnotationDesc anno) { // find LineAnnotations for the mark LineAnnotations lineAnnos = (LineAnnotations) lineAnnotationsByMark.get(anno.getMark()); int line = lineAnnos.getLine(); // remove annotation from the line lineAnnos.removeAnnotation(anno); // check if this mark is referenced or not. If not, remove it if (!lineAnnos.isMarkStillReferenced(anno.getMark())) { lineAnnotationsByMark.remove(anno.getMark()); MarkChain chain = getLayer().getMarkChain(); chain.removeMark(anno.getOffset()); } // if there is no more annotations on the line, remove LineAnnotations if (lineAnnos.getCount() == 0) { lineAnnotationsArray.remove(lineAnnotationsArray.indexOf(lineAnnos)); } // clear the mark from annotation anno.setMark(null); // remove listener on changes of annotation type anno.removePropertyChangeListener(l); // notify view that must be redrawn refreshLine(line); }
int offset; if (annos.getActiveAnnotation(line) != null) offset = annos.getActiveAnnotation(line).getOffset(); else offset = Utilities.getRowStartFromLineOffset(doc, line);
/** * Checks the number of inserted lines and recalculate LineAnnotations.line * property */ public void insertUpdate(DocumentEvent e) { BaseDocumentEvent be = (BaseDocumentEvent) e; int countOfInsertedLines = be.getLFCount(); if (countOfInsertedLines == 0) return; int changedLine = be.getLine(); LineAnnotations annos; LineAnnotations current = null; for (int i = 0; i < lineAnnotationsArray.size(); i++) { annos = (LineAnnotations) lineAnnotationsArray.get(i); if (annos.getLine() == changedLine && annos.getActive().getOffset() > e.getOffset()) current = annos; if (annos.getLine() > changedLine) annos.setLine(annos.getLine() + countOfInsertedLines); } if (current != null) current.setLine(current.getLine() + countOfInsertedLines); // fire event to AnnotationsListeners that everything should be redraw fireChangedAll(); }
int offset; if (annos.getActiveAnnotation(line) != null) offset = annos.getActiveAnnotation(line).getOffset(); else offset = Utilities.getRowStartFromLineOffset(doc, line);
chain.addMark(anno.getOffset()); } catch (BadLocationException e) { return;