Mercurial > projects > dwt-addons
diff dwtx/jface/text/source/AnnotationPainter.d @ 158:25f1f92fa3df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 26 Aug 2008 02:46:34 +0200 |
parents | 7f75eaa8103a |
children | 7926b636c282 |
line wrap: on
line diff
--- a/dwtx/jface/text/source/AnnotationPainter.d Mon Aug 25 19:06:44 2008 +0200 +++ b/dwtx/jface/text/source/AnnotationPainter.d Tue Aug 26 02:46:34 2008 +0200 @@ -118,21 +118,6 @@ import dwtx.jface.text.TextPresentation; -/** - * Paints decorations for annotations provided by an annotation model and/or - * highlights them in the associated source viewer. - * <p> - * The annotation painter can be configured with drawing strategies. A drawing - * strategy defines the visual presentation of a particular type of annotation - * decoration.</p> - * <p> - * Clients usually instantiate and configure objects of this class.</p> - * - * @since 2.1 - */ -public class AnnotationPainter : IPainter, PaintListener, IAnnotationModelListener, IAnnotationModelListenerExtension, ITextPresentationListener { - - /** * A drawing strategy draws the decoration for an annotation onto the text widget. * @@ -163,6 +148,22 @@ void draw(Annotation annotation, GC gc, StyledText textWidget, int offset, int length, Color color); } + alias IDrawingStrategy AnnotationPainter_IDrawingStrategy; + +/** + * Paints decorations for annotations provided by an annotation model and/or + * highlights them in the associated source viewer. + * <p> + * The annotation painter can be configured with drawing strategies. A drawing + * strategy defines the visual presentation of a particular type of annotation + * decoration.</p> + * <p> + * Clients usually instantiate and configure objects of this class.</p> + * + * @since 2.1 + */ +public class AnnotationPainter : IPainter, PaintListener, IAnnotationModelListener, IAnnotationModelListenerExtension, ITextPresentationListener { + /** * Squiggles drawing strategy. * @@ -931,7 +932,7 @@ * @return the annotation painter * @since 3.0 */ - private Object getPaintingStrategy(final String type) { + private Object getPaintingStrategy(String type) { Object strategy= fCachedAnnotationType2PaintingStrategy.get(type); if (strategy !is null) return strategy; @@ -966,7 +967,7 @@ * @return the color * @since 3.0 */ - private Color getColor(final Object annotationType) { + private Color getColor(Object annotationType) { Color color= cast(Color)fCachedAnnotationType2Color.get(annotationType); if (color !is null) return color; @@ -1091,7 +1092,7 @@ /* * @see dwtx.jface.text.source.IAnnotationModelListener#modelChanged(dwtx.jface.text.source.IAnnotationModel) */ - public synchronized void modelChanged(final IAnnotationModel model) { + public synchronized void modelChanged(IAnnotationModel model) { if (DEBUG) System.err.println("AP: OLD API of AnnotationModelListener called"); //$NON-NLS-1$ @@ -1101,7 +1102,7 @@ /* * @see dwtx.jface.text.source.IAnnotationModelListenerExtension#modelChanged(dwtx.jface.text.source.AnnotationModelEvent) */ - public void modelChanged(final AnnotationModelEvent event) { + public void modelChanged(AnnotationModelEvent event) { Display textWidgetDisplay; try { StyledText textWidget= fTextWidget; @@ -1136,12 +1137,10 @@ // changes any more. If the document gets modified between // now and running the posted runnable, the position information // is not accurate any longer. - textWidgetDisplay.asyncExec(new class() Runnable { - public void run() { - if (fTextWidget !is null && !fTextWidget.isDisposed()) - updatePainting(event); - } - }); + textWidgetDisplay.asyncExec( dgRunnable( (Event event_){ + if (fTextWidget !is null && !fTextWidget.isDisposed()) + updatePainting(event_); + }, event )); } }