Package org.eclipse.swt.graphics

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


  protected void paintObjectGroup(GC gc, ObjectGroup og) {
        final Point tsize = getTileSize();
        final Rectangle bounds = og.getBounds();
        Iterator<MapObject> itr = og.getObjects();
        Transform transform = new Transform(getDisplay());
        transform.translate(bounds.x * tsize.x,bounds.y * tsize.y);
    gc.setTransform(transform);
//        gc.translate(
//                bounds.x * tsize.x,
//                bounds.y * tsize.y);

 
View Full Code Here


                    Properties p = layer.getTileInstancePropertiesAt(i, j);
                    if (p != null && !p.isEmpty()) {
                        //gc.drawString( "PROP", x, y );
                        //gc.drawImage(MapView.propertyFlagImage, x + (tsize.width - 12), y, null);
                      Transform transform = new Transform(getDisplay());
                        transform.translate(x + (tsize.x - 13), y+1);
                    gc.setTransform(transform);
                        gc.drawPolygon(Converter.getPolygonArray(propPoly));
                        gc.setTransform(null);
                        transform.dispose();
                    }
View Full Code Here

    shell.addListener(SWT.Paint, new Listener() {
      @Override
      public void handleEvent(Event event) {
        GC gc = event.gc;
        Transform tr = new Transform(display);
        tr.translate(50, 120);
        tr.rotate(-30);
        gc.drawImage(image, 0, 0, rect.width, rect.height, 0, 0, rect.width / 2, rect.height / 2);
        gc.setAlpha(100);
        gc.setTransform(tr);
        Path path = new Path(display);
View Full Code Here

          } else {
            final Transform oldTransform = new Transform(gc.getDevice());
            gc.getTransform(oldTransform);

            final Transform transform = new Transform(gc.getDevice());
            transform.translate(offsetX + image.getBounds().width / 2, offsetY
                + image.getBounds().height / 2);
            transform.rotate(rotation);
            transform.translate(-(offsetX + image.getBounds().width / 2),
                -(offsetY + image.getBounds().height / 2));
            gc.setTransform(transform);
View Full Code Here

            final Transform transform = new Transform(gc.getDevice());
            transform.translate(offsetX + image.getBounds().width / 2, offsetY
                + image.getBounds().height / 2);
            transform.rotate(rotation);
            transform.translate(-(offsetX + image.getBounds().width / 2),
                -(offsetY + image.getBounds().height / 2));
            gc.setTransform(transform);
            gc.drawImage(image, offsetX, offsetY);
            gc.setTransform(oldTransform);
            transform.dispose();
View Full Code Here

            else
            {
                final Transform transform = new Transform(event.display);
                try
                {
                    transform.translate(r.x, r.y);
                    transform.rotate(-90);
                    event.gc.setTransform(transform);
                    event.gc.drawString(label, -labelExtend.x - 2, 2, true);
                    event.gc.drawString(info, -infoExtend.x - 2, 2 + labelExtend.y, true);
                }
View Full Code Here

     * @see java.awt.Graphics2D#translate(int, int)
     */
    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();
    }

    /* (non-Javadoc)
 
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

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.