Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Transform.translate()


           
            Point bounds = ((Canvas) e.widget).getSize();
            offsetX = (bounds.x - mapValues.getSize()) / 2;
            offsetY = (bounds.y - mapValues.getSize()) / 2;
            Transform t = new Transform(device);
            t.translate(offsetX, offsetY);
            gc.setTransform(t);
           
            this.paintMap(mapValues, gc);
           
            t.dispose();
View Full Code Here


                0, e.y };
        Transform save = new Transform(device);
        gc.getTransform(save);
        Transform t = new Transform(device);
        gc.getTransform(t);
        t.translate(location.px - e.x/2, location.py - e.y - ARROW_HEIGHT - GAP);
        gc.setTransform(t);
        gc.fillPolygon(polygon);
        gc.drawPolygon(polygon);
        gc.drawText(name, PADDING_X, PADDING_Y);
        gc.setTransform(save);
View Full Code Here

        gc.getTransform(save);
        Transform t = new Transform(device);
        gc.getTransform(t);
       
        // push stack, first translate is applied last
        t.translate(each.px, each.py);
        t.rotate(140);
        t.translate(0, GAP_Y);
        gc.setTransform(t);
       
        gc.fillPath(path);
View Full Code Here

        gc.getTransform(t);
       
        // push stack, first translate is applied last
        t.translate(each.px, each.py);
        t.rotate(140);
        t.translate(0, GAP_Y);
        gc.setTransform(t);
       
        gc.fillPath(path);
        gc.drawPath(path);
       
View Full Code Here

    translateX+=x;
    translateY+=y;
    Transform transform = new Transform(gc.getDevice());
    Transform transform2 = new Transform(gc.getDevice());
    gc.getTransform(transform2);
    transform2.translate((float) x, (float) y);
    transform.multiply(transform2);
    gc.setTransform(transform);
  }

  public void scale(double scaleX, double scaleY) {
View Full Code Here

      return;
    }

    if (angle != 0.0) {
      final Transform transform = new Transform(g2.getDevice());
      transform.translate(rotateX, rotateY);
      transform.rotate((float) (-angle * 180 / Math.PI));
      transform.translate(-rotateX, -rotateY);
      g2.setTransform(transform);
      transform.dispose();
    }
View Full Code Here

    if (angle != 0.0) {
      final Transform transform = new Transform(g2.getDevice());
      transform.translate(rotateX, rotateY);
      transform.rotate((float) (-angle * 180 / Math.PI));
      transform.translate(-rotateX, -rotateY);
      g2.setTransform(transform);
      transform.dispose();
    }

    g2.drawString(text, (int) textX, (int) textY, true);
View Full Code Here

                GC gc = event.gc;
                Transform transform = null;
                if (orientation == SWT.VERTICAL) {
                  transform = new Transform(event.display);
                transform.translate(TrimUtil.TRIM_DEFAULT_HEIGHT, 0);
                transform.rotate(90);
                }
                ILabelProvider labelProvider = (ILabelProvider) getLabelProvider();

                int itemCount = Math.min(displayedItems.length, numShowItems);
View Full Code Here

                    Rectangle rect = getClientArea();
                    x = (rect.width - 100) / 2;
                    y = (rect.height - 16) / 2;
                    Transform swtTransform = new Transform(e.gc.getDevice());
                    e.gc.getTransform(swtTransform);
                    swtTransform.translate(x, y);
                    e.gc.setTransform(swtTransform);
                    swtTransform.dispose();
                    e.gc.setBackground(getDisplay().getSystemColor(
                            SWT.COLOR_BLACK));
                    e.gc.setLineWidth((int) stroke.getLineWidth());
View Full Code Here

     * @param y  the translation along the y-axis.
     */
    public void translate(int x, int y) {
        Transform swtTransform = new Transform(this.gc.getDevice());
        this.gc.getTransform(swtTransform);
        swtTransform.translate(x, y);
        this.gc.setTransform(swtTransform);
        swtTransform.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.