1
2
3
4
5
6
7
8 package hoplugins.seriesstats.ui;
9
10 import hoplugins.Commons;
11 import hoplugins.SeriesStats;
12
13 import hoplugins.seriesstats.GraphicData;
14 import hoplugins.seriesstats.GraphicPanel;
15
16 import java.awt.BorderLayout;
17 import java.awt.Color;
18 import java.awt.GridBagConstraints;
19 import java.awt.GridBagLayout;
20 import java.awt.Insets;
21
22 import java.text.DecimalFormat;
23
24 import javax.swing.JPanel;
25
26
27 /***
28 * DOCUMENT ME!
29 *
30 * @author Mirtillo To change the template for this generated type comment go to
31 * Window>Preferences>Java>Code Generation>Code and Comments
32 */
33 public class GeneralPanelTab extends JPanel implements RefreshablePanel {
34
35
36
37 private GraphicPanel PanelGeneralGP;
38
39
40
41 /***
42 * Creates a new GeneralPanelTab object.
43 */
44 public GeneralPanelTab() {
45
46 JPanel PanelGeneral = Commons.getModel().getGUI().createImagePanel();
47 PanelGeneral.setOpaque(false);
48
49
50 GridBagLayout gridbaglayout = new GridBagLayout();
51 GridBagConstraints gridbagconstraints = new GridBagConstraints();
52 PanelGeneral.setLayout(gridbaglayout);
53
54
55 gridbagconstraints.fill = 1;
56 gridbagconstraints.gridx = 0;
57 gridbagconstraints.gridy = 0;
58 gridbagconstraints.weightx = 0.1;
59 gridbagconstraints.weighty = 0.4;
60 gridbagconstraints.anchor = GridBagConstraints.PAGE_START;
61 gridbagconstraints.insets = new Insets(2, 0, 2, 0);
62 PanelGeneral.add(new LegendaPanel(this, true), gridbagconstraints);
63
64
65 JPanel PanelDummy = Commons.getModel().getGUI().createImagePanel();
66 gridbagconstraints.gridx = 0;
67 gridbagconstraints.gridy = 1;
68 gridbagconstraints.weighty = 1.0D;
69 gridbagconstraints.weightx = 0D;
70 gridbagconstraints.anchor = 11;
71 gridbagconstraints.fill = 1;
72 PanelGeneral.add(PanelDummy, gridbagconstraints);
73
74
75 gridbagconstraints.fill = 1;
76 gridbagconstraints.gridx = 1;
77 gridbagconstraints.gridy = 0;
78 gridbagconstraints.gridheight = 2;
79 gridbagconstraints.weighty = 1.0D;
80 gridbagconstraints.weightx = 1.0D;
81 gridbagconstraints.anchor = 11;
82 PanelGeneral.add(PanelGeneralGraphic(), gridbagconstraints);
83
84
85 gridbagconstraints.fill = GridBagConstraints.HORIZONTAL;
86 gridbagconstraints.gridx = 0;
87 gridbagconstraints.gridy = 2;
88 gridbagconstraints.gridwidth = 2;
89 gridbagconstraints.weighty = 0;
90 gridbagconstraints.weightx = 0;
91
92 PanelGeneral.add(new BottomPanel(), gridbagconstraints);
93
94 setLayout(new BorderLayout());
95 add(PanelGeneral, BorderLayout.CENTER);
96 }
97
98
99
100 /***
101 * TODO Missing Method Documentation
102 */
103 public void refresh() {
104
105 System.out.println("GeneralPanel Tab Refresh");
106 }
107
108 /***
109 * TODO Missing Method Documentation
110 *
111 * @return TODO Missing Return Method Documentation
112 */
113 private JPanel PanelGeneralGraphic() {
114 JPanel d2 = new JPanel();
115 d2.setLayout(new BorderLayout());
116 PanelGeneralGP = new GraphicPanel(true);
117
118 try {
119
120 DecimalFormat format = new DecimalFormat("#0.00");
121
122 GraphicData[] ax = new GraphicData[8];
123
124 if (ax.length > 0) {
125 double[] x = {1.0f};
126
127 ax[0] = new GraphicData(x, "Bewertung", true, Color.black, format);
128 ax[1] = new GraphicData(x, "Mittelfeld", true, Color.black, format);
129 ax[2] = new GraphicData(x, "RechteAbwehr", true, Color.black, format);
130 ax[3] = new GraphicData(x, "Abwehrzentrum", true, Color.black, format);
131 ax[4] = new GraphicData(x, "LinkeAbwehr", false, Color.black, format);
132 ax[5] = new GraphicData(x, "RechterAngriff", false, Color.black, format);
133 ax[6] = new GraphicData(x, "Angriffszentrum", false, Color.black, format);
134 ax[7] = new GraphicData(x, "LinkerAngriff", false, Color.black, format);
135 }
136
137 String[] as = {"String1", "String2"};
138 PanelGeneralGP.setAllValues(ax, as, format,
139 Commons.getModel().getResource().getProperty("Spiele") + "", "", true,
140 true);
141 } catch (Exception e) {
142 if (true) {
143 SeriesStats.getIDB().append("---ooo---");
144 SeriesStats.getIDB().append(e);
145 }
146 }
147
148 d2.add(PanelGeneralGP);
149 return d2;
150 }
151 }