Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.GC.dispose()


            drawLine(width, height - 3, colorF, gc);
            drawLine(width, height - 2, colorG, gc);
            drawLine(width, height - 1, colorH, gc);

        } finally {
            gc.dispose();

            colorC.dispose();
            colorD.dispose();
            colorE.dispose();
            colorF.dispose();
View Full Code Here


    gcImage.setForeground(Colors.blue);
    int angle = (percent * 360) / 100;
    gcImage.setBackground(Colors.blues[Colors.BLUES_MIDDARK]);
    gcImage.fillArc(0,0,width,height,90-angle,angle);
    gcImage.drawOval(0 , 0 , width-1, height-1);
    gcImage.dispose();
    return image;
  }
 
  public static void drawPie(GC gc,int x, int y,int width,int height,int percent) {
    Color background = gc.getBackground();
View Full Code Here

      }

      drawnWidth += nextWidth;

    }
    gcImage.dispose();
   
    Image oldImage = null;
    Graphic graphic = cell.getGraphic();
    if (graphic instanceof UISWTGraphic) {
      oldImage = ((UISWTGraphic)graphic).getImage();
View Full Code Here

      cell.setGraphic(new UISWTGraphicImpl(image));
    }
    if (oldImage != null && !oldImage.isDisposed())
      oldImage.dispose();

    gcImage.dispose();
  }
}
View Full Code Here

        }
      }
      } catch (Exception e) {
        Debug.out(e);
      } finally {
        gcBuffer.dispose();
      }
    }
  }  
 
  public void dispose() {
View Full Code Here

      drawChart(sizeChanged);
    }
   
    GC gc = new GC(drawCanvas);
    gc.drawImage(bufferImage,bounds.x,bounds.y);
    gc.dispose();   
  }
 
  protected void drawChart(boolean sizeChanged) {
   try{
       this_mon.enter();
View Full Code Here

        int height = bounds.height - scale.getScaledValue(computeAverage(currentPosition-6)) - 2;
        gcImage.setForeground(colors[COLOR_AVERAGE]);
        gcImage.drawText(formater.format(computeAverage(currentPosition-6)),bounds.width - 65,height - 12,true);
      }   
     
      gcImage.dispose();

    }finally{
     
      this_mon.exit();
    }
View Full Code Here

      }      
      gcBuffer.setForeground(Colors.black);
      gcBuffer.drawLine(bounds.width-70,0,bounds.width-70,bounds.height-1);   
     
      gcBuffer.drawRectangle(0,0,bounds.width-1,bounds.height-1);
      gcBuffer.dispose();
    }
  }
 
  public void dispose() {
    if(bufferBackground != null && ! bufferBackground.isDisposed())
View Full Code Here

                    SWT.CENTER | SWT.WRAP);
              } else {
                sp.printString();
              }
            } finally {
              gc.dispose();
            }
          } catch (Throwable t) {
            //ignore
          }
        }
View Full Code Here

    Color color = ColorCache.getColor(display, rV, gV, bV);
    img = new Image(display,25,10);
    GC gc = new GC(img);
    gc.setBackground(color);
    gc.fillRectangle(0,0,25,10);
    gc.dispose();
    colorChooser.setImage(img);
    if(oldImg != null && ! oldImg.isDisposed())
      oldImg.dispose();
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.