package ie.dcu.segment.painters; import ie.dcu.segment.SegmentationContext; import ie.dcu.swt.*; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.ImageData; /** * Shows the current markup (annotations) only * * @author Kevin McGuinness */ public class MarkupPainter implements SegmentationPainter { public static final String NAME = "Markup"; public String getDescription() { return "Shows the current markup (annotations) only"; } public String getName() { return NAME; } public ImageData getMaskData(SegmentationContext ctx) { return null; } public void paint(SegmentationContext ctx, ObservableImage im) { GC gc = im.beginPaint(); // Paint white backdrop SwtUtils.setBackground(gc, SWT.COLOR_WHITE); gc.fillRectangle(im.getBounds()); // Paint all annotations ctx.getAnnotations().paint(im); // Commit changes im.endPaint(); } public void dispose() { // Nothing needs to be disposed } }