1 |
mojays |
2 |
package appl.parallel.gui; |
2 |
|
|
|
3 |
|
|
import java.awt.Dimension; |
4 |
|
|
import java.awt.GridBagConstraints; |
5 |
|
|
import java.awt.GridBagLayout; |
6 |
|
|
import java.awt.Insets; |
7 |
|
|
|
8 |
|
|
import javax.swing.JPanel; |
9 |
|
|
import javax.swing.JTabbedPane; |
10 |
alfonx |
78 |
|
11 |
mojays |
2 |
import edu.bonn.xulu.XuluModellingPlatform; |
12 |
|
|
import edu.bonn.xulu.appl.XuluConstants; |
13 |
alfonx |
78 |
import edu.bonn.xulu.gui.ModelContentManagerContainer; |
14 |
mojays |
2 |
import edu.bonn.xulu.model.XuluModel; |
15 |
|
|
import edu.bonn.xulu.plugin.gui.ModelControlFrame_Basic; |
16 |
|
|
|
17 |
|
|
/** |
18 |
|
|
* This class introduces tab functionality into the ModelControlFrame |
19 |
|
|
* |
20 |
|
|
* @author Dominik Appl |
21 |
|
|
* @version 1.0 |
22 |
|
|
*/ |
23 |
|
|
public class ModelControlFrame_Tabbed extends ModelControlFrame_Basic implements |
24 |
|
|
XuluConstants { |
25 |
|
|
|
26 |
|
|
protected JTabbedPane tabbedPane; |
27 |
|
|
|
28 |
|
|
/** |
29 |
|
|
* Creates a new controlling window |
30 |
|
|
* |
31 |
|
|
* @param appl |
32 |
|
|
* application in which the model is executed |
33 |
|
|
* @param model |
34 |
|
|
* the model to be controlled through the frame |
35 |
|
|
*/ |
36 |
|
|
public ModelControlFrame_Tabbed(XuluModellingPlatform appl, XuluModel model) { |
37 |
|
|
super(appl, model); |
38 |
|
|
this.pack(); |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
/** |
42 |
|
|
* inits the content pane as tabbed pane with one tab (the resource mapping) |
43 |
|
|
* |
44 |
|
|
* @see edu.bonn.xulu.plugin.gui.ModelControlFrame_Basic#initContentPane() |
45 |
|
|
*/ |
46 |
|
|
@Override |
47 |
|
|
protected void initContentPane() { |
48 |
|
|
|
49 |
|
|
// ####### Daten-Komponente ####### |
50 |
|
|
contentContainer = new ModelContentManagerContainer(model |
51 |
|
|
.getContentManager(), appl.getDataPool()); |
52 |
|
|
tabbedPane = new JTabbedPane(JTabbedPane.TOP); |
53 |
|
|
tabbedPane.setPreferredSize(new Dimension((int) contentContainer |
54 |
|
|
.getPreferredSize().getWidth() + 5, (int) contentContainer |
55 |
|
|
.getPreferredSize().getHeight() + 25)); |
56 |
|
|
JPanel panel = new JPanel(new GridBagLayout()); |
57 |
|
|
|
58 |
|
|
panel.add(contentContainer, new GridBagConstraints(0, 1, 2, 1, 1.0, |
59 |
|
|
0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, |
60 |
|
|
new Insets(5, 5, 5, 5), 0, 25)); |
61 |
|
|
|
62 |
|
|
tabbedPane.addTab("Resource Mapping", panel); |
63 |
|
|
contentPane.add(tabbedPane, new GridBagConstraints(0, 1, 2, 1, 1.0, |
64 |
|
|
0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, |
65 |
|
|
new Insets(0, 0, 0, 0), 0, 0)); |
66 |
|
|
} |
67 |
|
|
|
68 |
|
|
@Override |
69 |
|
|
protected ModelControlFrame_Tabbed newInstance(XuluModel newModel) { |
70 |
|
|
return new ModelControlFrame_Tabbed(appl, newModel); |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
} |