Java Code Examples for javax.swing.LayoutStyle.ComponentPlacement

The following examples show how to use javax.swing.LayoutStyle.ComponentPlacement. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 2
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 3
Source Project: jdk8u60   Source File: DefaultLayoutStyle.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 4
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 5
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 6
Source Project: Bytecoder   Source File: DefaultLayoutStyle.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 7
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 8
Source Project: jdk8u-jdk   Source File: DefaultLayoutStyle.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 9
Source Project: hottub   Source File: DefaultLayoutStyle.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 10
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 11
Source Project: openjdk-8   Source File: DefaultLayoutStyle.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 12
Source Project: jdk8u_jdk   Source File: DefaultLayoutStyle.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 13
Source Project: jdk8u-jdk   Source File: DefaultLayoutStyle.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 14
@Override
public int getPreferredGap(JComponent component1, JComponent component2,
        ComponentPlacement type, int position, Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1, position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
 
Example 15
Source Project: templatespider   Source File: diffItemPanel.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create the panel.
 */
public diffItemPanel() {
	
	lblNewLabel = new JLabel("template name");
	lblNewLabel.setFont(new Font("Dialog", Font.BOLD, 18));
	
	JScrollPane scrollPane = new JScrollPane();
	GroupLayout groupLayout = new GroupLayout(this);
	groupLayout.setHorizontalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, 444, Short.MAX_VALUE)
				.addGap(6))
			.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE)
	);
	groupLayout.setVerticalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addComponent(lblNewLabel)
				.addPreferredGap(ComponentPlacement.RELATED)
				.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE))
	);
	
	textArea = new JTextArea();
	scrollPane.setViewportView(textArea);
	setLayout(groupLayout);

}
 
Example 16
Source Project: netbeans   Source File: BoxFillerInitializer.java    License: Apache License 2.0 5 votes vote down vote up
WidthHeightPanel(boolean showWidth, boolean showHeight) {
    ResourceBundle bundle = NbBundle.getBundle(BoxFillerInitializer.class);
    JLabel widthLabel = new JLabel(bundle.getString("BoxFillerInitializer.width")); // NOI18N
    JLabel heightLabel = new JLabel(bundle.getString("BoxFillerInitializer.height")); // NOI18N
    widthField = new JSpinner(new SpinnerNumberModel());
    heightField = new JSpinner(new SpinnerNumberModel());
    GroupLayout layout = new GroupLayout(this);
    setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                .addComponent(widthLabel)
                .addComponent(heightLabel))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(widthField)
                .addComponent(heightField))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(widthLabel)
                .addComponent(widthField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(heightLabel)
                .addComponent(heightField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    widthLabel.setVisible(showWidth);
    heightLabel.setVisible(showHeight);
    widthField.setVisible(showWidth);
    heightField.setVisible(showHeight);
}
 
Example 17
Source Project: netbeans   Source File: CodeCompletionPanel.java    License: Apache License 2.0 5 votes vote down vote up
/** 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() {

    autoCompletionSmartQuotesLabel = new JLabel();
    autoCompletionSmartQuotesCheckBox = new JCheckBox();

    Mnemonics.setLocalizedText(autoCompletionSmartQuotesLabel, NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.autoCompletionSmartQuotesLabel.text")); // NOI18N

    Mnemonics.setLocalizedText(autoCompletionSmartQuotesCheckBox, NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.autoCompletionSmartQuotesCheckBox.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addComponent(autoCompletionSmartQuotesLabel)
                .addComponent(autoCompletionSmartQuotesCheckBox))
            .addContainerGap(30, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(autoCompletionSmartQuotesLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(autoCompletionSmartQuotesCheckBox)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    getAccessibleContext().setAccessibleName(NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.AccessibleContext.accessibleName")); // NOI18N
    getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.AccessibleContext.accessibleDescription")); // NOI18N
}
 
Example 18
Source Project: netbeans   Source File: InstallPanel.java    License: Apache License 2.0 5 votes vote down vote up
private void doDisplayEnableTask (
            JComponent enableMainLabel,
            JComponent enableDetailLabel,
            JComponent enableProgress
        ) {
    
    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(enableMainLabel)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(enableDetailLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGap(54, 54, 54))
                .addComponent(enableProgress, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(enableMainLabel)
                .addComponent(enableDetailLabel))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(enableProgress, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    
}
 
Example 19
Source Project: netbeans   Source File: FailedFilesPanel.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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() {

    titleLabel = new JLabel();
    failedFilesScrollPane = new JScrollPane();
    failedFilesList = new JList<String>();

    Mnemonics.setLocalizedText(titleLabel, "TITLE"); // NOI18N

    failedFilesList.setEnabled(false);
    failedFilesScrollPane.setViewportView(failedFilesList);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addComponent(failedFilesScrollPane)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(titleLabel)
                    .addGap(0, 0, Short.MAX_VALUE)))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(titleLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(failedFilesScrollPane)
            .addContainerGap())
    );
}
 
Example 20
Source Project: netbeans   Source File: TransferSelector.java    License: Apache License 2.0 5 votes vote down vote up
/** 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() {


    treePanel = new JPanel();
    checkAllCheckBox = new JCheckBox();

    setBorder(BorderFactory.createEtchedBorder());

    treePanel.setLayout(new BorderLayout());
    Mnemonics.setLocalizedText(checkAllCheckBox, NbBundle.getMessage(TransferSelector.class, "TransferSelector.checkAllCheckBox.text"));
    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(checkAllCheckBox)
            .addContainerGap(212, Short.MAX_VALUE))
        .addComponent(treePanel, GroupLayout.DEFAULT_SIZE, 310, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(Alignment.TRAILING, layout.createSequentialGroup()
            .addComponent(treePanel, GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(checkAllCheckBox))
    );
}
 
Example 21
Source Project: netbeans   Source File: CustomizerIncludePath.java    License: Apache License 2.0 5 votes vote down vote up
/** 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() {

    includePathLabel = new JLabel();
    includePathTabbedPane = new JTabbedPane();
    includePathInfoLabel = new JLabel();

    Mnemonics.setLocalizedText(includePathLabel, NbBundle.getMessage(CustomizerIncludePath.class, "CustomizerIncludePath.includePathLabel.text")); // NOI18N

    Mnemonics.setLocalizedText(includePathInfoLabel, NbBundle.getMessage(CustomizerIncludePath.class, "CustomizerIncludePath.includePathInfoLabel.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addComponent(includePathLabel)
        .addComponent(includePathInfoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
        .addComponent(includePathTabbedPane)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(includePathLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(includePathTabbedPane)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(includePathInfoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
    );
}
 
Example 22
Source Project: netbeans   Source File: SelectFilePanel.java    License: Apache License 2.0 5 votes vote down vote up
/** 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() {

    selectFileLabel = new JLabel();
    selectFileScrollPane = new JScrollPane();
    selectFileList = new JList<>();

    selectFileLabel.setLabelFor(selectFileList);
    Mnemonics.setLocalizedText(selectFileLabel, NbBundle.getMessage(SelectFilePanel.class, "SelectFilePanel.selectFileLabel.text")); // NOI18N

    selectFileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    selectFileScrollPane.setViewportView(selectFileList);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addComponent(selectFileScrollPane, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
                .addComponent(selectFileLabel))
            .addContainerGap())
    );
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(selectFileLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(selectFileScrollPane, GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE))
    );
}
 
Example 23
Source Project: netbeans   Source File: Doctrine2CustomizerPanel.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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() {

    enabledCheckBox = new JCheckBox();
    enabledInfoLabel = new JLabel();
    Mnemonics.setLocalizedText(enabledCheckBox, NbBundle.getMessage(Doctrine2CustomizerPanel.class, "Doctrine2CustomizerPanel.enabledCheckBox.text")); // NOI18N
    Mnemonics.setLocalizedText(enabledInfoLabel, NbBundle.getMessage(Doctrine2CustomizerPanel.class, "Doctrine2CustomizerPanel.enabledInfoLabel.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addComponent(enabledCheckBox)
        .addGroup(layout.createSequentialGroup()
            .addGap(21, 21, 21)
            .addComponent(enabledInfoLabel))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(enabledCheckBox)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(enabledInfoLabel))
    );
}
 
Example 24
Source Project: netbeans   Source File: VCSCommitPanel.java    License: Apache License 2.0 5 votes vote down vote up
static Component makeVerticalStrut(JComponent compA,
                                    JComponent compB,
                                    ComponentPlacement relatedUnrelated, 
                                    JPanel parent) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        SOUTH,
                        parent);
    return Box.createVerticalStrut(height);
}
 
Example 25
Source Project: netbeans   Source File: VCSCommitPanel.java    License: Apache License 2.0 5 votes vote down vote up
static Component makeHorizontalStrut(JComponent compA,
                                          JComponent compB,
                                          ComponentPlacement relatedUnrelated,
                                          JPanel parent) {
        int width = LayoutStyle.getInstance().getPreferredGap(
                            compA,
                            compB,
                            relatedUnrelated,
                            WEST,
                            parent);
        return Box.createHorizontalStrut(width);
}
 
Example 26
@Override
public void initComponents() {
	GroupLayout groupLayout = new GroupLayout(this);
	groupLayout.setHorizontalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
					.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
						.addComponent(getTfSlic3rLocation(), GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getBtnChangeSlicr()))
					.addComponent(getBtnLoadDefaults(), Alignment.TRAILING)
					.addComponent(getLblCurrentLocationOf()))
				.addContainerGap())
	);
	groupLayout.setVerticalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addComponent(getLblCurrentLocationOf())
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(getTfSlic3rLocation(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(getBtnChangeSlicr()))
				.addPreferredGap(ComponentPlacement.RELATED, 212, Short.MAX_VALUE)
				.addComponent(getBtnLoadDefaults())
				.addContainerGap())
	);
	setLayout(groupLayout);
	getTfSlic3rLocation().setText(prefs.getSlic3rLocation());
	
}
 
Example 27
Source Project: netbeans   Source File: NewMirrorPanel.java    License: Apache License 2.0 4 votes vote down vote up
/** 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() {

    lblId = new JLabel();
    txtId = new JTextField();
    lblMirrorOf = new JLabel();
    comMirrorOf = new JComboBox();
    lblUrl = new JLabel();
    comUrl = new JComboBox();
    btnLink = new JButton();

    lblId.setLabelFor(txtId);
    Mnemonics.setLocalizedText(lblId, NbBundle.getMessage(NewMirrorPanel.class, "NewMirrorPanel.lblId.text")); // NOI18N

    lblMirrorOf.setLabelFor(comMirrorOf);
    Mnemonics.setLocalizedText(lblMirrorOf, NbBundle.getMessage(NewMirrorPanel.class, "NewMirrorPanel.lblMirrorOf.text")); // NOI18N

    comMirrorOf.setEditable(true);
    comMirrorOf.setModel(new DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

    lblUrl.setLabelFor(comUrl);
    Mnemonics.setLocalizedText(lblUrl, NbBundle.getMessage(NewMirrorPanel.class, "NewMirrorPanel.lblUrl.text")); // NOI18N

    comUrl.setEditable(true);
    comUrl.setModel(new DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

    Mnemonics.setLocalizedText(btnLink, NbBundle.getMessage(NewMirrorPanel.class, "NewMirrorPanel.btnLink.text")); // NOI18N
    btnLink.setBorder(null);
    btnLink.setBorderPainted(false);
    btnLink.setContentAreaFilled(false);
    btnLink.setHorizontalAlignment(SwingConstants.LEFT);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(Alignment.LEADING)
                        .addComponent(lblMirrorOf)
                        .addComponent(lblId))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(txtId, GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                            .addGap(145, 145, 145))
                        .addComponent(comMirrorOf, 0, 304, Short.MAX_VALUE)))
                .addGroup(layout.createSequentialGroup()
                    .addComponent(lblUrl)
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addComponent(comUrl, 0, 303, Short.MAX_VALUE))
                .addComponent(btnLink, GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(lblId)
                .addComponent(txtId, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(lblMirrorOf)
                .addComponent(comMirrorOf, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(lblUrl)
                .addComponent(comUrl, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addGap(18, 18, 18)
            .addComponent(btnLink, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(36, Short.MAX_VALUE))
    );
}
 
Example 28
Source Project: netbeans   Source File: InstallPanel.java    License: Apache License 2.0 4 votes vote down vote up
private void doDisplayInstallTask (
            JComponent downloadMainLabel,
            JComponent downloadDetailLabel,
            JComponent downloadProgress,
            JComponent verifyMainLabel,
            JComponent verifyDetailLabel,
            JComponent verifyProgress,
            JComponent installMainLabel,
            JComponent installDetailLabel,
            JComponent installProgress
        ) {
    
    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(downloadMainLabel)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(downloadDetailLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGap(54, 54, 54))
                .addComponent(downloadProgress, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(verifyMainLabel)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(verifyDetailLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGap(54, 54, 54))
                .addComponent(verifyProgress, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(installMainLabel)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(installDetailLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGap(54, 54, 54))
                .addComponent(installProgress, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(downloadMainLabel)
                .addComponent(downloadDetailLabel))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(downloadProgress, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addGap(19, 19, 19)
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(verifyMainLabel)
                .addComponent(verifyDetailLabel))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(verifyProgress, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(installMainLabel)
                .addComponent(installDetailLabel))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(installProgress, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    
}
 
Example 29
Source Project: netbeans   Source File: BrowseFolderPanel.java    License: Apache License 2.0 4 votes vote down vote up
/** 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() {

    targetFolderLabel = new JLabel();
    targetFolderTextField = new JTextField();
    browseTargetFolderButton = new JButton();

    targetFolderLabel.setLabelFor(targetFolderTextField);
    Mnemonics.setLocalizedText(targetFolderLabel, NbBundle.getMessage(BrowseFolderPanel.class, "BrowseFolderPanel.targetFolderLabel.text"));
    Mnemonics.setLocalizedText(browseTargetFolderButton, NbBundle.getMessage(BrowseFolderPanel.class, "BrowseFolderPanel.browseTargetFolderButton.text"));
    browseTargetFolderButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            browseTargetFolderButtonActionPerformed(evt);
        }
    });

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(targetFolderLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(targetFolderTextField, GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(browseTargetFolderButton)
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(targetFolderLabel)
                .addComponent(targetFolderTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(browseTargetFolderButton)))
    );
}
 
Example 30
Source Project: netbeans   Source File: PhpDocPanel.java    License: Apache License 2.0 4 votes vote down vote up
/** 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() {

    targetLabel = new JLabel();
    targetTextField = new JTextField();
    targetButton = new JButton();
    titleLabel = new JLabel();
    titleTextField = new JTextField();

    targetLabel.setLabelFor(targetTextField);
    Mnemonics.setLocalizedText(targetLabel, NbBundle.getMessage(PhpDocPanel.class, "PhpDocPanel.targetLabel.text"));
    Mnemonics.setLocalizedText(targetButton, NbBundle.getMessage(PhpDocPanel.class, "PhpDocPanel.targetButton.text"));
    targetButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            targetButtonActionPerformed(evt);
        }
    });

    titleLabel.setLabelFor(titleTextField);
    Mnemonics.setLocalizedText(titleLabel, NbBundle.getMessage(PhpDocPanel.class, "PhpDocPanel.titleLabel.text"));

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addComponent(targetLabel)
                .addComponent(titleLabel))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(targetTextField)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(targetButton))
                .addComponent(titleTextField, GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE)))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(targetLabel)
                .addComponent(targetTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(targetButton))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(titleLabel)
                .addComponent(titleTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
}