List of usage examples for java.awt Graphics2D setTransform
public abstract void setTransform(AffineTransform Tx);
From source file:Main.java
public void paint(Graphics g) { Shape shape = new Rectangle2D.Float(100, 50, 80, 80); Graphics2D g2 = (Graphics2D) g; AffineTransform at = AffineTransform.getRotateInstance(-Math.PI / 6); g2.setTransform(at); g2.draw(shape);/*from ww w.j a va 2s .co m*/ }
From source file:Main.java
public void paint(Graphics g) { Shape shape = new Rectangle2D.Float(100, 50, 80, 80); Graphics2D g2 = (Graphics2D) g; AffineTransform at = new AffineTransform(); at.rotate(0.5);/*from w w w . ja v a 2s . c o m*/ g2.setTransform(at); g2.draw(shape); }
From source file:MainClass.java
public void paint(Graphics g) { Shape shape = new Rectangle2D.Float(100, 50, 80, 80); Graphics2D g2 = (Graphics2D) g; AffineTransform at = new AffineTransform(); at.shear(-.5, 0);/*from w w w . j a v a 2 s .c o m*/ g2.setTransform(at); g2.draw(shape); }
From source file:AffineTransformGetScaleInstance.java
public void paint(Graphics g) { AffineTransform atrans = null; Graphics2D g2d = (Graphics2D) g; atrans = AffineTransform.getScaleInstance(2, 3); if (atrans != null) g2d.setTransform(atrans); g2d.fillRect(50, 50, 100, 50);// w w w . j a v a2 s. co m }
From source file:Main.java
public void paint(Graphics g) { Shape shape = new Rectangle2D.Float(100, 50, 80, 80); Graphics2D g2 = (Graphics2D) g; AffineTransform at = new AffineTransform(); at.scale(0.3, 0.2);/*from www . j ava 2 s . c om*/ g2.setTransform(at); g2.draw(shape); }
From source file:AffineTransformGetShearInstance.java
public void paint(Graphics g) { AffineTransform atrans = null; Graphics2D g2d = (Graphics2D) g; atrans = AffineTransform.getShearInstance(.1, .5); if (atrans != null) g2d.setTransform(atrans); g2d.fillRect(50, 50, 100, 50);/* w w w. j a v a2 s . c om*/ }
From source file:Main.java
public void paint(Graphics g) { Shape shape = new Rectangle2D.Float(100, 50, 80, 80); Graphics2D g2 = (Graphics2D) g; AffineTransform at = new AffineTransform(); at.rotate(0.5, 0.3);//from w w w. j a va2s .c o m g2.setTransform(at); g2.draw(shape); }
From source file:BasicDraw.java
public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; AffineTransform at = new AffineTransform(); at.setToRotation(Math.PI / 4.0); g2d.setTransform(at); g2d.drawString("aString", 200, 100); }
From source file:Main.java
public void paint(Graphics g) { Shape shape = new Rectangle2D.Float(100, 50, 80, 80); Graphics2D g2 = (Graphics2D) g; AffineTransform at = new AffineTransform(); at.rotate(0.2, 0.5, 0.3);//from w ww .j av a2s . c om g2.setTransform(at); g2.draw(shape); }
From source file:Main.java
public void paint(Graphics g) { Shape shape = new Rectangle2D.Float(100, 50, 80, 80); Graphics2D g2 = (Graphics2D) g; AffineTransform at = new AffineTransform(); at.setToQuadrantRotation(2);/*from w ww.ja va 2 s. co m*/ g2.setTransform(at); g2.draw(shape); }