Package reportgen.gui.genepanel.corepanel

Source Code of reportgen.gui.genepanel.corepanel.CorePanel

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* CorePanel.java
*
* Created on 13.07.2009, 15:38:05
*/

package reportgen.gui.genepanel.corepanel;

import java.awt.GridLayout;
import java.awt.Window;
import javax.swing.JPanel;
import reportgen.gui.genepanel.corepanel.columnpanel.ColumnPanel;
import reportgen.gui.genepanel.corepanel.entitypanel.EntityPanel;
import reportgen.gui.genepanel.corepanel.inlinepanel.InlineTablePanel;
import reportgen.prototype.QCore;
import reportgen.prototype.inline.InlineCoreJavaList;
import reportgen.prototype.inline.InlineCoreSQLList;
import reportgen.utils.ReportException;

/**
*
* @author axe
*/
public class CorePanel extends javax.swing.JPanel {


    public CorePanel(Window parent, QCore core) throws ReportException {
        initComponents();

        tabs.add("Объекты", new EntityPanel(parent, core));
        tabs.add("Условия", core.getConditions().getPanel(parent));
        tabs.add("Результаты выборки", new ColumnPanel(parent, core));
        tabs.add("Постусловия", core.getPostConditions().getPanel(parent));

        InlineCoreSQLList inlines = core.getConditionInlinesList();
        InlineCoreSQLList sql = core.getResultInlinesList();
        InlineCoreJavaList java = core.getResultInJavaList();
        int width = (inlines != null ? 1:0) + (java != null  ? 1:0) + (sql != null ? 1:0);
        if(width > 0) {
            JPanel inlinesTabs = new JPanel(new GridLayout(0, width));
            if(inlines != null) {
                inlinesTabs.add(new InlineTablePanel(parent, inlines, "Условные подзапросы"));
            }
            if(sql != null) {
                inlinesTabs.add(new InlineTablePanel(parent, sql, "Подзапросы по сущностям"));
            }
            if(java != null) {
                inlinesTabs.add(new InlineTablePanel(parent, java, "Подзапросы по результатам"));
            }
            tabs.add("Подзапросы", inlinesTabs);
        }
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tabs = new javax.swing.JTabbedPane();

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(tabs, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(tabs, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane tabs;
    // End of variables declaration//GEN-END:variables
}
TOP

Related Classes of reportgen.gui.genepanel.corepanel.CorePanel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.