All Downloads are FREE. Search and download functionalities are using the official Maven repository.

studio.ui.GroupLayoutSimple Maven / Gradle / Ivy

package studio.ui;

import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;

public class GroupLayoutSimple extends GroupLayout {

    public GroupLayoutSimple(Container container) {
        super(container);
        container.setLayout(this);
        setAutoCreateGaps(true);
        setAutoCreateContainerGaps(true);
    }

    public void setStacks(Stack... stacks) {

        int lineCount = stacks[0].lines.size();
        for (int i = 1; i lines;
        public Stack() {
            lines = new ArrayList<>();
        }

        public Stack addLine(Component... line) {
            lines.add(line);
            return this;
        }

        public Stack addLineAndGlue(Component... line) {
            int count = line.length;
            Component[] newLine = new Component[count + 1];
            System.arraycopy(line, 0, newLine, 0, count);
            newLine[count] = Box.createGlue();
            lines.add(newLine);
            return this;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy