Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Transform


              } catch (Exception ex) {
                // Ignore ERROR_NO_GRAPHICS_LIBRARY error or any others
              }

              try {
                Transform transform = new Transform(e.gc.getDevice());
                transform.rotate(270);
                e.gc.setTransform(transform);

                String s = activeTopBar.getShortTitle();
                Point size = e.gc.textExtent(s);
                e.gc.drawText(s, -size.x, 0, true);
                //e.gc.drawText(s, 0,0, true);
                transform.dispose();
              } catch (Exception ex) {
                // setTransform can trhow a ERROR_NO_GRAPHICS_LIBRARY error
                // no use trying to draw.. it would look weird
              }
              //font.dispose();
View Full Code Here


            if (i < maxLbl) {
                if (g.getFontMetrics().getHeight() < width
                        && c.getBounds().height
                           > g.getFontMetrics().getAverageCharWidth()
                                * binLabels[i].length()) {
                    Transform tr = new Transform(disp);
                    tr.rotate(-90.0f);
                    g.setTransform(tr);
                    Path p = new Path(disp);
                    p.addString(binLabels[i], -c.getBounds().height + 5,
                            x1 + (int) (0.5 * width) - 10, f);
                    g.fillPath(p);
                    tr.rotate(90.0f);
                    g.setTransform(tr);
                    tr.dispose();
                    p.dispose();
                }
                f.dispose();
            }
        }
View Full Code Here

            if (i < maxLbl) {
                if (g.getFontMetrics().getHeight() < width
                        && c.getBounds().height
                           > g.getFontMetrics().getAverageCharWidth()
                                * binLabels[i].length()) {
                    Transform tr = new Transform(disp);
                    tr.rotate(-90.0f);
                    g.setTransform(tr);
                    Path p = new Path(disp);
                    p.addString(binLabels[i], -c.getBounds().height + 5,
                            x1 + (int) (0.5 * width) - 10, f);
                    g.fillPath(p);
                    tr.rotate(90.0f);
                    g.setTransform(tr);
                    tr.dispose();
                    p.dispose();
                }
                f.dispose();
            }
        }
View Full Code Here

            gc.fillRectangle(gc.getClipping());
           
            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();
            waterColor.dispose();
        }
        catch (Throwable ex) {
            ex.printStackTrace();
        }
View Full Code Here

                e.x, e.y,
                (e.x + ARROW_WIDTH) / 2, e.y,
                e.x / 2, e.y + ARROW_HEIGHT,
                (e.x - ARROW_WIDTH) / 2, e.y,
                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);
        t.dispose();
        save.dispose();

        // TODO learn from class RenameInformationPopup how to open a custom popup, dream on...

    }
View Full Code Here

    public void paintChild(MapValues map, GC gc, Location each) {
        // draw background
        Device device = gc.getDevice();
       
        // get transform
        Transform save = new Transform(device);
        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);
        gc.drawPath(path);
       
        // restore old transform
        gc.setTransform(save);
        t.dispose();
        save.dispose();
    }
View Full Code Here

    gc.setForeground(foregroundColor);
    gc.setAlpha(alphaStroke);
  }

  public void pushMatrix() {
    Transform transform = new Transform(gc.getDevice());
    gc.getTransform(transform);
    stackMatrix.push(transform);
  }
View Full Code Here

    gc.getTransform(transform);
    stackMatrix.push(transform);
  }

  public void popMatrix() {
    Transform transform = stackMatrix.pop();
    gc.setTransform(transform);
  }
View Full Code Here

    Transform transform = stackMatrix.pop();
    gc.setTransform(transform);
  }

  public void rotate(double angle) {
    Transform transform = new Transform(gc.getDevice());
    Transform transform2 = new Transform(gc.getDevice());
    gc.getTransform(transform);
    transform2.rotate((float)angle);
    transform.multiply(transform2);
    gc.setTransform(transform);
  }
View Full Code Here

  }

  public void translate(double x, double y) {
    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);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.Transform

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.