javax.swing.LayoutStyle的实例源码

项目:incubator-netbeans    文件ResourceWrapperEditor.java   
protected Component createCustomEditorGUI(Component resourcePanelGUI) {
    if (resourcePanelGUI == null)
        return delegateEditor.getCustomEditor();

    JPanel panel = new JPanel();
    Component delComp = delegateEditor.getCustomEditor();
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setautocreateGaps(true);
    layout.setHorizontalGroup(layout.createParallelGroup()
            .addComponent(delComp)
            .addGroup(layout.createSequentialGroup()
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(resourcePanelGUI)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)));
    layout.setVerticalGroup(layout.createSequentialGroup()
            .addComponent(delComp).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(resourcePanelGUI));

    return panel;
}
项目:incubator-netbeans    文件OperationDescriptionPanel.java   
private GroupLayout.ParallelGroup getVerticalGroup (GroupLayout layout,boolean hasPrimary,boolean hasrequired) {
    GroupLayout.ParallelGroup res = layout.createParallelGroup (/* XXX huh? GroupLayout.PREFERRED_SIZE*/);
    GroupLayout.SequentialGroup seq = layout.createSequentialGroup ();
    if (hasPrimary) {
        seq.addComponent (tpPrimaryTitle,GroupLayout.DEFAULT_SIZE,40,40)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addComponent (tpPrimaryPlugins,GroupLayout.PREFERRED_SIZE,tpPrimaryPlugins.getPreferredSize ().height,GroupLayout.PREFERRED_SIZE)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addGap (0,30,30);
    }
    if (hasrequired) {
        seq.addComponent (tpDependingTitle,80,80)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
                .addComponent (tpDependingPlugins,tpDependingPlugins.getPreferredSize ().height,GroupLayout.PREFERRED_SIZE)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED);
    }
    res.addGroup (seq);
    return res;
}
项目:incubator-netbeans    文件CssprepOptionsPanel.java   
private void init() {
    errorLabel.setText(" "); // NOI18N
    GroupLayout containerPanelLayout = new GroupLayout(containerPanel);
    containerPanel.setLayout(containerPanelLayout);
    GroupLayout.ParallelGroup horizontalGroup = containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    GroupLayout.SequentialGroup verticalGroup = containerPanelLayout.createSequentialGroup();
    containerPanelLayout.setHorizontalGroup(horizontalGroup);
    containerPanelLayout.setVerticalGroup(
        containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(verticalGroup)
    );
    for (CsspreprocessorUIImplementation.Options options : allOptions) {
        JComponent component = options.getComponent();
        Parameters.notNull("component",component); // NOI18N
        horizontalGroup.addComponent(component,Short.MAX_VALUE);
        verticalGroup.addComponent(component,GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    }
}
项目:incubator-netbeans    文件SwingAppLibDownloader.java   
private static JPanel searchingPanel(JLabel progressLabel,JComponent progressComponent) {
    JPanel panel = new JPanel();
    progressLabel.setLabelFor(progressComponent);
    javax.swing.GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                .addComponent(progressLabel,GroupLayout.Alignment.LEADING,Short.MAX_VALUE)
                .addComponent(progressComponent,399,Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(96,96,96)
            .addComponent(progressLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(progressComponent,GroupLayout.PREFERRED_SIZE)
            .addContainerGap(109,Short.MAX_VALUE))
    );
    return panel;
}
项目:stage-monitor    文件Monitor.java   
void layoutdisplay( int clockTop )
{
    displayLayout.setHorizontalGroup(
        displayLayout.createParallelGroup( GroupLayout.Alignment.CENTER)
            .addComponent(piePanel)
            .addComponent( ((clockTop==1)?timePanel:messagePanel) )
            .addComponent(datePanel)
            .addComponent(((clockTop==1)?messagePanel:timePanel)));

    displayLayout.setVerticalGroup(
        displayLayout.createSequentialGroup()
            .addComponent(piePanel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(((clockTop==1)?timePanel:messagePanel))
            .addComponent(datePanel)
            .addComponent(((clockTop==1)?messagePanel:timePanel)));

    displayPanel.validate();
}
项目:cats    文件ErrorConsole.java   
private void setButtonPanelLayout()
{

    GroupLayout buttonPanelLayout = new GroupLayout( buttonPanel );

    buttonPanel.setLayout( buttonPanelLayout );

    buttonPanelLayout.setHorizontalGroup( buttonPanelLayout.createParallelGroup( GroupLayout.Alignment.LEADING )
            .addGroup(
                    GroupLayout.Alignment.TRAILING,buttonPanelLayout.createSequentialGroup().addContainerGap( 248,Short.MAX_VALUE ).addComponent(
                            okButton ).addPreferredGap( LayoutStyle.ComponentPlacement.UNRELATED ).addComponent(
                            detailsButton ).addGap( 20,20,20 ) ) );

    buttonPanelLayout.setVerticalGroup( buttonPanelLayout.createParallelGroup( GroupLayout.Alignment.LEADING )
            .addGroup(
                    GroupLayout.Alignment.TRAILING,buttonPanelLayout.createSequentialGroup().addContainerGap( GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE ).addGroup(
                            buttonPanelLayout.createParallelGroup( GroupLayout.Alignment.BASELINE ).addComponent(
                                    okButton ).addComponent( detailsButton ) ).addContainerGap() ) );
}
项目:alevin-svn2    文件MultiAlgoScenarioWizard.java   
private void initGUI() {
    // Fill dropdown.
    String[] items = this.classnames.keySet().toArray(new String[0]);
    this.dropdown = new JComboBox<String>(items);

    // Select current generator in dropdown.
    for(int i = 0; i < items.length; i++) {
        if (this.generator.getName().equals(items[i])) {
            this.dropdown.setSelectedindex(i);
        }
    }

    // Create label.
    JLabel dropdownLabel = new JLabel("Generator:");
    dropdownLabel.setLabelFor(this.dropdown);
    dropdownLabel.setHorizontalAlignment(JLabel.TRAILING);

    // Initialize layout and add components to GUI.
    GroupLayout layout = new GroupLayout(this.panel);
    this.panel.setLayout(layout);
    layout.setautocreateGaps(true);
    layout.setautocreateContainerGaps(true);
    layout.setHorizontalGroup(layout
            .createSequentialGroup()
            .addComponent(dropdownLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(this.dropdown)
    );
    layout.setVerticalGroup(layout
            .createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(dropdownLabel)
            .addComponent(this.dropdown)
    );
}
项目:incubator-netbeans    文件AttachmentsPanel.java   
private void createAttachment (AttachmentInfo newAttachment) {
    AttachmentPanel attachment = new AttachmentPanel(nbCallback);
    attachment.setBackground(UIUtils.getSectionPanelBackground());
    horizontalGroup.addComponent(attachment,GroupLayout.PREFERRED_SIZE);
    verticalGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    verticalGroup.addComponent(attachment,GroupLayout.PREFERRED_SIZE);
    if (noneLabel.isVisible()) {
        noneLabel.setVisible(false);
        switchHelper();
        updateButtonText(false);
    }
    attachment.addPropertychangelistener(getDeletedListener());

    if (newAttachment != null) {
        attachment.setAttachment(newAttachment.getFile(),newAttachment.getDescription(),newAttachment.getContentType(),newAttachment.isPatch());
    }
    if(nbCallback != null) {
        File f = new File(Places.getUserDirectory(),nbCallback.getLogFilePath()); 
        if(f.exists()) {
            attachment.setAttachment(f,nbCallback.getLogFileDescription(),nbCallback.getLogFileContentType(),false); // NOI18N
        }
        attachment.browseButton.setEnabled(false);
        attachment.fileField.setEnabled(false);
        attachment.fileTypeCombo.setEnabled(false);
        attachment.patchChoice.setEnabled(false);
    } else {
        attachment.viewButton.setVisible(false);
    }

    newAttachments.add(attachment);
    UIUtils.keepFocusedComponentVisible(attachment,parentPanel);
    revalidate();
    attachment.addchangelistener(getchangelistener());
    attachment.fileField.requestFocus();
    if (nbCallback != null) {
        supp.fireChange();
    }
}
项目:incubator-netbeans    文件StringEditor.java   
@Override
protected Component createCustomEditorGUI(Component resourcePanelGUI) {
    if (resourcePanelGUI == null && ResourceSupport.isResourceableProperty(property)) {
        // not usable for full resourcing,only for internationalization
        // add a NOI18N checkBox so the user can mark the property as not to be internationalized
        Component customEd = delegateEditor.getCustomEditor();
        JPanel panel = new JPanel();
        GroupLayout layout = new GroupLayout(panel);
        panel.setLayout(layout);
        noI18nCheckBox = new JCheckBox();
        Mnemonics.setLocalizedText(noI18nCheckBox,NbBundle.getMessage(StringEditor.class,"CTL_NOI18NCheckBox")); // NOI18N
        noI18nCheckBox.getAccessibleContext().setAccessibleDescription(
                NbBundle.getBundle(
                    StringEditor.class).getString("ACD_NOI18NCheckBox")); //NOI18N

        layout.setHorizontalGroup(layout.createParallelGroup()
                .addComponent(customEd)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap().addComponent(noI18nCheckBox).addContainerGap()));
        layout.setVerticalGroup(layout.createSequentialGroup()
                .addComponent(customEd).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(noI18nCheckBox));
        return panel;
    }
    else {
        noI18nCheckBox = null;
        return super.createCustomEditorGUI(resourcePanelGUI);
    }
}
项目:incubator-netbeans    文件CommitPanel.java   
private Component makeVerticalStrut(JComponent compA,JComponent compB,LayoutStyle.ComponentPlacement relatedUnrelated) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,compB,relatedUnrelated,SOUTH,this);
    return Box.createVerticalStrut(height);
}
项目:incubator-netbeans    文件CommitPanel.java   
private Component makeHorizontalStrut(JComponent compA,LayoutStyle.ComponentPlacement relatedUnrelated) {
    int width = LayoutStyle.getInstance().getPreferredGap(
                        compA,WEST,this);
    return Box.createHorizontalStrut(width);
}
项目:incubator-netbeans    文件ExpandableMessage.java   
private static Component makeVerticalStrut(JComponent compA,JComponent compB) {
    LayoutStyle layoutStyle = LayoutStyle.getInstance();
    return Box.createVerticalStrut(
            layoutStyle.getPreferredGap(compA,UNRELATED,compA.getParent()));
}
项目:incubator-netbeans    文件VCSCommitPanel.java   
static Component makeVerticalStrut(JComponent compA,ComponentPlacement relatedUnrelated,JPanel parent) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,parent);
    return Box.createVerticalStrut(height);
}
项目:incubator-netbeans    文件VCSCommitPanel.java   
static Component makeHorizontalStrut(JComponent compA,JPanel parent) {
        int width = LayoutStyle.getInstance().getPreferredGap(
                            compA,parent);
        return Box.createHorizontalStrut(width);
}
项目:incubator-netbeans    文件CommentsPanel.java   
private void layoutHeaderPanel(JPanel headerPanel,JLabel iconLabel,JLabel leftLabel,JLabel commentLabel,JLabel rightLabel,LinkButton replyButton,LinkButton mailtoButton,JLabel stateLabel) {
    GroupLayout layout = new GroupLayout(headerPanel);
    headerPanel.setLayout(layout);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup()
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(stateLabel);
    }
    hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(commentLabel,Short.MAX_VALUE)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(rightLabel)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(mailtoButton);
    }
    layout.setHorizontalGroup(hGroup);

    GroupLayout.ParallelGroup vGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        vGroup.addComponent(stateLabel);
    }
    vGroup.addComponent(commentLabel)
          .addComponent(rightLabel)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        vGroup.addComponent(mailtoButton);
    }
    layout.setVerticalGroup(vGroup);
}
项目:incubator-netbeans    文件CsspreprocessorsCustomizerPanel.java   
/**
 * 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() {

    configureButton = new JButton();
    mainTabbedPane = new JTabbedPane();

    Mnemonics.setLocalizedText(configureButton,NbBundle.getMessage(CsspreprocessorsCustomizerPanel.class,"CsspreprocessorsCustomizerPanel.configureButton.text")); // NOI18N
    configureButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            configureButtonActionPerformed(evt);
        }
    });

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addComponent(mainTabbedPane,400,Short.MAX_VALUE)
        .addGroup(layout.createSequentialGroup()
            .addGap(0,Short.MAX_VALUE)
            .addComponent(configureButton))
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(GroupLayout.Alignment.TRAILING,layout.createSequentialGroup()
            .addComponent(configureButton)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(mainTabbedPane,269,Short.MAX_VALUE))
    );
}
项目:incubator-netbeans    文件HgUtils.java   
public static JComponent addContainerBorder(JComponent comp) {
    final LayoutStyle layoutStyle = LayoutStyle.getInstance();

    JPanel panel = new JPanel();
    panel.add(comp);
    panel.setBorder(BorderFactory.createEmptyBorder(
            layoutStyle.getContainerGap(comp,SwingConstants.norTH,null),layoutStyle.getContainerGap(comp,SwingConstants.WEST,SwingConstants.soUTH,SwingConstants.EAST,null)));
    return panel;
}
项目:incubator-netbeans    文件FakeJiraConnector.java   
private JPanel createControllerPanel() {
    JPanel controllerPanel = new JPanel();

    JLabel pane = new JLabel();
    pane.setText(NbBundle.getMessage(FakeJiraConnector.class,"MSG_NOT_YET_INSTALLED")); // NOI18N

    JButton downloadButton = new JButton();
    downloadButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            JiraUpdater.getInstance().downloadAndInstall(null);
        }
    });

    org.openide.awt.Mnemonics.setLocalizedText(downloadButton,org.openide.util.NbBundle.getMessage(FakeJiraConnector.class,"MissingJiraSupportPanel.downloadButton.text")); // NOI18N

    GroupLayout layout = new GroupLayout(controllerPanel);
    controllerPanel.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(pane,100,Short.MAX_VALUE))
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(downloadButton))
    );
    layout.setVerticalGroup(
    layout.createParallelGroup(GroupLayout.Alignment.LEADING)
    .addGroup(GroupLayout.Alignment.TRAILING,layout.createSequentialGroup()
        .addComponent(pane)
        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(downloadButton))
        .addContainerGap())
    );

    return controllerPanel;
}
项目:incubator-netbeans    文件RepositorySelectorBuilder.java   
private static void addInsetsToPanel(JComponent comp) {
    LayoutStyle layoutStyle = LayoutStyle.getInstance();
    comp.setBorder(BorderFactory.createEmptyBorder(
            layoutStyle.getContainerGap(comp,norTH,EAST,null)));
}
项目:incubator-netbeans    文件RepositorySelectorBuilder.java   
private int getSpace(JComponent parent,JComponent compA,LayoutStyle.ComponentPlacement related,int horizontal) {
    return LayoutStyle.getInstance()
           .getPreferredGap(compA,related,(horizontal == HORIZONTAL) ? EAST : SOUTH,parent);
}
项目:BlocktopograPHPC-GUI    文件NBTCelln.java   
private void initComponents() {
    nameLabel = new EditableJLabel("Name");
    separatorLabel = new JLabel();
    valueLabel = new EditableJLabel("Value");
    iconLabel = new JLabel();

    nameLabel.getLabel().setFont(nameLabel.getLabel().getFont().deriveFont(nameLabel.getLabel().getFont().getStyle() | Font.BOLD));

    separatorLabel.setText(":");

    iconLabel.setText(" ");
    iconLabel.setIconTextGap(0);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(iconLabel,23,GroupLayout.PREFERRED_SIZE)
            .addGap(5,5,5)
            .addComponent(nameLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(separatorLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(valueLabel)
            .addGap(0,0))
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(nameLabel)
            .addComponent(separatorLabel)
            .addComponent(valueLabel)
            .addComponent(iconLabel))
    );
}
项目:BlocktopograPHPC-GUI    文件NBTCell.java   
/**
 * 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() {

    nameLabel = new JLabel();
    separatorLabel = new JLabel();
    valueLabel = new JLabel();

    nameLabel.setFont(nameLabel.getFont().deriveFont(nameLabel.getFont().getStyle() | Font.BOLD));
    nameLabel.setText("Name");

    separatorLabel.setText(":");

    valueLabel.setText("Value");

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(0,0)
            .addComponent(nameLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(separatorLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(valueLabel)
            .addGap(0,0))
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(nameLabel)
            .addComponent(separatorLabel)
            .addComponent(valueLabel))
    );
}
项目:BlocktopograPHPC-GUI    文件WorldWindowFooterBar.java   
/**
 * 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() {

    footerMessage = new JLabel();
    messageIconLabel = new JLabel();

    setBorder(BorderFactory.createEtchedBorder());

    footerMessage.setHorizontalAlignment(SwingConstants.RIGHT);
    footerMessage.setText(" ");
    footerMessage.setHorizontalTextPosition(SwingConstants.RIGHT);

    messageIconLabel.setText(" ");
    messageIconLabel.setIconTextGap(0);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(footerMessage,377,Short.MAX_VALUE)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(messageIconLabel)
            .addContainerGap())
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(GroupLayout.Alignment.TRAILING,layout.createSequentialGroup()
            .addGap(0,0)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(footerMessage)
                .addComponent(messageIconLabel,GroupLayout.PREFERRED_SIZE)))
    );
}
项目:mapleLemon    文件DebugWindow.java   
private void initComponents() {
    this.jScrollPane1 = new JScrollPane();
    this.jTextArea1 = new JTextArea();
    this.jButton1 = new JButton();
    this.jLabel1 = new JLabel();

    setDefaultCloSEOperation(2);
    setTitle("调试窗口");
    setResizable(false);

    this.jTextArea1.setColumns(20);
    this.jTextArea1.setLineWrap(true);
    this.jTextArea1.setRows(5);
    this.jScrollPane1.setViewportView(this.jTextArea1);

    this.jButton1.setText("测试封包");
    this.jButton1.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            DebugWindow.this.jButton1ActionPerformed(evt);
        }
    });
    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(this.jScrollPane1,-1,446,32767).addGroup(GroupLayout.Alignment.TRAILING,layout.createSequentialGroup().addComponent(this.jLabel1,32767).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jButton1))).addContainerGap()));

    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(this.jScrollPane1,253,32767).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING,false).addComponent(this.jButton1).addGroup(layout.createSequentialGroup().addGap(0,0).addComponent(this.jLabel1,32767))).addContainerGap()));

    pack();
}
项目:cats    文件ErrorConsole.java   
private void setDetailsLayout()
{

    mainFrame.setPreferredSize( new Dimension( 450,480 ) );

    GroupLayout mainFrameLayout = new GroupLayout( mainFrame.getContentPane() );

    mainFrame.getContentPane().setLayout( mainFrameLayout );

    mainFrameLayout.setHorizontalGroup( mainFrameLayout.createParallelGroup( GroupLayout.Alignment.LEADING )
            .addGroup(
                    mainFrameLayout.createSequentialGroup().addContainerGap().addGroup(
                            mainFrameLayout.createParallelGroup( GroupLayout.Alignment.LEADING ).addComponent(
                                    detailsTextAreaPanel,Short.MAX_VALUE ).addComponent( errorTablePanel,Short.MAX_VALUE ).addComponent( buttonPanel,GroupLayout.Alignment.TRAILING,Short.MAX_VALUE ) ).addContainerGap() ) );

    mainFrameLayout.setVerticalGroup( mainFrameLayout.createParallelGroup( GroupLayout.Alignment.LEADING )
            .addGroup(
                    mainFrameLayout.createSequentialGroup().addContainerGap().addComponent( errorTablePanel,GroupLayout.PREFERRED_SIZE )
                            .addPreferredGap( LayoutStyle.ComponentPlacement.RELATED ).addComponent(
                                    detailsTextAreaPanel,GroupLayout.PREFERRED_SIZE ).addPreferredGap(
                                    LayoutStyle.ComponentPlacement.RELATED ).addComponent( buttonPanel,GroupLayout.PREFERRED_SIZE ).addContainerGap() ) );
}
项目:Alevin    文件MultiAlgoScenarioWizard.java   
private void initGUI() {
    // Fill dropdown.
    String[] items = this.classnames.keySet().toArray(new String[0]);
    this.dropdown = new JComboBox<String>(items);

    // Select current generator in dropdown.
    for(int i = 0; i < items.length; i++) {
        if (this.generator.getName().equals(items[i])) {
            this.dropdown.setSelectedindex(i);
        }
    }

    // Create label.
    JLabel dropdownLabel = new JLabel("Generator:");
    dropdownLabel.setLabelFor(this.dropdown);
    dropdownLabel.setHorizontalAlignment(JLabel.TRAILING);

    // Initialize layout and add components to GUI.
    GroupLayout layout = new GroupLayout(this.panel);
    this.panel.setLayout(layout);
    layout.setautocreateGaps(true);
    layout.setautocreateContainerGaps(true);
    layout.setHorizontalGroup(layout
            .createSequentialGroup()
            .addComponent(dropdownLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(this.dropdown)
    );
    layout.setVerticalGroup(layout
            .createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(dropdownLabel)
            .addComponent(this.dropdown)
    );
}
项目:cyNeo4j    文件NeoNetworkAnalyzerControlPanel.java   
private JPanel buildDirectionalityPanel() {
    JLabel directionalityLabel = new JLabel("Directionality");
    undirButton = new JRadioButton("Undirected");
    dirButton = new JRadioButton("Directed");
    dirButton.setEnabled(false);

    ButtonGroup directionality = new ButtonGroup();
    directionality.add(undirButton);
    directionality.add(dirButton);

    undirButton.setSelected(true);


    JPanel res = new JPanel();

    GroupLayout layout = new GroupLayout(res);

    layout.setHorizontalGroup(
            layout.createParallelGroup()
                .addComponent(directionalityLabel)
                .addComponent(undirButton)
                .addComponent(dirButton)
            );
    layout.setVerticalGroup(
            layout.createSequentialGroup()
                .addComponent(directionalityLabel)
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(undirButton)
                .addComponent(dirButton)

            );

    res.setLayout(layout);

    return res;
}
项目:MultiDendrograms    文件InfoExitPanel.java   
private void getPanel() {

        // Info
        btnInfo = Formats.getFormattedBoldButton(sInfo); // Info
        btnInfo.addActionListener(this);

        // Exit
        btnExit = Formats.getFormattedBoldButton(sExit); // Exit
        btnExit.addActionListener(this);

        // layout
        GroupLayout layout = new GroupLayout(this);
        this.setLayout(layout);

        layout.setHorizontalGroup(
                layout.createSequentialGroup()
                        .addGap(5,5)
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED,Short.MAX_VALUE)
                        .addComponent(btnInfo,110,110)
                        .addGap(3,3,3)
                        .addComponent(btnExit,110)
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED,Short.MAX_VALUE)
                        .addGap(5,5));

        layout.setVerticalGroup(
                layout.createSequentialGroup()
                        .addGap(8,8,8)
                        .addGroup(
                                layout.createParallelGroup(GroupLayout.Alignment.CENTER)
                                        .addComponent(btnInfo)
                                        .addComponent(btnExit))
                        .addGap(8,8));

}
项目:jClipCorn    文件SmallClipCharSortSelector.java   
private void createLayout() {
    this.setLayout(layout = new GroupLayout(this));

    setFloatable(false);

    SequentialGroup hGroup = layout.createSequentialGroup();
    ParallelGroup pGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE);

    boolean isSubst = LookAndFeelManager.isSubstance();

    for(int i = 0; i < BUTTONCOUNT; i++) {
        if (isSubst) {
            hGroup.addComponent(buttons[i],sizes[i],buttons[i].getPreferredSize().width,Short.MAX_VALUE);
            pGroup.addComponent(buttons[i],buttons[i].getPreferredSize().height,Short.MAX_VALUE);
        } else {
            hGroup.addComponent(buttons[i]);
            pGroup.addComponent(buttons[i]);
        }

        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED,Short.MAX_VALUE);
        final int fi = i;
        buttons[i].addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                onClick(fi);
            }
        });
    }

    if (isSubst) {
        hGroup.addGap(4);
    }

    layout.setHorizontalGroup(hGroup);

    layout.setVerticalGroup(pGroup);
}
项目:vars    文件VideoArchiveEditorPanel.java   
private JPanel getSearchPanel() {
    if (searchPanel == null) {
        searchPanel = new JPanel();
        GroupLayout gl_searchPanel = new GroupLayout(searchPanel);
        gl_searchPanel
                .setHorizontalGroup(gl_searchPanel.createParallelGroup(GroupLayout.Alignment.LEADING)
                        .addGroup(gl_searchPanel.createSequentialGroup().addContainerGap()
                                .addGroup(gl_searchPanel.createParallelGroup(GroupLayout.Alignment.LEADING)
                                        .addGroup(gl_searchPanel.createSequentialGroup()
                                                .addGroup(gl_searchPanel.createParallelGroup(GroupLayout.Alignment.LEADING)
                                                        .addComponent(getChckbxAssociation()).addComponent(getChckbxConcept()))
                                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(gl_searchPanel.createParallelGroup(GroupLayout.Alignment.LEADING)
                                                        .addComponent(getConceptComboBox(),309,Short.MAX_VALUE)
                                                        .addComponent(getAssociationComboBox(),Short.MAX_VALUE)))
                                        .addComponent(getBtnSearch(),GroupLayout.Alignment.TRAILING))
                                .addContainerGap()));
        gl_searchPanel
                .setVerticalGroup(gl_searchPanel.createParallelGroup(GroupLayout.Alignment.TRAILING)
                        .addGroup(gl_searchPanel.createSequentialGroup()
                                .addContainerGap(GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE)
                                .addGroup(gl_searchPanel.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                        .addComponent(getChckbxConcept())
                                        .addComponent(getConceptComboBox(),GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(gl_searchPanel
                                        .createParallelGroup(GroupLayout.Alignment.BASELINE)
                                        .addComponent(getChckbxAssociation())
                                        .addComponent(getAssociationComboBox(),GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(LayoutStyle.ComponentPlacement
                                        .RELATED).addComponent(getBtnSearch())));
        searchPanel.setLayout(gl_searchPanel);
    }

    return searchPanel;
}
项目:alevin-svn2    文件ConstraintsGeneratorDialog.java   
@Override
public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column) {

    JPanel panel = new JPanel();
    if (value instanceof String[]) {
        String[] valueArray = (String[]) value;
        if (valueArray.length == 0)
            return panel;
        GroupLayout layout = new GroupLayout(panel);
        panel.setLayout(layout);
        layout.setautocreateGaps(true);
        layout.setautocreateContainerGaps(true);
        SequentialGroup cols = layout.createSequentialGroup();
        layout.setHorizontalGroup(cols);
        ParallelGroup col1 = layout
                .createParallelGroup(GroupLayout.Alignment.LEADING);
        ParallelGroup col2 = layout
                .createParallelGroup(GroupLayout.Alignment.TRAILING);
        cols.addGroup(col1)
                .addPreferredGap(
                        LayoutStyle.ComponentPlacement.RELATED,Short.MAX_VALUE)
                .addGroup(col2);
        SequentialGroup rows = layout.createSequentialGroup();
        layout.setVerticalGroup(rows);
        for (int i = 0; i < valueArray.length; i++) {
            // the value array has null elements for
            // IdResource/Demand
            if (valueArray[i] != null) {
                /* Todo: Fix ArrayIndexOutofBounds Exception here 
                 * Update: Problem is actually above. Probably linked to resources without setters. */
                //System.out.println("ValueArray: " + valueArray[i]);
                //for (int j = 0; j < resParamNames.size(); j++) { System.out.println("resParamNames: " + resParamNames.get(j)); }
                JLabel label = new JLabel();
                if (resParamNames.get(row).length == 0)
                    label.setText("max. param");
                else
                    label.setText("max. " + resParamNames.get(row)[i]);
                JTextField tf = new JTextField(3);
                tf.setText(valueArray[i]);
                col1.addComponent(label);
                col2.addComponent(tf,GroupLayout.PREFERRED_SIZE);
                rows.addGroup(layout
                        .createParallelGroup(
                                GroupLayout.Alignment.CENTER)
                        .addComponent(label).addComponent(tf));
            }
        }
    }
    table.setRowHeight(row,Math.max(table.getRowHeight(row),(int) panel.getPreferredSize().getHeight()));
    TableColumn cm = table.getColumnModel().getColumn(column);
    cm.setMinWidth(Math.max(cm.getMinWidth(),(int) panel
            .getPreferredSize().getWidth()));
    return panel;
}
项目:alevin-svn2    文件ConstraintsGeneratorDialog.java   
@Override
public Component getTableCellEditorComponent(JTable table,int column) {
    panel = new JPanel();
    if (value instanceof String[]) {
        String[] valueArray = (String[]) value;
        if (valueArray.length == 0)
            return panel;
        GroupLayout layout = new GroupLayout(panel);
        panel.setLayout(layout);
        layout.setautocreateGaps(true);
        layout.setautocreateContainerGaps(true);
        SequentialGroup cols = layout.createSequentialGroup();
        layout.setHorizontalGroup(cols);
        ParallelGroup col1 = layout
                .createParallelGroup(GroupLayout.Alignment.LEADING);
        ParallelGroup col2 = layout
                .createParallelGroup(GroupLayout.Alignment.TRAILING);
        cols.addGroup(col1)
                .addPreferredGap(
                        LayoutStyle.ComponentPlacement.RELATED,Short.MAX_VALUE)
                .addGroup(col2);
        SequentialGroup rows = layout.createSequentialGroup();
        layout.setVerticalGroup(rows);

        for (int i = 0; i < valueArray.length; i++) {
            // create the label. use the resource param name for both
            // resource and demand params as it should be the same. Todo
            JLabel label = new JLabel();
            if (resParamNames.get(row).length == 0)
                label.setText("max. param");
            else
                label.setText("max. " + resParamNames.get(row)[i]);
            JTextField tf = new JTextField(3);
            tf.setText(valueArray[i]);
            tf.setEditable(true);
            col1.addComponent(label);
            col2.addComponent(tf,GroupLayout.PREFERRED_SIZE);
            rows.addGroup(layout
                    .createParallelGroup(GroupLayout.Alignment.CENTER)
                    .addComponent(label).addComponent(tf));
        }
    }
    table.setRowHeight(row,(int) panel
            .getPreferredSize().getWidth()));
    return panel;
}
项目:incubator-netbeans    文件JiraUpdater.java   
private static JPanel createNotificationPanel(final URL url) {
    JPanel panel = new JPanel();

    JLabel msgLabel = new JLabel("<html>" + NbBundle.getMessage(JiraUpdater.class,"MSG_PROJECT_NEEDS_JIRA")); // NOI18N
    JButton linkButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
    org.openide.awt.Mnemonics.setLocalizedText(linkButton,NbBundle.getMessage(JiraUpdater.class,"MSG_PROJECT_NEEDS_JIRA_LINK")); // NOI18N
    if (url != null) {
        linkButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                Htmlbrowser.URLdisplayer displayer = Htmlbrowser.URLdisplayer.getDefault ();
                if (displayer != null) {
                    displayer.showURL(url);
                } else {
                    // XXX nice error message?
                    Support.LOG.warning("No URLdisplayer found.");             // NOI18N
                }
            }
        });
    } else {
        linkButton.setVisible(false);
    }

    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(msgLabel,470,Short.MAX_VALUE)
                .addComponent(linkButton))
            .addContainerGap()
    );
    layout.setVerticalGroup(
        layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(msgLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(linkButton)
            .addContainerGap(25,Short.MAX_VALUE)
    );

    return panel;
}
项目:incubator-netbeans    文件CommitPanel.java   
private int getContainerGap(int direction) {
    return LayoutStyle.getInstance().getContainerGap(this,direction,null);
}
项目:incubator-netbeans    文件VCSCommitPanel.java   
int getContainerGap(int direction) {
    return LayoutStyle.getInstance().getContainerGap(this,null);
}
项目:incubator-netbeans    文件OperationDescriptionPanel.java   
/** 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.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    tpPrimaryTitle = new javax.swing.JTextPane();
    tpPrimaryPlugins = new javax.swing.JTextPane();
    tpDependingTitle = new javax.swing.JTextPane();
    tpDependingPlugins = new javax.swing.JTextPane();

    tpPrimaryTitle.setContentType("text/html"); // NOI18N
    tpPrimaryTitle.setEditable(false);

    tpPrimaryPlugins.setContentType("text/html"); // NOI18N
    tpPrimaryPlugins.setEditable(false);

    tpDependingTitle.setContentType("text/html"); // NOI18N
    tpDependingTitle.setEditable(false);

    tpDependingPlugins.setContentType("text/html"); // NOI18N
    tpDependingPlugins.setEditable(false);

    tpPrimaryTitle.setText(tpPrimaryTitleText);
    tpPrimaryPlugins.setText(tpPrimaryPluginsText);
    tpDependingTitle.setText(tpDependingTitleText);
    tpDependingPlugins.setText(tpDependingPluginsText);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addGroup(javax.swing.GroupLayout.Alignment.LEADING,layout.createSequentialGroup()
                    .addGap(49,49,49)
                    .addComponent(tpDependingPlugins,javax.swing.GroupLayout.DEFAULT_SIZE,403,Short.MAX_VALUE))
                .addGroup(javax.swing.GroupLayout.Alignment.LEADING,layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(tpDependingTitle,440,49)
                    .addComponent(tpPrimaryPlugins,layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(tpPrimaryTitle,Short.MAX_VALUE)))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(tpPrimaryTitle)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(tpPrimaryPlugins)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(tpDependingTitle)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(tpDependingPlugins,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(90,90,90))
    );
}
项目:incubator-netbeans    文件CssprepOptionsPanel.java   
/**
 * 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() {

    containerPanel = new JPanel();
    jPanel1 = new JPanel();
    jPanel2 = new JPanel();
    errorLabel = new JLabel();

    GroupLayout jPanel1Layout = new GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGap(0,Short.MAX_VALUE)
    );
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGap(0,Short.MAX_VALUE)
    );

    GroupLayout jPanel2Layout = new GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGap(0,Short.MAX_VALUE)
    );
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGap(0,Short.MAX_VALUE)
    );

    GroupLayout containerPanelLayout = new GroupLayout(containerPanel);
    containerPanel.setLayout(containerPanelLayout);
    containerPanelLayout.setHorizontalGroup(containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addComponent(jPanel1,Short.MAX_VALUE)
        .addComponent(jPanel2,Short.MAX_VALUE)
    );
    containerPanelLayout.setVerticalGroup(containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(containerPanelLayout.createSequentialGroup()
            .addComponent(jPanel1,GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jPanel2,GroupLayout.PREFERRED_SIZE)
            .addGap(0,166,Short.MAX_VALUE))
    );

    Mnemonics.setLocalizedText(errorLabel,"ERROR"); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(errorLabel)
            .addGap(0,380,Short.MAX_VALUE))
        .addComponent(containerPanel,Short.MAX_VALUE)
    );
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(containerPanel,Short.MAX_VALUE)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(errorLabel))
    );
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...