Java Code Examples for info.clearthought.layout.TableLayout#setVGap()

The following examples show how to use info.clearthought.layout.TableLayout#setVGap() . 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: ChartSourceSelectPanel.java    From ramus with GNU General Public License v3.0 6 votes vote down vote up
private Component createSourceTypePanel() {
    double[][] size = {
            {5, TableLayout.MINIMUM, TableLayout.FILL,
                    TableLayout.MINIMUM, TableLayout.FILL, 5},
            {5, TableLayout.FILL, 5}};

    TableLayout layout = new TableLayout(size);

    layout.setHGap(5);
    layout.setVGap(5);

    JPanel panel = new JPanel(layout);

    panel.add(new JLabel(ChartResourceManager.getString("SourceType")),
            "1,1");
    panel.add(sourceType, "2,1");
    panel.add(new JLabel(ChartResourceManager
            .getString("SourceType.tableAttribute")), "3,1");
    panel.add(tableAttribute, "4,1");
    return panel;
}
 
Example 2
Source File: DBBrowserPropertiesPanel.java    From nextreports-designer with Apache License 2.0 6 votes vote down vote up
private void initUI() {
    // create the layout
    double[] columns = {
            TableLayoutConstants.PREFERRED,
            TableLayoutConstants.FILL,
    };
    double[] rows = {
            TableLayoutConstants.PREFERRED,
            TableLayoutConstants.PREFERRED
    };
    TableLayout layout = new TableLayout(columns, rows);
    layout.setHGap(6);
    layout.setVGap(6);
    this.setLayout(layout);

    this.add(new JCheckBox("Show all schemas into object tree"), "0, 0, 1, 0");
    this.add(new JLabel("Object Filter"), "0, 1");
    this.add(new JTextField(25), "1, 1");
}
 
Example 3
Source File: JoinPropertiesPanel.java    From nextreports-designer with Apache License 2.0 6 votes vote down vote up
private JPanel createJoinPanel() {
    JPanel joinPanel = new JPanel();

    // create the layout
    double[] columns = {
            TableLayoutConstants.PREFERRED,
            TableLayoutConstants.PREFERRED,
            TableLayoutConstants.PREFERRED
    };
    double[] rows = {
            TableLayoutConstants.PREFERRED
    };
    TableLayout layout = new TableLayout(columns, rows);
    layout.setVGap(6);
    layout.setHGap(6);
    joinPanel.setLayout(layout);

    joinPanel.add(leftTextField, "0, 0");
    joinPanel.add(operatorsComboBox, "1, 0");
    joinPanel.add(rightTextField, "2, 0");

    return joinPanel;
}
 
Example 4
Source File: BaseDialog.java    From nextreports-designer with Apache License 2.0 6 votes vote down vote up
private void initUI() {
    JPanel mainPanel = new JPanel();

    // create the layout
    double[] columns = {
            TableLayoutConstants.FILL,
    };
    double[] rows = {
            TableLayoutConstants.FILL,
            TableLayoutConstants.PREFERRED
    };
    TableLayout layout = new TableLayout(columns, rows);
    layout.setVGap(10);
    mainPanel.setLayout(layout);

    createButtonsPanel();

    mainPanel.add(basePanel, "0, 0");
    mainPanel.add(buttonsPanel, "0, 1");

    mainPanel.setBorder(new CompoundBorder(new EmptyBorder(0, 0, 0, 0), new EmptyBorder(10, 10, 10, 10)));
    getContentPane().add(mainPanel);
    
    pack();      
}
 
Example 5
Source File: PieChartSetupEditor.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
@Override
public JComponent createComponent(GUIFramework framework, Element element) {
    JComponent component = super.createComponent(framework, element);
    final ChartSource source = getChartSource();
    initAttributes(framework.getEngine());
    key.setSelectedItem(source.getAttributeProperty(PIE_ATTRIBUTE_KEY));
    value.setSelectedItem(source.getAttributeProperty(PIE_ATTRIBUTE_VALUE));

    double[][] size = {
            {5, TableLayout.MINIMUM, TableLayout.FILL,
                    TableLayout.MINIMUM, TableLayout.FILL, 5},
            {5, TableLayout.FILL, 5}};

    TableLayout layout = new TableLayout(size);

    layout.setHGap(5);
    layout.setVGap(5);

    JPanel panel = new JPanel(layout);

    panel.add(new JLabel(ChartResourceManager.getString("Chart.key")),
            "1,1");
    panel.add(key, "2,1");
    panel.add(new JLabel(ChartResourceManager.getString("Chart.value")),
            "3,1");
    panel.add(value, "4,1");

    JPanel panel2 = new JPanel(new BorderLayout());

    panel2.add(component, BorderLayout.CENTER);
    panel2.add(panel, BorderLayout.SOUTH);

    return panel2;
}
 
Example 6
Source File: BarChartSetupEditor.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
@Override
public JComponent createComponent(GUIFramework framework, Element element) {
    JComponent component = super.createComponent(framework, element);

    initAttributes(framework.getEngine());

    ChartSource source = getChartSource();

    key.setSelectedItem(source.getAttributeProperty(BAR_ATTRIBUTE_KEY));

    double[][] size = {
            {5, TableLayout.MINIMUM, TableLayout.FILL,
                    TableLayout.MINIMUM, TableLayout.FILL, 5},
            {5, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, 5}};

    TableLayout layout = new TableLayout(size);

    layout.setHGap(5);
    layout.setVGap(5);

    JPanel panel = new JPanel(layout);

    panel.add(new JLabel(ChartResourceManager
            .getString("Label.categoryAxis")), "1,1");
    panel.add(categoryAxis, "2,1");
    panel.add(
            new JLabel(ChartResourceManager.getString("Label.valueAxis")),
            "3,1");
    panel.add(valueAxis, "4,1");

    panel.add(new JLabel(ChartResourceManager.getString("Chart.key")),
            "1,2");
    panel.add(key, "2,2");

    panel.add(new JLabel(ChartResourceManager.getString("Orientation")),
            "3,2");
    panel.add(orientation, "4,2");

    panel.add(new JLabel(ChartResourceManager.getString("Chart.values")),
            "1,3,3,3");

    attributesSelectPanel = new AttributesSelectPanel(framework, source
            .getPropertyAttributes(BAR_ATTRIBUTE_VALUE_PREFIX));

    attributesSelectPanel.setPreferredSize(new Dimension(300, 150));

    JPanel panel3 = new JPanel(new BorderLayout());

    panel3.add(panel, BorderLayout.CENTER);

    panel3.add(attributesSelectPanel, BorderLayout.SOUTH);

    categoryAxis.setText(source.getProperty(BAR_CATEGORY_AXIS_LABEL));
    valueAxis.setText(source.getProperty(BAR_VALUE_AXIS_LABEL));

    String o = source.getProperty(BAR_ORIENTATION);

    if (BAR_ORIENTATION_HORIZONTAL.equals(o))
        orientation.setSelectedIndex(1);

    JPanel panel2 = new JPanel(new BorderLayout());
    panel2.add(component, BorderLayout.CENTER);
    panel2.add(panel3, BorderLayout.SOUTH);

    return panel2;
}
 
Example 7
Source File: ChartPreferencesDialog.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
public ChartPreferencesDialog(GUIFramework framework, Row chart) {
    super(framework.getMainFrame(), true);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    setTitle(ChartResourceManager.getString("Action.ChartPreferences"));
    this.framework = framework;
    this.chart = chart;
    name.setText(chart.getName());

    Engine engine = framework.getEngine();
    ChartSource chartSource = new ChartSource(engine);
    chartSource.load(engine.getInputStream(getPreferencesPath(chart
            .getElement(), StandardAttributesPlugin
            .getAttributeNameAttribute(engine))));
    ChartGUIFramework chartFramework = ChartGUIFramework
            .getFramework(framework);
    chartPlugin = chartFramework.getChartPlugin(chartSource.getChartType());
    editor = chartPlugin.createChartSetupEditor();

    double[][] size = {{5, TableLayout.MINIMUM, TableLayout.FILL, 5},
            {5, TableLayout.FILL, 5}};

    TableLayout layout = new TableLayout(size);
    layout.setHGap(5);
    layout.setVGap(5);

    JPanel top = new JPanel(layout);

    top.add(new JLabel(ChartResourceManager.getString("Chart.name")),
            "1, 1");
    top.add(name, "2, 1");

    JPanel panel = new JPanel(new BorderLayout());
    panel.add(top, BorderLayout.NORTH);

    panel.add(editor.createComponent(framework, chart.getElement()),
            BorderLayout.CENTER);

    setMainPane(panel);
    setMinimumSize(new Dimension(600, 420));
    pack();
    centerDialog();
    Options.loadOptions(this);
}
 
Example 8
Source File: CreateChartDialog.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
public CreateChartDialog(GUIFramework framework, ChartsView chartsView) {
    super(framework.getMainFrame(), true);

    setTitle(ChartResourceManager.getString("Action.CreateChart"));
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    this.framework = framework;
    this.chartsView = chartsView;

    chartFramework = ChartGUIFramework.getFramework(framework);
    for (ChartPlugin chartPlugin : chartFramework.getChartPlugins()) {
        types.addItem(chartPlugin);
    }

    double[][] size = {
            {5, TableLayout.MINIMUM, TableLayout.FILL,
                    TableLayout.MINIMUM, TableLayout.FILL, 5},
            {5, TableLayout.FILL, 5}};

    TableLayout layout = new TableLayout(size);
    layout.setHGap(5);
    layout.setVGap(5);

    JPanel top = new JPanel(layout);

    top.add(new JLabel(ChartResourceManager.getString("Chart.type")),
            "1, 1");
    top.add(types, "2, 1");
    top.add(new JLabel(ChartResourceManager.getString("Chart.name")),
            "3, 1");
    top.add(name, "4, 1");

    JPanel panel = new JPanel(new BorderLayout());
    panel.add(top, BorderLayout.NORTH);
    panel.add(centerPanel, BorderLayout.CENTER);
    setPlugin((ChartPlugin) types.getSelectedItem());
    types.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            setPlugin((ChartPlugin) types.getSelectedItem());
        }
    });
    setMinimumSize(new Dimension(600, 420));
    setMainPane(panel);
    pack();
    centerDialog();
    Options.loadOptions(this);
}
 
Example 9
Source File: GuiUtils.java    From workcraft with MIT License 4 votes vote down vote up
public static TableLayout createTableLayout(double[] columnSizes, double[] rowSizes) {
    TableLayout result = new TableLayout(new double[][]{columnSizes, rowSizes});
    result.setHGap(SizeHelper.getLayoutHGap());
    result.setVGap(SizeHelper.getLayoutVGap());
    return result;
}