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