javax.swing.BoxLayout#LINE_AXIS源码实例Demo

下面列出了javax.swing.BoxLayout#LINE_AXIS 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: ConnectionErrorDlg.java
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);
    }
}
 
源代码2 项目: pega-tracerviewer   文件: TracerDataSingleView.java
@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();
}
 
源代码3 项目: netbeans   文件: BoxLayoutSupport.java
/** 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;
}
 
源代码4 项目: visualvm   文件: GenericToolbar.java
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);
}
 
源代码5 项目: jdal   文件: TitledSeparator.java
public TitledSeparator(String title, int fontType) {
	super(BoxLayout.LINE_AXIS);
	this.font = getFont(fontType);

	if (fontType == BORDER)
		color = UIManager.getColor("TitledBorder.titleColor");
	
	build(title);
}
 
源代码6 项目: jdal   文件: TitledSeparator.java
public TitledSeparator(String title, Font font, Color color) {
	super(BoxLayout.LINE_AXIS);
	this.font = font;
	this.color = color;
	build(title);
}
 
源代码7 项目: dragonwell8_jdk   文件: javax_swing_Box.java
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
源代码8 项目: TencentKona-8   文件: javax_swing_BoxLayout.java
protected BoxLayout getObject() {
    return new BoxLayout(new JLabel("TEST"), BoxLayout.LINE_AXIS);
}
 
源代码9 项目: jdk8u_jdk   文件: javax_swing_BoxLayout.java
protected BoxLayout getObject() {
    return new BoxLayout(new JLabel("TEST"), BoxLayout.LINE_AXIS);
}
 
源代码10 项目: openjdk-8   文件: javax_swing_Box.java
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
源代码11 项目: jdk8u60   文件: javax_swing_Box.java
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
源代码12 项目: openjdk-jdk8u   文件: javax_swing_Box.java
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
@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;

}
 
源代码14 项目: pega-tracerviewer   文件: TracerDataSingleView.java
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;
    }
 
源代码15 项目: hottub   文件: javax_swing_Box.java
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
protected BoxLayout getObject() {
    return new BoxLayout(new JLabel("TEST"), BoxLayout.LINE_AXIS);
}
 
源代码17 项目: openjdk-jdk9   文件: javax_swing_BoxLayout.java
protected BoxLayout getObject() {
    return new BoxLayout(new JLabel("TEST"), BoxLayout.LINE_AXIS);
}
 
源代码18 项目: pega-tracerviewer   文件: TracerDataCompareView.java
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;

    }
 
源代码19 项目: jdk8u-dev-jdk   文件: javax_swing_Box.java
protected Box getObject() {
    return new Box(BoxLayout.LINE_AXIS);
}
 
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;

    }
 
 方法所在类