Package java.awt

Examples of java.awt.Graphics2D.rotate()


        g2.draw(new Rectangle2D.Float(0, 0, rfm.maxBoundsWidth, lineHeight));
      }
      // end DEBUG
      int mid = (lineHeight) / 2;
      g2.translate(rfm.maxBoundsWidth / 2, mid);
      g2.rotate(angle);
      // DEBUG section
      if (DEBUG) {
        g2.setColor(Color.red);

        g2.draw(new Rectangle2D.Double(-1, -1, 1, 1));
View Full Code Here


            g2d.setRenderingHint(key, hints.get(key));
        }

        // set transform
        g2d.translate(trans.getTranslation().getX(), trans.getTranslation().getY());
        g2d.rotate(trans.getMatrix().toAngles(null)[2]); // rotation about z
        g2d.scale(trans.getScale().getX(), trans.getScale().getY());

        // set composite
        if (_compositeOverride != null) {
            g2d.setComposite(_compositeOverride);
View Full Code Here

            g2d.setRenderingHint(key, hints.get(key));
        }

        // set transform
        g2d.translate(trans.getTranslation().getX(), trans.getTranslation().getY());
        g2d.rotate(trans.getMatrix().toAngles(null)[2]); // rotation about z
        g2d.scale(trans.getScale().getX(), trans.getScale().getY());

        // set composite
        if (_compositeOverride != null) {
            g2d.setComposite(_compositeOverride);
View Full Code Here

    // Un rectangulo para depuracion
    gr.drawRect(0, 0, width - 1, height - 1);

    // Lo transformamos
    gr.translate((int) (width / 2.0), (int) (height / 2.0));
    gr.rotate(Math.PI / 2 * this.rotation);

    // Rescatamos el descriptor de la compuerta y lo usamos para pintar
    GateDescriptor gateDesc = gate.getGateDescriptor();

    // Invocamos el paint
View Full Code Here

                BorderPainter painter = getBorderPainter(i);

                double angle = i * Math.PI / 2;
                g2.setClip(g.getClip()); // Restore initial clip
                g2.translate(intCorners[i][0], intCorners[i][1]);
                g2.rotate(angle);
                g2.clip(shape);
                painter.paint(shape, g2, color, i);
                g2.rotate(-angle);
                g2.translate(-intCorners[i][0], -intCorners[i][1]);
            }
View Full Code Here

                g2.setClip(g.getClip()); // Restore initial clip
                g2.translate(intCorners[i][0], intCorners[i][1]);
                g2.rotate(angle);
                g2.clip(shape);
                painter.paint(shape, g2, color, i);
                g2.rotate(-angle);
                g2.translate(-intCorners[i][0], -intCorners[i][1]);
            }
        }
        g2.dispose();
    }
View Full Code Here

                    dataRenderer.setSize(Math.max(contentWidth, 0),
                        Math.max(getWidth() - (buttonPadding.left + buttonPadding.right + 2), 0));

                    contentGraphics.translate(buttonPadding.top + 1, buttonPadding.left + 1);
                    contentGraphics.rotate(-Math.PI / 2d);
                    contentGraphics.translate(-dataRenderer.getWidth(), 0);

                    break;
                }
            }
View Full Code Here

            for (int i = 0; i < c; i++) {
                float f = ((i + 1) / (float)c);
                Color col = new Color(0.0f, 1 - f, 0.0f);
                copy.setColor(col);
                copy.fillRect(70, 90, 50, 50);
                copy.rotate(-2 * Math.PI / (double)c, 70, 90);
            }
            copy.dispose();

            //Some text
            g2d.rotate(-0.25);
View Full Code Here

        for (int i = 0; i < c; i++) {
            float f = ((i + 1) / (float)c);
            Color col = new Color(0.0f, 1 - f, 0.0f);
            copy.setColor(col);
            copy.fillRect(70, 90, 50, 50);
            copy.rotate(-2 * Math.PI / (double)c, 70, 90);
        }
        copy.dispose();

        //Some text
        copy = (Graphics2D)g2d.create();
View Full Code Here

        }
        copy.dispose();

        //Some text
        copy = (Graphics2D)g2d.create();
        copy.rotate(-0.25);
        copy.setColor(Color.RED);
        copy.setFont(new Font("sans-serif", Font.PLAIN, 36));
        copy.drawString("Hello world!", 140, 140);
        copy.setColor(Color.RED.darker());
        copy.setFont(new Font("serif", Font.PLAIN, 36));
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.