Package javax.swing

Examples of javax.swing.GroupLayout$Spring


    jButtonIptal.setIcon(PSAUtil
        .getImageIconViaRelativePath("picture/geriButonu.png"));

    jButtonIptal.setFont(new Font("Tahoma", Font.BOLD, 12));
    jButtonIptal.setBounds(70, 273, 144, 23);
    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout
        .setHorizontalGroup(groupLayout
            .createParallelGroup(Alignment.TRAILING)
            .addGroup(
                groupLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        groupLayout
                            .createParallelGroup(
                                Alignment.TRAILING)
                            .addComponent(
                                cTablePanelRenk,
                                Alignment.LEADING,
                                GroupLayout.DEFAULT_SIZE,
                                442,
                                Short.MAX_VALUE)
                            .addComponent(
                                jButtonIptal,
                                Alignment.LEADING,
                                GroupLayout.DEFAULT_SIZE,
                                442,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(
        Alignment.LEADING).addGroup(
        groupLayout
            .createSequentialGroup()
            .addContainerGap()
            .addComponent(cTablePanelRenk,
                GroupLayout.DEFAULT_SIZE, 439, Short.MAX_VALUE)
            .addGap(7)
View Full Code Here


    jBUttonMusteriSec = new JButton("SEÇ");
    jBUttonMusteriSec.setIcon(PSAUtil
        .getImageIconViaRelativePath("picture/onay.png"));
    jBUttonMusteriSec.setFont(new Font("Tahoma", Font.BOLD, 12));
    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout
        .setHorizontalGroup(groupLayout
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                groupLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        groupLayout
                            .createParallelGroup(
                                Alignment.LEADING)
                            .addComponent(
                                cTablePanelMusteri,
                                GroupLayout.DEFAULT_SIZE,
                                589,
                                Short.MAX_VALUE)
                            .addGroup(
                                groupLayout
                                    .createSequentialGroup()
                                    .addComponent(
                                        jButtonIptal,
                                        GroupLayout.DEFAULT_SIZE,
                                        291,
                                        Short.MAX_VALUE)
                                    .addGap(7)
                                    .addComponent(
                                        jBUttonMusteriSec,
                                        GroupLayout.PREFERRED_SIZE,
                                        291,
                                        GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap())
            .addGroup(
                Alignment.TRAILING,
                groupLayout
                    .createSequentialGroup()
                    .addGap(308)
                    .addComponent(jButtonMusteriEkle,
                        GroupLayout.DEFAULT_SIZE, 291,
                        Short.MAX_VALUE)
                    .addContainerGap()));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(
        Alignment.LEADING).addGroup(
        groupLayout
            .createSequentialGroup()
            .addGap(13)
            .addComponent(jButtonMusteriEkle,
                GroupLayout.PREFERRED_SIZE,
                GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addPreferredGap(ComponentPlacement.UNRELATED)
            .addComponent(cTablePanelMusteri,
                GroupLayout.PREFERRED_SIZE, 386,
                GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(ComponentPlacement.UNRELATED)
            .addGroup(
                groupLayout
                    .createParallelGroup(Alignment.LEADING)
                    .addComponent(jButtonIptal,
                        GroupLayout.DEFAULT_SIZE, 41,
                        Short.MAX_VALUE)
                    .addComponent(jBUttonMusteriSec,
View Full Code Here

    setIconImage(PSAUtil.getImageIconViaRelativePath("picture/psaIcon.png")
        .getImage());

    jPanelSatisKodBilgi = new JPanel();
    jPanelSatisKodBilgi.setBackground(UIManager.getColor("Button.shadow"));
    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(
        Alignment.LEADING).addGroup(
        groupLayout
            .createSequentialGroup()
            .addContainerGap()
            .addComponent(jPanelSatisKodBilgi,
                GroupLayout.DEFAULT_SIZE, 589, Short.MAX_VALUE)
            .addContainerGap()));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(
        Alignment.LEADING).addGroup(
        groupLayout
            .createSequentialGroup()
            .addContainerGap()
            .addComponent(jPanelSatisKodBilgi,
                GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)
            .addGap(10)));

    jLabelSatisKoduBilgi = new JLabel();
    jLabelSatisKoduBilgi
        .setText("Beklemeye alınacak satışın satis kodu : ");
    jLabelSatisKoduBilgi.setFont(new Font("Tahoma", Font.BOLD, 14));

    cTextFieldBarkod = new CTextField(11);
    cTextFieldBarkod.setHorizontalAlignment(SwingConstants.CENTER);
    cTextFieldBarkod.setFont(new Font("Tahoma", Font.PLAIN, 13));

    jButtonSatisBeklet = new JButton();
    jButtonSatisBeklet.setText("SATIŞ BEKLET");
    jButtonSatisBeklet.setIcon(PSAUtil
        .getImageIconViaRelativePath("picture/satisBeklet.png"));
    jButtonSatisBeklet.setFont(new Font("Tahoma", Font.BOLD, 15));

    jButtonIptal = new JButton();
    jButtonIptal.setText("İPTAL");
    jButtonIptal.setIcon(PSAUtil
        .getImageIconViaRelativePath("picture/geriButonu.png"));
    jButtonIptal.setFont(new Font("Tahoma", Font.BOLD, 15));
    GroupLayout gl_jPanelSatisKodBilgi = new GroupLayout(
        jPanelSatisKodBilgi);
    gl_jPanelSatisKodBilgi
        .setHorizontalGroup(gl_jPanelSatisKodBilgi
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_jPanelSatisKodBilgi
                    .createSequentialGroup()
                    .addGap(79)
                    .addGroup(
                        gl_jPanelSatisKodBilgi
                            .createParallelGroup(
                                Alignment.LEADING)
                            .addGroup(
                                gl_jPanelSatisKodBilgi
                                    .createSequentialGroup()
                                    .addComponent(
                                        jLabelSatisKoduBilgi,
                                        GroupLayout.DEFAULT_SIZE,
                                        276,
                                        Short.MAX_VALUE)
                                    .addGap(10)
                                    .addComponent(
                                        cTextFieldBarkod,
                                        GroupLayout.DEFAULT_SIZE,
                                        141,
                                        Short.MAX_VALUE))
                            .addGroup(
                                gl_jPanelSatisKodBilgi
                                    .createSequentialGroup()
                                    .addComponent(
                                        jButtonIptal,
                                        GroupLayout.DEFAULT_SIZE,
                                        200,
                                        Short.MAX_VALUE)
                                    .addGap(27)
                                    .addComponent(
                                        jButtonSatisBeklet,
                                        GroupLayout.DEFAULT_SIZE,
                                        200,
                                        Short.MAX_VALUE)))
                    .addGap(83)));
    gl_jPanelSatisKodBilgi
        .setVerticalGroup(gl_jPanelSatisKodBilgi
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_jPanelSatisKodBilgi
                    .createSequentialGroup()
                    .addGap(11)
                    .addGroup(
                        gl_jPanelSatisKodBilgi
                            .createParallelGroup(
                                Alignment.LEADING)
                            .addGroup(
                                gl_jPanelSatisKodBilgi
                                    .createSequentialGroup()
                                    .addComponent(
                                        jLabelSatisKoduBilgi,
                                        GroupLayout.DEFAULT_SIZE,
                                        20,
                                        Short.MAX_VALUE)
                                    .addGap(1))
                            .addGroup(
                                gl_jPanelSatisKodBilgi
                                    .createSequentialGroup()
                                    .addGap(1)
                                    .addComponent(
                                        cTextFieldBarkod,
                                        GroupLayout.PREFERRED_SIZE,
                                        20,
                                        Short.MAX_VALUE)))
                    .addGap(10)
                    .addGroup(
                        gl_jPanelSatisKodBilgi
                            .createParallelGroup(
                                Alignment.LEADING)
                            .addComponent(
                                jButtonIptal,
                                GroupLayout.DEFAULT_SIZE,
View Full Code Here

    setIconImage(PSAUtil.getImageIconViaRelativePath("picture/psaIcon.png")
        .getImage());

    jPanelSatisKodBilgi = new JPanel();
    jPanelSatisKodBilgi.setBackground(UIManager.getColor("Button.shadow"));
    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(
        Alignment.LEADING).addGroup(
        groupLayout
            .createSequentialGroup()
            .addContainerGap()
            .addComponent(jPanelSatisKodBilgi,
                GroupLayout.DEFAULT_SIZE, 589, Short.MAX_VALUE)
            .addContainerGap()));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(
        Alignment.LEADING).addGroup(
        groupLayout
            .createSequentialGroup()
            .addContainerGap()
            .addComponent(jPanelSatisKodBilgi,
                GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)
            .addGap(10)));

    jLabelKategoriBilgi = new JLabel();
    jLabelKategoriBilgi.setText(urunGrupBilgi + " eklenecek grup :");
    jLabelKategoriBilgi.setFont(new Font("Tahoma", Font.BOLD, 14));

    jButtonBilgiTasi = new JButton();
    jButtonBilgiTasi.setText("BİLGİ TAŞI");
    jButtonBilgiTasi.setIcon(PSAUtil
        .getImageIconViaRelativePath("picture/kategoriTasi.png"));
    jButtonBilgiTasi.setFont(new Font("Tahoma", Font.BOLD, 15));

    jButtonIptal = new JButton();
    jButtonIptal.setText("İPTAL");
    jButtonIptal.setIcon(PSAUtil
        .getImageIconViaRelativePath("picture/geriButonu.png"));
    jButtonIptal.setFont(new Font("Tahoma", Font.BOLD, 15));

    cComboboxUrunGrup = new CComboBox<UrunGrup>(UrunGrup.class);
    GroupLayout gl_jPanelSatisKodBilgi = new GroupLayout(
        jPanelSatisKodBilgi);
    gl_jPanelSatisKodBilgi
        .setHorizontalGroup(gl_jPanelSatisKodBilgi
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_jPanelSatisKodBilgi
                    .createSequentialGroup()
                    .addGap(79)
                    .addGroup(
                        gl_jPanelSatisKodBilgi
                            .createParallelGroup(
                                Alignment.LEADING)
                            .addGroup(
                                gl_jPanelSatisKodBilgi
                                    .createSequentialGroup()
                                    .addComponent(
                                        jLabelKategoriBilgi,
                                        GroupLayout.DEFAULT_SIZE,
                                        200,
                                        Short.MAX_VALUE)
                                    .addGap(27)
                                    .addComponent(
                                        cComboboxUrunGrup,
                                        GroupLayout.DEFAULT_SIZE,
                                        200,
                                        Short.MAX_VALUE))
                            .addGroup(
                                gl_jPanelSatisKodBilgi
                                    .createSequentialGroup()
                                    .addComponent(
                                        jButtonIptal,
                                        GroupLayout.DEFAULT_SIZE,
                                        200,
                                        Short.MAX_VALUE)
                                    .addGap(27)
                                    .addComponent(
                                        jButtonBilgiTasi,
                                        GroupLayout.DEFAULT_SIZE,
                                        200,
                                        Short.MAX_VALUE)))
                    .addGap(83)));
    gl_jPanelSatisKodBilgi
        .setVerticalGroup(gl_jPanelSatisKodBilgi
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_jPanelSatisKodBilgi
                    .createSequentialGroup()
                    .addGap(11)
                    .addGroup(
                        gl_jPanelSatisKodBilgi
                            .createParallelGroup(
                                Alignment.LEADING)
                            .addGroup(
                                gl_jPanelSatisKodBilgi
                                    .createSequentialGroup()
                                    .addComponent(
                                        jLabelKategoriBilgi,
                                        GroupLayout.DEFAULT_SIZE,
                                        20,
                                        Short.MAX_VALUE)
                                    .addGap(2))
                            .addGroup(
                                gl_jPanelSatisKodBilgi
                                    .createSequentialGroup()
                                    .addGap(2)
                                    .addComponent(
                                        cComboboxUrunGrup,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)))
                    .addGap(11)
                    .addGroup(
                        gl_jPanelSatisKodBilgi
                            .createParallelGroup(
                                Alignment.LEADING)
                            .addComponent(
                                jButtonIptal,
                                GroupLayout.DEFAULT_SIZE,
View Full Code Here

    // Section Panels
    JPanel roomPanel     = new JPanel();
    JPanel characterPanel   = new JPanel();
    JPanel weaponPanel     = new JPanel();   
   
    GroupLayout characterLayout = new GroupLayout(characterPanel);
    characterLayout.setAutoCreateGaps(true);
    characterLayout.setAutoCreateContainerGaps(true);
   
    characterLayout.setHorizontalGroup(characterLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(characterLayout.createSequentialGroup()
            .addComponent(colMustardLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(colMustardChkbox)
            .addComponent(colMustardTextField)
           )
          .addGroup(characterLayout.createSequentialGroup()
            .addComponent(profPlumLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(profPlumChkbox)
            .addComponent(profPlumTextField))
        .addGroup(characterLayout.createSequentialGroup()
            .addComponent(mrGreenLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(mrGreenChkbox)
            .addComponent(mrGreenTextField))
        .addGroup(characterLayout.createSequentialGroup()
            .addComponent(mrsPeacockLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(mrsPeacockChkbox)
            .addComponent(mrsPeacockTextField))
        .addGroup(characterLayout.createSequentialGroup()
            .addComponent(missScarletLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(missScarletChkbox)
            .addComponent(missScarletTextField))
        .addGroup(characterLayout.createSequentialGroup()
            .addComponent(mrsWhiteLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(mrsWhiteChkbox)
            .addComponent(mrsWhiteTextField))
      );
   
    characterLayout.setVerticalGroup(characterLayout.createSequentialGroup()
        .addGroup(characterLayout.createParallelGroup()
            .addComponent(colMustardLabel)
            .addComponent(colMustardChkbox)
            .addComponent(colMustardTextField))
        .addGroup(characterLayout.createParallelGroup()
            .addComponent(profPlumLabel)
            .addComponent(profPlumChkbox)
            .addComponent(profPlumTextField))
        .addGroup(characterLayout.createParallelGroup()
            .addComponent(mrGreenLabel)
            .addComponent(mrGreenChkbox)
            .addComponent(mrGreenTextField))
        .addGroup(characterLayout.createParallelGroup()
            .addComponent(mrsPeacockLabel)
            .addComponent(mrsPeacockChkbox)
            .addComponent(mrsPeacockTextField))
        .addGroup(characterLayout.createParallelGroup()
            .addComponent(missScarletLabel)
            .addComponent(missScarletChkbox)
            .addComponent(missScarletTextField))
        .addGroup(characterLayout.createParallelGroup()
            .addComponent(mrsWhiteLabel)
            .addComponent(mrsWhiteChkbox)
            .addComponent(mrsWhiteTextField))
        );
   
    GroupLayout weaponLayout = new GroupLayout(weaponPanel);
    weaponLayout.setAutoCreateGaps(true);
    weaponLayout.setAutoCreateContainerGaps(true);
   
    weaponLayout.setHorizontalGroup(weaponLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(weaponLayout.createSequentialGroup()
            .addComponent(knifeLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(knifeChkbox)
            .addComponent(knifeTextField))
          .addGroup(weaponLayout.createSequentialGroup()
            .addComponent(candlestickLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(candlestickChkbox)
            .addComponent(candlestickTextField))
        .addGroup(weaponLayout.createSequentialGroup()
            .addComponent(revolverLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(revolverChkbox)
            .addComponent(revolverTextField))
        .addGroup(weaponLayout.createSequentialGroup()
            .addComponent(ropeLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(ropeChkbox)
            .addComponent(ropeTextField))
        .addGroup(weaponLayout.createSequentialGroup()
            .addComponent(leadPipeLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(leadPipeChkbox)
            .addComponent(leadPipeTextField))
        .addGroup(weaponLayout.createSequentialGroup()
            .addComponent(wrenchLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(wrenchChkbox)
            .addComponent(wrenchTextField))
      );
   
    weaponLayout.setVerticalGroup(weaponLayout.createSequentialGroup()
        .addGroup(weaponLayout.createParallelGroup()
            .addComponent(knifeLabel)
            .addComponent(knifeChkbox)
            .addComponent(knifeTextField))
        .addGroup(weaponLayout.createParallelGroup()
            .addComponent(candlestickLabel)
            .addComponent(candlestickChkbox)
            .addComponent(candlestickTextField))
        .addGroup(weaponLayout.createParallelGroup()
            .addComponent(revolverLabel)
            .addComponent(revolverChkbox)
            .addComponent(revolverTextField))
        .addGroup(weaponLayout.createParallelGroup()
            .addComponent(ropeLabel)
            .addComponent(ropeChkbox)
            .addComponent(ropeTextField))
        .addGroup(weaponLayout.createParallelGroup()
            .addComponent(leadPipeLabel)
            .addComponent(leadPipeChkbox)
            .addComponent(leadPipeTextField))
        .addGroup(weaponLayout.createParallelGroup()
            .addComponent(wrenchLabel)
            .addComponent(wrenchChkbox)
            .addComponent(wrenchTextField))
        );
   
    GroupLayout roomLayout = new GroupLayout(roomPanel);
    roomLayout.setAutoCreateGaps(true);
    roomLayout.setAutoCreateContainerGaps(true);
   
    roomLayout.setHorizontalGroup(roomLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(roomLayout.createSequentialGroup()
            .addComponent(hallLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(hallChkbox)
            .addComponent(hallTextField))
          .addGroup(roomLayout.createSequentialGroup()
            .addComponent(loungeLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(loungeChkbox)
            .addComponent(loungeTextField))
        .addGroup(roomLayout.createSequentialGroup()
            .addComponent(diningLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(diningChkbox)
            .addComponent(diningTextField))
        .addGroup(roomLayout.createSequentialGroup()
            .addComponent(kitchenLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(kitchenChkbox)
            .addComponent(kitchenTextField))
        .addGroup(roomLayout.createSequentialGroup()
            .addComponent(ballRmLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(ballRmChkbox)
            .addComponent(ballRmTextField))
        .addGroup(roomLayout.createSequentialGroup()
            .addComponent(conservLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(conservChkbox)
            .addComponent(conservTextField))
        .addGroup(roomLayout.createSequentialGroup()
            .addComponent(billiardLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(billiardChkbox)
            .addComponent(billiardTextField))
        .addGroup(roomLayout.createSequentialGroup()
            .addComponent(libraryLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(libraryChkbox)
            .addComponent(libraryTextField))
        .addGroup(roomLayout.createSequentialGroup()
            .addComponent(studyLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(studyChkbox)
            .addComponent(studyTextField))
      );
   
    roomLayout.setVerticalGroup(roomLayout.createSequentialGroup()
        .addGroup(roomLayout.createParallelGroup()
            .addComponent(hallLabel)
            .addComponent(hallChkbox)
            .addComponent(hallTextField))
        .addGroup(roomLayout.createParallelGroup()
            .addComponent(loungeLabel)
            .addComponent(loungeChkbox)
            .addComponent(loungeTextField))
        .addGroup(roomLayout.createParallelGroup()
            .addComponent(diningLabel)
            .addComponent(diningChkbox)
            .addComponent(diningTextField))
        .addGroup(roomLayout.createParallelGroup()
            .addComponent(kitchenLabel)
            .addComponent(kitchenChkbox)
            .addComponent(kitchenTextField))
        .addGroup(roomLayout.createParallelGroup()
            .addComponent(ballRmLabel)
            .addComponent(ballRmChkbox)
            .addComponent(ballRmTextField))
        .addGroup(roomLayout.createParallelGroup()
            .addComponent(conservLabel)
            .addComponent(conservChkbox)
            .addComponent(conservTextField))
        .addGroup(roomLayout.createParallelGroup()
            .addComponent(billiardLabel)
            .addComponent(billiardChkbox)
            .addComponent(billiardTextField))
        .addGroup(roomLayout.createParallelGroup()
            .addComponent(libraryLabel)
            .addComponent(libraryChkbox)
            .addComponent(libraryTextField))
        .addGroup(roomLayout.createParallelGroup()
            .addComponent(studyLabel)
            .addComponent(studyChkbox)
            .addComponent(studyTextField))
        );
   
View Full Code Here

            JLabel priceLabel  = new JLabel("Price :", SwingConstants.RIGHT);
            JLabel fromLabel   = new JLabel("from ", SwingConstants.RIGHT);
            JLabel toLabel     = new JLabel("to ", SwingConstants.RIGHT);

            JPanel panel = new JPanel();
            GroupLayout layout = new GroupLayout(panel);
            panel.setLayout(layout);
            layout.setAutoCreateContainerGaps(true);
            layout.setAutoCreateGaps(true);
            GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();
            hGroup.addGroup(layout.createParallelGroup()
                                  .addComponent(titleLabel)
                                  .addComponent(authorLabel)
                                  .addComponent(priceLabel));
            hGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER)
                                  .addComponent(_title)
                                  .addComponent(_author)
                                  .addGroup(layout.createSequentialGroup()
                                          .addComponent(fromLabel)
                                          .addComponent(_minPrice)
                                          .addComponent(toLabel)
                                          .addComponent(_maxPrice)));
           
            GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
            vGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER)
                    .addComponent(titleLabel)
                    .addComponent(_title));
            vGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER)
                    .addComponent(authorLabel)
                    .addComponent(_author));
            vGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER)
                    .addComponent(priceLabel)
                    .addComponent(fromLabel)
                    .addComponent(_minPrice)
                    .addComponent(toLabel)
                    .addComponent(_maxPrice));
           
            layout.setHorizontalGroup(hGroup);
            layout.setVerticalGroup(vGroup);

            JButton searchButton = new JButton("Search", Images.SEARCH);
            searchButton.setHorizontalTextPosition(SwingConstants.LEADING);
            ShowCodeAction showCode = Demo.getInstance().new ShowCodeAction();
            showCode.setPage("Dynamic Query", "server/OpenBookServiceImpl.java.html#buildQuery");
View Full Code Here

   *         represents actions of the selected <TT>ECState</TT>
   */
  private JPanel createActionPane() {
    JPanel actionPane = new JPanel();
    setComponentSize(actionPane, new Dimension(285, 150));
    GroupLayout actionPaneLayout = new GroupLayout(actionPane);
    actionPane.setLayout(actionPaneLayout);
    actionPaneLayout.setAutoCreateContainerGaps(false);
    actionPaneLayout.setAutoCreateGaps(false);

    TitledBorder actionPaneBorder = BorderFactory.createTitledBorder(" Action ");
    Font titleFont = actionPaneBorder.getTitleFont();
    float newFontSize = 10;
    actionPaneBorder.setTitleFont(titleFont.deriveFont(newFontSize));

    actionPane.setBorder(actionPaneBorder);

    JButton addActionButton = new JButton("Add new action");
    Font addActionButtonFont = addActionButton.getFont();
    addActionButton.setFont(addActionButtonFont.deriveFont(newFontSize));
    addActionButton.setSize(addActionButton.getMinimumSize());
    addActionButton.addActionListener(new ActionListener() {
      public void actionPerformed( ActionEvent e) {//add a child to the table's nodelist
        Element newEle = document.createElement("ECAction");
        ((ECActionsTableModel)aoTable.getModel()).getState().appendChild(newEle);//add an empty ECAction element to table's NodeList
        aoTable.addNotify();
      }
    });
    JButton deleteActionButton = new JButton("Delete selected actions");
    Font deleteActionButtonFont = deleteActionButton.getFont();
    deleteActionButton.setFont(deleteActionButtonFont.deriveFont(newFontSize));
    deleteActionButton.setMargin(new Insets(2,2,2,2));
    deleteActionButton.addActionListener(new ActionListener() {
      public void actionPerformed( ActionEvent e) {
        int[] selRows = aoTable.getSelectedRows();
        if(selRows.length > 0){
          aoTable.getCellEditor(aoTable.getSelectedRow(), aoTable.getSelectedColumn()).cancelCellEditing();
          aoTable.clearSelection();
          ((ECActionsTableModel)aoTable.getModel()).removeRows(selRows);
          aoTable.addNotify();
        }
      }
    });

    Border border1 = BorderFactory.createCompoundBorder(
        BorderFactory.createLineBorder(Color.black), BorderFactory
        .createEmptyBorder(2, 4, 2, 4));

    aoTable = new JTable();
    aoTablePane = new JScrollPane(aoTable);
    aoTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    aoTable.setFont(getFont());
    aoTable.setBorder(border1);
    aoTable.setGridColor(Color.black);
    aoTable.setRowSelectionAllowed(true);
    setComponentSize(aoTablePane, new Dimension(255, 83));

    Element newStateElement = document.createElement("ECState");
    Element newActionElement = document.createElement("ECAction");
    newStateElement.appendChild(newActionElement);

    aoTable.setModel(new ECActionsTableModel(isForAddingState? newStateElement : stateElement));

    //Setting properties of the first column of aoTable
    TableColumn firstColumn = aoTable.getColumnModel().getColumn(0);
    DefaultTableCellRenderer firstColumnRenderer = new DefaultTableCellRenderer();
    firstColumnRenderer.setHorizontalAlignment(SwingConstants.CENTER);
    firstColumn.setCellRenderer(firstColumnRenderer);
    firstColumn.setMaxWidth(20);
    firstColumn.setMinWidth(20);
    firstColumn.setResizable(false);

    //Adding items to algorithmCell (column index : 1)
    JComboBox algorithmCell = new JComboBox();
    algorithmCell.setFont(getFont());
    algorithmCell.setEditable(false);
    algorithmCell.addItem("");

    NodeList algorithmList = document.getElementsByTagName("Algorithm");
    for(int i = 0; i < algorithmList.getLength(); i++)
      algorithmCell.addItem(((Element) algorithmList.item(i)).getAttribute("Name"));
    aoTable.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(algorithmCell));

    //Adding items to outputCell (column index : 2)
    JComboBox outputCell = new JComboBox();
    outputCell.setFont(getFont());
    outputCell.setEditable(false);
    outputCell.addItem("");

    NodeList interfaceList = document.getElementsByTagName("InterfaceList");
    NodeList eventOutputList = ((Element) interfaceList.item(0)).getElementsByTagName("EventOutputs");
    NodeList eventOutputNodes = eventOutputList.item(0).getChildNodes();
    for(int i = 0; i < eventOutputNodes.getLength(); i++){
      outputCell.addItem(((Element) eventOutputNodes.item(i)).getAttribute("Name"));
    }
    aoTable.getColumnModel().getColumn(2).setCellEditor(new DefaultCellEditor(outputCell));

    actionPaneLayout.linkSize(SwingConstants.HORIZONTAL, addActionButton, deleteActionButton);

    actionPaneLayout.setHorizontalGroup(actionPaneLayout.createSequentialGroup()
        .addGap(10)
        .addGroup(actionPaneLayout.createParallelGroup(LEADING)
            .addComponent(aoTablePane)
            .addGroup(actionPaneLayout.createSequentialGroup()
                .addComponent(addActionButton)
                .addGap(5)
                .addComponent(deleteActionButton))));
    actionPaneLayout.setVerticalGroup(actionPaneLayout.createSequentialGroup()
        .addGap(5)
        .addComponent(aoTablePane)
        .addGap(5)
        .addGroup(actionPaneLayout.createParallelGroup(LEADING)
            .addComponent(addActionButton)
            .addComponent(deleteActionButton)));
    return actionPane;
  }
View Full Code Here

  }
 
 
  private JPanel createConditionPane() {
    JPanel contentPane = new JPanel();
    GroupLayout cpLayout = new GroupLayout(contentPane);
    contentPane.setLayout(cpLayout);

    TitledBorder cpBorder = new TitledBorder(" Transition Condition  ");
    Font sizeTenFont = cpBorder.getTitleFont().deriveFont(new Float(10));
    cpBorder.setTitleFont(sizeTenFont);
    contentPane.setBorder(cpBorder);

    JLabel eventLabel = new JLabel("Event");
    eventLabel.setFont(sizeTenFont);
    JLabel conditionLabel = new JLabel("Guard Condition");
    conditionLabel.setFont(sizeTenFont);
   
    NodeList tempList,
      eventList = null,
      inputVarsList = null,
      internalVarsList = null;
   
    tempList = document.getElementsByTagName("EventInputs");
    if(tempList != null && tempList.getLength() > 0){
      eventList = tempList.item(0).getChildNodes();
    }
   
    tempList = document.getElementsByTagName("InputVars");
    if(tempList != null && tempList.getLength() > 0){
      inputVarsList = tempList.item(0).getChildNodes();
    }
   
    tempList = document.getElementsByTagName("InternalVars");
    if(tempList != null && tempList.getLength() > 0){
      internalVarsList = tempList.item(0).getChildNodes();
    }
   
    Vector<String> eventNames = new Vector<String>();
    Vector<String> conditionList = new Vector<String>();

    eventNames.add("");
    eventNames.add("1");
    if(eventList != null){
      for(int i = 0; i < eventList.getLength(); i++)
        eventNames.add(((Element)eventList.item(i)).getAttribute("Name"));
    }

    conditionList.add("");
    if(inputVarsList != null){
      for(int i = 0; i < inputVarsList.getLength(); i++)
        conditionList.add(((Element)inputVarsList.item(i)).getAttribute("Name"));
    }
   
    if(internalVarsList != null){
      for(int i = 0; i < internalVarsList.getLength(); i++)
        conditionList.add(((Element)internalVarsList.item(i)).getAttribute("Name"));
    }

    eventListBox = new JComboBox(eventNames);
    eventListBox.setFont(sizeTenFont);

    guardConditionListBox = new JComboBox(conditionList);
    guardConditionListBox.setFont(sizeTenFont);
    guardConditionListBox.setEditable(true);

    cpLayout.setHorizontalGroup(cpLayout.createSequentialGroup()
        .addGap(10)
        .addGroup(cpLayout.createParallelGroup(LEADING)
            .addComponent(eventLabel)
            .addComponent(conditionLabel))
            .addGap(10)
            .addGroup(cpLayout.createParallelGroup(LEADING)
                .addComponent(eventListBox)
                .addComponent(guardConditionListBox))
                .addGap(10));
    cpLayout.setVerticalGroup(cpLayout.createSequentialGroup()
        .addGap(5)
        .addGroup(cpLayout.createParallelGroup(CENTER)
            .addComponent(eventLabel)
            .addComponent(eventListBox))
            .addGap(5)
            .addGroup(cpLayout.createParallelGroup(CENTER)
                .addComponent(conditionLabel)
                .addComponent(guardConditionListBox))
                .addGap(5));
   
    return contentPane;
View Full Code Here

  }


  private JPanel getVariableListPane(){
    JPanel contentPane = new JPanel();
    GroupLayout cpLayout = new GroupLayout(contentPane);
    contentPane.setLayout(cpLayout);

    TitledBorder border = new TitledBorder("Associated Variables");
    border.setTitleFont(border.getTitleFont().deriveFont(new Float(10)));
    contentPane.setBorder(border);

    /**
     * Retrieves list of all the input or output variables that belongs to this FunctionBlock.</br>
     * Its class variable <B>Vector associatedVariableList</B> consists of
     * Vector variables that has name of a variable as a first element and a Boolean variable
     * as a second element to indicate whether the given variable is associated with the event.
     * 
     * @author Jason
     */
    class Variables{
      private Vector<Vector> associatedVariableList = new Vector<Vector>();

      private Variables(Element eventElement){
        NodeList eventInputNL = document.getElementsByTagName("EventInputs");
        if(eventInputNL.getLength() != 0){
          NodeList inputEventNodes = eventInputNL.item(0).getChildNodes();
          boolean isInputEvent = false;
          for(int i = 0; i < inputEventNodes.getLength(); i++){
            if(inputEventNodes.item(i).equals(eventElement)){
              isInputEvent = true;
              break;
            }
          }
          updateAssociatedVariableList(isInputEvent);
        }
      }
      private Variables(EventType et){
        boolean isInputEvent = false;
        if(et == EventType.Input)
          isInputEvent = true;
        else if(et == EventType.Output)
          isInputEvent = false;
        updateAssociatedVariableList(isInputEvent);
      }

      private void updateAssociatedVariableList(boolean isInputEvent) {
        NodeList variableNodes;
        if(isInputEvent){
          try{
            variableNodes = document.getElementsByTagName("InputVars").item(0).getChildNodes();
          } catch (NullPointerException e){
            variableNodes = null;
            associatedVariableList = new Vector<Vector>();
            return;
          }
        }
        else{
          try{
            variableNodes = document.getElementsByTagName("OutputVars").item(0).getChildNodes();
          } catch (NullPointerException e){
            variableNodes = null;
            associatedVariableList = new Vector<Vector>();
            return;
          }
        }

        for(int i = 0; i < variableNodes.getLength(); i++){
          Element variableElem = (Element) variableNodes.item(i);
          Vector variable = new Vector(2);
          variable.add(0, variableElem.getAttribute("Name"));
          associatedVariableList.add(variable);
        }
        try{
          NodeList associatedVarList = eventElement.getChildNodes();
          for(int i = 0; i < associatedVariableList.size(); i++){
            String variableName = associatedVariableList.get(i).get(0).toString();
            for(int j = 0; j < associatedVarList.getLength(); j++){
              String associatedVarName = ((Element) associatedVarList.item(j)).getAttribute("Var");
              if(variableName.equals(associatedVarName))
                associatedVariableList.get(i).add(1, new Boolean(true));
              else {
                if(associatedVariableList.get(i).size() == 1){
                  associatedVariableList.get(i).add(1, new Boolean(false));
                }
              }
            }
          }
        } catch (NullPointerException e){
          for(int i = 0; i < associatedVariableList.size(); i++) {
            associatedVariableList.get(i).add(1, new Boolean(false));
          }
        }

      }

      private Vector<Vector> getAssociatedVarList(){
        return associatedVariableList;
      }
    }
    Vector<Vector> variableList;
    Variables variables;
    if(isForAddingEvent)
      variables = new Variables(eventType);

    else
      variables = new Variables(eventElement);
    variableList = variables.getAssociatedVarList();
    Vector<String> columnHeading = new Vector<String>(2);
    columnHeading.add("Variable");
    columnHeading.add("Assocated");

    variableTable = new JTable(variableList.size(), 2);

    DefaultTableModel vtTableModel = (DefaultTableModel)variableTable.getModel();
    vtTableModel.setDataVector(variableList, columnHeading);

    /**
     * Set CellRenderer and CellEditor if there is any element in the table.
     * Otherwise, skip this setting.
     */
    if(variableList.size() > 0){
      JCheckBox checkBox = new JCheckBox();
      DefaultCellEditor cellEditor = new DefaultCellEditor(checkBox);
      checkBox.setHorizontalAlignment(SwingConstants.CENTER);
      variableTable.getColumnModel().getColumn(1).setCellEditor(cellEditor);
      TableCellRenderer booleanCellRenderer =
        (TableCellRenderer) variableTable.getDefaultRenderer(vtTableModel
            .getValueAt(0, 1).getClass())
            .getTableCellRendererComponent
            (variableTable, variableList.get(0).get(1),false, false, 0, 1);
      variableTable.getColumnModel().getColumn(1).setCellRenderer(booleanCellRenderer);
    }

    variableTable.setGridColor(Color.gray);
    float fontSizeTen = 10;
    variableTable.setFont(getFont().deriveFont(fontSizeTen));
    JScrollPane variableTablePane = new JScrollPane(variableTable);
    variableTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    cpLayout.setHorizontalGroup(cpLayout.createSequentialGroup()
        .addGap(7)
        .addComponent(variableTablePane)
        .addGap(5));
    cpLayout.setVerticalGroup(cpLayout.createSequentialGroup()
        .addComponent(variableTablePane)
        .addGap(5));
    Dimension size = new Dimension(350,112);
    contentPane.setMinimumSize(size);
    contentPane.setMaximumSize(size);
View Full Code Here

      initialValueField.setText(varElement.getAttribute("InitialValue"));
    }
  }
  private JPanel createVariableDetailPane(){
    JPanel contentPane = new JPanel();
    GroupLayout layout = new GroupLayout(contentPane);
    layout.setAutoCreateGaps(true);
    contentPane.setLayout(layout);

    Font sizeTenFont = getFont().deriveFont(new Float(10));
    TitledBorder border = new TitledBorder("Variable Details");
    border.setTitleFont(sizeTenFont);

    contentPane.setBorder(border);

    arraySizeLabel.setFont(sizeTenFont);
    typeLabel.setFont(sizeTenFont);
    initialValueLabel.setFont(sizeTenFont);

    arraySizeField.setFont(sizeTenFont);
    typeBox.setFont(sizeTenFont);
    initialValueField.setFont(sizeTenFont);

    typeBox.setEditable(false);

    arraySizeLabel.setMaximumSize(new Dimension(arraySizeLabel.getWidth()+10, arraySizeLabel.getHeight()));
    arraySizeField.setMinimumSize(new Dimension(20, arraySizeField.getHeight()));

    layout.setHorizontalGroup(layout.createSequentialGroup()
        .addGap(10)
        .addGroup(layout.createParallelGroup(LEADING)
            .addComponent(typeLabel)
            .addComponent(initialValueLabel))
            .addGroup(layout.createParallelGroup(LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(typeBox)
                    .addComponent(arraySizeLabel)
                    .addComponent(arraySizeField))
                    .addComponent(initialValueField))
                    .addGap(10));
    layout.setVerticalGroup(layout.createSequentialGroup()
        .addGroup(layout.createParallelGroup(CENTER)
            .addComponent(typeLabel)
            .addComponent(typeBox)
            .addComponent(arraySizeLabel)
            .addComponent(arraySizeField))
            .addGroup(layout.createParallelGroup(CENTER)
                .addComponent(initialValueLabel)
                .addComponent(initialValueField))
                .addGap(7));

    return contentPane;
View Full Code Here

TOP

Related Classes of javax.swing.GroupLayout$Spring

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.