Package javax.swing

Examples of javax.swing.GroupLayout$SpringDelta


        labelPreview.setHorizontalAlignment(SwingConstants.CENTER);
        labelPreview.setText("The quick brown fox jumped over the lazy dog");
        panelPreview.add(labelPreview, BorderLayout.CENTER);

        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(Alignment.LEADING)
                    .addComponent(panelPreview, GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(Alignment.LEADING)
                            .addComponent(editFamily, GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                            .addComponent(labelFamily, GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                            .addComponent(scrollerFamily, GroupLayout.PREFERRED_SIZE, 174, GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(labelStyle, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(editStyle)
                            .addComponent(scrollerStyle, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(Alignment.LEADING)
                            .addComponent(labelSize, GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE)
                            .addComponent(editSize, GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE)
                            .addComponent(scrollerSize, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE)))
                    .addGroup(Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(buttonOK)
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addComponent(buttonCancel)
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addComponent(buttonHelp)))
                .addContainerGap())
        );

        layout.linkSize(SwingConstants.HORIZONTAL, new Component[] {buttonCancel, buttonHelp, buttonOK});

        layout.setVerticalGroup(
            layout.createParallelGroup(Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                            .addComponent(labelFamily)
                            .addComponent(labelSize))
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                            .addComponent(editFamily, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(editSize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(Alignment.LEADING)
                            .addComponent(scrollerFamily, GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)
                            .addComponent(scrollerSize, GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(labelStyle)
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addComponent(editStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addComponent(scrollerStyle, GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)))
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(panelPreview, GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(buttonHelp)
                    .addComponent(buttonCancel)
                    .addComponent(buttonOK))
                .addContainerGap())
        );
View Full Code Here


  // desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGap(0, 400, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGap(0, 300, Short.MAX_VALUE));

    pack();
  }// </editor-fold>//GEN-END:initComponents
View Full Code Here

  // desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGap(0, 400, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGap(0, 300, Short.MAX_VALUE));

    pack();
  }// </editor-fold>//GEN-END:initComponents
View Full Code Here

        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        label.setText("Below you see a GLCanvas");

        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(Alignment.LEADING)
                    .addComponent(canvas, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                    .addComponent(label))
                .addContainerGap())
       
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(label)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(canvas, GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                .addContainerGap())
View Full Code Here

    });
   
    JLabel lblSelectArea = new JLabel(getTextLabel(textLabels, 4)); //#id 734
    JPanel panelStatus = new JPanel();
   
    GroupLayout gl_contentPane = new GroupLayout(contentPane);
    gl_contentPane.setHorizontalGroup(
      gl_contentPane.createParallelGroup(Alignment.LEADING)
        .addGroup(gl_contentPane.createSequentialGroup()
          .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_contentPane.createSequentialGroup()
              .addGap(7)
              .addComponent(lblStartSharing))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addGap(21)
              .addComponent(btnStartStopSharing, 200, 200, 200)
              .addGap(52)
              )
            .addGroup(gl_contentPane.createSequentialGroup()
              .addGap(7)
              .addComponent(lblSelectArea, GroupLayout.PREFERRED_SIZE, 470, GroupLayout.PREFERRED_SIZE))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addContainerGap()
              .addComponent(panelScreen, GroupLayout.PREFERRED_SIZE, 472, GroupLayout.PREFERRED_SIZE))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addContainerGap()
              .addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 472, GroupLayout.PREFERRED_SIZE))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addComponent(panelStatus, 494, 494, 494)))
          .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    gl_contentPane.setVerticalGroup(
      gl_contentPane.createParallelGroup(Alignment.LEADING)
        .addGroup(gl_contentPane.createSequentialGroup()
          .addGap(7)
          .addComponent(lblStartSharing)
          .addGap(4)
          .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addComponent(btnStartStopSharing, 32, 32, 32)
            )
          .addGap(4)
          .addComponent(lblSelectArea)
          .addGap(4)
View Full Code Here

      public void actionPerformed(ActionEvent e) {
        core.setAudioNotify(audioNotify.isSelected());
      }
    });
   
    GroupLayout gl_contentPane = new GroupLayout(contentPane);
    gl_contentPane.setHorizontalGroup(
      gl_contentPane.createParallelGroup(Alignment.LEADING)
        .addGroup(gl_contentPane.createSequentialGroup()
          .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_contentPane.createSequentialGroup()
              .addGap(7)
              .addComponent(lblStartSharing)
              .addGap(15)
              .addComponent(audioNotify))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addGap(21)
              .addComponent(btnStartStopSharing, 200, 200, 200)
              .addGap(52)
              )
            .addGroup(gl_contentPane.createSequentialGroup()
              .addGap(7)
              .addComponent(lblSelectArea, GroupLayout.PREFERRED_SIZE, 470, GroupLayout.PREFERRED_SIZE))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addContainerGap()
              .addComponent(panelScreen, GroupLayout.PREFERRED_SIZE, 472, GroupLayout.PREFERRED_SIZE))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addContainerGap()
              .addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 472, GroupLayout.PREFERRED_SIZE))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addComponent(panelStatus, 494, 494, 494)))
          .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    gl_contentPane.setVerticalGroup(
      gl_contentPane.createParallelGroup(Alignment.LEADING)
        .addGroup(gl_contentPane.createSequentialGroup()
          .addGap(7)
          .addComponent(lblStartSharing)
          .addGap(4)
          .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addComponent(btnStartStopSharing, 32, 32, 32).addComponent(audioNotify, 32, 32, 32)
            )
          .addGap(4)
          .addComponent(lblSelectArea)
          .addGap(4)
View Full Code Here

      public void actionPerformed(ActionEvent e) {
        core.setAudioNotify(audioNotify.isSelected());
      }
    });
   
    GroupLayout gl_contentPane = new GroupLayout(contentPane);
    gl_contentPane.setHorizontalGroup(
      gl_contentPane.createParallelGroup(Alignment.LEADING)
        .addGroup(gl_contentPane.createSequentialGroup()
          .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_contentPane.createSequentialGroup()
              .addGap(7)
              .addComponent(lblStartSharing)
              .addGap(15)
              .addComponent(audioNotify))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addGap(21)
              .addComponent(btnStartStopSharing, 200, 200, 200)
              .addGap(52)
              )
            .addGroup(gl_contentPane.createSequentialGroup()
              .addGap(7)
              .addComponent(lblSelectArea, GroupLayout.PREFERRED_SIZE, 470, GroupLayout.PREFERRED_SIZE))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addContainerGap()
              .addComponent(panelScreen, GroupLayout.PREFERRED_SIZE, 472, GroupLayout.PREFERRED_SIZE))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addContainerGap()
              .addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 472, GroupLayout.PREFERRED_SIZE))
            .addGroup(gl_contentPane.createSequentialGroup()
              .addComponent(panelStatus, 494, 494, 494)))
          .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    gl_contentPane.setVerticalGroup(
      gl_contentPane.createParallelGroup(Alignment.LEADING)
        .addGroup(gl_contentPane.createSequentialGroup()
          .addGap(7)
          .addComponent(lblStartSharing)
          .addGap(4)
          .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addComponent(btnStartStopSharing, 32, 32, 32).addComponent(audioNotify, 32, 32, 32)
            )
          .addGap(4)
          .addComponent(lblSelectArea)
          .addGap(4)
View Full Code Here

    JLabel lblMemoryToAllocate = new JLabel("Memory to allocate: ");
    JLabel lblPack = new JLabel("Select Mod Pack: ");

    JLabel selectBuild = new JLabel("Select Modpack build: ");

    GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
    gl_contentPanel.setHorizontalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING).addGroup(gl_contentPanel.createSequentialGroup().addContainerGap().addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING).addGroup(gl_contentPanel.createSequentialGroup().addComponent(selectBuild).addPreferredGap(ComponentPlacement.RELATED).addComponent(buildsCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addComponent(devBuilds).addComponent(recBuilds).addComponent(customBuilds).addGroup(gl_contentPanel.createSequentialGroup()) // .addComponent(clipboardCheckbox)
    .addComponent(backupCheckbox).addComponent(retryLoginCheckbox).addComponent(latestLWJGLCheckbox).addComponent(clearCache).addComponent(buildInfo).addGroup(gl_contentPanel.createSequentialGroup().addComponent(lblMemoryToAllocate).addPreferredGap(ComponentPlacement.RELATED).addComponent(memoryCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))).addContainerGap(27, Short.MAX_VALUE)));

    Font font = new Font("Arial", Font.PLAIN, 11);
    backupCheckbox.setFont(font);
    // clipboardCheckbox.setFont(font);
    devBuilds.setFont(font);
    recBuilds.setFont(font);
    retryLoginCheckbox.setFont(font);
    clearCache.setFont(font);
    clearCache.setActionCommand("Clear Cache");
    clearCache.addActionListener(this);
    gl_contentPanel.setVerticalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING).addGroup(gl_contentPanel.createSequentialGroup().addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE).addComponent(selectBuild).addComponent(buildsCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addComponent(devBuilds).addComponent(recBuilds).addComponent(customBuilds).addComponent(retryLoginCheckbox).addPreferredGap(ComponentPlacement.RELATED) // .addComponent(clipboardCheckbox)
    .addComponent(backupCheckbox).addComponent(latestLWJGLCheckbox).addPreferredGap(ComponentPlacement.RELATED).addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE).addComponent(memoryCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(lblMemoryToAllocate)).addPreferredGap(ComponentPlacement.RELATED).addComponent(clearCache).addPreferredGap(ComponentPlacement.RELATED).addComponent(buildInfo).addContainerGap(316, Short.MAX_VALUE)));

    contentPanel.setLayout(gl_contentPanel);
    {
      JPanel buttonPane = new JPanel();
      buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
View Full Code Here

                vv.repaint();
            }
        });
        vertLabelPosComboBox.setSelectedItem(Renderer.VertexLabel.Position.AUTO);

        GroupLayout jPanel1Layout = new GroupLayout(labelsPanel);
        labelsPanel.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(jPanel1Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout
                                        .createSequentialGroup()
                                        .addGroup(jPanel1Layout
                                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(vertLabelCheckBox)
                                                        .addGroup(jPanel1Layout
                                                                        .createSequentialGroup()
                                                                        .addComponent(vertLabelPos)
                                                                        .addPreferredGap(
                                                                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(vertLabelPosComboBox, 0, 127,
                                                                                        Short.MAX_VALUE)).addComponent(
                                                                        edgeLabelCheckBox).addComponent(
                                                                        showExploredCheckBox)).addContainerGap()));
        jPanel1Layout.setVerticalGroup(jPanel1Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout
                                        .createSequentialGroup()
                                        .addComponent(vertLabelCheckBox)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel1Layout
                                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel1Layout
                                                                        .createParallelGroup(
                                                                                        javax.swing.GroupLayout.Alignment.BASELINE)
                                                                        .addComponent(vertLabelPos)
                                                                        .addComponent(vertLabelPosComboBox,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(jPanel1Layout
                                                                        .createSequentialGroup()
                                                                        .addGap(25, 25, 25)
                                                                        .addGroup(jPanel1Layout
                                                                                        .createParallelGroup(
                                                                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                                                        .addComponent(edgeLabelCheckBox))))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 2,
                                                        Short.MAX_VALUE).addComponent(showExploredCheckBox)));

        layoutTypePanel.setBorder(BorderFactory.createTitledBorder("Layout Type"));

        layoutTypeComboBox.setName("layoutTypeComboBox");
        layoutTypeComboBox.setModel(new DefaultComboBoxModel(new JUNGHelper.LayoutType[] { JUNGHelper.LayoutType.FR,
                        JUNGHelper.LayoutType.CIRCLE, JUNGHelper.LayoutType.ISOM, JUNGHelper.LayoutType.KK,
                        JUNGHelper.LayoutType.SPRING }));
        layoutTypeComboBox.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                try {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        Layout<Object, Object> l = jView_.getLayout((JUNGHelper.LayoutType) e.getItem());
                        l.setGraph(g);
                        l.setInitializer(vv.getGraphLayout());
                        l.setSize(vv.getSize());
                        LayoutTransition<Object, Object> lt = new LayoutTransition<Object, Object>(vv, vv
                                        .getGraphLayout(), l);
                        Animator animator = new Animator(lt);
                        animator.start();

                        layout = l;
                        vv.repaint();
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                }

            }
        });
        layoutTypeComboBox.setSelectedItem(JUNGHelper.LayoutType.FR);

        GroupLayout layoutTypePanelLayout = new GroupLayout(layoutTypePanel);
        layoutTypePanel.setLayout(layoutTypePanelLayout);
        layoutTypePanelLayout.setHorizontalGroup(layoutTypePanelLayout.createParallelGroup(
                        GroupLayout.Alignment.LEADING).addComponent(layoutTypeComboBox, 0, 178, Short.MAX_VALUE));
        layoutTypePanelLayout.setVerticalGroup(layoutTypePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                        .addGroup(layoutTypePanelLayout.createSequentialGroup().addComponent(layoutTypeComboBox,
                                        GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(
                                        GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        mergePanel.setBorder(BorderFactory.createTitledBorder("Merge"));

        mergeVerticesButton.setText("Merge states");
        mergeVerticesButton.addActionListener(this);
        mergeVerticesButton.setActionCommand("mergeVerticesButton");

        expandVerticesButton.setText("Expand states");
        expandVerticesButton.addActionListener(this);
        expandVerticesButton.setActionCommand("expandVerticesButton");

        mergeEdgesButton.setText("Merge transitions");
        mergeEdgesButton.addActionListener(this);
        mergeEdgesButton.setActionCommand("mergeEdgesButton");

        expandEdgesButton.setText("Expand transitions");
        expandEdgesButton.addActionListener(this);
        expandEdgesButton.setActionCommand("expandEdgesButton");

        resetButton.setText("Reset");
        resetButton.addActionListener(this);
        resetButton.setActionCommand("resetButton");

        GroupLayout jPanel3Layout = new GroupLayout(mergePanel);
        mergePanel.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(
                        expandVerticesButton, GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE).addComponent(
                        mergeVerticesButton, GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
        //TODO add these back when the merge edges has been fixed.
        //.addComponent(mergeEdgesButton, GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
        //.addComponent(expandEdgesButton, GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
                        .addComponent(resetButton, GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE));
        jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                        jPanel3Layout.createSequentialGroup().addComponent(mergeVerticesButton).addPreferredGap(
                                        LayoutStyle.ComponentPlacement.RELATED).addComponent(expandVerticesButton)
                                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                        // TODO add these back when the merge edges has been fixed.
                                        //.addComponent(mergeEdgesButton)
                                        //.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
                                        //.addComponent(expandEdgesButton)
                                        //.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(resetButton).addContainerGap()));

        animationPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Animation"));

        //Create the label table
        Hashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();
        labelTable.put(new Integer(100), new JLabel("Fast"));
        labelTable.put(new Integer(1000), new JLabel("Normal"));
        labelTable.put(new Integer(3000), new JLabel("Slow"));
        animationSlider.setLabelTable(labelTable);
        animationSlider.setPaintLabels(true);
        animationSlider.setMajorTickSpacing(500);
        animationSlider.setMaximum(3000);
        animationSlider.setMinimum(100);
        animationSlider.setValue(300);
        animationSlider.setPaintTicks(true);
        animationSlider.setToolTipText("Use this slider to control the speed of the animation");
        animationSlider.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent evt) {
                JSlider slider = (JSlider) evt.getSource();
                if (!slider.getValueIsAdjusting()) {
                    animationSleepTime_ = slider.getValue();
                }
            }
        });
        animationSleepTime_ = animationSlider.getValue();

        animationButton.setText("Stop");
        animationButton.addActionListener(this);
        animationButton.setActionCommand("animationButton");

        animationCheckBox.setText("Show animation");
        animationCheckBox.setSelected(true);
        animationCheckBox.addActionListener(this);
        animationCheckBox.setActionCommand("animationCheckBox");

        animationToggleButton.setText("Pause");
        animationToggleButton.addActionListener(this);
        animationToggleButton.setActionCommand("animationToggleButton");

        javax.swing.GroupLayout animationPanelLayout = new javax.swing.GroupLayout(animationPanel);
        animationPanel.setLayout(animationPanelLayout);
        animationPanelLayout
                        .setHorizontalGroup(animationPanelLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(animationPanelLayout
                                                        .createSequentialGroup()
                                                        .addContainerGap()
                                                        .addGroup(animationPanelLayout
                                                                        .createParallelGroup(
                                                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                                        .addComponent(animationSlider,
                                                                                        javax.swing.GroupLayout.Alignment.TRAILING,
                                                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                        157, Short.MAX_VALUE)
                                                                        .addGroup(animationPanelLayout
                                                                                        .createParallelGroup(
                                                                                                        javax.swing.GroupLayout.Alignment.TRAILING,
                                                                                                        false)
                                                                                        .addGroup(animationPanelLayout
                                                                                                        .createSequentialGroup()
                                                                                                        .addComponent(animationToggleButton,
                                                                                                                        GroupLayout.DEFAULT_SIZE,
                                                                                                                        GroupLayout.DEFAULT_SIZE,
                                                                                                                        Short.MAX_VALUE)
                                                                                                        .addPreferredGap(
                                                                                                                        LayoutStyle.ComponentPlacement.RELATED)
                                                                                                        .addComponent(animationButton,
                                                                                                                        GroupLayout.DEFAULT_SIZE,
                                                                                                                        GroupLayout.DEFAULT_SIZE,
                                                                                                                        Short.MAX_VALUE))
                                                                                        .addComponent(animationCheckBox,
                                                                                                        javax.swing.GroupLayout.Alignment.LEADING)))
                                                        .addContainerGap()));
        animationPanelLayout.setVerticalGroup(animationPanelLayout.createParallelGroup(
                        javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                        animationPanelLayout.createSequentialGroup().addComponent(animationCheckBox).addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(
                                        animationPanelLayout.createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.BASELINE).addComponent(
                                                        animationToggleButton).addComponent(animationButton))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(animationSlider, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(21,
                                                        Short.MAX_VALUE)));

        capturePanel.setBorder(BorderFactory.createTitledBorder("Capture"));

        captureButton.setText("Save as image");
        captureButton.addActionListener(this);
        captureButton.setActionCommand("captureButton");

        GroupLayout jPanel4Layout = new GroupLayout(capturePanel);
        capturePanel.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(
                        captureButton, GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE));
        jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                        jPanel4Layout.createSequentialGroup().addComponent(captureButton).addContainerGap(
                                        GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        GroupLayout layout = new GroupLayout(panel);
        panel.setLayout(layout);
        layout.setHorizontalGroup(layout
                        .createParallelGroup(GroupLayout.Alignment.LEADING)
                        .addComponent(layoutTypePanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                        .addComponent(labelsPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(mergePanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(capturePanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(animationPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE));
        layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                        layout.createSequentialGroup().addComponent(labelsPanel, GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(
                                        LayoutStyle.ComponentPlacement.RELATED).addComponent(layoutTypePanel,
                                        GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE).addPreferredGap(
                                        LayoutStyle.ComponentPlacement.RELATED).addComponent(mergePanel,
View Full Code Here

        // add the tree into a scrollpane.
        jScrollPane1.setViewportView(tree);

        jPanel2.setBorder(BorderFactory.createTitledBorder("Test Sequences"));

        GroupLayout jPanel2Layout = new GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                        jPanel2Layout.createSequentialGroup().addContainerGap().addComponent(explScrollBar,
                                        GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE).addContainerGap()));
        jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                        jPanel2Layout.createSequentialGroup().addComponent(explScrollBar, GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addContainerGap(
                                        GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        GroupLayout layout = new GroupLayout(panel);
        panel.setLayout(layout);
        layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                        GroupLayout.Alignment.TRAILING,
                        layout.createSequentialGroup().addComponent(expandButton, GroupLayout.DEFAULT_SIZE, 94,
                                        Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(collapseButton, GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE))
                        .addComponent(jPanel2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE));
        layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
                        layout.createSequentialGroup().addGroup(
                                        layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(
                                                        collapseButton).addComponent(expandButton)).addPreferredGap(
                                        LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel2,
                                        GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE).addPreferredGap(
                                        LayoutStyle.ComponentPlacement.RELATED).addComponent(jScrollPane1,
View Full Code Here

TOP

Related Classes of javax.swing.GroupLayout$SpringDelta

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.