Examples of PaintListener


Examples of org.eclipse.swt.events.PaintListener

    canvas.addListener(SWT.MouseDown, moveImageListener);
    canvas.addListener(SWT.MouseUp, moveImageListener);
    canvas.addListener(SWT.MouseMove, moveImageListener);

    canvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent arg0) {
        drawCurrentImage();
      }
    });
View Full Code Here

Examples of org.eclipse.swt.events.PaintListener

    };

    canvas = new Canvas(parent, SWT.NO_BACKGROUND);
    canvas.setLayout(new FillLayout());

    canvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        if (img != null && !img.isDisposed()) {
          Rectangle bounds = img.getBounds();
          if (bounds.width >= e.width && bounds.height >= e.height) {
            e.gc.drawImage(img, e.x, e.y, e.width, e.height, e.x, e.y, e.width,
View Full Code Here

Examples of org.eclipse.swt.events.PaintListener

    final SWTSkinObjectText soWaitTask = (SWTSkinObjectText) skin.getSkinObject("task");

    final SWTSkinObject soWaitProgress = skin.getSkinObject("progress");
    if (soWaitProgress != null) {
      soWaitProgress.getControl().addPaintListener(new PaintListener() {
        public void paintControl(PaintEvent e) {
          Control c = (Control) e.widget;
          Point size = c.getSize();
          e.gc.setBackground(ColorCache.getColor(e.display, "#23a7df"));
          Object data = soWaitProgress.getData("progress");
View Full Code Here

Examples of org.eclipse.swt.events.PaintListener

    sc.getVerticalBar().setIncrement(BLOCK_SIZE);

    peerInfoCanvas = new Canvas(sc, SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND);
    gridData = new GridData(GridData.FILL, SWT.DEFAULT, true, false);
    peerInfoCanvas.setLayoutData(gridData);
    peerInfoCanvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        if (e.width <= 0 || e.height <= 0)
          return;
        try {
          Rectangle bounds = (img == null) ? null : img.getBounds();
View Full Code Here

Examples of org.eclipse.swt.events.PaintListener

    // Top gradient
    final Canvas window_top = new Canvas(shell,SWT.NONE);
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    layout_data.heightHint = TOP_GRADIENT_HEIGHT;
    window_top.setLayoutData(layout_data);
    window_top.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent arg0) {
        Rectangle rect = shell.getClientArea ();
        GC gc = arg0.gc;
        gc.setForeground (GRADIENT_COLOR_2);
        gc.setBackground (GRADIENT_COLOR_1);
View Full Code Here

Examples of org.eclipse.swt.events.PaintListener

    grid_data.heightHint = 20;
    total_progress.setLayoutData(grid_data);
    gap_list_painter = new GapListPainter(download_session.getGapList(),
        download_session.getFileSize());
    gap_list_painter.setMarginWidth(0);
    total_progress.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent arg0) {
        gap_list_painter.draw(arg0.gc, 0, 0, arg0.width, arg0.height);
      }
    });
View Full Code Here

Examples of org.eclipse.swt.events.PaintListener

        Control c = content.getChildren()[i];
        addPaintListener(c);
      }
    }
   
    content.addPaintListener(new PaintListener() {
   
      public void paintControl(PaintEvent arg0) {
        updateScroll();
      }
     
View Full Code Here

Examples of org.eclipse.swt.events.PaintListener

   * add controls to composite.
   *
   * @param control control.
   */
  public void addPaintListener(Control control) {
    control.addPaintListener(new PaintListener() {

      public void paintControl(PaintEvent arg0) {
        updateScroll();
      }
     
View Full Code Here

Examples of org.eclipse.swt.events.PaintListener

    layout.marginHeight = 10;
    layout.marginWidth  = 10;
    shell.setLayout(layout);
    final Canvas canvas = new Canvas(shell,SWT.NONE);
   
    canvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent arg0) {
        System.out.println(arg0.width+" : " + arg0.height);
        gap_list_painter.draw(arg0.gc, 0, 0, arg0.width, arg0.height);
      }
    });
View Full Code Here

Examples of org.eclipse.swt.events.PaintListener

      public void mouseDoubleClick(MouseEvent e) {
      }

    });

    composite.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        int x = (int)(WIDTH_NO_PADDING * value / maxValue);
        if (x < 0) {
          x = 0;
        } else if (x > WIDTH_NO_PADDING) {
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.