forked from yannrichet/jmathplot
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDataPanel.java
More file actions
75 lines (58 loc) · 1.63 KB
/
DataPanel.java
File metadata and controls
75 lines (58 loc) · 1.63 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package org.math.plot;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import org.math.io.*;
import org.math.plot.components.*;
/**
* BSD License
*
* @author Yann RICHET
*/
public abstract class DataPanel extends JPanel implements ComponentListener, FilePrintable, ClipBoardPrintable, StringPrintable {
protected DataToolBar toolBar;
protected JScrollPane scrollPane;
public static int[] dimension = new int[]{400, 400};
public DataPanel() {
setLayout(new BorderLayout());
initToolBar();
init();
}
protected void initToolBar() {
toolBar = new DataToolBar(this);
add(toolBar, BorderLayout.NORTH);
toolBar.setFloatable(false);
}
protected void initSize() {
if (scrollPane != null) {
scrollPane.setSize(this.getSize());
}
// scrollPane.setPreferredSize(this.getSize());
}
protected void init() {
// initSize();
addComponentListener(this);
}
public void update() {
// this.remove(scrollPane);
toWindow();
repaint();
}
protected abstract void toWindow();
public abstract void toClipBoard();
public abstract void toASCIIFile(File file);
public void componentHidden(ComponentEvent e) {
}
public void componentMoved(ComponentEvent e) {
}
public void componentResized(ComponentEvent e) {
/*
* dimension = new int[] { (int) (this.getSize().getWidth()), (int)
* (this.getSize().getHeight()) };
*/
initSize();
}
public void componentShown(ComponentEvent e) {
}
}