private void updateToolSettings() { final org.eclipse.swt.examples.paint.PaintTool activePaintTool = paintSurface.getPaintTool(); if (activePaintTool == null) { return; } activePaintTool.endSession(); activePaintTool.set(toolSettings); activePaintTool.beginSession(); }
public void dispose() { if (paintSurface != null) { paintSurface.dispose(); } if (paintColors != null) { for (int i = 0; i < paintColors.length; ++i) { final org.eclipse.swt.graphics.Color color = paintColors[i]; if (color != null) { color.dispose(); } } } paintDefaultFont = null; paintColors = null; paintSurface = null; freeResources(); }
public void setPaintTool(int id) { org.eclipse.swt.examples.paint.PaintTool paintTool = (org.eclipse.swt.examples.paint.PaintTool) tools[id].data; paintSurface.setPaintSession(paintTool); updateToolSettings(); }