/** 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; /* #33165 - line in line-annotations handled in a different way 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(); }
public void propertyChange (PropertyChangeEvent evt) { if (evt.getPropertyName() == AnnotationTypes.PROP_COMBINE_GLYPHS) { LineAnnotations lineAnnos; for( Iterator it = lineAnnotationsArray.iterator(); it.hasNext(); ) { lineAnnos = (LineAnnotations)it.next(); lineAnnos.refreshAnnotations(); } } if (evt.getPropertyName() == AnnotationTypes.PROP_ANNOTATION_TYPES) { LineAnnotations lineAnnos; for( Iterator it = lineAnnotationsArray.iterator(); it.hasNext(); ) { lineAnnos = (LineAnnotations)it.next(); for( Iterator it2 = lineAnnos.getAnnotations(); it2.hasNext(); ) { AnnotationDesc anno = (AnnotationDesc)it2.next(); anno.updateAnnotationType(); } } } fireChangedAll(); } });
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName() == AnnotationTypes.PROP_COMBINE_GLYPHS) { LineAnnotations lineAnnos; for (Iterator it = lineAnnotationsArray.iterator(); it.hasNext();) { lineAnnos = (LineAnnotations) it.next(); lineAnnos.refreshAnnotations(); } } if (evt.getPropertyName() == AnnotationTypes.PROP_ANNOTATION_TYPES) { LineAnnotations lineAnnos; for (Iterator it = lineAnnotationsArray.iterator(); it.hasNext();) { lineAnnos = (LineAnnotations) it.next(); for (Iterator it2 = lineAnnos.getAnnotations(); it2.hasNext();) { AnnotationDesc anno = (AnnotationDesc) it2.next(); anno.updateAnnotationType(); } } } fireChangedAll(); } });
/** Checks the number of removed lines and recalculate * LineAnnotations.line property */ public void removeUpdate(DocumentEvent e) { BaseDocumentEvent be = (BaseDocumentEvent)e; int countOfDeletedLines = be.getLFCount(); if (countOfDeletedLines == 0) return; int changedLine = be.getLine(); /* #33165 - line in line-annotations handled in a different way LineAnnotations annos; for (int i=0; i<lineAnnotationsArray.size(); i++) { annos = (LineAnnotations)lineAnnotationsArray.get(i); if (annos.getLine() > changedLine && annos.getLine() < changedLine+countOfDeletedLines) annos.setLine(changedLine); if (annos.getLine() > changedLine) annos.setLine(annos.getLine()-countOfDeletedLines); } */ // fire event to AnnotationsListeners that everything should be redraw fireChangedAll(); }
/** * Checks the number of removed lines and recalculate LineAnnotations.line * property */ public void removeUpdate(DocumentEvent e) { BaseDocumentEvent be = (BaseDocumentEvent) e; int countOfDeletedLines = be.getLFCount(); if (countOfDeletedLines == 0) return; int changedLine = be.getLine(); LineAnnotations annos; for (int i = 0; i < lineAnnotationsArray.size(); i++) { annos = (LineAnnotations) lineAnnotationsArray.get(i); if (annos.getLine() > changedLine && annos.getLine() < changedLine + countOfDeletedLines) annos.setLine(changedLine); if (annos.getLine() > changedLine) annos.setLine(annos.getLine() - countOfDeletedLines); } // fire event to AnnotationsListeners that everything should be redraw fireChangedAll(); }
/** * 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(); }