View Javadoc

1   // %815048719:hoplugins.teamAnalyzer.ui.lineup%
2   package hoplugins.teamAnalyzer.ui.lineup;
3   
4   import java.awt.BorderLayout;
5   import java.awt.GridBagConstraints;
6   import java.awt.Insets;
7   
8   
9   /***
10   * This is an empty panel to display a lineup in mixed style
11   *
12   * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
13   */
14  public class MixedLineupPanel extends LineupStylePanel {
15      //~ Constructors -------------------------------------------------------------------------------
16  
17      /***
18       * Constructor
19       *
20       * @param _mainPanel the main formation planel
21       */
22      public MixedLineupPanel(FormationPanel _mainPanel) {
23          super(_mainPanel);
24      }
25  
26      //~ Methods ------------------------------------------------------------------------------------
27  
28      //--------------------------------------------------------------------------
29  
30      /***
31       * Setup the layout, with 2 teams displayed
32       */
33      public void initCompare() {
34          centerPanel.removeAll();
35          setLayout(new BorderLayout());
36          setOpaque(false);
37          centerPanel.setOpaque(false);
38  
39          constraints.anchor = GridBagConstraints.CENTER;
40          constraints.fill = GridBagConstraints.NONE;
41          constraints.weightx = 0.0;
42          constraints.weighty = 0.0;
43          constraints.insets = new Insets(0, 0, 0, 0);
44          centerPanel.setLayout(layout);
45  
46          setOpponentPanel(0);
47  
48          setOpponentKeeper(1);
49          setOpponentDefence(2);
50          setRatingBar1(3);
51          setMyAttack(4);
52  
53          setOpponentMidfield(5);
54          setMidfieldRatingBar(6);
55          setMyMidfield(7);
56  
57          setOpponentAttack(8);
58          setRatingBar2(9);
59          setMyDefence(10);
60          setMyKeeper(11);
61  
62          setMyPanel(12);
63  
64          add(centerPanel, BorderLayout.CENTER);
65      }
66  
67      /***
68       * Setup the layout, with only 1 team displayed
69       */
70      public void initSingle() {
71          centerPanel.removeAll();
72  
73          setLayout(new BorderLayout());
74          setOpaque(false);
75          centerPanel.setOpaque(false);
76  
77          constraints.anchor = GridBagConstraints.CENTER;
78          constraints.fill = GridBagConstraints.NONE;
79          constraints.weightx = 0.0;
80          constraints.weighty = 0.0;
81          constraints.insets = new Insets(2, 2, 2, 2);
82          centerPanel.setLayout(layout);
83  
84          setOpponentPanel(0);
85          setOpponentKeeper(1);
86          setOpponentDefence(2);
87          setOpponentMidfield(3);
88          setOpponentAttack(4);
89  
90          add(centerPanel, BorderLayout.CENTER);
91      }
92  }