/** * The change in document notification. * * @param evt * The change notification from the currently associated * document. */ public void changedUpdate(DocumentEvent evt) { if (evt instanceof BaseDocumentEvent) { BaseDocumentEvent bdevt = (BaseDocumentEvent) evt; BaseDocument doc = (BaseDocument) bdevt.getDocument(); String layerName = bdevt.getDrawLayerName(); if (layerName != null) { getEditorUI().addLayer(doc.findLayer(layerName), bdevt.getDrawLayerVisibility()); } else { // some other type of change, propagate to root view rootView.changedUpdate(evt, null, rootView.getViewFactory()); } } }
/** The change in document notification. * * @param evt The change notification from the currently associated document. */ public void changedUpdate(DocumentEvent evt) { if (evt instanceof BaseDocumentEvent) { BaseDocumentEvent bdevt = (BaseDocumentEvent)evt; BaseDocument doc = (BaseDocument)bdevt.getDocument(); String layerName = bdevt.getDrawLayerName(); if (layerName != null) { getEditorUI().addLayer(doc.findLayer(layerName), bdevt.getDrawLayerVisibility()); }else{ //temp try { JTextComponent comp = getComponent(); if (comp!=null && comp.isShowing()) { getEditorUI().repaintBlock(evt.getOffset(), evt.getOffset() + evt.getLength()); } } catch (BadLocationException ex) { Utilities.annotateLoggable(ex); } } } }