Java Code Examples for javax.swing.BoxLayout#LINE_AXIS

The following examples show how to use javax.swing.BoxLayout#LINE_AXIS . 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: ConnectionErrorDlg.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void addLine(List<Segment> line) {
    if (line.size() == 1) {
        addSegment(this, line.get(0));
    } else {
        Box lineBox = new Box(BoxLayout.LINE_AXIS);
        if (lineBox.getComponentOrientation().isLeftToRight()) {
            lineBox.setAlignmentX(LEFT_ALIGNMENT);
        } else {
            lineBox.setAlignmentX(RIGHT_ALIGNMENT);
        }
        for (Segment s : line) {
            addSegment(lineBox, s);
        }
        add(lineBox);
    }
}
 
Example 2
Source File: TitledSeparator.java    From jdal with Apache License 2.0 5 votes vote down vote up
public TitledSeparator(String title, int fontType) {
	super(BoxLayout.LINE_AXIS);
	this.font = getFont(fontType);

	if (fontType == BORDER)
		color = UIManager.getColor("TitledBorder.titleColor");
	
	build(title);
}
 
Example 3
Source File: TracerDataSingleView.java    From pega-tracerviewer with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateSupplementUtilityJPanel() {

    JPanel supplementUtilityJPanel = getSupplementUtilityJPanel();

    supplementUtilityJPanel.removeAll();
    LayoutManager layout = new BoxLayout(supplementUtilityJPanel, BoxLayout.LINE_AXIS);
    supplementUtilityJPanel.setLayout(layout);
    supplementUtilityJPanel.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));

    supplementUtilityJPanel.revalidate();
    supplementUtilityJPanel.repaint();
}
 
Example 4
Source File: GenericToolbar.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private void tweak() {
    if (UIUtils.isGTKLookAndFeel() || UIUtils.isNimbusLookAndFeel()) {
        int axis = getOrientation() == VERTICAL ? BoxLayout.PAGE_AXIS :
                                                  BoxLayout.LINE_AXIS;
        setLayout(new BoxLayout(this, axis));
    }
    
    if (UIUtils.isNimbusLookAndFeel())
        setBorder(BorderFactory.createEmptyBorder(-2, 0, -2, 0));
    else if (UIUtils.isAquaLookAndFeel())
        setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 1));
    
    if (UIUtils.isWindowsClassicLookAndFeel()) setRollover(true);
}
 
Example 5
Source File: BoxLayoutSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** This method calculates position (index) for a component dragged
 * over a container (or just for mouse cursor being moved over container,
 * without any component).
 * @param container instance of a real container over/in which the
 *        component is dragged
 * @param containerDelegate effective container delegate of the container
 *        (for layout managers we always use container delegate instead of
 *        the container)
 * @param component the real component being dragged; not needed here
 * @param index position (index) of the component in its current container;
 *        not needed here
 * @param posInCont position of mouse in the container delegate
 * @param posInComp position of mouse in the dragged component;
 *        not needed here
 * @return index corresponding to the position of the component in the
 *         container
 */
@Override
public int getNewIndex(Container container,
                       Container containerDelegate,
                       Component component,
                       int index,
                       Point posInCont,
                       Point posInComp)
{
    if (!(containerDelegate.getLayout() instanceof BoxLayout))
        return -1;
    
    assistantParams = 0;
    Component[] components = containerDelegate.getComponents();
    for (int i = 0; i < components.length; i++) {
        if (components[i] == component) {
            assistantParams--;
            continue;
        }
        Rectangle b = components[i].getBounds();
        if ((axis == BoxLayout.X_AXIS) || (axis == BoxLayout.LINE_AXIS)) {
            if (posInCont.x < b.x + b.width / 2) {
                assistantParams += i;
                return i;
            }
        }
        else {
            if (posInCont.y < b.y + b.height / 2) {
                assistantParams += i;
                return i;
            }
        }
    }
    
    assistantParams += components.length;
    return components.length;
}
 
Example 6
Source File: TracerDataSingleView.java    From pega-tracerviewer with Apache License 2.0 4 votes vote down vote up
private JPanel getTracerUtilsJPanel() {

        JPanel tracerReportJPanel = new JPanel();

        LayoutManager layout = new BoxLayout(tracerReportJPanel, BoxLayout.LINE_AXIS);
        tracerReportJPanel.setLayout(layout);

        JPanel additionalUtilityPanel = getAdditionalUtilityPanel();

        Dimension dim = new Dimension(5, 30);

        tracerReportJPanel.add(Box.createHorizontalGlue());
        tracerReportJPanel.add(Box.createRigidArea(dim));

        if (additionalUtilityPanel != null) {
            tracerReportJPanel.add(additionalUtilityPanel);
            tracerReportJPanel.add(Box.createRigidArea(dim));
        }

        tracerReportJPanel.add(Box.createHorizontalGlue());

        tracerReportJPanel.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));

        return tracerReportJPanel;
    }
 
Example 7
Source File: TracerSimpleReportFrame.java    From pega-tracerviewer with Apache License 2.0 4 votes vote down vote up
private JPanel getLabelJPanel(String text) {

        JPanel labelJPanel = new JPanel();

        LayoutManager layout = new BoxLayout(labelJPanel, BoxLayout.LINE_AXIS);
        labelJPanel.setLayout(layout);

        JLabel label = new JLabel(text);

        int height = 30;

        Dimension spacer = new Dimension(10, height);
        labelJPanel.add(Box.createRigidArea(spacer));
        labelJPanel.add(label);
        labelJPanel.add(Box.createHorizontalGlue());

        labelJPanel.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
        return labelJPanel;

    }
 
Example 8
Source File: javax_swing_Box.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
Example 9
Source File: TracerDataCompareView.java    From pega-tracerviewer with Apache License 2.0 4 votes vote down vote up
private JPanel getStatusBarJPanel(JTextField statusBar) {

        JPanel statusBarJPanel = new JPanel();

        LayoutManager layout = new BoxLayout(statusBarJPanel, BoxLayout.LINE_AXIS);
        statusBarJPanel.setLayout(layout);

        Dimension spacer = new Dimension(5, 16);

        statusBarJPanel.add(Box.createRigidArea(spacer));
        statusBarJPanel.add(statusBar);
        statusBarJPanel.add(Box.createRigidArea(spacer));

        statusBarJPanel.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));

        return statusBarJPanel;

    }
 
Example 10
Source File: javax_swing_BoxLayout.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected BoxLayout getObject() {
    return new BoxLayout(new JLabel("TEST"), BoxLayout.LINE_AXIS);
}
 
Example 11
Source File: javax_swing_BoxLayout.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected BoxLayout getObject() {
    return new BoxLayout(new JLabel("TEST"), BoxLayout.LINE_AXIS);
}
 
Example 12
Source File: javax_swing_Box.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
Example 13
Source File: TitledSeparator.java    From jdal with Apache License 2.0 4 votes vote down vote up
public TitledSeparator(String title, Font font, Color color) {
	super(BoxLayout.LINE_AXIS);
	this.font = font;
	this.color = color;
	build(title);
}
 
Example 14
Source File: TracerDataTreeTableView.java    From pega-tracerviewer with Apache License 2.0 4 votes vote down vote up
@Override
protected JPanel getAdditionalUtilityPanel() {

    JPanel additionalUtilityPanel = new JPanel();

    LayoutManager layout = new BoxLayout(additionalUtilityPanel, BoxLayout.LINE_AXIS);

    additionalUtilityPanel.setLayout(layout);

    JButton expandAllJButton = getExpandAllJButton();

    additionalUtilityPanel.add(expandAllJButton);

    return additionalUtilityPanel;

}
 
Example 15
Source File: javax_swing_Box.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
Example 16
Source File: javax_swing_Box.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
Example 17
Source File: javax_swing_Box.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
Example 18
Source File: javax_swing_BoxLayout.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected BoxLayout getObject() {
    return new BoxLayout(new JLabel("TEST"), BoxLayout.LINE_AXIS);
}
 
Example 19
Source File: javax_swing_BoxLayout.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected BoxLayout getObject() {
    return new BoxLayout(new JLabel("TEST"), BoxLayout.LINE_AXIS);
}
 
Example 20
Source File: javax_swing_Box.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}