1 package fi.jyu.mit.graphics;
2
3 import java.awt.Container;
4 import java.awt.event.ActionListener;
5
6 import javax.swing.*;
7
8
13 public class TransformButton extends JButton {
14
15 private static final long serialVersionUID = 1L;
16
17 private Matrix tM;
18
19
23 public TransformButton(String text) {
24 super(text);
25 }
26
27
31 public void setTransform(Matrix pM) {
32 this.tM = pM;
33 }
34
35
39 public Matrix getTransform() {
40 return this.tM;
41 }
42
43
51 public TransformButton set(Matrix pM,Container parent,Object constraints,ActionListener listener) {
52 setTransform(pM);
53 if ( parent != null ) parent.add(this,constraints);
54 addActionListener(listener);
55 return this;
56 }
57
58 }
59