Examples of rotate()


Examples of java.awt.geom.AffineTransform.rotate()

      switch (rotation) {
      case CLOCKWISE:
        // Reminder: newWidth == result.getHeight() at this point
        tx.translate(newWidth, 0);
        tx.rotate(Math.toRadians(90));

        break;

      case COUNTER_CLOCKWISE:
        // Reminder: newHeight == result.getWidth() at this point
View Full Code Here

Examples of java.awt.geom.AffineTransform.rotate()

        break;

      case COUNTER_CLOCKWISE:
        // Reminder: newHeight == result.getWidth() at this point
        tx.translate(0, newHeight);
        tx.rotate(Math.toRadians(-90));
        break;

      case FLIP:
        /*
         * This is the one rotation case where the new width and height
View Full Code Here

Examples of java.awt.geom.AffineTransform.rotate()

         */
        newWidth = result.getWidth();
        newHeight = result.getHeight();

        tx.translate(newWidth, newHeight);
        tx.rotate(Math.toRadians(180));
        break;
      }

      /*
       * Create our target image we will render the rotated result to. At
View Full Code Here

Examples of java.awt.geom.AffineTransform.rotate()

      // Transform length text bounding rectangle corners to their real location
      double angle = Math.atan2(dimensionLine.getYEnd() - dimensionLine.getYStart(),
          dimensionLine.getXEnd() - dimensionLine.getXStart());
      AffineTransform transform = new AffineTransform();
      transform.translate(dimensionLine.getXStart(), dimensionLine.getYStart());
      transform.rotate(angle);
      transform.translate(0, dimensionLine.getOffset());
      transform.translate((dimensionLineLength - lengthTextBounds.getWidth()) / 2,
          dimensionLine.getOffset() <= 0
              ? -lengthFontMetrics.getDescent() - 1
              : lengthFontMetrics.getAscent() + 1);
View Full Code Here

Examples of java.awt.geom.AffineTransform.rotate()

        it.next();
      }
      // Add to bounds the end lines drawn at dimension line start and end 
      transform = new AffineTransform();
      transform.translate(dimensionLine.getXStart(), dimensionLine.getYStart());
      transform.rotate(angle);
      transform.translate(0, dimensionLine.getOffset());
      for (PathIterator it = DIMENSION_LINE_END.getPathIterator(transform); !it.isDone(); ) {
        float [] pathPoint = new float[2];
        if (it.currentSegment(pathPoint) != PathIterator.SEG_CLOSE) {
          itemBounds.add(pathPoint [0], pathPoint [1]);
View Full Code Here

Examples of java.awt.geom.AffineTransform.rotate()

          yLabel + labelFontMetrics.getDescent());
    } else if (item instanceof Compass) {
      Compass compass = (Compass)item;
      AffineTransform transform = AffineTransform.getTranslateInstance(compass.getX(), compass.getY());
      transform.scale(compass.getDiameter(), compass.getDiameter());
      transform.rotate(compass.getNorthDirection());
      return COMPASS.createTransformedShape(transform).getBounds2D();
    }
    return itemBounds;
  }
 
View Full Code Here

Examples of java.awt.geom.AffineTransform.rotate()

          {x - halfTextLength, y + (float)textBounds.getHeight() - textBaseLine}};
    } else {
      // Transform text bounding rectangle corners to their real location
      AffineTransform transform = new AffineTransform();
      transform.translate(x - halfTextLength, y + (float)textBounds.getHeight() - textBaseLine);
      transform.rotate(angle);
      GeneralPath textBoundsPath = new GeneralPath(textBounds);
      List<float []> textPoints = new ArrayList<float[]>(4);
      for (PathIterator it = textBoundsPath.getPathIterator(transform); !it.isDone(); ) {
        float [] pathPoint = new float[2];
        if (it.currentSegment(pathPoint) != PathIterator.SEG_CLOSE) {
View Full Code Here

Examples of java.awt.geom.AffineTransform.rotate()

    Arc2D arc = new Arc2D.Float(xAxis - sashWidth, yAxis - sashWidth,
        2 * sashWidth, 2 * sashWidth,
        startAngle, extentAngle, Arc2D.PIE);
    AffineTransform transformation = new AffineTransform();
    transformation.translate(doorOrWindow.getX(), doorOrWindow.getY());
    transformation.rotate(doorOrWindow.getAngle());
    transformation.translate(modelMirroredSign * -doorOrWindow.getWidth() / 2, -doorOrWindow.getDepth() / 2);
    PathIterator it = arc.getPathIterator(transformation);
    GeneralPath sashShape = new GeneralPath();
    sashShape.append(it, false);
    return sashShape;
View Full Code Here

Examples of java.awt.geom.AffineTransform.rotate()

        oldTransform = g.getTransform();
        AffineTransform transform = new AffineTransform();
        if (slider.getOrientation() == GradientSlider.VERTICAL) {
            if (slider.isInverted()) {
                transform.rotate(Math.PI / 2, trackRect.x, trackRect.y);
            } else {
                transform.rotate(-Math.PI / 2, trackRect.x, trackRect.y + trackRect.height);
            }
        } else {
            if (slider.isInverted()) {
View Full Code Here

Examples of java.awt.geom.AffineTransform.rotate()

        AffineTransform transform = new AffineTransform();
        if (slider.getOrientation() == GradientSlider.VERTICAL) {
            if (slider.isInverted()) {
                transform.rotate(Math.PI / 2, trackRect.x, trackRect.y);
            } else {
                transform.rotate(-Math.PI / 2, trackRect.x, trackRect.y + trackRect.height);
            }
        } else {
            if (slider.isInverted()) {
                //flip horizontal:
                double x1 = trackRect.x;
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.