/Users/lyon/j4p/src/j2d/edge/gabor/GaborView.java
|
1 package j2d.edge.gabor;
2
3 import gui.run.RunSlider;
4
5 import javax.swing.*;
6
7
8 public class GaborView {
9 GaborParams gp = null;
10
11 GaborView(GaborParams _gp) {
12 gp = _gp;
13 init();
14 }
15
16
17 public void init() {
18 gui.ClosableJFrame cf = new gui.ClosableJFrame();
19 cf.setSize(200, 200);
20 java.awt.Container c = cf.getContentPane();
21 c.setLayout(new java.awt.FlowLayout());
22 thetaSlide(c);
23 lambdaSlide(c);
24 sigmaSlide(c);
25 phiSlide(c);
26 cf.setVisible(true);
27 }
28
29 private void thetaSlide(java.awt.Container c) {
30 c.add(new RunSlider(0, 180, gp.getTheta()) {
31 public void run() {
32 gp.setTheta(Math.PI * getValue() / 180.0);
33 }
34 });
35 c.add(new JLabel("theta"));
36 }
37
38
39 private void lambdaSlide(java.awt.Container c) {
40 c.add(new RunSlider(0, 100, gp.getLambda()) {
41 public void run() {
42 gp.setLambda(getValue());
43 }
44 });
45 c.add(new JLabel("lambda"));
46 }
47
48 private void phiSlide(java.awt.Container c) {
49 c.add(new RunSlider(-180, 180, gp.getPhi()) {
50 public void run() {
51 gp.setPhi(Math.PI * getValue() / 180.0);
52 }
53 });
54 c.add(new JLabel("phi"));
55 }
56
57 private void sigmaSlide(java.awt.Container c) {
58 c.add(new RunSlider(0, 100, gp.getSigma()) {
59 public void run() {
60 gp.setSigma(getValue());
61 }
62 });
63 c.add(new JLabel("sigma"));
64 }
65
66 }