Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Canvas


    // drawMoldure();
  }

  private void drawMoldure() {
    photoCanvas = new Canvas(categoryButtonsComposite, SWT.NONE);
    photoCanvas.redraw();
    drawImageMoldure();
    photoCanvas.redraw();

    FormData data = new FormData();
View Full Code Here


       
//        fillPhoto((Photo) gd.get("photo"));
    }
  
    private void createPhotoCanvas(Composite groupComposite) {
        photoCanvas = new Canvas(groupComposite,SWT.NONE);
        photoCanvas.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
       
        FormData data = new FormData();
        data.top = new FormAttachment(0,0);
        data.left = new FormAttachment(0,0);
View Full Code Here

            numberOfLinesSpinner.setSelection(labelPage.getNumberOfLines());
        }
    }
   
    private void createDetailsCanvas() {
        detailsCanvas = new Canvas(dialog, SWT.NONE);
        detailsCanvas.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
       
        if(labelPage != null) {
            topEdge = labelPage.getTopEdge()*10;
            sideEdge = labelPage.getLeftEdge()*10;
 
View Full Code Here

            public void handleEvent(Event event) {
                refreshObject();
            }
        });
        text = new Text(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
        canvas = new Canvas(shell, SWT.BORDER);
        canvas.addListener(SWT.Paint, new Listener() {
            public void handleEvent(Event event) {
                paintCanvas(event);
            }
        });
View Full Code Here

        CLabel cLabel1 = new CLabel(composite, SWT.NULL);
        cLabel1.setText("Todos os ajustes ou outros podem ser alterados clicando na Central de Prefer�ncias.");
    }

    private void createFinalImage() {
        canvas = new Canvas(composite, SWT.FLAT);
        canvas.setLayout(new FormLayout());
        canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
        canvas.addListener(SWT.Paint, new Listener(){
            public void handleEvent(Event arg0) {
                GC gc = new GC(canvas);
View Full Code Here

        CLabel cLabel1 = new CLabel(composite, SWT.NULL);
        cLabel1.setText("Voc� tamb�m pode abrir o assistente diretamente no menu Arquivo.");
    }

    private void createWelcomeImage() {
        canvas = new Canvas(composite, SWT.FLAT);
        canvas.setLayout(new FormLayout());
        canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
        canvas.addListener(SWT.Paint, new Listener(){
            public void handleEvent(Event arg0) {
                GC gc = new GC(canvas);
View Full Code Here

            }
        });
    }

    private void createCloseButton() {
        final Canvas close = new Canvas(shell, SWT.FLAT);
        close.setBackground(new Color(null, 0, 84, 227));

        close.addListener(SWT.MouseExit, new Listener() {
            public void handleEvent(Event event) {
                GC gc = new GC(close);
                gc.setForeground(new Color(null, 255, 255, 255));
                gc.setLineWidth(2);
                gc.drawLine(0, 0, 8, 8);
                gc.drawLine(0, 8, 8, 0);
            }
        });

        close.addListener(SWT.MouseEnter, new Listener() {
            public void handleEvent(Event event) {
                GC gc = new GC(close);
                gc.setForeground(new Color(null, 221, 65, 65));
                gc.setLineWidth(2);
                gc.drawLine(0, 0, 8, 8);
                gc.drawLine(0, 8, 8, 0);
            }
        });

        close.addListener(SWT.Paint, new Listener() {
            public void handleEvent(Event event) {
                GC gc = new GC(close);
                gc.setForeground(new Color(null, 255, 255, 255));
                gc.setLineWidth(2);
                gc.drawLine(0, 0, 8, 8);
                gc.drawLine(0, 8, 8, 0);
            }
        });

        close.addListener(SWT.MouseUp, new Listener() {
            public void handleEvent(Event event) {
                mainScreen.closeView(shell.getParent());
            }
        });

        FormData data = new FormData();
        data.left = new FormAttachment(0, getSize() - 10);
        data.top = new FormAttachment(0, 10);
        data.width = 10;
        data.height = 10;
        close.setLayoutData(data);
    }
View Full Code Here

      createPhotoCanvas();
//      loadImage("img/userNoPhotoIco.png");
  }

    private void createPhotoCanvas() {
        photoCanvas = new Canvas(this, SWT.NONE);
    }
View Full Code Here

    String platform= SWT.getPlatform();
    final boolean isWin= platform.equals("win32"); //$NON-NLS-1$
    if (!isWin && !platform.equals("gtk")) //$NON-NLS-1$
      return;
   
    final Canvas resizer= new Canvas(bars, SWT.NONE);
   
    int size= getResizeHandleSize(bars);
   
    GridData data= new GridData(SWT.END, SWT.END, false, true);
    data.widthHint= size;
    data.heightHint= size;
    resizer.setLayoutData(data);
    resizer.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        Point s= resizer.getSize();
        int x= s.x - 2;
        int y= s.y - 2;
        int min= Math.min(x, y);
        if (isWin) {
          // draw dots
          e.gc.setBackground(resizer.getDisplay().getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
          int end= min - 1;
          for (int i= 0; i <= 2; i++)
            for (int j= 0; j <= 2 - i; j++)
              e.gc.fillRectangle(end - 4 * i, end - 4 * j, 2, 2);
          end--;
          e.gc.setBackground(resizer.getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
          for (int i= 0; i <= 2; i++)
            for (int j= 0; j <= 2 - i; j++)
              e.gc.fillRectangle(end - 4 * i, end - 4 * j, 2, 2);
         
        } else {
          // draw diagonal lines
          e.gc.setForeground(resizer.getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
          for (int i= 1; i < min; i+= 4) {
            e.gc.drawLine(i, y, x, i);
          }
          e.gc.setForeground(resizer.getDisplay().getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
          for (int i= 2; i < min; i+= 4) {
            e.gc.drawLine(i, y, x, i);
          }
        }
      }
    });
   
    resizer.setCursor(new Cursor(resizer.getDisplay(), SWT.CURSOR_SIZESE));
    MouseAdapter resizeSupport= new MouseAdapter() {
      private MouseMoveListener fResizeListener;
     
      public void mouseDown(MouseEvent e) {
        Point shellSize= fShell.getSize();
        final int shellX= shellSize.x;
        final int shellY= shellSize.y;
        Point mouseLoc= resizer.toDisplay(e.x, e.y);
        final int mouseX= mouseLoc.x;
        final int mouseY= mouseLoc.y;
        fResizeListener= new MouseMoveListener() {
          public void mouseMove(MouseEvent e2) {
            Point mouseLoc2= resizer.toDisplay(e2.x, e2.y);
            int dx= mouseLoc2.x - mouseX;
            int dy= mouseLoc2.y - mouseY;
            setSize(shellX + dx, shellY + dy);
          }
        };
        resizer.addMouseMoveListener(fResizeListener);
      }
     
      public void mouseUp(MouseEvent e) {
        resizer.removeMouseMoveListener(fResizeListener);
        fResizeListener= null;
      }
    };
    resizer.addMouseListener(resizeSupport);
  }
View Full Code Here

   */
  public Control createControl(Composite parent, ITextViewer textViewer) {

    fTextViewer= textViewer;

    fCanvas= new Canvas(parent, SWT.NO_BACKGROUND);

    fCanvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent event) {
        if (fTextViewer != null)
          doubleBufferPaint(event.gc);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Canvas

Copyright © 2018 www.massapicom. 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.