Blame view
BRIC/.svn/pristine/17/17259f26dbd52fc2d140141be6ba0277033f9c98.svn-base
42.5 KB
eeb5cac08
![]() |
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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 |
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package GUI; import LOGIC.Channel; import LOGIC.Componente; import LOGIC.Contract; import LOGIC.Instance; import LOGIC.Internacional; import LOGIC.ObjectList; import LOGIC.PathFDR; import LOGIC.Sistema; import javax.swing.ImageIcon; import javax.swing.ListSelectionModel; import javax.swing.table.DefaultTableModel; import java.util.LinkedList; import javax.swing.BorderFactory; import javax.swing.JOptionPane; /** * * @author Dalay */ public class TelaInicial extends javax.swing.JFrame { /** * Creates new form NewJFrame */ @SuppressWarnings("empty-statement") public TelaInicial(Internacional inter) { this.inter = inter; initComponents(); this.setTitle("Projeto Bric"); newOption.setIcon(new ImageIcon("images/new.png")); saveOption.setIcon(new ImageIcon("images/save.png")); open.setIcon(new ImageIcon("images/open.gif")); typeOption.setIcon(new ImageIcon("images/typepequeno.png")); channelOption.setIcon(new ImageIcon("images/channelpequeno.png")); contractOption.setIcon(new ImageIcon("images/contractpequeno.png")); instanceOption.setIcon(new ImageIcon("images/Instancepequeno.png")); composeOption.setIcon(new ImageIcon("images/Systempequeno.png")); english.setIcon((new ImageIcon("images/usa.png"))); portugues.setIcon(new ImageIcon("images/brasil.png")); auxiliarProcessOption.setIcon(new ImageIcon("images/auxiliarProcessPequeno.png")); exitOption.setIcon(new ImageIcon("images/xx.jpg")); project.setIcon(new ImageIcon("images/projectpequeno.png")); seeAP.setIcon(new ImageIcon("images/auxiliarProcessPequeno.png")); /*b1.setIcon(new ImageIcon("src/images/new.png")); b3.setIcon(new ImageIcon("src/images/save.png")); b2.setIcon(new ImageIcon("src/images/open.gif")); b4.setIcon(new ImageIcon("src/images/typepequeno.png")); b5.setIcon(new ImageIcon("src/images/channelpequeno.png")); b6.setIcon(new ImageIcon("src/images/contractpequeno.png")); b7.setIcon(new ImageIcon("src/images/Instancepequeno.png")); b8.setIcon(new ImageIcon("src/images/Systempequeno.png"));*/ /*try{ ObjectSerialize.saves = s.deserializaLista(); }catch(Exception e){ System.out.println("sem arquivos salvos..."); }*/ //System.out.println((String) JOptionPane.showInputDialog("coloque uma mensagem qualquer...")); //this.path.setPath(path.deserializaLista()); //this.path.setPath(path.deserializaLista()); bundleButtons(); } //Serialize s = new Serialize(); public static boolean aberto = false; DefaultTableModel typeTipo = new DefaultTableModel(null, new String[]{"Name"}) { public boolean isCellEditable(int rowIndex, int mColIndex) { return false; } }; DefaultTableModel channelTipo = new DefaultTableModel(null, new String[]{"Name"}) { public boolean isCellEditable(int rowIndex, int mColIndex) { return false; } }; DefaultTableModel contractTipo = new DefaultTableModel(null, new String[]{"Name"}) { public boolean isCellEditable(int rowIndex, int mColIndex) { return false; } }; DefaultTableModel instanciationTipo = new DefaultTableModel(null, new String[]{"Name"}) { public boolean isCellEditable(int rowIndex, int mColIndex) { return false; } }; ListSelectionModel listS; /*Contract contrato = new Contract(); Channel canal = new Channel(); LOGIC.Type tipo = new LOGIC.Type(); Instance instancia = new Instance();*/ ObjectList listas = new ObjectList(); public Internacional inter; PathFDR path = new PathFDR(); Sistema s = new Sistema(); /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); jMenuItem4 = new javax.swing.JMenuItem(); typesPanel = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); typesTable = new javax.swing.JTable(); editType = new javax.swing.JButton(); deleteType = new javax.swing.JButton(); newType = new javax.swing.JButton(); contractsPanel = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); contractsTable = new javax.swing.JTable(); deleteContract = new javax.swing.JButton(); editContract = new javax.swing.JButton(); newContract = new javax.swing.JButton(); instancesPanel = new javax.swing.JPanel(); jScrollPane4 = new javax.swing.JScrollPane(); instanciationTable = new javax.swing.JTable(); deleteInstance = new javax.swing.JButton(); newInstance = new javax.swing.JButton(); channelsPanel = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); channelsTable = new javax.swing.JTable(); deleteChannel = new javax.swing.JButton(); editChannel = new javax.swing.JButton(); newChannel = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); file = new javax.swing.JMenu(); newOption = new javax.swing.JMenu(); typeOption = new javax.swing.JMenuItem(); channelOption = new javax.swing.JMenuItem(); contractOption = new javax.swing.JMenuItem(); instanceOption = new javax.swing.JMenuItem(); composeOption = new javax.swing.JMenuItem(); auxiliarProcessOption = new javax.swing.JMenuItem(); open = new javax.swing.JMenu(); project = new javax.swing.JMenuItem(); seeAP = new javax.swing.JMenuItem(); saveOption = new javax.swing.JMenuItem(); exitOption = new javax.swing.JMenuItem(); options = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); language = new javax.swing.JMenu(); english = new javax.swing.JMenuItem(); portugues = new javax.swing.JMenuItem(); jMenuItem2.setText("jMenuItem2"); jMenuItem3.setText("jMenuItem3"); jMenuItem4.setText("jMenuItem4"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setMinimumSize(new java.awt.Dimension(920, 760)); setPreferredSize(new java.awt.Dimension(920, 760)); addWindowListener(new java.awt.event.WindowAdapter() { public void windowActivated(java.awt.event.WindowEvent evt) { formWindowActivated(evt); } }); typesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(102, 102, 255), null), "Types", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 18))); // NOI18N typesPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { typesPanelMouseClicked(evt); } }); typesTable.setModel(typeTipo); jScrollPane1.setViewportView(typesTable); editType.setText("Editar"); editType.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editTypeActionPerformed(evt); } }); deleteType.setText("Excluir"); deleteType.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteTypeActionPerformed(evt); } }); newType.setText("Novo"); newType.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newTypeActionPerformed(evt); } }); javax.swing.GroupLayout typesPanelLayout = new javax.swing.GroupLayout(typesPanel); typesPanel.setLayout(typesPanelLayout); typesPanelLayout.setHorizontalGroup( typesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(typesPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(typesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE) .addGroup(typesPanelLayout.createSequentialGroup() .addComponent(newType) .addGap(16, 16, 16) .addComponent(editType) .addGap(18, 18, 18) .addComponent(deleteType) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); typesPanelLayout.setVerticalGroup( typesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(typesPanelLayout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(typesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(editType) .addComponent(deleteType) .addComponent(newType)) .addContainerGap()) ); contractsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(102, 102, 255), null), "Contracts", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 18))); // NOI18N contractsTable.setModel(contractTipo); jScrollPane3.setViewportView(contractsTable); deleteContract.setText("Excluir"); deleteContract.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteContractActionPerformed(evt); } }); editContract.setText("Editar"); editContract.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editContractActionPerformed(evt); } }); newContract.setText("Novo"); newContract.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newContractActionPerformed(evt); } }); javax.swing.GroupLayout contractsPanelLayout = new javax.swing.GroupLayout(contractsPanel); contractsPanel.setLayout(contractsPanelLayout); contractsPanelLayout.setHorizontalGroup( contractsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(contractsPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(contractsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE) .addGroup(contractsPanelLayout.createSequentialGroup() .addComponent(newContract) .addGap(16, 16, 16) .addComponent(editContract) .addGap(18, 18, 18) .addComponent(deleteContract) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); contractsPanelLayout.setVerticalGroup( contractsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(contractsPanelLayout.createSequentialGroup() .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(contractsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(editContract) .addComponent(deleteContract) .addComponent(newContract)) .addGap(0, 12, Short.MAX_VALUE)) ); instancesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(102, 102, 255), null), "Instances", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 18))); // NOI18N instanciationTable.setModel(instanciationTipo); jScrollPane4.setViewportView(instanciationTable); deleteInstance.setText("Excluir"); deleteInstance.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteInstanceActionPerformed(evt); } }); newInstance.setText("Novo"); newInstance.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newInstanceActionPerformed(evt); } }); javax.swing.GroupLayout instancesPanelLayout = new javax.swing.GroupLayout(instancesPanel); instancesPanel.setLayout(instancesPanelLayout); instancesPanelLayout.setHorizontalGroup( instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(instancesPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE) .addGroup(instancesPanelLayout.createSequentialGroup() .addComponent(newInstance) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(deleteInstance) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); instancesPanelLayout.setVerticalGroup( instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(instancesPanelLayout.createSequentialGroup() .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(deleteInstance) .addComponent(newInstance)) .addGap(0, 12, Short.MAX_VALUE)) ); channelsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(102, 102, 255), null), "Channel", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 18))); // NOI18N channelsTable.setModel(channelTipo); jScrollPane2.setViewportView(channelsTable); deleteChannel.setText("Excluir"); deleteChannel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteChannelActionPerformed(evt); } }); editChannel.setText("Editar"); editChannel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editChannelActionPerformed(evt); } }); newChannel.setText("Novo"); newChannel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newChannelActionPerformed(evt); } }); javax.swing.GroupLayout channelsPanelLayout = new javax.swing.GroupLayout(channelsPanel); channelsPanel.setLayout(channelsPanelLayout); channelsPanelLayout.setHorizontalGroup( channelsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(channelsPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(channelsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE) .addGroup(channelsPanelLayout.createSequentialGroup() .addComponent(newChannel) .addGap(16, 16, 16) .addComponent(editChannel) .addGap(18, 18, 18) .addComponent(deleteChannel) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); channelsPanelLayout.setVerticalGroup( channelsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(channelsPanelLayout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE) .addGroup(channelsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(editChannel) .addComponent(deleteChannel) .addComponent(newChannel)) .addContainerGap()) ); file.setText("File"); newOption.setText("New"); typeOption.setText("Type"); typeOption.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { typeOptionActionPerformed(evt); } }); newOption.add(typeOption); channelOption.setText("Channel"); channelOption.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { channelOptionActionPerformed(evt); } }); newOption.add(channelOption); contractOption.setText("Contract"); contractOption.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { contractOptionActionPerformed(evt); } }); newOption.add(contractOption); instanceOption.setText("Instance"); instanceOption.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { instanceOptionActionPerformed(evt); } }); newOption.add(instanceOption); composeOption.setText("Compose"); composeOption.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { composeOptionActionPerformed(evt); } }); newOption.add(composeOption); auxiliarProcessOption.setText("Auxiliar Process"); auxiliarProcessOption.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { auxiliarProcessOptionActionPerformed(evt); } }); newOption.add(auxiliarProcessOption); file.add(newOption); open.setText("Open"); project.setText("Project"); project.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { projectActionPerformed(evt); } }); open.add(project); seeAP.setText("Auxiliar Processes"); seeAP.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { seeAPActionPerformed(evt); } }); open.add(seeAP); file.add(open); saveOption.setText("Save"); saveOption.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveOptionActionPerformed(evt); } }); file.add(saveOption); exitOption.setText("Exit"); file.add(exitOption); jMenuBar1.add(file); options.setText("Options"); jMenuItem1.setText("pFDR"); options.add(jMenuItem1); language.setText("Language"); english.setText("English (US)"); english.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { englishActionPerformed(evt); } }); language.add(english); portugues.setText("Português (BR)"); portugues.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { portuguesActionPerformed(evt); } }); language.add(portugues); options.add(language); jMenuBar1.add(options); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(typesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(contractsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(channelsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(instancesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {channelsPanel, contractsPanel, instancesPanel, typesPanel}); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(typesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(channelsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(contractsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(instancesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(193, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void typeOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_typeOptionActionPerformed if (!hasOpenned()) { new TypeGUI(inter, listas, false, -1).setVisible(true); } }//GEN-LAST:event_typeOptionActionPerformed private void channelOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_channelOptionActionPerformed if (!hasOpenned()) { new ChannelGUI(inter, listas, false, -1).setVisible(true); } }//GEN-LAST:event_channelOptionActionPerformed private void contractOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_contractOptionActionPerformed if (!hasOpenned()) { new ContractGUI(inter, listas, false, -1).setVisible(true); } }//GEN-LAST:event_contractOptionActionPerformed private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated showTypes(); showChannels(); showContracts(); showInstances(); System.out.println(listas.getTypeList()); System.out.println(listas.getChannelList()); System.out.println("contratoooooo: "+listas.getContractList()); System.out.println("canais: "); for(int i = 0; i< listas.getContractList().size(); i++){ for(int j = 0; j< listas.getContractList().get(i).getChannel().size(); j++){ System.out.println(listas.getContractList().get(i).getChannel().get(j).getName()); } } System.out.println("protocolos: "); for(int i = 0; i< listas.getContractList().size(); i++){ for(int j = 0; j< listas.getContractList().get(i).getProtocolos().size(); j++){ System.out.println(listas.getContractList().get(i).getProtocolos().get(j).getCanal().getName()); } } System.out.println("instanciaaaa: "+listas.getInstanceList()); System.out.println("canais: "); for(int i = 0; i< listas.getInstanceList().size(); i++){ for(int j = 0; j< listas.getInstanceList().get(i).getChannel().size(); j++){ System.out.println(listas.getInstanceList().get(i).getChannel().get(j).getName()); } } System.out.println("protocolos: "); for(int i = 0; i< listas.getInstanceList().size(); i++){ for(int j = 0; j< listas.getInstanceList().get(i).getProtocolos().size(); j++){ System.out.println(listas.getInstanceList().get(i).getProtocolos().get(j).getCanal().getName()); } } /*if(Instantiations.contratos.size()>0){ for(int i = 0; i<Instantiations.contratos.get(Instantiations.contratos.size()-1).channel.size(); i++){ System.out.println("aqui TI "+Instantiations.contratos.get(Instantiations.contratos.size()-1).channel.get(i).getNome()); } System.out.println(Instantiations.contratos.get(Instantiations.contratos.size()-1).channel.size()); }*/ }//GEN-LAST:event_formWindowActivated private void instanceOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_instanceOptionActionPerformed if (!hasOpenned()) { new InstanceGUI(inter, listas).setVisible(true); } }//GEN-LAST:event_instanceOptionActionPerformed private void typesPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_typesPanelMouseClicked // TODO add your handling code here: }//GEN-LAST:event_typesPanelMouseClicked private void saveOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveOptionActionPerformed new save(inter, listas).setVisible(true); // TODO add your handling code here: }//GEN-LAST:event_saveOptionActionPerformed private void projectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_projectActionPerformed new open(inter, listas).setVisible(true); }//GEN-LAST:event_projectActionPerformed private void newTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newTypeActionPerformed if (!hasOpenned()) { new TypeGUI(inter, listas, false, -1).setVisible(true); }// TODO add your handling code here: }//GEN-LAST:event_newTypeActionPerformed private void newChannelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newChannelActionPerformed if (!hasOpenned()) { new ChannelGUI(inter, listas, false, -1).setVisible(true); }// TODO add your handling code here: }//GEN-LAST:event_newChannelActionPerformed private void newContractActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newContractActionPerformed if (!hasOpenned()) { new ContractGUI(inter, listas, false, -1).setVisible(true); } // TODO add your handling code here: }//GEN-LAST:event_newContractActionPerformed private void newInstanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newInstanceActionPerformed if (!hasOpenned()) { new InstanceGUI(inter, listas).setVisible(true); }// TODO add your handling code here: }//GEN-LAST:event_newInstanceActionPerformed private void composeOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_composeOptionActionPerformed if (!hasOpenned()) { new SystemCompositionSimplesGUI(inter, listas).setVisible(true); } }//GEN-LAST:event_composeOptionActionPerformed private void deleteTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteTypeActionPerformed if (this.isTypeFree(listas.getTypeList().get(typesTable.getSelectedRow()))) { listas.getTypeList().remove(typesTable.getSelectedRow()); } else { } this.showTypes(); }//GEN-LAST:event_deleteTypeActionPerformed private void deleteChannelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteChannelActionPerformed if (this.isChannelFree(listas.getChannelList().get(channelsTable.getSelectedRow()))) { listas.getChannelList().remove(channelsTable.getSelectedRow()); } else { } this.showChannels(); // TODO add your handling code here: }//GEN-LAST:event_deleteChannelActionPerformed private void editTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editTypeActionPerformed if (!hasOpenned()){ if(typesTable.getSelectedRow()>-1){ new TypeGUI(inter, listas, true, typesTable.getSelectedRow()).setVisible(true); } } // TODO add your handling code here: }//GEN-LAST:event_editTypeActionPerformed private void editChannelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editChannelActionPerformed if (!hasOpenned()){ if(channelsTable.getSelectedRow()>-1){ new ChannelGUI(inter, listas, true, channelsTable.getSelectedRow()).setVisible(true); } } // TODO add your handling code here: }//GEN-LAST:event_editChannelActionPerformed private void editContractActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editContractActionPerformed if (!hasOpenned()){ if(contractsTable.getSelectedRow()>-1){ new ContractGUI(inter, listas, true, contractsTable.getSelectedRow()).setVisible(true); } } // TODO add your handling code here: }//GEN-LAST:event_editContractActionPerformed private void deleteInstanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteInstanceActionPerformed if(instanciationTable.getSelectedRow()>-1){ listas.getInstanceList().remove(instanciationTable.getSelectedRow()); showInstances(); } // TODO add your handling code here: }//GEN-LAST:event_deleteInstanceActionPerformed private void deleteContractActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteContractActionPerformed if(contractsTable.getSelectedRow()>-1){ listas.getContractList().remove(contractsTable.getSelectedRow()); showContracts(); } // TODO add your handling code here: }//GEN-LAST:event_deleteContractActionPerformed /* private void englishActionPerformed(java.awt.event.ActionEvent evt) { inter = new Internacional("en", "US"); bundle(); // TODO add your handling code here: } private void portuguesActionPerformed(java.awt.event.ActionEvent evt) { inter = new Internacional("pt", "BR"); bundle(); // TODO add your handling code here: } */ private void englishActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_englishActionPerformed inter = new Internacional("en", "US"); bundleButtons(); // TODO add your handling code here: }//GEN-LAST:event_englishActionPerformed private void portuguesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_portuguesActionPerformed inter = new Internacional("pt", "BR"); bundleButtons(); // TODO add your handling code here: }//GEN-LAST:event_portuguesActionPerformed private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed /*String aux = JOptionPane.showInputDialog("Coloque o novo caminho para o FDR..."); if(aux != null){ path.setPath(aux); path.serializaPath(aux); }*/ // TODO add your handling code here: }//GEN-LAST:event_jMenuItem1ActionPerformed private void auxiliarProcessOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_auxiliarProcessOptionActionPerformed new AuxiliarProcessGUI(listas, listas.getProcessosAuxiliares()).setVisible(true); // TODO add your handling code here: }//GEN-LAST:event_auxiliarProcessOptionActionPerformed private void seeAPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_seeAPActionPerformed new AuxiliarProcessGUI(listas, listas.getProcessosAuxiliares()).setVisible(true);// TODO add your handling code here: }//GEN-LAST:event_seeAPActionPerformed public boolean hasOpenned() { if (aberto == true) { return true; } return false; } public void showTypes() { while (typesTable.getRowCount() > 0) { typeTipo.removeRow(0); } if (listas.getTypeList().isEmpty()) { } else { String[] linha = new String[]{null, null}; for (int j = 0; j < listas.getTypeList().size(); j++) { typeTipo.addRow(linha); typeTipo.setValueAt(listas.getTypeList().get(j).getNome(), j, 0); } } } public void showChannels() { while (channelsTable.getRowCount() > 0) { channelTipo.removeRow(0); } if (listas.getChannelList().isEmpty()) { } else { String[] linha = new String[]{null, null}; for (int j = 0; j < listas.getChannelList().size(); j++) { channelTipo.addRow(linha); channelTipo.setValueAt(listas.getChannelList().get(j).getName(), j, 0); } } } public void showContracts() { while (contractsTable.getRowCount() > 0) { contractTipo.removeRow(0); } if (listas.getContractList().isEmpty()) { } else { String[] linha = new String[]{null, null}; for (int j = 0; j < listas.getContractList().size(); j++) { contractTipo.addRow(linha); contractTipo.setValueAt(listas.getContractList().get(j).getName(), j, 0); } } } public void showInstances() { //System.out.println("instancia "+Instantiations.contratos.size()); while (instanciationTable.getRowCount() > 0) { instanciationTipo.removeRow(0); } instanciationTable.removeAll(); if (listas.getInstanceList().isEmpty()) { } else { String[] linha = new String[]{null, null}; for (int j = 0; j < listas.getInstanceList().size(); j++) { instanciationTipo.addRow(linha); instanciationTipo.setValueAt(listas.getInstanceList().get(j).getName(), j, 0); } } } public boolean isTypeFree(LOGIC.Type t) { for (int i = 0; i < listas.getChannelList().size(); i++) { for (int j = 0; j < listas.getChannelList().get(i).getType().size(); j++) { if (t == listas.getChannelList().get(i).getType().get(j)) { return false; } } } return true; } public boolean isChannelFree(LOGIC.Channel c) { for (int i = 0; i < listas.getContractList().size(); i++) { for (int j = 0; j < listas.getContractList().get(i).getChannel().size(); j++) { if (c == listas.getContractList().get(i).getChannel().get(j)) { return false; } } } return true; } public void bundleButtons(){ file.setText(inter.retornarMensagem("COD0043")); options.setText(inter.retornarMensagem("COD0036")); saveOption.setText(inter.retornarMensagem("COD0022")); open.setText(inter.retornarMensagem("COD0023")); project.setText(inter.retornarMensagem("COD0046")); exitOption.setText(inter.retornarMensagem("COD0024")); typeOption.setText(inter.retornarMensagem("COD0001")); channelOption.setText(inter.retornarMensagem("COD0002")); contractOption.setText(inter.retornarMensagem("COD0003")); instanceOption.setText(inter.retornarMensagem("COD0004")); composeOption.setText(inter.retornarMensagem("COD0011")); language.setText(inter.retornarMensagem("COD0037")); newType.setText(inter.retornarMensagem("COD0018")); newChannel.setText(inter.retornarMensagem("COD0018")); newContract.setText(inter.retornarMensagem("COD0018")); newInstance.setText(inter.retornarMensagem("COD0018")); editType.setText(inter.retornarMensagem("COD0019")); editChannel.setText(inter.retornarMensagem("COD0019")); editContract.setText(inter.retornarMensagem("COD0019")); deleteType.setText(inter.retornarMensagem("COD0020")); deleteChannel.setText(inter.retornarMensagem("COD0020")); deleteContract.setText(inter.retornarMensagem("COD0020")); deleteInstance.setText(inter.retornarMensagem("COD0020")); typesPanel.setBorder(BorderFactory.createTitledBorder(inter.retornarMensagem("COD0005"))); channelsPanel.setBorder(BorderFactory.createTitledBorder(inter.retornarMensagem("COD0006"))); contractsPanel.setBorder(BorderFactory.createTitledBorder(inter.retornarMensagem("COD0007"))); instancesPanel.setBorder(BorderFactory.createTitledBorder(inter.retornarMensagem("COD0008"))); } public void bundleTabelas(){ } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JMenuItem auxiliarProcessOption; private javax.swing.JMenuItem channelOption; private javax.swing.JPanel channelsPanel; private javax.swing.JTable channelsTable; private javax.swing.JMenuItem composeOption; private javax.swing.JMenuItem contractOption; private javax.swing.JPanel contractsPanel; private javax.swing.JTable contractsTable; private javax.swing.JButton deleteChannel; private javax.swing.JButton deleteContract; private javax.swing.JButton deleteInstance; private javax.swing.JButton deleteType; private javax.swing.JButton editChannel; private javax.swing.JButton editContract; private javax.swing.JButton editType; private javax.swing.JMenuItem english; private javax.swing.JMenuItem exitOption; private javax.swing.JMenu file; private javax.swing.JMenuItem instanceOption; private javax.swing.JPanel instancesPanel; private javax.swing.JTable instanciationTable; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane4; private javax.swing.JMenu language; private javax.swing.JButton newChannel; private javax.swing.JButton newContract; private javax.swing.JButton newInstance; private javax.swing.JMenu newOption; private javax.swing.JButton newType; private javax.swing.JMenu open; private javax.swing.JMenu options; private javax.swing.JMenuItem portugues; private javax.swing.JMenuItem project; private javax.swing.JMenuItem saveOption; private javax.swing.JMenuItem seeAP; private javax.swing.JMenuItem typeOption; private javax.swing.JPanel typesPanel; private javax.swing.JTable typesTable; // End of variables declaration//GEN-END:variables } |