]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdPlatformDefs.java
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@710 6f19259b...
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdPlatformDefs.java
1 /** @file
2 Java class FpdPlatformDefs is GUI for Flash element operation in SPD file.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 **/
13 package org.tianocore.frameworkwizard.platform.ui;
14
15 import java.awt.BorderLayout;
16 import javax.swing.JPanel;
17
18 import javax.swing.DefaultCellEditor;
19 import javax.swing.DefaultListModel;
20 import javax.swing.JFrame;
21 import javax.swing.JTabbedPane;
22 import javax.swing.JButton;
23
24 import org.tianocore.PlatformSurfaceAreaDocument;
25 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
26
27
28 import java.awt.FlowLayout;
29
30
31 import javax.swing.JCheckBox;
32 import javax.swing.JTextField;
33 import javax.swing.JLabel;
34 import javax.swing.JScrollPane;
35 import javax.swing.JTable;
36 import javax.swing.event.InternalFrameAdapter;
37 import javax.swing.event.InternalFrameEvent;
38 import javax.swing.event.ListSelectionEvent;
39 import javax.swing.event.ListSelectionListener;
40 import javax.swing.event.TableModelEvent;
41 import javax.swing.event.TableModelListener;
42 import javax.swing.table.DefaultTableModel;
43 import javax.swing.table.TableColumn;
44 import javax.swing.table.TableModel;
45 import javax.swing.JComboBox;
46 import java.awt.Dimension;
47 import javax.swing.JRadioButton;
48 import javax.swing.JTextArea;
49 import java.awt.CardLayout;
50
51 public class FpdPlatformDefs extends IInternalFrame {
52
53 /**
54 *
55 */
56 private static final long serialVersionUID = 1L;
57 static JFrame frame;
58 private JPanel jContentPane = null;
59 private JPanel jPanel = null;
60 private JPanel jPanel1 = null;
61 private JPanel jPanel2 = null;
62 private JPanel jPanel3 = null;
63 private JTabbedPane jTabbedPane = null;
64 private JButton jButtonOk = null;
65 private JButton jButtonCancel = null;
66 private JPanel jPanelFvImageW = null;
67 private JScrollPane jScrollPane = null;
68 private DefaultTableModel imageEntryPointTableModel = null;
69 private DefaultTableModel outputDirectoryTableModel = null;
70
71 private DefaultTableModel skuInfoTableModel = null;
72 private DefaultTableModel fdfBlocksTableModel = null;
73 private DefaultTableModel fdfRegionsTableModel = null;
74 private DefaultTableModel fdfSubRegionsTableModel = null;
75
76 private JLabel jLabel17 = null;
77 private DefaultListModel listModel = new DefaultListModel();
78 private FpdFileContents ffc = null;
79 private JPanel jPanel4 = null;
80 private JPanel jPanel5 = null;
81 private JLabel jLabel = null;
82 private JCheckBox jCheckBox1 = null;
83 private JCheckBox jCheckBox2 = null;
84 private JCheckBox jCheckBox3 = null;
85 private JPanel jPanel6 = null;
86 private JLabel jLabel1 = null;
87 private JCheckBox jCheckBox4 = null;
88 private JComboBox jComboBox = null;
89 private JTextField jTextField = null;
90 private JTable jTable = null;
91 private JPanel jPanel7 = null;
92 private JLabel jLabel2 = null;
93 private JTextField jTextField1 = null;
94 private JButton jButton2 = null;
95 private JButton jButton3 = null;
96 private JScrollPane jScrollPane2 = null;
97 private JTable jTable1 = null;
98 private JLabel jLabel3 = null;
99 private JScrollPane jScrollPane3 = null;
100 private JTable jTable2 = null;
101 private JLabel jLabel4 = null;
102 private JTextField jTextField2 = null;
103 private JLabel jLabel5 = null;
104 private JTextField jTextField3 = null;
105 private JLabel jLabel6 = null;
106 private JButton jButton4 = null;
107 private JButton jButton5 = null;
108 private JLabel jLabel7 = null;
109 public FpdPlatformDefs() {
110 super();
111 // TODO Auto-generated constructor stub
112
113 initialize();
114 this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
115 this.setVisible(true);
116 }
117
118 public FpdPlatformDefs(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd){
119 this();
120 ffc = new FpdFileContents(fpd);
121 init(ffc);
122 }
123
124 /**
125 * This method initializes jPanel
126 *
127 * @return javax.swing.JPanel
128 */
129 private JPanel getJPanel() {
130 if (jPanel == null) {
131 jPanel = new JPanel();
132 }
133 return jPanel;
134 }
135
136 /**
137 * This method initializes jPanel1
138 *
139 * @return javax.swing.JPanel
140 */
141 private JPanel getJPanel1() {
142 if (jPanel1 == null) {
143 FlowLayout flowLayout = new FlowLayout();
144 flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
145 flowLayout.setHgap(15);
146 jPanel1 = new JPanel();
147 jPanel1.setLayout(flowLayout);
148 jPanel1.setComponentOrientation(java.awt.ComponentOrientation.LEFT_TO_RIGHT);
149 jPanel1.add(getJButtonCancel(), null);
150 jPanel1.add(getJButtonOk(), null);
151 }
152 return jPanel1;
153 }
154
155 /**
156 * This method initializes jPanel2
157 *
158 * @return javax.swing.JPanel
159 */
160 private JPanel getJPanel2() {
161 if (jPanel2 == null) {
162 jPanel2 = new JPanel();
163 }
164 return jPanel2;
165 }
166
167 /**
168 * This method initializes jPanel3
169 *
170 * @return javax.swing.JPanel
171 */
172 private JPanel getJPanel3() {
173 if (jPanel3 == null) {
174 jPanel3 = new JPanel();
175 }
176 return jPanel3;
177 }
178
179 /**
180 * This method initializes jTabbedPane
181 *
182 * @return javax.swing.JTabbedPane
183 */
184 private JTabbedPane getJTabbedPane() {
185 if (jTabbedPane == null) {
186 jTabbedPane = new JTabbedPane();
187
188 jTabbedPane.addTab("General", null, getJPanel4(), null);
189
190 }
191 return jTabbedPane;
192 }
193
194 /**
195 * This method initializes jButtonOk
196 *
197 * @return javax.swing.JButton
198 */
199 private JButton getJButtonOk() {
200 if (jButtonOk == null) {
201 jButtonOk = new JButton();
202 jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));
203 jButtonOk.setText("Cancel");
204 jButtonOk.setVisible(false);
205 }
206 return jButtonOk;
207 }
208
209 /**
210 * This method initializes jButtonCancel
211 *
212 * @return javax.swing.JButton
213 */
214 private JButton getJButtonCancel() {
215 if (jButtonCancel == null) {
216 jButtonCancel = new JButton();
217 jButtonCancel.setPreferredSize(new java.awt.Dimension(80,20));
218 jButtonCancel.setText("Ok");
219 jButtonCancel.setVisible(false);
220 }
221 return jButtonCancel;
222 }
223
224 /**
225 * This method initializes jPanelFvImageW
226 *
227 * @return javax.swing.JPanel
228 */
229 private JPanel getJPanelFvImageW() {
230 if (jPanelFvImageW == null) {
231 jPanelFvImageW = new JPanel();
232 jPanelFvImageW.setPreferredSize(new java.awt.Dimension(10,2));
233 }
234 return jPanelFvImageW;
235 }
236
237
238 /**
239 * This method initializes this
240 *
241 * @return void
242 */
243 private void initialize() {
244 this.setSize(518, 650);
245 this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
246 this.setContentPane(getJContentPane());
247 this.setTitle("FPD Platform Definitions");
248 this.addInternalFrameListener(new InternalFrameAdapter(){
249 public void internalFrameDeactivated(InternalFrameEvent e){
250 if (jTable.isEditing()) {
251 jTable.getCellEditor().stopCellEditing();
252 }
253 if (jTable2.isEditing()) {
254 jTable2.getCellEditor().stopCellEditing();
255 }
256
257 }
258 });
259 }
260
261 private void init(FpdFileContents ffc) {
262
263 }
264
265
266
267 /**
268 * This method initializes jContentPane
269 *
270 * @return javax.swing.JPanel
271 */
272 private JPanel getJContentPane() {
273 if (jContentPane == null) {
274 jContentPane = new JPanel();
275 jContentPane.setLayout(new BorderLayout());
276 jContentPane.add(getJPanel(), java.awt.BorderLayout.EAST);
277 jContentPane.add(getJPanel1(), java.awt.BorderLayout.SOUTH);
278 jContentPane.add(getJPanel2(), java.awt.BorderLayout.WEST);
279 jContentPane.add(getJPanel3(), java.awt.BorderLayout.NORTH);
280 jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
281 }
282 return jContentPane;
283 }
284
285 /**
286 * This method initializes jPanel4
287 *
288 * @return javax.swing.JPanel
289 */
290 private JPanel getJPanel4() {
291 if (jPanel4 == null) {
292 jPanel4 = new JPanel();
293 jPanel4.setLayout(new BorderLayout());
294 jPanel4.add(getJPanel5(), java.awt.BorderLayout.NORTH);
295 jPanel4.add(getJPanel6(), java.awt.BorderLayout.SOUTH);
296 jPanel4.add(getJPanel7(), java.awt.BorderLayout.CENTER);
297 }
298 return jPanel4;
299 }
300
301 /**
302 * This method initializes jPanel5
303 *
304 * @return javax.swing.JPanel
305 */
306 private JPanel getJPanel5() {
307 if (jPanel5 == null) {
308 jLabel = new JLabel();
309 jLabel.setText("Tool Chain Families");
310 FlowLayout flowLayout2 = new FlowLayout();
311 flowLayout2.setAlignment(FlowLayout.LEFT);
312 flowLayout2.setHgap(20);
313 jPanel5 = new JPanel();
314 jPanel5.setLayout(flowLayout2);
315 jPanel5.add(jLabel, null);
316 jPanel5.add(getJCheckBox1(), null);
317 jPanel5.add(getJCheckBox2(), null);
318 jPanel5.add(getJCheckBox3(), null);
319 }
320 return jPanel5;
321 }
322
323 /**
324 * This method initializes jCheckBox1
325 *
326 * @return javax.swing.JCheckBox
327 */
328 private JCheckBox getJCheckBox1() {
329 if (jCheckBox1 == null) {
330 jCheckBox1 = new JCheckBox();
331 jCheckBox1.setText("MSFT");
332 }
333 return jCheckBox1;
334 }
335
336 /**
337 * This method initializes jCheckBox2
338 *
339 * @return javax.swing.JCheckBox
340 */
341 private JCheckBox getJCheckBox2() {
342 if (jCheckBox2 == null) {
343 jCheckBox2 = new JCheckBox();
344 jCheckBox2.setText("GCC");
345 }
346 return jCheckBox2;
347 }
348
349 /**
350 * This method initializes jCheckBox3
351 *
352 * @return javax.swing.JCheckBox
353 */
354 private JCheckBox getJCheckBox3() {
355 if (jCheckBox3 == null) {
356 jCheckBox3 = new JCheckBox();
357 jCheckBox3.setText("INTC");
358 }
359 return jCheckBox3;
360 }
361
362 /**
363 * This method initializes jTable
364 *
365 * @return javax.swing.JTable
366 */
367 private JTable getJTable() {
368 if (jTable == null) {
369 imageEntryPointTableModel = new DefaultTableModel();
370 imageEntryPointTableModel.addColumn("Build Target");
371 }
372 return jTable;
373 }
374
375 /**
376 * This method initializes jTable1
377 *
378 * @return javax.swing.JTable
379 */
380 private JTable getJTable1() {
381 if (jTable1 == null) {
382 outputDirectoryTableModel = new DefaultTableModel();
383 outputDirectoryTableModel.addColumn("Output Directory");
384 outputDirectoryTableModel.addColumn("Intermediate Directories");
385
386 TableColumn imDirCol = jTable1.getColumnModel().getColumn(1);
387 JComboBox cb = new JComboBox();
388 cb.addItem("MODULE");
389 cb.addItem("UNIFIED");
390 imDirCol.setCellEditor(new DefaultCellEditor(cb));
391 }
392 return jTable1;
393 }
394
395
396 /**
397 * This method initializes jPanel6
398 *
399 * @return javax.swing.JPanel
400 */
401 private JPanel getJPanel6() {
402 if (jPanel6 == null) {
403 jLabel7 = new JLabel();
404 jLabel7.setPreferredSize(new java.awt.Dimension(100,20));
405 jLabel7.setText("");
406 jLabel1 = new JLabel();
407 jLabel1.setText("Output Directory");
408 FlowLayout flowLayout3 = new FlowLayout();
409 flowLayout3.setAlignment(FlowLayout.LEFT);
410 flowLayout3.setHgap(20);
411 jPanel6 = new JPanel();
412 jPanel6.setPreferredSize(new java.awt.Dimension(10,250));
413 jPanel6.setLayout(flowLayout3);
414 jPanel6.add(getJCheckBox4(), null);
415 jPanel6.add(getJComboBox(), null);
416 jPanel6.add(jLabel7, null);
417 jPanel6.add(jLabel1, null);
418 jPanel6.add(getJTextField(), null);
419 }
420 return jPanel6;
421 }
422
423 /**
424 * This method initializes jCheckBox4
425 *
426 * @return javax.swing.JCheckBox
427 */
428 private JCheckBox getJCheckBox4() {
429 if (jCheckBox4 == null) {
430 jCheckBox4 = new JCheckBox();
431 jCheckBox4.setText("Intermediate Directories");
432 }
433 return jCheckBox4;
434 }
435
436 /**
437 * This method initializes jComboBox
438 *
439 * @return javax.swing.JComboBox
440 */
441 private JComboBox getJComboBox() {
442 if (jComboBox == null) {
443 jComboBox = new JComboBox();
444 jComboBox.setPreferredSize(new Dimension(100, 20));
445 jComboBox.addItem("MODULE");
446 jComboBox.addItem("UNIFIED");
447 jComboBox.setSelectedIndex(0);
448 }
449 return jComboBox;
450 }
451
452 /**
453 * This method initializes jTextField
454 *
455 * @return javax.swing.JTextField
456 */
457 private JTextField getJTextField() {
458 if (jTextField == null) {
459 jTextField = new JTextField();
460 jTextField.setPreferredSize(new java.awt.Dimension(350,20));
461 }
462 return jTextField;
463 }
464
465 /**
466 * This method initializes jPanel7
467 *
468 * @return javax.swing.JPanel
469 */
470 private JPanel getJPanel7() {
471 if (jPanel7 == null) {
472 jLabel6 = new JLabel();
473 jLabel6.setPreferredSize(new java.awt.Dimension(280,20));
474 jLabel6.setText(" ");
475 jLabel5 = new JLabel();
476 jLabel5.setPreferredSize(new java.awt.Dimension(40,20));
477 jLabel5.setText("Name");
478 jLabel4 = new JLabel();
479 jLabel4.setPreferredSize(new java.awt.Dimension(20,20));
480 jLabel4.setText("ID");
481 jLabel3 = new JLabel();
482 jLabel3.setPreferredSize(new java.awt.Dimension(109,20));
483 jLabel3.setText("SKU Information");
484 jLabel2 = new JLabel();
485 jLabel2.setPreferredSize(new Dimension(109, 16));
486 jLabel2.setText("Build Targets");
487 FlowLayout flowLayout4 = new FlowLayout();
488 flowLayout4.setAlignment(FlowLayout.LEFT);
489 flowLayout4.setHgap(20);
490 jPanel7 = new JPanel();
491 jPanel7.setPreferredSize(new Dimension(972, 100));
492 jPanel7.setLayout(flowLayout4);
493 jPanel7.add(jLabel2, null);
494 jPanel7.add(getJTextField1(), null);
495 jPanel7.add(getJButton2(), null);
496 jPanel7.add(getJButton3(), null);
497 jPanel7.add(getJScrollPane2(), null);
498 jPanel7.add(jLabel3, null);
499 jPanel7.add(jLabel4, null);
500 jPanel7.add(getJTextField2(), null);
501 jPanel7.add(jLabel5, null);
502 jPanel7.add(getJTextField3(), null);
503 jPanel7.add(getJScrollPane3(), null);
504 jPanel7.add(jLabel6, null);
505 jPanel7.add(getJButton4(), null);
506 jPanel7.add(getJButton5(), null);
507 }
508 return jPanel7;
509 }
510
511 /**
512 * This method initializes jTextField1
513 *
514 * @return javax.swing.JTextField
515 */
516 private JTextField getJTextField1() {
517 if (jTextField1 == null) {
518 jTextField1 = new JTextField();
519 jTextField1.setPreferredSize(new Dimension(150, 20));
520 }
521 return jTextField1;
522 }
523
524 /**
525 * This method initializes jButton2
526 *
527 * @return javax.swing.JButton
528 */
529 private JButton getJButton2() {
530 if (jButton2 == null) {
531 jButton2 = new JButton();
532 jButton2.setPreferredSize(new Dimension(70, 20));
533 jButton2.setText("Add");
534 }
535 return jButton2;
536 }
537
538 /**
539 * This method initializes jButton3
540 *
541 * @return javax.swing.JButton
542 */
543 private JButton getJButton3() {
544 if (jButton3 == null) {
545 jButton3 = new JButton();
546 jButton3.setPreferredSize(new Dimension(70, 20));
547 jButton3.setText("Delete");
548 }
549 return jButton3;
550 }
551
552 /**
553 * This method initializes jScrollPane2
554 *
555 * @return javax.swing.JScrollPane
556 */
557 private JScrollPane getJScrollPane2() {
558 if (jScrollPane2 == null) {
559 jScrollPane2 = new JScrollPane();
560 jScrollPane2.setPreferredSize(new Dimension(453, 100));
561 jScrollPane2.setViewportView(getJTable());
562 }
563 return jScrollPane2;
564 }
565
566 /**
567 * This method initializes jScrollPane3
568 *
569 * @return javax.swing.JScrollPane
570 */
571 private JScrollPane getJScrollPane3() {
572 if (jScrollPane3 == null) {
573 jScrollPane3 = new JScrollPane();
574 jScrollPane3.setPreferredSize(new java.awt.Dimension(453,100));
575 jScrollPane3.setViewportView(getJTable2());
576 }
577 return jScrollPane3;
578 }
579
580 /**
581 * This method initializes jTable2
582 *
583 * @return javax.swing.JTable
584 */
585 private JTable getJTable2() {
586 if (jTable2 == null) {
587 skuInfoTableModel = new DefaultTableModel();
588 skuInfoTableModel.addColumn("SKU ID");
589 skuInfoTableModel.addColumn("Name");
590 jTable2 = new JTable(skuInfoTableModel);
591 }
592 return jTable2;
593 }
594
595 /**
596 * This method initializes jTextField2
597 *
598 * @return javax.swing.JTextField
599 */
600 private JTextField getJTextField2() {
601 if (jTextField2 == null) {
602 jTextField2 = new JTextField();
603 jTextField2.setPreferredSize(new java.awt.Dimension(50,20));
604 }
605 return jTextField2;
606 }
607
608 /**
609 * This method initializes jTextField3
610 *
611 * @return javax.swing.JTextField
612 */
613 private JTextField getJTextField3() {
614 if (jTextField3 == null) {
615 jTextField3 = new JTextField();
616 jTextField3.setPreferredSize(new Dimension(150, 20));
617 }
618 return jTextField3;
619 }
620
621 /**
622 * This method initializes jButton4
623 *
624 * @return javax.swing.JButton
625 */
626 private JButton getJButton4() {
627 if (jButton4 == null) {
628 jButton4 = new JButton();
629 jButton4.setPreferredSize(new Dimension(70, 20));
630 jButton4.setText("Add");
631 }
632 return jButton4;
633 }
634
635 /**
636 * This method initializes jButton5
637 *
638 * @return javax.swing.JButton
639 */
640 private JButton getJButton5() {
641 if (jButton5 == null) {
642 jButton5 = new JButton();
643 jButton5.setPreferredSize(new Dimension(70, 20));
644 jButton5.setText("Delete");
645 }
646 return jButton5;
647 }
648
649
650 } // @jve:decl-index=0:visual-constraint="10,10"
651
652