/Users/lyon/j4p/src/j2d/gui/FalseColorToolbox.java
|
1 // Glenn Josefiak
2 // Fairfield University
3 // SW513
4 // Spring 2003
5
6 package j2d.gui;
7
8 import gui.run.ObservableSliderBank;
9
10 import javax.swing.*;
11 import java.awt.*;
12
13 /**
14 * A JInternalFrame containing sliders for manipulating false
15 * colors added to an image.
16 */
17 public class FalseColorToolbox extends JInternalFrame {
18 private ObservableSliderBank sbkRGBSliders;
19
20 /**
21 * Construct a new FalseColorToolbox.
22 */
23 public FalseColorToolbox() {
24 Container c;
25
26 sbkRGBSliders = new ObservableSliderBank(3);
27 sbkRGBSliders.setSliderLabel(0, "Red");
28 sbkRGBSliders.setSliderLabel(1, "Green");
29 sbkRGBSliders.setSliderLabel(2, "Blue");
30 for (int i = 0; i < 3; i++) {
31 sbkRGBSliders.setSliderRange(i, 0.01f, 0.4f);
32 sbkRGBSliders.setTickLabel(i, 0.01f, "0.01");
33 sbkRGBSliders.setTickLabel(i, 0.4f, "0.40");
34 }
35
36 c = getContentPane();
37 c.setLayout(new BorderLayout());
38 c.add(sbkRGBSliders, BorderLayout.CENTER);
39
40 setTitle("False Color");
41 setMinimumSize(new Dimension(150, 150));
42 pack();
43 setClosable(true);
44 setMaximizable(false);
45 setResizable(false);
46 }
47
48 /**
49 * Return a handle to the slider bank on the control panel.
50 *
51 * @return A reference to an ObservableSliderBank
52 */
53 public ObservableSliderBank getSliderBank() {
54 return sbkRGBSliders;
55 }
56 }
57