comparison dwtx/jface/text/source/projection/ProjectionSupport.d @ 158:25f1f92fa3df

...
author Frank Benoit <benoit@tionex.de>
date Tue, 26 Aug 2008 02:46:34 +0200
parents f70d9508c95c
children 1a5b8f8129df
comparison
equal deleted inserted replaced
157:7f75eaa8103a 158:25f1f92fa3df
95 95
96 return super.skip(annotation); 96 return super.skip(annotation);
97 } 97 }
98 } 98 }
99 99
100 private static class ProjectionDrawingStrategy : AnnotationPainter.IDrawingStrategy { 100 private static class ProjectionDrawingStrategy : AnnotationPainter_IDrawingStrategy {
101 /* 101 /*
102 * @see dwtx.jface.text.source.AnnotationPainter.IDrawingStrategy#draw(dwt.graphics.GC, dwt.custom.StyledText, int, int, dwt.graphics.Color) 102 * @see dwtx.jface.text.source.AnnotationPainter.IDrawingStrategy#draw(dwt.graphics.GC, dwt.custom.StyledText, int, int, dwt.graphics.Color)
103 */ 103 */
104 public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset, int length, Color color) { 104 public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset, int length, Color color) {
105 if ( cast(ProjectionAnnotation)annotation ) { 105 if ( cast(ProjectionAnnotation)annotation ) {
176 private ProjectionAnnotationsPainter fPainter; 176 private ProjectionAnnotationsPainter fPainter;
177 private ProjectionRulerColumn fColumn; 177 private ProjectionRulerColumn fColumn;
178 /** 178 /**
179 * @since 3.1 179 * @since 3.1
180 */ 180 */
181 private AnnotationPainter.IDrawingStrategy fDrawingStrategy; 181 private AnnotationPainter_IDrawingStrategy fDrawingStrategy;
182 182
183 /** 183 /**
184 * Creates new projection support for the given projection viewer. Initially, 184 * Creates new projection support for the given projection viewer. Initially,
185 * no annotation types are summarized. A default hover control creator and a 185 * no annotation types are summarized. A default hover control creator and a
186 * default drawing strategy are used. 186 * default drawing strategy are used.
264 * 264 *
265 * @param strategy the drawing strategy or <code>null</code> to reset the 265 * @param strategy the drawing strategy or <code>null</code> to reset the
266 * strategy to the default 266 * strategy to the default
267 * @since 3.1 267 * @since 3.1
268 */ 268 */
269 public void setAnnotationPainterDrawingStrategy(AnnotationPainter.IDrawingStrategy strategy) { 269 public void setAnnotationPainterDrawingStrategy(AnnotationPainter_IDrawingStrategy strategy) {
270 fDrawingStrategy= strategy; 270 fDrawingStrategy= strategy;
271 } 271 }
272 272
273 /** 273 /**
274 * Returns the drawing strategy to be used by the support's annotation painter. 274 * Returns the drawing strategy to be used by the support's annotation painter.
275 * 275 *
276 * @return the drawing strategy to be used by the support's annotation painter 276 * @return the drawing strategy to be used by the support's annotation painter
277 * @since 3.1 277 * @since 3.1
278 */ 278 */
279 private AnnotationPainter.IDrawingStrategy getDrawingStrategy() { 279 private AnnotationPainter_IDrawingStrategy getDrawingStrategy() {
280 if (fDrawingStrategy is null) 280 if (fDrawingStrategy is null)
281 fDrawingStrategy= new ProjectionDrawingStrategy(); 281 fDrawingStrategy= new ProjectionDrawingStrategy();
282 return fDrawingStrategy; 282 return fDrawingStrategy;
283 } 283 }
284 284
369 * @param viewer the viewer 369 * @param viewer the viewer
370 * @param required the required class of the adapter 370 * @param required the required class of the adapter
371 * @return the adapter or <code>null</code> 371 * @return the adapter or <code>null</code>
372 * 372 *
373 */ 373 */
374 public Object getAdapter(ISourceViewer viewer, Class required) { 374 public Object getAdapter(ISourceViewer viewer, ClassInfo required) {
375 if (ProjectionAnnotationModel.classinfo ==/*eq*/ required) { 375 if (ProjectionAnnotationModel.classinfo ==/*eq*/ required) {
376 if ( cast(ProjectionViewer)viewer ) { 376 if ( cast(ProjectionViewer)viewer ) {
377 ProjectionViewer projectionViewer= cast(ProjectionViewer) viewer; 377 ProjectionViewer projectionViewer= cast(ProjectionViewer) viewer;
378 return projectionViewer.getProjectionAnnotationModel(); 378 return projectionViewer.getProjectionAnnotationModel();
379 } 379 }