示例#1
0
 private void updateToolSettings() {
   final org.eclipse.swt.examples.paint.PaintTool activePaintTool = paintSurface.getPaintTool();
   if (activePaintTool == null) {
     return;
   }
   activePaintTool.endSession();
   activePaintTool.set(toolSettings);
   activePaintTool.beginSession();
 }
示例#2
0
 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();
 }
示例#3
0
 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();
 }