Java Code Examples for info.clearthought.layout.TableLayout#MINIMUM

The following examples show how to use info.clearthought.layout.TableLayout#MINIMUM . 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: AttributeHierarchyEditorPanel.java    From ramus with GNU General Public License v3.0 6 votes vote down vote up
/**
 * This method initializes this
 *
 * @return void
 */
private void initialize() {
    double[][] size = {
            {5, TableLayout.FILL, 5, TableLayout.MINIMUM, 5,
                    TableLayout.FILL, 5, TableLayout.MINIMUM, 5},
            {5, TableLayout.MINIMUM, 5, TableLayout.FILL, 5}};
    setLayout(new TableLayout(size));
    jLabel1 = new JLabel();
    jLabel1.setText(GlobalResourcesManager
            .getString("HierarchicalAttributes"));
    jLabel = new JLabel();
    jLabel.setText(GlobalResourcesManager.getString("PresentAttributes"));
    this.add(jLabel, "1,1");
    this.add(jLabel1, "5, 1");
    this.add(getJScrollPane1(), "1,3");
    this.add(getJPanel1(), "3,3");
    this.add(getJScrollPane(), "5,3");
    this.add(getJPanel(), "7,3");
}
 
Example 2
Source File: NewJavaScriptDialog.java    From ramus with GNU General Public License v3.0 6 votes vote down vote up
public NewJavaScriptDialog(GUIFramework framework) {
    super(framework.getMainFrame(), true);
    this.engine = framework.getEngine();
    setTitle(ScriptPlugin.getBundle()
            .getString("NewJavaScriptDialog.title"));
    double[][] size = {{5, TableLayout.FILL, TableLayout.MINIMUM, 5},
            {5, TableLayout.MINIMUM, 5}};
    JPanel panel = new JPanel(new TableLayout(size));
    panel.add(moduleName, "1, 1");
    panel.add(new JLabel(".js"), "2, 1");
    setMainPane(panel);
    this.pack();
    this.setMinimumSize(getSize());
    centerDialog();
    Options.loadOptions(this);
}
 
Example 3
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 4
Source File: CreateOrEditElementListDialog.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
private void init() {
    double[][] size = {
            {DIV_SPACE, TableLayout.MINIMUM, DIV_SPACE, TableLayout.FILL,
                    DIV_SPACE}, {DIV_SPACE, TableLayout.FILL, DIV_SPACE}};

    JPanel panel = new JPanel(new TableLayout(size));

    panel.add(
            new JLabel(GlobalResourcesManager.getString("ElementListName")),
            "1, 1");

    panel.add(nameField, "3, 1");

    Attribute attribute = getAttribute();
    if (attribute != null)
        nameField.setText(attribute.getName());

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

    AttributePlugin attributePlugin = framework
            .findAttributePlugin(getAttributeType());

    editor = (ElementListPreferenciesEditor) attributePlugin
            .getAttributePreferenciesEditor();
    JPanel panel2 = new JPanel(new BorderLayout());
    panel2.add(editor.createComponent(getAttribute(), engine, rules),
            BorderLayout.CENTER);
    main.add(panel2, BorderLayout.CENTER);
    setMainPane(main);
}
 
Example 5
Source File: CreateBaseFunctionDialog.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
public CreateBaseFunctionDialog(JFrame frame, Engine engine,
                                AccessRules rules) {
    super(frame, true);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    this.engine = engine;
    this.rules = rules;
    this.setTitle(GlobalResourcesManager.getString("CreateFunction"));
    double[][] size = {{5, TableLayout.MINIMUM, 5, TableLayout.FILL, 5},
            {5, TableLayout.FILL, 5}};
    JPanel panel = new JPanel(new TableLayout(size));

    panel.add(new JLabel(ResourceLoader.getString("name")), "1,1");

    field.setPreferredSize(new Dimension(220,
            field.getPreferredSize().height));

    panel.add(field, "3,1");

    ButtonGroup bg = new ButtonGroup();
    bg.add(idef0);
    bg.add(dfd);
    bg.add(dfds);

    JPanel jPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));

    idef0.setSelected(true);
    jPanel.add(idef0);
    jPanel.add(dfd);
    jPanel.add(dfds);

    JPanel jPanel2 = new JPanel(new BorderLayout());

    jPanel2.add(panel, BorderLayout.CENTER);
    jPanel2.add(jPanel, BorderLayout.SOUTH);

    this.setMainPane(jPanel2);
    setMinSizePack();
    centerDialog();
    this.setResizable(false);
}
 
Example 6
Source File: Preferences.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
private void init() {
    double[][] size = {
            {5, TableLayout.MINIMUM, 5, TableLayout.FILL},
            {5, TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5,
                    TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5}};
    this.setTitle(getString("Preferences.Title"));

    JPanel panel = new JPanel(new TableLayout(size));

    JLabel path = new JLabel(getString("Base.Location"));

    panel.add(path, "1, 1");
    panel.add(createLocationSector(), "3, 1");

    panel.add(new JLabel(getString("WebPort")), "1, 3");
    panel.add(webPort, "3, 3");

    //panel.add(new JLabel(), "1, 5");
    panel.add(canUndoRedo, "3, 5");

    //panel.add(new JLabel(), "1, 7");
    panel.add(autostart, "3, 7");

    setMainPane(panel);
    pack();
    centerDialog();
    setResizable(false);
}
 
Example 7
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 8
Source File: DFDObjectDialog.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
protected Component createFirstTab(JTabbedPane pane) {
    double[][] size = {{5, TableLayout.MINIMUM, 5, TableLayout.FILL, 5},
            {5, TableLayout.MINIMUM, 5, TableLayout.MINIMUM}};

    JPanel panel = new JPanel(new BorderLayout());
    JPanel c = new JPanel(new TableLayout(size));
    c.add(new JLabel("row:"), "1,1");
    c.add(qualifier, "3,1");

    c.add(new JLabel("element:"), "1,3");
    c.add(element, "3,3");
    panel.add(c, BorderLayout.NORTH);

    JPanel jPanel = new JPanel(new BorderLayout());

    JPanel jPanel2 = new JPanel(new FlowLayout(FlowLayout.RIGHT));

    JButton button = new JButton("set_dfd_object");

    jPanel2.add(button);

    button.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            SelectRowDialog dialog = new SelectRowDialog(
                    DFDObjectDialog.this) {

            };
            dialog.setSelectType(SelectType.RADIO);
            dialog.init(framework, dataPlugin, framework.getAccessRules());
            List<Row> list = dialog.showModal();
            if ((list != null) && (list.size() > 0)) {
                setLink(list.get(0));
            }
        }
    });

    jPanel.add(jPanel2, BorderLayout.NORTH);

    panel.add(jPanel, BorderLayout.CENTER);
    return panel;
}
 
Example 9
Source File: DiagramOptionsDialog.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
private Component createGeneralPanel() {
    double[][] size = {
            {5, TableLayout.FILL, 5},
            {5, TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5,
                    TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5,
                    TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5,
                    TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5,
                    TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5}};
    JPanel panel = new JPanel(new TableLayout(size));

    panel.add(new JLabel(ResourceLoader.getString("autor:")), "1,1");
    panel.add(author, "1,3");

    panel.add(new JLabel(ResourceLoader.getString("creation_date:")), "1,5");
    panel.add(createDate, "1,7");

    panel.add(new JLabel(ResourceLoader.getString("rev_date:")), "1,9");
    panel.add(revDate, "1,11");

    panel.add(new JLabel(ResourceLoader.getString("page_size:")), "1,13");
    panel.add(sizesBox, "1,15");

    panel.add(
            new JLabel(ResourceLoader.getString("horizontal_page_count:")),
            "1,17");
    panel.add(horizontalPageCountBox, "1,19");

    sizesBox.addItem("A4");
    sizesBox.addItem("A3");

    horizontalPageCountBox.addItem("1");
    horizontalPageCountBox.addItem("2");
    horizontalPageCountBox.addItem("3");
    horizontalPageCountBox.addItem("4");
    horizontalPageCountBox.addItem("5");
    horizontalPageCountBox.addItem("6");
    horizontalPageCountBox.addItem("7");
    horizontalPageCountBox.addItem("8");
    horizontalPageCountBox.addItem("9");
    horizontalPageCountBox.addItem("10");

    return panel;
}
 
Example 10
Source File: ExportToImagesDialog.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
private Component createBottomPanel() {
    double[][] size = {
            {5, TableLayout.MINIMUM, 5, TableLayout.FILL, 5,
                    TableLayout.MINIMUM, 5},
            {5, TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5,
                    TableLayout.MINIMUM, 5}};

    JPanel panel = new JPanel(new TableLayout(size));

    imageSizeComboBox = new JComboBox();
    imageSizeComboBox.addItem("799x530");
    imageSizeComboBox.addItem("904x601");
    imageSizeComboBox.addItem("1023x680");
    imageSizeComboBox.addItem("1151x765");
    imageSizeComboBox.addItem("1299x864");
    imageSizeComboBox.addItem("1600x1064");

    imageTypeComboBox = new JComboBox();
    imageTypeComboBox.addItem(".bmp");
    imageTypeComboBox.addItem(".png");
    imageTypeComboBox.addItem(".jpg");
    imageTypeComboBox.addItem(".svg");
    imageTypeComboBox.addItem(".emf");
    imageTypeComboBox.setSelectedIndex(1);

    panel.add(new JLabel(ResourceLoader.getString("ImageSize")), "1,1");
    panel.add(imageSizeComboBox, "3,1,5,1");

    panel.add(new JLabel(ResourceLoader.getString("ImageType")), "1,3");
    panel.add(imageTypeComboBox, "3,3,5,3");

    panel.add(new Label(ResourceLoader.getString("Folder")), "1, 5");
    panel.add(directory, "3, 5");
    panel.add(new JButton(new AbstractAction(GlobalResourcesManager
            .getString("Action.Browse")) {

        @Override
        public void actionPerformed(ActionEvent e) {
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.setSelectedFile(new File(directory.getText()));
            fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            int r = fileChooser.showOpenDialog(null);
            if (r == JFileChooser.APPROVE_OPTION)
                directory.setText(fileChooser.getSelectedFile()
                        .getAbsolutePath());
        }
    }), "5, 5");

    return panel;
}
 
Example 11
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 12
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 13
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);
}