Java Code Examples for javax.swing.Box#createVerticalStrut()

The following examples show how to use javax.swing.Box#createVerticalStrut() . 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
Source File: CommitPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Component makeVerticalStrut(JComponent compA,
                                    JComponent compB,
                                    LayoutStyle.ComponentPlacement relatedUnrelated) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        SOUTH,
                        this);
    return Box.createVerticalStrut(height);
}
 
Example 2
Source File: ExpandableMessage.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static Component makeVerticalStrut(JComponent compA,
                                           JComponent compB) {
    LayoutStyle layoutStyle = LayoutStyle.getInstance();
    return Box.createVerticalStrut(
            layoutStyle.getPreferredGap(compA,
                                        compB,
                                        UNRELATED,
                                        SOUTH,
                                        compA.getParent()));
}
 
Example 3
Source File: VCSCommitPanel.java    From netbeans with 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 4
Source File: CommitPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Component makeVerticalStrut(JComponent compA,
                                    JComponent compB,
                                    LayoutStyle.ComponentPlacement relatedUnrelated) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        SOUTH,
                        this);
    return Box.createVerticalStrut(height);
}
 
Example 5
Source File: AquaComboBoxPopup.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void updateContents(final boolean remove) {
    // for more background on this issue, see AquaMenuBorder.getBorderInsets()

    isPopDown = isPopdown();
    if (isPopDown) {
        if (remove) {
            if (topStrut != null) {
                this.remove(topStrut);
            }
            if (bottomStrut != null) {
                this.remove(bottomStrut);
            }
        } else {
            add(scroller);
        }
    } else {
        if (topStrut == null) {
            topStrut = Box.createVerticalStrut(4);
            bottomStrut = Box.createVerticalStrut(4);
        }

        if (remove) remove(scroller);

        this.add(topStrut);
        this.add(scroller);
        this.add(bottomStrut);
    }
}
 
Example 6
Source File: DataDisplay.java    From netbeans with Apache License 2.0 4 votes vote down vote up
static Component createTopSpacer() {
return Box.createVerticalStrut(1);
   }
 
Example 7
Source File: RepositorySelectorBuilder.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private Component createVerticalStrut(JComponent parent, JComponent compA, JComponent compB, LayoutStyle.ComponentPlacement related) {
    return Box.createVerticalStrut(getSpace(parent, compA, compB, related, VERTICAL));
}
 
Example 8
Source File: OSVPanel.java    From osv with GNU General Public License v3.0 4 votes vote down vote up
public OSVPanel(MainWindow mw) {
	this.mw = mw;

	buildScreensButtons();

	this.setLayout(new BorderLayout());
	setOpaque(false);

	leftPanel = new JPanel();
	leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
	verticalSpaceLeftPanel = Box.createVerticalStrut((int) (mw.getHeight() * 0.35f));
	leftPanel.add(verticalSpaceLeftPanel, 0);
	leftPanel.add(new OSVDateWidget(mw), 1);
	verticalSpaceLeftPanel2 = Box.createVerticalStrut((int) (mw.getHeight() * 0.1f));
	leftPanel.add(verticalSpaceLeftPanel2, 2);
	for (OSVToggleButton b : screensButtons) {
		JPanel p = new JPanel();
		p.add(b);
		leftPanel.add(p);
	}
	leftPanel.setOpaque(false);
	this.add(leftPanel, BorderLayout.WEST);

	batteryWidget = new OSVBatteryWidget(mw);
	this.add(batteryWidget, BorderLayout.EAST);

	bottomPanel = new JPanel();
	bottomPanel.setLayout(new GridLayout(1, 3));

	exitButton = new OSVButton(mw.iconClose, mw.iconCloseBright);
	exitButton.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			System.exit(0);
		}
	});
	bp1 = new JPanel();
	bp1.setOpaque(false);
	bottomPanel.add(bp1);
	bottomPanel.setOpaque(false);

	textWidget = new OSVBasicTextWidget(mw);
	bottomPanel.add(textWidget);
	bp3 = new JPanel();
	bp3.setOpaque(false);
	bp3.setLayout(new BoxLayout(bp3, BoxLayout.Y_AXIS));
	bp3.add(Box.createVerticalStrut(100));
	bottomPanel.add(bp3);
	this.add(bottomPanel, BorderLayout.SOUTH);

	screensButtons.get(0).makeSelected(true);

	speedCounter = new OSVSpeedCounter(mw);
	mapPanel = new MapPanel(mw);
	settingsPanel = new SettingsPanel(mw);

	add(speedCounter, BorderLayout.CENTER);
}
 
Example 9
Source File: StatusBar.java    From Girinoscope with Apache License 2.0 4 votes vote down vote up
public StatusBar() {
    super.setFloatable(false);
    super.add(Box.createVerticalStrut(16));
    super.add(label);
    label.setBorder(new EmptyBorder(4, 4, 4, 4));
}