Example usage for java.awt Cursor Cursor

List of usage examples for java.awt Cursor Cursor

Introduction

In this page you can find the example usage for java.awt Cursor Cursor.

Prototype

protected Cursor(String name) 

Source Link

Document

Creates a new custom cursor object with the specified name.

Note: this constructor should only be used by AWT implementations as part of their support for custom cursors.

Usage

From source file:us.daveread.basicquery.BasicQuery.java

/**
 * Executes all the queries//from w  w  w .j  ava  2  s.  c o  m
 */
private void runAllQueries() {
    int numExecutions, numQueries;
    int execution, query;
    ProgressMonitor monitor;
    boolean canceled;
    java.util.Date start;
    int elapsed;
    long remaining;
    int hours, minutes, seconds;

    numQueries = querySelection.getModel().getSize();
    try {
        numExecutions = Integer
                .parseInt(JOptionPane.showInputDialog(this, Resources.getString("dlgAllQueriesText"),
                        Resources.getString("dlgAllQueriesTitle"), JOptionPane.QUESTION_MESSAGE));
    } catch (Exception any) {
        numExecutions = 0;
    }

    messageOut(Resources.getString("msgNumExecutions", numExecutions + ""));

    monitor = new ProgressMonitor(this, Resources.getString("dlgRunAllQueriesProgressTitle"),
            Resources.getString("dlgRunAllQueriesProgressNote", "0", numExecutions + "", "0", numQueries + ""),
            0, numQueries * Math.abs(numExecutions));

    getContentPane().setCursor(new Cursor(Cursor.WAIT_CURSOR));

    if (numExecutions < 0) {
        numExecutions = Math.abs(numExecutions);

        for (query = 0; !monitor.isCanceled() && query < numQueries; ++query) {
            querySelection.setSelectedIndex(query);
            elapsed = -1;
            for (execution = 0; !monitor.isCanceled() && execution < numExecutions; ++execution) {
                monitor.setProgress(query * numExecutions + execution);
                if (elapsed <= 0) {
                    monitor.setNote(Resources.getString("dlgRunAllQueriesProgressNote", (execution + 1) + "",
                            numExecutions + "", (query + 1) + "", numQueries + ""));
                } else {
                    remaining = elapsed
                            * ((numExecutions * (numQueries - (query + 1))) + (numExecutions - execution));
                    hours = (int) (remaining / SECONDS_PER_HOUR);
                    remaining -= hours * SECONDS_PER_HOUR;
                    minutes = (int) (remaining / SECONDS_PER_MINUTE);
                    remaining -= minutes * SECONDS_PER_MINUTE;
                    seconds = (int) remaining;

                    monitor.setNote(Resources.getString("dlgRunAllQueriesProgressNoteWithRemainTime",
                            (execution + 1) + "", numExecutions + "", (query + 1) + "", numQueries + "",
                            Utility.formattedNumber(hours, "00"), Utility.formattedNumber(minutes, "00"),
                            Utility.formattedNumber(seconds, "00")));
                }
                messageOut(Resources.getString("dlgRunAllQueriesProgressNote", (execution + 1) + "",
                        numExecutions + "", (query + 1) + "", numQueries + ""));
                start = new java.util.Date();
                processStatement(true);
                elapsed = (int) ((new java.util.Date().getTime() - start.getTime()) / 1000);
            }
        }
    } else {
        elapsed = -1;
        for (execution = 0; !monitor.isCanceled() && execution < numExecutions; ++execution) {
            start = new java.util.Date();
            for (query = 0; !monitor.isCanceled() && query < numQueries; ++query) {
                querySelection.setSelectedIndex(query);
                monitor.setProgress(execution * numQueries + query);

                if (elapsed <= 0) {
                    monitor.setNote(Resources.getString("dlgRunAllQueriesProgressNote", (execution + 1) + "",
                            numExecutions + "", (query + 1) + "", numQueries + ""));
                } else {
                    remaining = elapsed * (numExecutions - execution);
                    hours = (int) (remaining / SECONDS_PER_HOUR);
                    remaining -= hours * SECONDS_PER_HOUR;
                    minutes = (int) (remaining / SECONDS_PER_MINUTE);
                    remaining -= minutes * SECONDS_PER_MINUTE;
                    seconds = (int) remaining;

                    monitor.setNote(Resources.getString("dlgRunAllQueriesProgressNoteWithRemainTime",
                            (execution + 1) + "", numExecutions + "", (query + 1) + "", numQueries + "",
                            Utility.formattedNumber(hours, "00"), Utility.formattedNumber(minutes, "00"),
                            Utility.formattedNumber(seconds, "00")));
                }

                messageOut(Resources.getString("dlgRunAllQueriesProgressNote", (execution + 1) + "",
                        numExecutions + "", (query + 1) + "", numQueries + ""));
                processStatement(true);
            }
            elapsed = (int) ((new java.util.Date().getTime() - start.getTime()) / 1000);
        }
    }

    canceled = monitor.isCanceled();

    monitor.close();

    getContentPane().setCursor(new Cursor(Cursor.DEFAULT_CURSOR));

    if (canceled) {
        userMessage(Resources.getString("dlgExecutionsCanceledText"),
                Resources.getString("dlgExecutionsCanceledTitle"), JOptionPane.WARNING_MESSAGE);
    } else if (numExecutions != 0) {
        userMessage(Resources.getString("dlgExecutionsCompletedText"),
                Resources.getString("dlgExecutionsCompletedTitle"), JOptionPane.INFORMATION_MESSAGE);
    } else {
        userMessage(Resources.getString("dlgExecutionsNoneText"), Resources.getString("dlgExecutionsNoneTitle"),
                JOptionPane.INFORMATION_MESSAGE);
    }
}

From source file:us.daveread.basicquery.BasicQuery.java

/**
 * Run a SQL statement on its own thread. If a statement is currently being
 * executed the user may either cancel the new request or the currently
 * running query.//from w  ww.ja v  a 2s  .com
 * 
 * @param statementRunType
 *          The type of query execution -- single or
 *          multiple statement
 */
private void runIt(int statementRunType) {
    if (runningQuery != null) {
        if (!runningQuery.isAlive()) {
            runningQuery = null;
        } else {
            final int decision = JOptionPane.showConfirmDialog(this,
                    Utility.characterInsert(Resources.getString("dlgCancelQueryText"), "\n", 40, 60, " ."),
                    Resources.getString("dlgCancelQueryTitle"), JOptionPane.YES_NO_OPTION,
                    JOptionPane.WARNING_MESSAGE);
            if (decision == JOptionPane.YES_OPTION) {
                runningQuery.interrupt();
                runningQuery = null;
                flashRunIndicator.interrupt();
                flashRunIndicator = null;
                timeRunIndicator.interrupt();
                timeRunIndicator = null;
                this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
            }
        }
    }

    if (runningQuery == null) {
        runType = statementRunType;
        (runningQuery = new Thread(this)).start();
    }
}

From source file:src.gui.ItSIMPLE.java

/**
 * @return Returns the planAnalysisFramePanel.
 *///from w  w w  . ja va  2 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:src.gui.ItSIMPLE.java

/**
 * This method initializes planEvaluationPanel
 *
 * @return javax.swing.JPanel/*from  w  ww  . j  a v a 2  s .  c o  m*/
 */
private JPanel getPlanEvaluationPanel() {
    //TODO:

    if (planEvaluationPanel == null) {
        planEvaluationPanel = new JPanel(new BorderLayout());

        JPanel contentPanel = new JPanel(new BorderLayout());

        //Plan evaluation summary
        planEvaluationInfoEditorPane = new JEditorPane();
        planEvaluationInfoEditorPane.setContentType("text/html");
        planEvaluationInfoEditorPane.setEditable(false);
        planEvaluationInfoEditorPane.setCursor(new Cursor(Cursor.TEXT_CURSOR));
        planEvaluationInfoEditorPane.setBackground(Color.WHITE);
        planEvaluationInfoEditorPane.setPreferredSize(new Dimension(600, 100));
        contentPanel.add(new JScrollPane(planEvaluationInfoEditorPane), BorderLayout.CENTER);
        //contentPanel.add(new JScrollPane(planEvaluationInfoEditorPane), BorderLayout.NORTH);

        //metric table
        // create parameters table
        //                        JScrollPane scrollParamPane = new JScrollPane(getMetricsTable());
        //                        JPanel paramPane = new JPanel(new BorderLayout());
        //                        paramPane.add(scrollParamPane, BorderLayout.CENTER);
        //                        paramPane.setPreferredSize(new Dimension(600, 210));
        //                        //add(paramPane, BorderLayout.CENTER);
        //                        plannerSettingPanel.add(paramPane, BorderLayout.CENTER);

        //                        //cost and overall plan evaluation panel
        //                        FormLayout layout = new FormLayout(
        //                                        "pref, 4px, 100px", // columns
        //                                        "pref, 4px, pref"); // rows
        //                        JPanel costoverallPanel = new JPanel(layout);
        //
        //                        //plan cost
        //                        JLabel costLabel = new JLabel("Plan Cost:");
        //                        JLabel thecostLabel = new JLabel("...");
        //                        //plan overall evaluation
        //                        JLabel evaluationLabel = new JLabel("<html><strong>Plan evaluation:</strong></html>");
        //                        overallPlanEvaluationValue = new JTextField(30);
        //                        JTextFieldFilter filter = new JTextFieldFilter(JTextFieldFilter.FLOAT);
        //                        filter.setNegativeAccepted(false);
        //                        //filter.setLimit(3);
        //                        overallPlanEvaluationValue.setDocument(filter);
        //                        overallPlanEvaluationValue.setColumns(9);
        //
        //                        CellConstraints cc = new CellConstraints();
        //                        costoverallPanel.add(costLabel, cc.xy (1, 1));
        //                        costoverallPanel.add(thecostLabel, cc.xy(3, 1));
        //                        costoverallPanel.add(evaluationLabel, cc.xy(1, 3));
        //                        costoverallPanel.add(overallPlanEvaluationValue, cc.xy(3, 3));
        //                        contentPanel.add(costoverallPanel, BorderLayout.SOUTH);

        planEvaluationPanel.add(getPlanEvaluationToolBar(), BorderLayout.NORTH);
        planEvaluationPanel.add(contentPanel, BorderLayout.CENTER);
    }

    return planEvaluationPanel;
}

From source file:src.gui.ItSIMPLE.java

/**
 * This method initializes planInfoFramePanel
 *
 * @return javax.swing.JPanel/*from   w  w w .j a v a  2  s. c o m*/
 */
private ItFramePanel getPlanInfoFramePanel() {
    if (planInfoFramePanel == null) {
        JPanel planInfoPanel = new JPanel(new BorderLayout());
        planInfoPanel.setMinimumSize(new Dimension(100, 40));
        planInfoFramePanel = new ItFramePanel(":: Console", ItFramePanel.MINIMIZE_MAXIMIZE);
        //informationPanel.setMinimumSize(new Dimension(100,25));

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

        outputEditorPane = new JTextArea();
        //outputEditorPane.setContentType("text/html");
        outputEditorPane.setEditable(false);
        outputEditorPane.setLineWrap(true);
        outputEditorPane.setWrapStyleWord(true);
        outputEditorPane.setCursor(new Cursor(Cursor.TEXT_CURSOR));

        // tabbed panes with jtrees
        JTabbedPane outputPane = new JTabbedPane();
        outputPane.addTab("Output", new JScrollPane(outputEditorPane));
        //outputPane.addTab("Results", new JScrollPane(planInfoEditorPane));

        //planInfoFramePanel.setContent(planInfoEditorPane, true);
        planInfoFramePanel.setContent(outputPane, false);
        planInfoFramePanel.setParentSplitPane(planInfoSplitPane);

        planInfoPanel.add(planInfoFramePanel, BorderLayout.CENTER);
    }
    return planInfoFramePanel;
}

From source file:src.gui.ItSIMPLE.java

private JPanel getTranslatedPddlPanel() {
    JPanel anPanel = new JPanel(new BorderLayout());

    //TOP panel//from  ww  w. j  a v  a 2s  . c o  m
    if (pddlTextSplitPane == null) {
        pddlTextSplitPane = new JSplitPane();
        pddlTextSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);

        //Problem Panel
        ItFramePanel problemPanel = new ItFramePanel(":: Problem", ItFramePanel.MINIMIZE_MAXIMIZE);
        problemPanel.setContent(getBottomPddlPanel(), false);
        problemPanel.setParentSplitPane(pddlTextSplitPane);
        pddlTextSplitPane.setBottomComponent(problemPanel);

        //Doamin Panel
        ItFramePanel domainPanel = new ItFramePanel(":: Domain", ItFramePanel.NO_MINIMIZE_MAXIMIZE);
        domainPanel.setContent(getTopPddlPanel(), false);
        //domainPanel.setParentSplitPane(pddlTextSplitPane);
        pddlTextSplitPane.setTopComponent(domainPanel);

        pddlTextSplitPane.setDividerSize(3);
        pddlTextSplitPane.setContinuousLayout(true);
        pddlTextSplitPane.setDividerLocation((int) (screenSize.height * 0.40));
        pddlTextSplitPane.setResizeWeight(0.5);
    }
    anPanel.add(pddlTextSplitPane, BorderLayout.CENTER);

    //BOTTOM
    //Console output
    ItFramePanel outputPanel = new ItFramePanel(":: Output console", ItFramePanel.NO_MINIMIZE_MAXIMIZE);
    outputPanel.setPreferredSize(new Dimension(screenSize.width / 4 - 20, 120));
    //Results output
    //Content of the FramePanel            
    JPanel resultsPanel = new JPanel(new BorderLayout());
    outputPddlTranslationEditorPane = new JTextArea();
    //analysisInfoEditorPane.setContentType("text/html");
    outputPddlTranslationEditorPane.setEditable(false);
    outputPddlTranslationEditorPane.setLineWrap(true);
    outputPddlTranslationEditorPane.setWrapStyleWord(true);
    outputPddlTranslationEditorPane.setCursor(new Cursor(Cursor.TEXT_CURSOR));
    outputPddlTranslationEditorPane.setBackground(Color.WHITE);
    resultsPanel.add(new JScrollPane(outputPddlTranslationEditorPane), BorderLayout.CENTER);

    outputPanel.setContent(resultsPanel, false);

    anPanel.add(outputPanel, BorderLayout.SOUTH);

    return anPanel;

}

From source file:src.gui.ItSIMPLE.java

/**
 * This method initializes petriEditorSplitPane
 *
 * @return javax.swing.JSplitPane/*w ww.j a  v a  2  s.c o  m*/
 */
private JSplitPane getPetriEditorSplitPane() {
    if (petriEditorSplitPane == null) {
        petriEditorSplitPane = new JSplitPane();
        petriEditorSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);

        //Analysis Results Panel
        ItFramePanel analysisPanel = new ItFramePanel(":: Analysis Results", ItFramePanel.MINIMIZE_MAXIMIZE);
        analysisPanel.setContent(getBottomPetriPanel(), false);
        analysisPanel.setParentSplitPane(petriEditorSplitPane);
        petriEditorSplitPane.setBottomComponent(analysisPanel);
        petriInfoEditorPane = new JEditorPane();
        petriInfoEditorPane.setContentType("text/html");
        petriInfoEditorPane.setEditable(false);
        petriInfoEditorPane.setCursor(new Cursor(Cursor.TEXT_CURSOR));
        analysisPanel.setContent(petriInfoEditorPane, true);

        //Editor Panel
        ItFramePanel editorPanel = new ItFramePanel(":: Petri Net", ItFramePanel.NO_MINIMIZE_MAXIMIZE);
        editorPanel.setContent(getTopPetriPane(), false);

        petriDiagramGraph.setInfoPane(petriInfoEditorPane);
        //domainPanel.setParentSplitPane(pddlTextSplitPane);
        petriEditorSplitPane.setTopComponent(editorPanel);

        petriEditorSplitPane.setDividerSize(3);
        petriEditorSplitPane.setContinuousLayout(true);
        petriEditorSplitPane.setDividerLocation((int) (screenSize.height * 0.45));
        petriEditorSplitPane.setResizeWeight(0.5);
    }
    return petriEditorSplitPane;
}

From source file:src.gui.ItSIMPLE.java

/**
 * Creates the main content panel in the main analysis panel
 * @return /*from  w  ww  . jav  a2  s  .c  o m*/
 */
private JPanel getAnalysisMainContentPane() {

    JPanel anPanel = new JPanel(new BorderLayout());

    ItFramePanel mainContentPanel = new ItFramePanel(":: Analysis Techniques and Results",
            ItFramePanel.NO_MINIMIZE_MAXIMIZE);

    //Content of the FramePanel            
    JPanel resultsPanel = new JPanel(new BorderLayout());

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

    JButton TorchlightButton = new JButton("TorchLight", new ImageIcon("resources/images/compare.png"));
    TorchlightButton.setToolTipText(
            "<html>Run TorchLight system. <br>TorchLight analyzes h+ search space topology without actually running any search</html>");
    TorchlightButton.addActionListener(new java.awt.event.ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {

            new Thread() {
                public void run() {

                    ItTreeNode selectedNode = (ItTreeNode) projectAnalysisTree.getLastSelectedPathComponent();

                    if (selectedNode.getData() != null
                            && selectedNode.getData().getName().indexOf("problem") != -1) {
                        appendAnalysisOutputPanelText(
                                "(!) Know more about TorchLight at http://www.loria.fr/~hoffmanj/ \n");
                        appendAnalysisOutputPanelText(">> Calling TorchLight System... \n");
                        analysisStatusBar.setText("Status: Running Tourchlight ...");

                        String pddlVersion = pddlButtonsGroup.getSelection().getActionCommand();

                        //Call TorchLight
                        TorchLightAnalyzer.getTorchLightAnalysis(selectedNode, pddlVersion);

                        appendAnalysisOutputPanelText(">> TorchLight analysis done!'\n");
                        appendAnalysisOutputPanelText(" \n");
                        analysisStatusBar.setText("Status: Tourchlight analysis done!");
                    } else {
                        JOptionPane.showMessageDialog(ItSIMPLE.this,
                                "<html>Please chose a problem node at the 'Project Selection' tree. </html>");
                    }

                }
            }.start();

        }
    });
    analysisToolSetBar.add(TorchlightButton);

    //Results output
    outputAnalysisEditorPane = new JTextArea();
    //analysisInfoEditorPane.setContentType("text/html");
    outputAnalysisEditorPane.setEditable(false);
    outputAnalysisEditorPane.setLineWrap(true);
    outputAnalysisEditorPane.setWrapStyleWord(true);
    outputAnalysisEditorPane.setCursor(new Cursor(Cursor.TEXT_CURSOR));
    outputAnalysisEditorPane.setBackground(Color.WHITE);

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

    resultsPanel.add(analysisToolSetBar, BorderLayout.NORTH);
    resultsPanel.add(new JScrollPane(outputAnalysisEditorPane), BorderLayout.CENTER);

    mainContentPanel.setContent(resultsPanel, false);
    //mainContentPanel.setParentSplitPane(petriEditorSplitPane);           
    anPanel.add(mainContentPanel, BorderLayout.CENTER);

    return anPanel;
}

From source file:src.gui.ItSIMPLE.java

/**
 * This method initializes petriEditorPane
 *
 * @return javax.swing.JPanel/*from   ww  w . java  2s  .  c o  m*/
 */
private JEditorPane getPetriEditorPane() {
    if (petriEditorPane == null) {
        petriEditorPane = new JEditorPane();
        petriEditorPane.setContentType("text/html");
        petriEditorPane.setEditable(false);
        petriEditorPane.setCursor(new Cursor(Cursor.TEXT_CURSOR));
    }
    return petriEditorPane;
}

From source file:src.gui.ItSIMPLE.java

/**
 * This method initializes informationPanel
 *
 * @return javax.swing.JPanel/* w  w  w .  ja  v a2  s . c o m*/
 */
private JPanel getInformationPanel() {
    if (informationPanel == null) {
        informationPanel = new JPanel(new BorderLayout());
        informationPanel.setMinimumSize(new Dimension(100, 20));
        infoPanel = new ItFramePanel(":: Information", ItFramePanel.MINIMIZE_MAXIMIZE);
        //informationPanel.setMinimumSize(new Dimension(100,25));
        infoEditorPane = new JEditorPane();
        infoEditorPane.setContentType("text/html");
        infoEditorPane.setEditable(false);
        infoEditorPane.setCursor(new Cursor(Cursor.TEXT_CURSOR));
        infoPanel.setContent(infoEditorPane, true);
        infoPanel.setParentSplitPane(graphSplitPane);
        informationPanel.add(infoPanel, BorderLayout.CENTER);
    }
    return informationPanel;
}