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