forked from yannrichet/jmathplot
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFrameView.java
More file actions
61 lines (51 loc) · 1.15 KB
/
FrameView.java
File metadata and controls
61 lines (51 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package org.math.plot;
import javax.swing.*;
import org.math.plot.canvas.*;
/**
* BSD License
*
* @author Yann RICHET
*/
public class FrameView extends JFrame {
private static final long serialVersionUID = 1L;
public FrameView(Plot2DCanvas... canvas) {
JPanel panel = new JPanel();
for (int i = 0; i < canvas.length; i++)
panel.add(new Plot2DPanel(canvas[i]));
setContentPane(panel);
pack();
setSize(600,600);
setVisible(true);
}
public FrameView(Plot3DCanvas... canvas) {
JPanel panel = new JPanel();
for (int i = 0; i < canvas.length; i++)
panel.add(new Plot3DPanel(canvas[i]));
setContentPane(panel);
pack();
setSize(600,600);
setVisible(true);
}
public FrameView(String title, JComponent panel) {
super(title);
setContentPane(panel);
pack();
setSize(600,600);
setVisible(true);
}
public FrameView(JComponent... panels) {
JPanel panel = new JPanel();
for (int i = 0; i < panels.length; i++)
panel.add(panels[i]);
setContentPane(panel);
pack();
setSize(600,600);
setVisible(true);
}
public FrameView(JPanel panel) {
setContentPane(panel);
pack();
setSize(600,600);
setVisible(true);
}
}