transform.java

来自「java 图形处理」· Java 代码 · 共 34 行

JAVA
34
字号
//package paint2d;

import java.awt.*;
import java.awt.geom.*;

/** A Transform is a Picture that consists of
    another picture with an affine transformation
    applied to it.
*/ 

public class Transform extends Picture {

   private Picture pic;
   private AffineTransform trans;

   /** Create Picture consisting of picture p
       with tramsformation t applied to it.
   */
   public Transform(Picture p, AffineTransform t) {
      pic = p;
      trans = t;
   }

   /** Apply transformation t to this Transform picture,
       and display it using graphics g2.
   */
   public void transDisplay
      (AffineTransform t, Graphics2D g2) {
      AffineTransform combined =  new AffineTransform(t);
      combined.concatenate(trans);
      pic.transDisplay(combined, g2);
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?