Example usage for javax.swing JSplitPane setLeftComponent

List of usage examples for javax.swing JSplitPane setLeftComponent

Introduction

In this page you can find the example usage for javax.swing JSplitPane setLeftComponent.

Prototype

public void setLeftComponent(Component comp) 

Source Link

Document

Sets the component to the left (or above) the divider.

Usage

From source file:src.gui.ItSIMPLE.java

/**
 * @return Returns the planAnalysisFramePanel.
 */// w ww.j  a v  a2 s.  c  o  m
private ItFramePanel getPlanAnalysisFramePanel() {
    if (planAnalysisFramePanel == null) {
        planAnalysisFramePanel = new ItFramePanel(":: Plan Analysis", ItFramePanel.NO_MINIMIZE_MAXIMIZE);

        // tool bar
        JToolBar chartsToolBar = new JToolBar();
        chartsToolBar.add(new JButton(drawChartAction));

        // charts panel
        chartsPanel = new JPanel();
        chartsPanel.setLayout(new BoxLayout(chartsPanel, BoxLayout.Y_AXIS));

        ItFramePanel variableSelectionPanel = new ItFramePanel(".: Select variables to be tracked",
                ItFramePanel.NO_MINIMIZE_MAXIMIZE);
        //variableSelectionPanel.setBackground(new Color(151,151,157));

        JSplitPane split = new JSplitPane();
        split.setContinuousLayout(true);
        split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
        split.setDividerLocation(2 * screenSize.height / 3);

        split.setDividerSize(8);
        //split.setPreferredSize(new Dimension(screenSize.width/4-20, screenSize.height/2 - 50));
        //split.setPreferredSize(new Dimension(screenSize.width/4-20, 120));
        split.setLeftComponent(new JScrollPane(variablesPlanTree));
        split.setRightComponent(new JScrollPane(selectedVariablesPlanTree));

        variableSelectionPanel.setContent(split, false);
        //variableSelectionPanel.setParentSplitPane()

        //JPanel variableSelectionPanel  = new JPanel(new BorderLayout());
        //variableSelectionPanel.add(new JScrollPane(variablesPlanTree), BorderLayout.CENTER);
        //variableSelectionPanel.add(new JScrollPane(selectedVariablesPlanTree), BorderLayout.EAST);

        ItFramePanel variableGraphPanel = new ItFramePanel(".: Chart", ItFramePanel.NO_MINIMIZE_MAXIMIZE);
        variableGraphPanel.setContent(chartsPanel, true);

        JSplitPane mainvariablesplit = new JSplitPane();
        mainvariablesplit.setContinuousLayout(true);
        mainvariablesplit.setOrientation(JSplitPane.VERTICAL_SPLIT);
        mainvariablesplit.setDividerLocation(150);
        mainvariablesplit.setDividerSize(8);
        //mainvariablesplit.setPreferredSize(new Dimension(screenSize.width/4-20, screenSize.height/2 - 50));
        mainvariablesplit.setTopComponent(variableSelectionPanel);
        mainvariablesplit.setBottomComponent(variableGraphPanel);

        // main charts panel - used to locate the tool bar above the charts panel
        JPanel mainChartsPanel = new JPanel(new BorderLayout());
        mainChartsPanel.add(chartsToolBar, BorderLayout.NORTH);
        //mainChartsPanel.add(new JScrollPane(chartsPanel), BorderLayout.CENTER);
        mainChartsPanel.add(mainvariablesplit, BorderLayout.CENTER);

        //Results
        planInfoEditorPane = new JEditorPane();
        planInfoEditorPane.setContentType("text/html");
        planInfoEditorPane.setEditable(false);
        planInfoEditorPane.setCursor(new Cursor(Cursor.TEXT_CURSOR));
        planInfoEditorPane.setBackground(Color.WHITE);

        JPanel resultsPanel = new JPanel(new BorderLayout());

        JToolBar resultsToolBar = new JToolBar();
        resultsToolBar.setRollover(true);

        JButton planReportButton = new JButton("View Full Report",
                new ImageIcon("resources/images/viewreport.png"));
        planReportButton.setToolTipText("<html>View full plan report.<br> For multiple plans you will need "
                + "access to the Internet.<br> The components used in the report require such access (no data is "
                + "sent through the Internet).</html>");
        planReportButton.addActionListener(new java.awt.event.ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                //Opens html with defaut browser
                String path = "resources/report/Report.html";
                File report = new File(path);
                path = report.getAbsolutePath();
                try {
                    BrowserLauncher launcher = new BrowserLauncher();
                    launcher.openURLinBrowser("file://" + path);
                } catch (BrowserLaunchingInitializingException ex) {
                    Logger.getLogger(ItSIMPLE.class.getName()).log(Level.SEVERE, null, ex);
                    appendOutputPanelText("ERROR. Problem while trying to open the default browser. \n");
                } catch (UnsupportedOperatingSystemException ex) {
                    Logger.getLogger(ItSIMPLE.class.getName()).log(Level.SEVERE, null, ex);
                    appendOutputPanelText("ERROR. Problem while trying to open the default browser. \n");
                }
            }
        });
        resultsToolBar.add(planReportButton);

        resultsToolBar.addSeparator();
        JButton planReportDataButton = new JButton("Save Report Data",
                new ImageIcon("resources/images/savePDDL.png"));
        planReportDataButton.setToolTipText("<html>Save report data to file</html>");
        planReportDataButton.addActionListener(new java.awt.event.ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                //Save report data
                if (solveResult != null) {
                    Element lastOpenFolderElement = itSettings.getChild("generalSettings")
                            .getChild("lastOpenFolder");
                    JFileChooser fc = new JFileChooser(lastOpenFolderElement.getText());
                    fc.setDialogTitle("Save Report Data");
                    fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
                    fc.setFileFilter(new XMLFileFilter());

                    int returnVal = fc.showSaveDialog(ItSIMPLE.this);
                    if (returnVal == JFileChooser.APPROVE_OPTION) {
                        File selectedFile = fc.getSelectedFile();
                        String path = selectedFile.getPath();

                        if (!path.toLowerCase().endsWith(".xml")) {
                            path += ".xml";
                        }
                        //save file (xml)
                        try {
                            FileWriter file = new FileWriter(path);
                            file.write(XMLUtilities.toString(solveResult));
                            file.close();
                        } catch (IOException e1) {
                            e1.printStackTrace();
                        }

                        //Save as a last open folder
                        String folder = selectedFile.getParent();
                        //Element lastOpenFolderElement = itSettings.getChild("generalSettings").getChild("lastOpenFolder");
                        lastOpenFolderElement.setText(folder);
                        XMLUtilities.writeToFile("resources/settings/itSettings.xml", itSettings.getDocument());

                        //Ask if the user wants to save plans individually too.
                        boolean needToSavePlans = false;
                        int option = JOptionPane.showOptionDialog(instance,
                                "<html><center>Do you also want to save the plans"
                                        + "<br>in individual files?</center></html>",
                                "Save plans", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
                                null, null);
                        switch (option) {
                        case JOptionPane.YES_OPTION: {
                            needToSavePlans = true;
                        }
                            break;
                        case JOptionPane.NO_OPTION: {
                            needToSavePlans = false;
                        }
                            break;
                        }

                        if (needToSavePlans) {
                            //Close Open tabs
                            List<?> problems = null;
                            try {
                                XPath ppath = new JDOMXPath("project/domains/domain/problems/problem");
                                problems = ppath.selectNodes(solveResult);
                            } catch (JaxenException e2) {
                                e2.printStackTrace();
                            }

                            for (int i = 0; i < problems.size(); i++) {
                                Element problem = (Element) problems.get(i);
                                //create a folder for each problem and put all plans inside as xml files
                                String folderName = problem.getChildText("name");
                                String folderPath = selectedFile.getAbsolutePath()
                                        .replace(selectedFile.getName(), folderName);
                                //System.out.println(folderPath);
                                File planfolder = new File(folderPath);
                                boolean canSavePlan = false;
                                try {
                                    if (planfolder.mkdir()) {
                                        System.out.println("Directory '" + folderPath + "' created.");
                                        canSavePlan = true;
                                    } else {
                                        System.out.println("Directory '" + folderPath + "' was not created.");
                                    }

                                } catch (Exception ep) {
                                    ep.printStackTrace();
                                }

                                if (canSavePlan) {
                                    Element plans = problem.getChild("plans");
                                    for (Iterator<Element> it = plans.getChildren("xmlPlan").iterator(); it
                                            .hasNext();) {
                                        Element eaplan = it.next();
                                        Element theplanner = eaplan.getChild("planner");
                                        //save file (xml)
                                        String planFileName = "solution" + theplanner.getChildText("name") + "-"
                                                + theplanner.getChildText("version") + "-"
                                                + Integer.toString(plans.getChildren().indexOf(eaplan))
                                                + ".xml";
                                        String planPath = folderPath + File.separator + planFileName;
                                        /*
                                        try {
                                            FileWriter planfile = new FileWriter(planPath);
                                            planfile.write(XMLUtilities.toString(eaplan));
                                            planfile.close();
                                            System.out.println("File '" + planPath + "' created.");
                                        } catch (IOException e1) {
                                            e1.printStackTrace();
                                        }
                                        *
                                        */
                                        if (eaplan.getChild("plan").getChildren().size() > 0) {

                                            //TODO: save the plan in PDDL too. It should be done through the XPDDL/PDDL classes
                                            String pddlplan = ToXPDDL.XMLtoXPDDLPlan(eaplan);
                                            String planFileNamePDDL = "solution"
                                                    + theplanner.getChildText("name") + "-"
                                                    + theplanner.getChildText("version") + "-"
                                                    + Integer.toString(plans.getChildren().indexOf(eaplan))
                                                    + ".pddl";
                                            String planPathPDDL = folderPath + File.separator
                                                    + planFileNamePDDL;

                                            //String cfolderPath = selectedFile.getAbsolutePath().replace(selectedFile.getName(), "");
                                            //String planFileNamePDDL = theplanner.getChildText("name")+"-"+theplanner.getChildText("version") + "-" + folderName+"-solution.pddl";
                                            //String planPathPDDL = cfolderPath + File.separator + planFileNamePDDL;
                                            //if (!theplanner.getChildText("name").contains("MIPS")){
                                            try {
                                                FileWriter planfile = new FileWriter(planPathPDDL);
                                                planfile.write(pddlplan);
                                                planfile.close();
                                                System.out.println("File '" + planPathPDDL + "' created.");
                                            } catch (IOException e1) {
                                                e1.printStackTrace();
                                            }
                                        } //}

                                    }

                                }

                            }
                        }

                    }
                } else {
                    appendOutputPanelText(">> No report data available to save! \n");
                }

            }
        });
        resultsToolBar.add(planReportDataButton);

        JButton openPlanReportDataButton = new JButton("Open Report Data",
                new ImageIcon("resources/images/openreport.png"));
        openPlanReportDataButton.setToolTipText("<html>Open report data to file</html>");
        openPlanReportDataButton.addActionListener(new java.awt.event.ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                planSimStatusBar.setText("Status: Opening File...");
                appendOutputPanelText(">> Opening File... \n");
                //Open report data
                Element lastOpenFolderElement = itSettings.getChild("generalSettings")
                        .getChild("lastOpenFolder");
                JFileChooser fc = new JFileChooser(lastOpenFolderElement.getText());
                fc.setDialogTitle("Open Report Data");
                fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
                fc.setFileFilter(new XMLFileFilter());

                int returnVal = fc.showOpenDialog(ItSIMPLE.this);
                if (returnVal == JFileChooser.APPROVE_OPTION) {

                    File file = fc.getSelectedFile();
                    // Get itSIMPLE itSettings from itSettings.xml
                    org.jdom.Document resultsDoc = null;
                    try {
                        resultsDoc = XMLUtilities.readFromFile(file.getPath());
                        solveResult = resultsDoc.getRootElement();
                        //XMLUtilities.printXML(solveResult);
                        if (solveResult.getName().equals("projects")) {

                            String report = PlanAnalyzer.generatePlannersComparisonReport(solveResult);
                            String comparisonReport = PlanAnalyzer
                                    .generateFullPlannersComparisonReport(solveResult);
                            //Save Comparison Report file
                            saveFile("resources/report/Report.html", comparisonReport);
                            setPlanInfoPanelText(report);
                            setPlanEvaluationInfoPanelText("");
                            appendOutputPanelText(">> Report data read! \n");

                            //My experiments
                            PlanAnalyzer.myAnalysis(itPlanners.getChild("planners"), solveResult);
                        }
                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }

                    //Save as a last open folder
                    String folder = fc.getSelectedFile().getParent();
                    lastOpenFolderElement.setText(folder);
                    XMLUtilities.writeToFile("resources/settings/itSettings.xml", itSettings.getDocument());

                } else {
                    planSimStatusBar.setText("Status:");
                    appendOutputPanelText(">> Canceled \n");
                }

            }
        });
        resultsToolBar.add(openPlanReportDataButton);

        JButton compareProjectReportDataButton = new JButton("Compare Project Data",
                new ImageIcon("resources/images/compare.png"));
        compareProjectReportDataButton.setToolTipText(
                "<html>Compare different project report data <br> This is commonly use to compare diferent domain models with different adjustments.<br>"
                        + "One project data must be chosen as a reference; others will be compared to this referencial one.</html>");
        compareProjectReportDataButton.addActionListener(new java.awt.event.ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {

                final ProjectComparisonDialog dialog = new ProjectComparisonDialog();
                dialog.setVisible(true);

                final List<String> files = dialog.getFiles();

                if (files.size() > 1) {

                    new Thread() {
                        public void run() {
                            appendOutputPanelText(">> Project comparison report requested. Processing... \n");

                            planSimStatusBar.setText("Status: Reading files ...");
                            appendOutputPanelText(">> Reading files ... \n");

                            //base project file
                            String baseFileName = files.get(0);
                            appendOutputPanelText(">> Reading file '" + baseFileName + "' \n");
                            org.jdom.Document baseProjectDoc = null;
                            try {
                                baseProjectDoc = XMLUtilities.readFromFile(baseFileName);
                            } catch (Exception ec) {
                                ec.printStackTrace();
                            }
                            Element baseProject = null;
                            if (baseProjectDoc != null) {
                                baseProject = baseProjectDoc.getRootElement().getChild("project");
                            }

                            //The comparible projects
                            List<Element> comparableProjects = new ArrayList<Element>();

                            for (int i = 1; i < files.size(); i++) {
                                String eafile = files.get(i);
                                appendOutputPanelText(">> Reading file '" + eafile + "' \n");
                                org.jdom.Document eaProjectDoc = null;
                                try {
                                    eaProjectDoc = XMLUtilities.readFromFile(eafile);
                                } catch (Exception ec) {
                                    ec.printStackTrace();
                                }
                                if (eaProjectDoc != null) {
                                    comparableProjects.add(eaProjectDoc.getRootElement().getChild("project"));
                                }

                            }
                            appendOutputPanelText(">> Files read. Building report... \n");

                            String comparisonReport = PlanAnalyzer.generateProjectComparisonReport(baseProject,
                                    comparableProjects);
                            saveFile("resources/report/Report.html", comparisonReport);
                            appendOutputPanelText(
                                    ">> Project comparison report generated. Press 'View Full Report'\n");
                            appendOutputPanelText(" \n");

                        }
                    }.start();

                }

            }
        });
        resultsToolBar.add(compareProjectReportDataButton);

        resultsPanel.add(resultsToolBar, BorderLayout.NORTH);
        resultsPanel.add(new JScrollPane(planInfoEditorPane), BorderLayout.CENTER);

        JTabbedPane planAnalysisTabbedPane = new JTabbedPane();
        planAnalysisTabbedPane.addTab("Results", resultsPanel);
        planAnalysisTabbedPane.addTab("Variable Tracking", mainChartsPanel);
        planAnalysisTabbedPane.addTab("Movie Maker", getMovieMakerPanel());
        planAnalysisTabbedPane.addTab("Plan Evaluation", getPlanEvaluationPanel());
        planAnalysisTabbedPane.addTab("Plan Database", getPlanDatabasePanel());
        planAnalysisTabbedPane.addTab("Rationale Database", getRationaleDatabasePanel());

        JPanel planAnalysisPanel = new JPanel(new BorderLayout());
        //planAnalysisPanel.add(chartsToolBar, BorderLayout.NORTH);
        planAnalysisPanel.add(planAnalysisTabbedPane, BorderLayout.CENTER);
        planAnalysisFramePanel.setContent(planAnalysisPanel, false);

    }

    return planAnalysisFramePanel;
}

From source file:com.lp.client.frame.component.PanelDokumentenablage.java

private void jbInit() throws Throwable {
    if (LPMain.getInstance().getDesktop()
            .darfAnwenderAufZusatzfunktionZugreifen(MandantFac.ZUSATZFUNKTION_DOKUMENTENABLAGE)) {
        if (!(new HeliumDocPath()).equals(fullDocPath)) {
            bHatDokumentenablage = true;
        }/* w  w  w .j a va  2  s .c  o  m*/
    }
    if (bShowExitButton) {
        String[] aWhichButtonIUse = new String[] { PanelBasis.ACTION_NEW, PanelBasis.ACTION_UPDATE,
                PanelBasis.ACTION_SAVE, PanelBasis.ACTION_DISCARD };
        enableToolsPanelButtons(aWhichButtonIUse);
        createAndSaveAndShowButton("/com/lp/client/res/scanner.png", "TWAIN-Import", BUTTON_SCAN, null);
    }
    dropArea.setCenterText(LPMain.getTextRespectUISPr("lp.datei.draganddrop.ablegen"));
    dropArea.setBackground(Color.LIGHT_GRAY);
    dropArea.setSupportFiles(true);
    dropArea.addDropListener(this);
    dropArea.setMinimumSize(new Dimension(200, 100));

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);

    JPanel leftPane = new JPanel();
    JPanel rightPane = new JPanel();

    JLayeredPane rightLayered = new JLayeredPane();
    rightLayered.setLayout(new GridBagLayout());
    rightLayered.add(rightPane, new GridBagConstraints(1, 1, 1, 1, 1, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    // rightLayered.setLayer(rightPane, 0, 1);
    if (bShowExitButton && bHatDokumentenablage)
        rightLayered.add(dropArea, new GridBagConstraints(1, 2, 1, 1, 1, 1, GridBagConstraints.CENTER,
                GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    // rightLayered.setLayer(dropArea, 1, 1);

    rightPane.setLayout(new GridBagLayout());

    tree = new WrapperJTree(treeModel);
    tree.setEditable(false);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.setShowsRootHandles(true);
    tree.setRowHeight(0);

    tree.setCellRenderer(new ToolTipCellRenderer());
    ToolTipManager.sharedInstance().registerComponent(tree);

    tree.addTreeSelectionListener(this);

    refresh();

    personalDto = DelegateFactory.getInstance().getPersonalDelegate()
            .personalFindByPrimaryKey(LPMain.getTheClient().getIDPersonal());
    dokumentbelegartDto = DelegateFactory.getInstance().getJCRDocDelegate()
            .dokumentbelegartfindbyMandant(LPMain.getTheClient().getMandant());
    for (int i = 0; i < dokumentbelegartDto.length; i++) {
        if (!JCRDocFac.DEFAULT_ARCHIV_BELEGART.equals(dokumentbelegartDto[i].getCNr()))
            wcbBelegart.addItem(dokumentbelegartDto[i].getCNr());
    }
    dokumentgruppierungDto = DelegateFactory.getInstance().getJCRDocDelegate()
            .dokumentgruppierungfindbyMandant(LPMain.getTheClient().getMandant());
    for (int i = 0; i < dokumentgruppierungDto.length; i++) {
        if (!JCRDocFac.DEFAULT_ARCHIV_GRUPPE.equals(dokumentgruppierungDto[i].getCNr())
                || !JCRDocFac.DEFAULT_KOPIE_GRUPPE.equals(dokumentgruppierungDto[i].getCNr())
                || !JCRDocFac.DEFAULT_VERSANDAUFTRAG_GRUPPE.equals(dokumentgruppierungDto[i].getCNr())) {
            wcbGruppierung.addItem(dokumentgruppierungDto[i].getCNr());
        }
    }

    // Listen for when the selection changes.
    tree.addTreeExpansionListener(this);

    wcbVersteckteAnzeigen.setEnabled(true);
    wcbVersteckteAnzeigen.addActionListener(actionListener);

    wtfSuche.setEditable(true);
    wbuSuche.setEnabled(true);
    wbuSuche.addActionListener(actionListener);
    wbuPartner = new WrapperButton();

    wbuPartner.setText(LPMain.getTextRespectUISPr("button.partner"));
    wbuPartner.setToolTipText(LPMain.getTextRespectUISPr("button.partner.tooltip"));

    wbuPartner.setActionCommand(ACTION_SPECIAL_PARTNER);
    wbuPartner.addActionListener(this);
    wbuChooseDoc.setActionCommand(ACTION_SPECIAL_CHOOSE);
    wbuChooseDoc.addActionListener(this);
    wbuShowDoc.setActionCommand(ACTION_SPECIAL_SHOW);
    wbuShowDoc.addActionListener(this);
    wbuSaveDoc.setActionCommand(ACTION_SPECIAL_SAVE);
    wbuSaveDoc.addActionListener(this);

    wtfPartner = new WrapperTextField();
    wtfPartner.setColumnsMax(Facade.MAX_UNBESCHRAENKT);
    wtfPartner.setActivatable(false);
    wtfAnleger.setActivatable(false);
    wdfZeitpunkt.setActivatable(false);
    wtfBelegnummer.setActivatable(false);
    wtfTable.setActivatable(false);
    wtfRow.setActivatable(false);
    wtfFilename.setActivatable(false);
    wtfFilename.setColumnsMax(100);
    wtfMIME.setActivatable(false);
    wcbVersteckt.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            wtfSchlagworte.setMandatoryField(!wcbVersteckt.isSelected());
        }
    });

    if (bHatStufe0) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_NONE);
    }
    if (bHatStufe1) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_LOW);
    }
    if (bHatStufe2) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_MEDIUM);
    }
    if (bHatStufe3) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_HIGH);
    }
    if (bHatStufe99) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_ARCHIV);
    }

    wtfTable.setMandatoryField(true);
    wtfName.setMandatoryField(true);
    wtfName.setColumnsMax(200);
    wtfBelegnummer.setMandatoryField(true);
    wtfRow.setMandatoryField(true);
    wtfFilename.setMandatoryField(true);
    wtfMIME.setMandatoryField(true);
    wtfAnleger.setMandatoryField(true);
    wtfSchlagworte.setMandatoryField(true);
    wtfSchlagworte.setColumnsMax(300);
    wdfZeitpunkt.setMandatoryField(true);
    wtfPartner.setMandatoryField(true);

    treeView = new JScrollPane(tree);
    treeView.setMinimumSize(new Dimension(200, 10));
    treeView.setPreferredSize(new Dimension(200, 10));

    iZeile = 0;
    if (!bShowExitButton) {
        jpaWorkingOn.add(wtfSuche, new GridBagConstraints(0, iZeile, 1, 1, 0.2, 0.0, GridBagConstraints.WEST,
                GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
        jpaWorkingOn.add(wbuSuche, new GridBagConstraints(1, iZeile, 1, 1, 0.1, 0.0, GridBagConstraints.WEST,
                GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
        iZeile++;
    }
    jpaWorkingOn.add(wcbVersteckteAnzeigen, new GridBagConstraints(0, iZeile, 1, 1, 1, 0.0,
            GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    iZeile++;
    leftPane.add(treeView);

    jpaWorkingOn.add(splitPane, new GridBagConstraints(0, iZeile, 3, 1, 1.0, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    iZeile = 0;
    rightPane.add(wlaName, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    rightPane.add(wtfName, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    rightPane.add(wlaTable, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfTable, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaSchlagworte, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfSchlagworte, new GridBagConstraints(1, iZeile, 6, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaZeitpunkt, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wdfZeitpunkt, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaSicherheitsstufe, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wcbSicherheitsstufe, new GridBagConstraints(5, iZeile, 1, 1, 1.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wcbVersteckt, new GridBagConstraints(6, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaBelegnummer, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfBelegnummer, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaRow, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfRow, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaFilename, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfFilename, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaMIME, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfMIME, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaBelegart, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wcbBelegart, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaGruppierung, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wcbGruppierung, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wbuPartner, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfPartner, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaAnleger, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfAnleger, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    iZeile++;

    rightPane.add(wbuChooseDoc, new GridBagConstraints(0, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    rightPane.add(wbuShowDoc, new GridBagConstraints(3, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wbuSaveDoc, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaVorschau, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wmcMedia, new GridBagConstraints(0, iZeile, 7, 4, 1.0, 0.5, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    splitPane.setLeftComponent(treeView);
    splitPane.setRightComponent(rightLayered);
}

From source file:org.apache.jmeter.gui.MainFrame.java

/**
 * Create the GUI components and layout.
 *///from   w  ww  .j a  v a  2  s.  com
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    menuBar = new JMeterMenuBar();
    setJMenuBar(menuBar);
    JPanel all = new JPanel(new BorderLayout());
    all.add(createToolBar(), BorderLayout.NORTH);

    JSplitPane treeAndMain = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);

    treePanel = createTreePanel();
    treeAndMain.setLeftComponent(treePanel);

    JSplitPane topAndDown = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    topAndDown.setOneTouchExpandable(true);
    topAndDown.setDividerLocation(0.8);
    topAndDown.setResizeWeight(.8);
    topAndDown.setContinuousLayout(true);
    topAndDown.setBorder(null); // see bug jdk 4131528
    if (!DISPLAY_LOGGER_PANEL) {
        topAndDown.setDividerSize(0);
    }
    mainPanel = createMainPanel();

    logPanel = createLoggerPanel();
    errorsAndFatalsCounterLogTarget = new ErrorsAndFatalsCounterLogTarget();
    LoggingManager.addLogTargetToRootLogger(new LogTarget[] { logPanel, errorsAndFatalsCounterLogTarget });

    topAndDown.setTopComponent(mainPanel);
    topAndDown.setBottomComponent(logPanel);

    treeAndMain.setRightComponent(topAndDown);

    treeAndMain.setResizeWeight(.2);
    treeAndMain.setContinuousLayout(true);
    all.add(treeAndMain, BorderLayout.CENTER);

    getContentPane().add(all);

    tree.setSelectionRow(1);
    addWindowListener(new WindowHappenings());
    // Building is complete, register as listener
    GuiPackage.getInstance().registerAsListener();
    setTitle(DEFAULT_TITLE);
    setIconImage(JMeterUtils.getImage("icon-apache.png").getImage());// $NON-NLS-1$
    setWindowTitle(); // define AWT WM_CLASS string
}

From source file:org.executequery.gui.editor.ManageShortcutsPanel.java

private void init() {

    createTextPane();//from w  ww  . jav  a  2s .c o m
    createList();

    JSplitPane splitPane = createSplitPane();
    splitPane.setLeftComponent(new JScrollPane(list));
    splitPane.setRightComponent(new JScrollPane(textPane));

    JPanel panel = new JPanel(new GridBagLayout());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridy = 0;
    gbc.gridx = 1;
    gbc.insets.top = 5;
    gbc.insets.left = 5;
    gbc.insets.right = 5;
    panel.add(labelForKey("shortcuts"), gbc);
    gbc.gridy++;
    gbc.insets.bottom = 5;
    gbc.weighty = 1.0;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.BOTH;
    panel.add(splitPane, gbc);
    gbc.gridx = 0;
    gbc.weightx = 0;
    gbc.weighty = 0;
    gbc.insets.left = 5;
    gbc.insets.right = 0;
    gbc.fill = GridBagConstraints.NONE;
    panel.add(createMoveButtonsPanel(), gbc);

    addActionButton(createSaveButton());
    addActionButton(createCancelButton());

    addContentPanel(panel);

    setPreferredSize(new Dimension(600, 350));
}

From source file:org.intermine.install.swing.ProjectEditor.java

/**
 * Common initialisation: lays out the child components and wires up the necessary
 * event listeners. /*from ww  w  . j av  a  2  s. co m*/
 */
private void init() {

    setName("Project Editor Frame");
    setTitle(Messages.getMessage("projecteditor.title"));
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    addWindowListener(new MyWindowListener());

    modelViewerFrame = new JFrame();
    modelViewerFrame.setName("Model Viewer Frame");

    modelViewer = new ModelViewer();
    modelViewerFrame.setContentPane(modelViewer);
    modelViewerFrame.setTitle(Messages.getMessage("modelviewer.title"));
    modelViewerFrame.setSize(800, 600);

    newMineDialog = new NewMineDialog(this);
    createDatabaseDialog = new CreateDatabaseDialog(this);
    newMineDialog.setCreateDatabaseDialog(createDatabaseDialog);
    createPropertiesDialog = new CreatePropertiesDialog(this);
    createDatabaseDialog.setCreatePropertiesDialog(createPropertiesDialog);
    makeMineDialog = new MakeMineDialog(this);
    createPropertiesDialog.setMakeMineDialog(makeMineDialog);

    addSourceDialog = new AddSourceDialog(this);
    newDerivedSourceDialog = new NewDerivedTypeDialog(this);
    addSourceDialog.setNewDerivedDialog(newDerivedSourceDialog);

    postProcessorDialog = new PostProcessorDialog(this);

    buildProjectDialog = new BuildProjectDialog(this);

    preferencesDialog = new PreferencesDialog(this);

    ProjectListener projectListener = new MyProjectListener();
    addSourceDialog.addProjectListener(projectListener);
    newDerivedSourceDialog.addProjectListener(projectListener);
    postProcessorDialog.addProjectListener(projectListener);
    sourcePanel.addProjectListener(projectListener);
    makeMineDialog.addProjectListener(projectListener);
    addProjectListener(projectListener);

    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);

    JMenu fileMenu = new JMenu(Messages.getMessage("file"));
    fileMenu.setMnemonic(KeyEvent.VK_P);
    menuBar.add(fileMenu);

    fileMenu.add(new NewMineAction());
    fileMenu.add(new OpenAction());
    fileMenu.addSeparator();
    fileMenu.add(saveAction);
    fileMenu.addSeparator();
    fileMenu.add(buildProjectAction);

    JMenu editMenu = new JMenu(Messages.getMessage("edit"));
    editMenu.setMnemonic(KeyEvent.VK_E);
    menuBar.add(editMenu);

    editMenu.add(addSourceAction);
    editMenu.add(deleteSourceAction);
    editMenu.addSeparator();
    editMenu.add(postProcessorAction);

    JMenu viewMenu = new JMenu(Messages.getMessage("view"));
    viewMenu.setMnemonic(KeyEvent.VK_M);
    menuBar.add(viewMenu);

    viewMenu.add(new ViewModelAction());

    JMenu toolsMenu = new JMenu(Messages.getMessage("tools"));
    toolsMenu.setMnemonic(KeyEvent.VK_T);
    menuBar.add(toolsMenu);

    toolsMenu.add(new PreferencesAction());

    sourceListModel = new SourceListModel();
    sourceList = new JList(sourceListModel);

    Container cp = getContentPane();
    cp.setLayout(new BorderLayout());

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    cp.add(splitPane, BorderLayout.CENTER);

    initButtonPanel();

    Box vbox = Box.createVerticalBox();
    vbox.add(sourcePanel);
    vbox.add(buttonPanel);

    splitPane.setLeftComponent(new JScrollPane(sourceList));
    splitPane.setRightComponent(vbox);

    splitPane.setDividerLocation(200);

    initStatusPanel();
    cp.add(statusPanel, BorderLayout.SOUTH);

    sourceList.setCellRenderer(new SourceListRenderer());
    sourceList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    sourceList.addListSelectionListener(new SourceListSelectionListener());

    statusMessageClearTimer = new Timer(4000, new StatusMessageClearer());
    statusMessageClearTimer.setInitialDelay(4000);
    statusMessageClearTimer.setRepeats(false);

    setSize(800, 600);
}

From source file:org.monkeys.gui.matcher.MatcherPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./*  ww  w.ja  v  a2 s . c om*/
 */
@SuppressWarnings("unchecked")

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

    javax.swing.JSplitPane splitPane = new javax.swing.JSplitPane();
    textPanel = new javax.swing.JPanel();
    textHeader = new org.monkeys.gui.HeaderLabel();
    javax.swing.JScrollPane textScroll = new javax.swing.JScrollPane();
    textArea = new javax.swing.JTextArea();
    editPanel = new javax.swing.JPanel();
    clearButton = new javax.swing.JButton();
    javax.swing.JSeparator jSeparator2 = new javax.swing.JSeparator();
    editButton = new javax.swing.JToggleButton();
    matchingPanel = new javax.swing.JPanel();
    org.monkeys.gui.HeaderLabel matchingHeader = new org.monkeys.gui.HeaderLabel();
    matchingScroll = new javax.swing.JScrollPane();
    matchingList = new org.monkeys.gui.matcher.MatcherTable();
    org.monkeys.gui.HeaderLabel categoryLabel = new org.monkeys.gui.HeaderLabel();
    categoryDropdown = new org.monkeys.gui.CategoryDropdown();
    clipboardButton = new javax.swing.JToggleButton();
    selectButton = new javax.swing.JToggleButton();
    removeDuplicateButton = new javax.swing.JButton();
    removeRowButton = new javax.swing.JButton();
    javax.swing.JSeparator jSeparator3 = new javax.swing.JSeparator();
    javax.swing.JSeparator jSeparator4 = new javax.swing.JSeparator();
    javax.swing.JSeparator jSeparator5 = new javax.swing.JSeparator();
    modifyButton = new javax.swing.JButton();
    javax.swing.JSeparator jSeparator6 = new javax.swing.JSeparator();
    undoButton = new javax.swing.JButton();
    javax.swing.JSeparator jSeparator7 = new javax.swing.JSeparator();
    clipboardDropdown = new javax.swing.JComboBox();

    splitPane.setBorder(null);
    splitPane.setDividerSize(8);
    splitPane.setResizeWeight(0.6);

    textHeader.setText("Text");

    textScroll.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray));
    textScroll.setMinimumSize(new java.awt.Dimension(200, 50));
    textScroll.setPreferredSize(new java.awt.Dimension(300, 150));

    textArea.setTabSize(4);
    textArea.setAutoscrolls(false);
    textScroll.setViewportView(textArea);

    clearButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/clear-20.png"))); // NOI18N
    clearButton.setText("Clear");
    clearButton.setToolTipText("Clear All Fields");
    clearButton.setBorderPainted(false);
    clearButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            clearButtonActionPerformed(evt);
        }
    });

    jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

    editButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/lock-18.png"))); // NOI18N
    editButton.setSelected(true);
    editButton.setText("Edit");
    editButton.setToolTipText("Edit Text");
    editButton.setBorderPainted(false);
    editButton.setDisabledIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/lock-18.png"))); // NOI18N
    editButton.setIconTextGap(3);
    editButton.setSelectedIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/unlock-18.png"))); // NOI18N
    editButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            editButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout editPanelLayout = new javax.swing.GroupLayout(editPanel);
    editPanel.setLayout(editPanelLayout);
    editPanelLayout.setHorizontalGroup(editPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(editPanelLayout.createSequentialGroup().addComponent(editButton).addGap(0, 0, 0)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, 0).addComponent(clearButton).addGap(0, 89, Short.MAX_VALUE)));

    editPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
            new java.awt.Component[] { clearButton, editButton });

    editPanelLayout.setVerticalGroup(editPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(editPanelLayout.createSequentialGroup().addGap(0, 0, 0)
                    .addGroup(editPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jSeparator2)
                            .addComponent(editButton, javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(clearButton, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(0, 0, 0)));

    editPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL,
            new java.awt.Component[] { clearButton, editButton });

    javax.swing.GroupLayout textPanelLayout = new javax.swing.GroupLayout(textPanel);
    textPanel.setLayout(textPanelLayout);
    textPanelLayout.setHorizontalGroup(textPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(textPanelLayout.createSequentialGroup()
                    .addComponent(editPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(textPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(textPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(textScroll, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addComponent(textHeader, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap()));
    textPanelLayout.setVerticalGroup(textPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(textPanelLayout.createSequentialGroup().addContainerGap()
                    .addComponent(textHeader, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, 0)
                    .addComponent(editPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(textScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
                    .addContainerGap()));

    splitPane.setLeftComponent(textPanel);

    matchingHeader.setText("Matches");

    matchingScroll.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray));
    matchingScroll.setMinimumSize(new java.awt.Dimension(200, 120));
    matchingScroll.setPreferredSize(new java.awt.Dimension(480, 300));
    matchingScroll.setViewportView(matchingList);

    categoryLabel.setText("Category");

    clipboardButton.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/clipboard-16.png"))); // NOI18N
    clipboardButton.setToolTipText("Copy Selected To Clipboard");
    clipboardButton.setBorderPainted(false);
    clipboardButton.setEnabled(false);
    clipboardButton.setIconTextGap(2);
    clipboardButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            clipboardButtonActionPerformed(evt);
        }
    });

    selectButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/list-16.png"))); // NOI18N
    selectButton.setToolTipText("Select / Unselect All");
    selectButton.setBorderPainted(false);
    selectButton.setEnabled(false);
    selectButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            selectButtonActionPerformed(evt);
        }
    });

    removeDuplicateButton.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/monkeys/gui/icons/remove-duplicates-16.png"))); // NOI18N
    removeDuplicateButton.setToolTipText("Remove Duplicates");
    removeDuplicateButton.setBorderPainted(false);
    removeDuplicateButton.setEnabled(false);
    removeDuplicateButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeDuplicateButtonActionPerformed(evt);
        }
    });

    removeRowButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/remove-16.png"))); // NOI18N
    removeRowButton.setToolTipText("Remove Selected");
    removeRowButton.setBorderPainted(false);
    removeRowButton.setEnabled(false);
    removeRowButton.setIconTextGap(2);
    removeRowButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeRowButtonActionPerformed(evt);
        }
    });

    jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);

    jSeparator4.setOrientation(javax.swing.SwingConstants.VERTICAL);

    jSeparator5.setOrientation(javax.swing.SwingConstants.VERTICAL);

    modifyButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/edit-16.png"))); // NOI18N
    modifyButton.setToolTipText("Edit Selected");
    modifyButton.setBorderPainted(false);
    modifyButton.setEnabled(false);
    modifyButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            modifyButtonActionPerformed(evt);
        }
    });

    jSeparator6.setOrientation(javax.swing.SwingConstants.VERTICAL);

    undoButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/undo-16.png"))); // NOI18N
    undoButton.setBorderPainted(false);
    undoButton.setEnabled(false);
    undoButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            undoButtonActionPerformed(evt);
        }
    });

    jSeparator7.setOrientation(javax.swing.SwingConstants.VERTICAL);

    clipboardDropdown.setEditable(true);
    clipboardDropdown.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    clipboardDropdown.setEnabled(false);

    javax.swing.GroupLayout matchingPanelLayout = new javax.swing.GroupLayout(matchingPanel);
    matchingPanel.setLayout(matchingPanelLayout);
    matchingPanelLayout.setHorizontalGroup(matchingPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(matchingPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(matchingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(matchingPanelLayout.createSequentialGroup().addComponent(selectButton)
                                    .addGap(0, 0, 0)
                                    .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, 0).addComponent(removeDuplicateButton).addGap(0, 0, 0)
                                    .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, 0).addComponent(removeRowButton).addGap(0, 0, 0)
                                    .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 12,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, 0).addComponent(modifyButton).addGap(0, 0, 0)
                                    .addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 12,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, 0).addComponent(undoButton).addGap(0, 0, 0)
                                    .addComponent(jSeparator7, javax.swing.GroupLayout.PREFERRED_SIZE, 12,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, 0)
                                    .addComponent(clipboardDropdown, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, 0).addComponent(clipboardButton)
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(matchingScroll, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addComponent(categoryLabel, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(categoryDropdown, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(matchingHeader, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap()));

    matchingPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
            new java.awt.Component[] { clipboardButton, modifyButton, removeRowButton });

    matchingPanelLayout.setVerticalGroup(matchingPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(matchingPanelLayout.createSequentialGroup().addContainerGap()
                    .addComponent(categoryLabel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, 0)
                    .addComponent(categoryDropdown, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(matchingHeader, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(matchingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(matchingPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, matchingPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(removeDuplicateButton).addComponent(jSeparator4,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(matchingPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                    false)
                                            .addComponent(selectButton,
                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                                            .addComponent(jSeparator3,
                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(removeRowButton,
                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    28, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(modifyButton)
                            .addGroup(matchingPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(clipboardButton, javax.swing.GroupLayout.Alignment.TRAILING,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(matchingPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(undoButton).addComponent(jSeparator6,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jSeparator7, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(clipboardDropdown, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(matchingScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
                    .addContainerGap()));

    matchingPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL,
            new java.awt.Component[] { clipboardButton, clipboardDropdown });

    splitPane.setRightComponent(matchingPanel);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(splitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 664, Short.MAX_VALUE)
                    .addGap(0, 0, 0)));
    layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(splitPane));
}

From source file:org.notebook.gui.MainFrame.java

public void initGui() {
    setLayout(new BorderLayout());
    menu = new MenuToolbar(events);
    this.getRootPane().setJMenuBar(menu.getMenuBar());

    //editor = new DocumentEditor();
    //menu.addExtraToolBar(editor.getToolBar());

    //JScrollPane leftTree = new JScrollPane(tree);
    Dimension minSize = new Dimension(150, 400);

    mainPanel = new SimplePrintPanel();
    events.registerAction(mainPanel.getEventsHandler());
    _panel = new JScrollPane(mainPanel);
    _panel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

    JSplitPane splitPanel;
    splitPanel = new JSplitPane();
    splitPanel.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
    //splitPanel.setAutoscrolls(true);
    splitPanel.setDividerLocation(0.35);
    splitPanel.setOneTouchExpandable(true);
    splitPanel.setLeftComponent(getNavigationBar());
    splitPanel.setRightComponent(_panel);

    statusBar = new StatusBar();
    mainPanel.bar = statusBar;//ww  w.  java  2 s  . co m

    Container contentPane = getContentPane();
    contentPane.add(menu.getToolBar(), BorderLayout.NORTH);

    contentPane.add(splitPanel, BorderLayout.CENTER);
    //contentPane.add(_panel, BorderLayout.CENTER);

    contentPane.add(statusBar, BorderLayout.SOUTH);

    //controller = createPrivilegedProxy(new DefaultBookController(this));

    //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setIconImage(appIcon16());

    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    final MainFrame mainFrame = this;

    addWindowListener(new WindowAdapter() {
        //?
        public void windowClosing(WindowEvent e) {
            events.fireEvent(MenuToolbar.EXIT, mainFrame);
        }

        //???
        public void windowOpened(WindowEvent e) {
            events.fireEvent(MenuToolbar.LOADED, mainFrame);
        }
    });

    //????????
    events.fireEvent(MenuToolbar.GUI_INITED, this);

    events.registerAction(this);

    pack();
    setSize(670, 548);

}

From source file:org.openmicroscopy.shoola.agents.imviewer.view.ImViewerUI.java

/**
 * Adds a left and right component to the specified pane.
 * /*from w  ww . j av  a 2 s  . c  o m*/
 * @param pane   The split pane to add the components to.
 * @param left   The left component to add.
 * @param right The right component to add.
 */
private void addComponents(JSplitPane pane, JComponent left, JComponent right) {
    Component c = pane.getLeftComponent();
    if (c != null)
        pane.remove(c);
    c = pane.getRightComponent();
    if (c != null)
        pane.remove(c);
    pane.setLeftComponent(left);
    pane.setRightComponent(right);
}

From source file:org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewPane.java

private void refreshReportController(final ReportController newReportController) {
    for (int i = 0; i < outerReportControllerHolder.getComponentCount(); i++) {
        final Component maybeSplitPane = outerReportControllerHolder.getComponent(i);
        if (maybeSplitPane instanceof JSplitPane) {
            final JSplitPane splitPane = (JSplitPane) maybeSplitPane;
            reportControllerSliderSize = splitPane.getDividerLocation();
            break;
        }/*from  w  ww  .ja v a2 s  .com*/
    }

    if (newReportController == null) {
        if (reportControllerComponent != null) {
            // thats relatively easy.
            outerReportControllerHolder.removeAll();
            outerReportControllerHolder.add(toolbarHolder, BorderLayout.NORTH);
            outerReportControllerHolder.add(reportPaneScrollPane, BorderLayout.CENTER);
            reportControllerComponent = null;
            reportControllerInner = false;
            reportControllerLocation = null;
        }
    } else {
        final JComponent rcp = newReportController.getControlPanel();
        if (rcp == null) {
            if (reportControllerComponent != null) {
                outerReportControllerHolder.removeAll();
                outerReportControllerHolder.add(toolbarHolder, BorderLayout.NORTH);
                outerReportControllerHolder.add(reportPaneScrollPane, BorderLayout.CENTER);
                reportControllerComponent = null;
                reportControllerInner = false;
                reportControllerLocation = null;
            }
        } else if (reportControllerComponent != rcp
                || reportControllerInner != newReportController.isInnerComponent()
                || ObjectUtilities.equal(reportControllerLocation,
                        newReportController.getControllerLocation()) == false) {
            // if either the controller component or its position (inner vs outer)
            // and border-position has changed, then refresh ..
            this.reportControllerLocation = newReportController.getControllerLocation();
            this.reportControllerInner = newReportController.isInnerComponent();
            this.reportControllerComponent = newReportController.getControlPanel();

            outerReportControllerHolder.removeAll();
            if (reportControllerInner) {
                final JSplitPane innerHolder = new JSplitPane();
                innerHolder.setOpaque(false);
                if (BorderLayout.SOUTH.equals(reportControllerLocation)) {
                    innerHolder.setOrientation(JSplitPane.VERTICAL_SPLIT);
                    innerHolder.setTopComponent(reportPaneScrollPane);
                    innerHolder.setBottomComponent(reportControllerComponent);
                } else if (BorderLayout.EAST.equals(reportControllerLocation)) {
                    innerHolder.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
                    innerHolder.setLeftComponent(reportPaneScrollPane);
                    innerHolder.setRightComponent(reportControllerComponent);
                } else if (BorderLayout.WEST.equals(reportControllerLocation)) {
                    innerHolder.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
                    innerHolder.setRightComponent(reportPaneScrollPane);
                    innerHolder.setLeftComponent(reportControllerComponent);
                } else {
                    innerHolder.setOrientation(JSplitPane.VERTICAL_SPLIT);
                    innerHolder.setBottomComponent(reportPaneScrollPane);
                    innerHolder.setTopComponent(reportControllerComponent);
                }

                if (reportControllerSliderSize > 0) {
                    innerHolder.setDividerLocation(reportControllerSliderSize);
                }
                outerReportControllerHolder.add(toolbarHolder, BorderLayout.NORTH);
                outerReportControllerHolder.add(innerHolder, BorderLayout.CENTER);
            } else {
                final JPanel reportPaneHolder = new JPanel();
                reportPaneHolder.setOpaque(false);
                reportPaneHolder.setLayout(new BorderLayout());
                reportPaneHolder.add(toolbarHolder, BorderLayout.NORTH);
                reportPaneHolder.add(reportPaneScrollPane, BorderLayout.CENTER);

                final JSplitPane innerHolder = new JSplitPane();
                if (BorderLayout.SOUTH.equals(reportControllerLocation)) {
                    innerHolder.setOrientation(JSplitPane.VERTICAL_SPLIT);
                    innerHolder.setTopComponent(reportPaneHolder);
                    innerHolder.setBottomComponent(reportControllerComponent);
                } else if (BorderLayout.EAST.equals(reportControllerLocation)) {
                    innerHolder.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
                    innerHolder.setLeftComponent(reportPaneHolder);
                    innerHolder.setRightComponent(reportControllerComponent);
                } else if (BorderLayout.WEST.equals(reportControllerLocation)) {
                    innerHolder.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
                    innerHolder.setRightComponent(reportPaneHolder);
                    innerHolder.setLeftComponent(reportControllerComponent);
                } else {
                    innerHolder.setOrientation(JSplitPane.VERTICAL_SPLIT);
                    innerHolder.setBottomComponent(reportPaneHolder);
                    innerHolder.setTopComponent(reportControllerComponent);
                }
                if (reportControllerSliderSize > 0) {
                    innerHolder.setDividerLocation(reportControllerSliderSize);
                }
                outerReportControllerHolder.add(innerHolder, BorderLayout.CENTER);
            }
        }
    }
}

From source file:org.pentaho.reporting.ui.datasources.kettle.KettleDataSourceDialog.java

protected Component createContentPane() {
    final JPanel previewAndParameterPanel = createTransformParameterPanel();
    final JPanel queryListPanel = createQueryListPanel();

    final JPanel mainPanel = new JPanel(new GridBagLayout());
    mainPanel.setBorder(new EmptyBorder(5, 5, 0, 5));
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;//www.  j a  va2 s  . c o  m
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.WEST;
    mainPanel.add(new JLabel(Messages.getString("KettleDataSourceDialog.QueryName")), gbc);

    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.weightx = 1;
    mainPanel.add(nameTextField, gbc);

    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 3;
    gbc.gridwidth = 3;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weightx = 1;
    gbc.weighty = 1;
    gbc.anchor = GridBagConstraints.WEST;
    mainPanel.add(createDatasourcePanel(), gbc);

    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 4;
    gbc.gridwidth = 3;
    gbc.anchor = GridBagConstraints.WEST;
    mainPanel.add(previewAndParameterPanel, gbc);

    final JSplitPane panel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    panel.setLeftComponent(queryListPanel);
    panel.setRightComponent(mainPanel);
    panel.setDividerLocation(250);
    return panel;
}