1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
public void Design2() {
setLayout(new GridBagLayout());
setBorder(BorderFactory.createRaisedBevelBorder());
for (int indx = 0; indx < lbl.length; indx++) {
// Led les alarmes
m_LedAlarme[indx] = new Led();
m_LedAlarme[indx].setLedColor(LedColor.RED);
org.jdesktop.layout.GroupLayout ledLayout = new org.jdesktop.layout.GroupLayout(
m_LedAlarme[indx]);
ledLayout.setHorizontalGroup(ledLayout.createParallelGroup(
org.jdesktop.layout.GroupLayout.LEADING).add(0, 48,
Short.MAX_VALUE));
ledLayout.setVerticalGroup(ledLayout.createParallelGroup(
org.jdesktop.layout.GroupLayout.LEADING).add(0, 48,
Short.MAX_VALUE));
m_LedAlarme[indx].setLayout(ledLayout);
m_LedAlarme[indx].setMinimumSize(new Dimension(48, 48));
GridBagConstraints gbcS = new GridBagConstraints();
gbcS.gridx = 2 * indx;
gbcS.gridy = 1;
gbcS.gridwidth = 1;
gbcS.gridheight = 1;
gbcS.anchor = GridBagConstraints.LINE_END;
gbcS.fill = GridBagConstraints.NONE;
gbcS.insets = new Insets(5, 5, 5, 5);
gbcS.weightx = 0.0;
gbcS.weighty = 0.0;
add(m_LedAlarme[indx], gbcS);
// Label contenant le nom du server
m_Label[indx] = new JLabel(lbl[indx]);
GridBagConstraints gbcL = new GridBagConstraints();
gbcL.gridx = 2 * indx + 1;
gbcL.gridy = 1;
gbcL.gridwidth = 1;
gbcL.gridheight = 1;
gbcL.anchor = GridBagConstraints.LINE_START;
gbcL.fill = GridBagConstraints.NONE;
gbcL.insets = new Insets(5, 5, 5, 5);
gbcL.weightx = 0.0;
gbcL.weighty = 0.0;
add(m_Label[indx], gbcL);
}
GridBagConstraints gbcLt = new GridBagConstraints();
gbcLt.gridx = 2 * lbl.length + 1;
gbcLt.gridy = 1;
gbcLt.gridwidth = 1;
gbcLt.gridheight = 1;
gbcLt.anchor = GridBagConstraints.CENTER;
gbcLt.fill = GridBagConstraints.NONE;
gbcLt.insets = new Insets(5, 5, 5, 5);
gbcLt.weightx = 1.0;
gbcLt.weighty = 0.0;
add(new JLabel(""), gbcLt);
JLabel Titre = new JLabel("Stabilisation");
GridBagConstraints gbcT = new GridBagConstraints();
gbcT.gridx = 1;
gbcT.gridy = 0;
gbcT.gridwidth = 1;
gbcT.gridheight = 1;
gbcT.anchor = GridBagConstraints.LINE_END;
gbcT.fill = GridBagConstraints.NONE;
gbcT.insets = new Insets(5, 5, 5, 5);
gbcT.weightx = 0.0;
gbcT.weighty = 0.0;
add(Titre, gbcT);
m_LedStabON = new Led();
m_LedStabON.setLedColor(LedColor.GREEN);
org.jdesktop.layout.GroupLayout ledLayout = new org.jdesktop.layout.GroupLayout(
m_LedStabON);
ledLayout.setHorizontalGroup(ledLayout.createParallelGroup(
org.jdesktop.layout.GroupLayout.LEADING).add(0, 48,
Short.MAX_VALUE));
ledLayout.setVerticalGroup(ledLayout.createParallelGroup(
org.jdesktop.layout.GroupLayout.LEADING).add(0, 48,
Short.MAX_VALUE));
m_LedStabON.setLayout(ledLayout);
m_LedStabON.setMinimumSize(new Dimension(48, 48));
GridBagConstraints gbcS = new GridBagConstraints();
gbcS.gridx = 2;
gbcS.gridy = 0;
gbcS.gridwidth = 1;
gbcS.gridheight = 1;
gbcS.anchor = GridBagConstraints.LINE_START;
gbcS.fill = GridBagConstraints.NONE;
gbcS.insets = new Insets(5, 5, 5, 5);
gbcS.weightx = 1.0;
gbcS.weighty = 0.0;
add(m_LedStabON, gbcS);
} |
Partager