Example usage for java.awt Cursor DEFAULT_CURSOR

List of usage examples for java.awt Cursor DEFAULT_CURSOR

Introduction

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

Prototype

int DEFAULT_CURSOR

To view the source code for java.awt Cursor DEFAULT_CURSOR.

Click Source Link

Document

The default cursor type (gets set if no cursor is defined).

Usage

From source file:edu.scripps.fl.pubchem.xmltool.gui.PubChemXMLCreatorGUI.java

public void mouseClicked(MouseEvent e) {
    try {/*  ww  w  . j  a v a 2 s.c  o  m*/
        if (e.getClickCount() > 0) {
            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            if (e.getSource() == jtpExample) {
                URL url = getClass().getClassLoader().getResource("ExampleExcel.xlsx");
                File tmpFile = File.createTempFile("example", ".xlsx");
                FileUtils.copyURLToFile(url, tmpFile);
                tmpFile.deleteOnExit();
                Desktop.getDesktop().open(tmpFile);
            } else if (e.getSource() == jtpExcelTemplate) {
                File saveFile = gc.fileChooser(jtfFileExcel, ".xlsx", "save");
                if (saveFile != null) {
                    URL url = getClass().getClassLoader().getResource("ExcelTemplate_withBAO.xlsx");
                    OutputStream out = new FileOutputStream(saveFile, true);
                    IOUtils.copy(url.openStream(), out);
                    String output = FilenameUtils.concat(FilenameUtils.getFullPath(saveFile.toString()),
                            FilenameUtils.getBaseName(saveFile.toString()));
                    Desktop.getDesktop().open(new File(saveFile.toString()));
                }
            } else if (e.getSource() == jtfFileTemplate && jtfFileTemplate.getText().equals(template)) {
                jtfFileTemplate.setText("");
            } else if (e.getSource() == this) {
                if (jtfFileTemplate.getText().equals("")) {
                    jtfFileTemplate.setText(template);
                }
            }
        }
        setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    } catch (Throwable throwable) {
        SwingGUI.handleError(this, throwable);
    }
}

From source file:client.welcome3.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./* w w w . ja v  a  2  s . co m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    searchGroup = new javax.swing.ButtonGroup();
    SupplierButtonGroup = new javax.swing.ButtonGroup();
    AddUserSearchGroup = new javax.swing.ButtonGroup();
    ProjectStatusReportGroup = new javax.swing.ButtonGroup();
    jSeparator1 = new javax.swing.JSeparator();
    jLabel4 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    projectsButton = new javax.swing.JButton();
    reportsButton = new javax.swing.JButton();
    logoutButton = new javax.swing.JButton();
    jLayeredPane1 = new javax.swing.JLayeredPane();
    projectsTab = new javax.swing.JTabbedPane();
    AddProjectPanel = new javax.swing.JPanel();
    projIDtxt = new javax.swing.JTextField();
    projNametxt = new javax.swing.JTextField();
    projStartDate = new com.toedter.calendar.JDateChooser();
    projDueDate = new com.toedter.calendar.JDateChooser();
    jScrollPane13 = new javax.swing.JScrollPane();
    projDesctxt = new javax.swing.JTextArea();
    projAddButton = new javax.swing.JButton();
    projClearButton = new javax.swing.JButton();
    ProjectIDLabel = new javax.swing.JLabel();
    ProjectNameLabel = new javax.swing.JLabel();
    ProjectStartdateLabel = new javax.swing.JLabel();
    ProjectDuedateLabel = new javax.swing.JLabel();
    ProjectCommentsLabel = new javax.swing.JLabel();
    background_green11 = new javax.swing.JLabel();
    StatusProjectPanel = new javax.swing.JPanel();
    jScrollPane14 = new javax.swing.JScrollPane();
    projUpTable = new javax.swing.JTable();
    projUpDueDate = new com.toedter.calendar.JDateChooser();
    projUpStatusChoice = new java.awt.Choice();
    projUpStatusButton = new javax.swing.JButton();
    projUpRefreshButton = new javax.swing.JButton();
    projUpSearchButton = new javax.swing.JButton();
    projSearchUptxt = new javax.swing.JTextField();
    projNameRadioButton = new javax.swing.JRadioButton();
    projIDRadioButton = new javax.swing.JRadioButton();
    jScrollPane15 = new javax.swing.JScrollPane();
    projComUptxt = new javax.swing.JTextArea();
    EnterYourSearchLabel9 = new javax.swing.JLabel();
    jLabel22 = new javax.swing.JLabel();
    jLabel23 = new javax.swing.JLabel();
    jLabel24 = new javax.swing.JLabel();
    background_green12 = new javax.swing.JLabel();
    SearchProjectPanel = new javax.swing.JPanel();
    projSearchtxt = new javax.swing.JTextField();
    projSearchButton = new javax.swing.JButton();
    projNameRadioButton1 = new javax.swing.JRadioButton();
    projIDRadioButton1 = new javax.swing.JRadioButton();
    jScrollPane16 = new javax.swing.JScrollPane();
    projSearchTable = new javax.swing.JTable();
    projRefreshSearchButton = new javax.swing.JButton();
    EnterYourSearchLabel10 = new javax.swing.JLabel();
    background_green13 = new javax.swing.JLabel();
    reportsTab = new javax.swing.JTabbedPane();
    ProjectReportPanel = new javax.swing.JPanel();
    genRepButton = new javax.swing.JToggleButton();
    pBeginDateChooser = new com.toedter.calendar.JDateChooser();
    pEndDateChooser = new com.toedter.calendar.JDateChooser();
    jLabel2 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    Show_report_Button = new javax.swing.JButton();
    jLabel8 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    PendingRadioButton = new javax.swing.JRadioButton();
    AllRadioButton = new javax.swing.JRadioButton();
    ProgressRadioButton = new javax.swing.JRadioButton();
    CompletedRadioButton = new javax.swing.JRadioButton();
    background_green15 = new javax.swing.JLabel();
    HistoryPanel = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    repHistoryTable = new javax.swing.JTable();
    repSearchButton = new javax.swing.JButton();
    repDateSearchtxt = new com.toedter.calendar.JDateChooser();
    searchRepDateRadioButton = new javax.swing.JRadioButton();
    searchRepIDRadioButton = new javax.swing.JRadioButton();
    searchRepStatRadioButton = new javax.swing.JRadioButton();
    repIDSearchtxt = new javax.swing.JTextField();
    showRepSearchButton = new javax.swing.JButton();
    repProjStatchoice = new java.awt.Choice();
    EnterYourSearchLabel2 = new javax.swing.JLabel();
    RefreshButton2 = new javax.swing.JButton();
    background_green16 = new javax.swing.JLabel();
    AlertIcon = new javax.swing.JLabel();
    QuantityChangeButton = new javax.swing.JButton();
    jLabel9 = new javax.swing.JLabel();
    manageUserButtonLabel = new javax.swing.JLabel();
    changePasswordLabel = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    dropManageUserLabel = new javax.swing.JLabel();
    changeLogoLabel = new javax.swing.JLabel();
    jLabel1 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    setUndecorated(true);
    getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jSeparator1.setPreferredSize(new java.awt.Dimension(55, 10));
    getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 222, 1240, 10));

    jLabel4.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jLabel4MouseClicked(evt);
        }
    });
    getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(1223, 4, 55, 20));

    jLabel3.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jLabel3MouseMoved(evt);
        }
    });
    jLabel3.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jLabel3MouseClicked(evt);
        }
    });
    getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(1151, 3, 35, 22));

    projectsButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/Projects icon 53 x 50.png"))); // NOI18N
    projectsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projectsButtonActionPerformed(evt);
        }
    });
    getContentPane().add(projectsButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 110, 65, 60));

    reportsButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/Reports icon 53 x 50.png"))); // NOI18N
    reportsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            reportsButtonActionPerformed(evt);
        }
    });
    getContentPane().add(reportsButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 110, 65, 60));

    logoutButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/logout button.png"))); // NOI18N
    logoutButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            logoutButtonActionPerformed(evt);
        }
    });
    getContentPane().add(logoutButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, 30, 30));

    projectsTab.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    projectsTab.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            projectsTabMouseClicked(evt);
        }
    });

    AddProjectPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    AddProjectPanel.add(projIDtxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 70, 118, -1));
    AddProjectPanel.add(projNametxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 120, 120, -1));

    projStartDate.setDateFormatString("yyyy-MM-dd");
    projStartDate.setMinSelectableDate(new Date());
    AddProjectPanel.add(projStartDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 170, 127, -1));

    projDueDate.setMinSelectableDate(new Date());
    AddProjectPanel.add(projDueDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 220, 127, -1));

    projDesctxt.setColumns(10);
    projDesctxt.setRows(4);
    projDesctxt.setTabSize(0);
    jScrollPane13.setViewportView(projDesctxt);

    AddProjectPanel.add(jScrollPane13, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 260, 150, 90));

    projAddButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projAddButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/plus_icon.png"))); // NOI18N
    projAddButton.setText("Add");
    projAddButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projAddButtonActionPerformed(evt);
        }
    });
    AddProjectPanel.add(projAddButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 330, -1, -1));

    projClearButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projClearButton.setText("Clear");
    projClearButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projClearButtonActionPerformed(evt);
        }
    });
    AddProjectPanel.add(projClearButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 330, 100, 40));

    ProjectIDLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectIDLabel.setText("Project ID");
    AddProjectPanel.add(ProjectIDLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 70, -1, -1));

    ProjectNameLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectNameLabel.setText("Project Name");
    AddProjectPanel.add(ProjectNameLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 120, -1, -1));

    ProjectStartdateLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectStartdateLabel.setText("Start Date");
    AddProjectPanel.add(ProjectStartdateLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 170, -1, -1));

    ProjectDuedateLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectDuedateLabel.setText("Due Date");
    AddProjectPanel.add(ProjectDuedateLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 220, -1, -1));

    ProjectCommentsLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectCommentsLabel.setText("Comments");
    AddProjectPanel.add(ProjectCommentsLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 270, -1, -1));

    background_green11.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    AddProjectPanel.add(background_green11, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1250, 430));

    projectsTab.addTab("Add Project", AddProjectPanel);

    StatusProjectPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    projUpTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null, null, null, null, null }, { null, null, null, null, null, null },
                    { null, null, null, null, null, null }, { null, null, null, null, null, null } },
            new String[] { "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6" }));
    projUpTable.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            projUpTableMouseClicked(evt);
        }
    });
    jScrollPane14.setViewportView(projUpTable);

    StatusProjectPanel.add(jScrollPane14, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 20, 800, 220));

    projUpDueDate.setMinSelectableDate(new Date());
    StatusProjectPanel.add(projUpDueDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 130, 140, -1));

    projUpStatusChoice.addItem("Pending");
    projUpStatusChoice.addItem("In Progress");
    projUpStatusChoice.addItem("Completed");
    StatusProjectPanel.add(projUpStatusChoice,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 170, 100, -1));

    projUpStatusButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projUpStatusButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/save-icon-30.png"))); // NOI18N
    projUpStatusButton.setText("Update");
    projUpStatusButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projUpStatusButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projUpStatusButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(870, 250, -1, -1));

    projUpRefreshButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projUpRefreshButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/refresh.png"))); // NOI18N
    projUpRefreshButton.setText("Refresh");
    projUpRefreshButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projUpRefreshButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projUpRefreshButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(1010, 250, -1, -1));

    projUpSearchButton.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    projUpSearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/search.png"))); // NOI18N
    projUpSearchButton.setText("Search");
    projUpSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projUpSearchButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projUpSearchButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 40, -1, -1));
    StatusProjectPanel.add(projSearchUptxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 160, -1));

    searchGroup.add(projNameRadioButton);
    projNameRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    projNameRadioButton.setText("By Name");
    projNameRadioButton
            .setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
    projNameRadioButton.setBorderPainted(true);
    projNameRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projNameRadioButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projNameRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 80, 90, -1));

    searchGroup.add(projIDRadioButton);
    projIDRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    projIDRadioButton.setText("By ID");
    projIDRadioButton
            .setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
    projIDRadioButton.setBorderPainted(true);
    projIDRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projIDRadioButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projIDRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 60, -1));

    projComUptxt.setColumns(5);
    projComUptxt.setRows(2);
    projComUptxt.setTabSize(0);
    jScrollPane15.setViewportView(projComUptxt);

    StatusProjectPanel.add(jScrollPane15, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 210, 150, 60));

    EnterYourSearchLabel9.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    EnterYourSearchLabel9.setText("Enter your search");
    StatusProjectPanel.add(EnterYourSearchLabel9,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

    jLabel22.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    jLabel22.setText(" Due Date");
    StatusProjectPanel.add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 130, -1, -1));

    jLabel23.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    jLabel23.setText("Project Status");
    StatusProjectPanel.add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 170, -1, -1));

    jLabel24.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    jLabel24.setText("Comments");
    StatusProjectPanel.add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 210, -1, -1));

    background_green12.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    StatusProjectPanel.add(background_green12,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1250, 430));

    projectsTab.addTab(" Status", StatusProjectPanel);

    SearchProjectPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    SearchProjectPanel.add(projSearchtxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 160, -1));

    projSearchButton.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    projSearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/search.png"))); // NOI18N
    projSearchButton.setText("Search");
    projSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projSearchButtonActionPerformed(evt);
        }
    });
    SearchProjectPanel.add(projSearchButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 40, -1, -1));

    searchGroup.add(projNameRadioButton1);
    projNameRadioButton1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    projNameRadioButton1.setText("By Name");
    projNameRadioButton1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    projNameRadioButton1.setBorderPainted(true);
    projNameRadioButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projNameRadioButton1ActionPerformed(evt);
        }
    });
    SearchProjectPanel.add(projNameRadioButton1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 80, 90, -1));

    searchGroup.add(projIDRadioButton1);
    projIDRadioButton1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    projIDRadioButton1.setText("By ID");
    projIDRadioButton1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    projIDRadioButton1.setBorderPainted(true);
    projIDRadioButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projIDRadioButton1ActionPerformed(evt);
        }
    });
    SearchProjectPanel.add(projIDRadioButton1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 60, -1));

    projSearchTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null, null, null, null, null }, { null, null, null, null, null, null },
                    { null, null, null, null, null, null }, { null, null, null, null, null, null } },
            new String[] { "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6" }));
    jScrollPane16.setViewportView(projSearchTable);

    SearchProjectPanel.add(jScrollPane16, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 20, 800, 220));

    projRefreshSearchButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projRefreshSearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/refresh.png"))); // NOI18N
    projRefreshSearchButton.setText("Refresh");
    projRefreshSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projRefreshSearchButtonActionPerformed(evt);
        }
    });
    SearchProjectPanel.add(projRefreshSearchButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(1010, 250, -1, -1));

    EnterYourSearchLabel10.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    EnterYourSearchLabel10.setText("Enter your search");
    SearchProjectPanel.add(EnterYourSearchLabel10,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

    background_green13.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    SearchProjectPanel.add(background_green13,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1250, 430));

    projectsTab.addTab("Search", SearchProjectPanel);

    reportsTab.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    reportsTab.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            reportsTabMouseClicked(evt);
        }
    });

    ProjectReportPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    genRepButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    genRepButton.setText("Generate Report");
    genRepButton.setOpaque(true);
    genRepButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            genRepButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(genRepButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 270, -1, 40));

    pBeginDateChooser.setDateFormatString("yyyy-MM-dd");
    ProjectReportPanel.add(pBeginDateChooser,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 120, 130, -1));

    pEndDateChooser.setDateFormatString("yyyy-MM-dd");
    ProjectReportPanel.add(pEndDateChooser,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 170, 130, -1));

    jLabel2.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel2.setText("This report shows all projects from two chosen dates.");
    ProjectReportPanel.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 70, -1, -1));

    jLabel5.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel5.setText("You can see the report here ");
    ProjectReportPanel.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 340, -1, -1));

    jLabel6.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel6.setText("please chose a start date ");
    ProjectReportPanel.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 120, -1, -1));

    jLabel7.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel7.setText("Chose a due date");
    ProjectReportPanel.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 170, -1, -1));

    Show_report_Button.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    Show_report_Button
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/icon-service-contract.png"))); // NOI18N
    Show_report_Button.setText("Show Report");
    Show_report_Button.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Show_report_ButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(Show_report_Button,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 330, 190, 40));

    jLabel8.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel8.setText("Click on ");
    ProjectReportPanel.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 280, -1, -1));

    jLabel10.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel10.setText("Chose relevant project status");
    ProjectReportPanel.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 220, -1, -1));

    ProjectStatusReportGroup.add(PendingRadioButton);
    PendingRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    PendingRadioButton.setText("Pending");
    PendingRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    PendingRadioButton.setBorderPainted(true);
    PendingRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            PendingRadioButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(PendingRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 220, 80, -1));

    ProjectStatusReportGroup.add(AllRadioButton);
    AllRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    AllRadioButton.setText("All");
    AllRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    AllRadioButton.setBorderPainted(true);
    AllRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            AllRadioButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(AllRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 220, 50, -1));

    ProjectStatusReportGroup.add(ProgressRadioButton);
    ProgressRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProgressRadioButton.setText("In Progress");
    ProgressRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    ProgressRadioButton.setBorderPainted(true);
    ProgressRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ProgressRadioButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(ProgressRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 220, 100, -1));

    ProjectStatusReportGroup.add(CompletedRadioButton);
    CompletedRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    CompletedRadioButton.setText("Completed");
    CompletedRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    CompletedRadioButton.setBorderPainted(true);
    CompletedRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            CompletedRadioButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(CompletedRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 220, 100, -1));

    background_green15.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    ProjectReportPanel.add(background_green15,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1250, 430));

    reportsTab.addTab("Project Report", ProjectReportPanel);

    HistoryPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    repHistoryTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    repHistoryTable.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            repHistoryTableMouseClicked(evt);
        }
    });
    jScrollPane1.setViewportView(repHistoryTable);

    HistoryPanel.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 20, 700, 290));

    repSearchButton.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    repSearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/search.png"))); // NOI18N
    repSearchButton.setText("Search");
    repSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            repSearchButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(repSearchButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 40, -1, -1));

    repDateSearchtxt.setDateFormatString("yyyy-MM-dd");
    HistoryPanel.add(repDateSearchtxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 150, -1));

    searchGroup.add(searchRepDateRadioButton);
    searchRepDateRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    searchRepDateRadioButton.setText("By Project Date");
    searchRepDateRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    searchRepDateRadioButton.setBorderPainted(true);
    searchRepDateRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            searchRepDateRadioButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(searchRepDateRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 90, 130, -1));

    searchGroup.add(searchRepIDRadioButton);
    searchRepIDRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    searchRepIDRadioButton.setText("By Report ID");
    searchRepIDRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    searchRepIDRadioButton.setBorderPainted(true);
    searchRepIDRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            searchRepIDRadioButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(searchRepIDRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 90, 110, -1));

    searchGroup.add(searchRepStatRadioButton);
    searchRepStatRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    searchRepStatRadioButton.setText("By Project Status");
    searchRepStatRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    searchRepStatRadioButton.setBorderPainted(true);
    searchRepStatRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            searchRepStatRadioButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(searchRepStatRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 90, 140, -1));
    HistoryPanel.add(repIDSearchtxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 150, -1));

    showRepSearchButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    showRepSearchButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/icon-service-contract.png"))); // NOI18N
    showRepSearchButton.setText("Show Report");
    showRepSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            showRepSearchButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(showRepSearchButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(810, 320, -1, -1));

    repProjStatchoice.add("All Projects");
    repProjStatchoice.add("Pending Projects");
    repProjStatchoice.add("In Progress Projects");
    repProjStatchoice.add("Completed Projects");
    HistoryPanel.add(repProjStatchoice, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 150, -1));

    EnterYourSearchLabel2.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    EnterYourSearchLabel2.setText("Enter your search");
    HistoryPanel.add(EnterYourSearchLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

    RefreshButton2.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    RefreshButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/refresh.png"))); // NOI18N
    RefreshButton2.setText("Refresh");
    RefreshButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            RefreshButton2ActionPerformed(evt);
        }
    });
    HistoryPanel.add(RefreshButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(1000, 320, -1, -1));

    background_green16.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    HistoryPanel.add(background_green16, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1250, 430));

    reportsTab.addTab("History", HistoryPanel);

    javax.swing.GroupLayout jLayeredPane1Layout = new javax.swing.GroupLayout(jLayeredPane1);
    jLayeredPane1.setLayout(jLayeredPane1Layout);
    jLayeredPane1Layout.setHorizontalGroup(jLayeredPane1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1250, Short.MAX_VALUE)
            .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jLayeredPane1Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                            .addComponent(projectsTab, javax.swing.GroupLayout.PREFERRED_SIZE, 1250,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 0, Short.MAX_VALUE)))
            .addGroup(
                    jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jLayeredPane1Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(reportsTab, javax.swing.GroupLayout.PREFERRED_SIZE, 1250,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, Short.MAX_VALUE))));
    jLayeredPane1Layout.setVerticalGroup(jLayeredPane1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 430, Short.MAX_VALUE)
            .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jLayeredPane1Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                            .addComponent(projectsTab, javax.swing.GroupLayout.PREFERRED_SIZE, 430,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 0, Short.MAX_VALUE)))
            .addGroup(
                    jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jLayeredPane1Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(reportsTab, javax.swing.GroupLayout.PREFERRED_SIZE, 430,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, Short.MAX_VALUE))));
    jLayeredPane1.setLayer(projectsTab, javax.swing.JLayeredPane.DEFAULT_LAYER);
    jLayeredPane1.setLayer(reportsTab, javax.swing.JLayeredPane.DEFAULT_LAYER);

    getContentPane().add(jLayeredPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 230, 1240, 430));

    AlertIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/applet-critical-48.png"))); // NOI18N
    getContentPane().add(AlertIcon, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 160, -1, -1));

    QuantityChangeButton.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/Images/Quantity Change icon 53x50.png"))); // NOI18N
    QuantityChangeButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            QuantityChangeButtonActionPerformed(evt);
        }
    });
    getContentPane().add(QuantityChangeButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 110, 65, 60));

    jLabel9.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
    getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 150, 180, 40));
    jLabel9.setText(loginGUI.username + " Is Logged in");

    manageUserButtonLabel.setFont(new java.awt.Font("Calibri", 0, 12)); // NOI18N
    manageUserButtonLabel.setText("Manage user");
    manageUserButtonLabel
            .setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    manageUserButtonLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            manageUserButtonLabelMouseReleased(evt);
        }
    });
    getContentPane().add(manageUserButtonLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 110, 80, 20));

    changePasswordLabel.setForeground(new java.awt.Color(240, 240, 240));
    changePasswordLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            changePasswordLabelMouseMoved(evt);
        }
    });
    changePasswordLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            changePasswordLabelMouseClicked(evt);
        }
    });
    getContentPane().add(changePasswordLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(164, 112, 106, 17));
    getContentPane().add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(1150, 0, 40, 30));

    dropManageUserLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/menu.png"))); // NOI18N
    getContentPane().add(dropManageUserLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 110, -1, -1));

    changeLogoLabel.setForeground(new java.awt.Color(240, 240, 240));
    changeLogoLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            changeLogoLabelMouseMoved(evt);
        }
    });
    changeLogoLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            changeLogoLabelMouseClicked(evt);
        }
    });
    getContentPane().add(changeLogoLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 90, 106, 17));

    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/Images/  ? .png"))); // NOI18N
    jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));
    jLabel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jLabel1MouseMoved(evt);
        }
    });
    getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1280, 680));

    pack();
    setLocationRelativeTo(null);
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.EditorComponent.java

/** 
 * Implemented as specified by the {@link Editor} interface.
 * @see Editor#setStructuredDataResults()
 *//*from   w  ww .  j a v a2 s  . co m*/
public void setStructuredDataResults() {
    view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    view.layoutUI();
    view.setStatus(false);
}

From source file:com.vgi.mafscaling.OpenLoop.java

protected void clearRunTables() {
    setCursor(new Cursor(Cursor.WAIT_CURSOR));
    try {/* w  w  w  .j  a v a  2s .  co  m*/
        for (int i = 0; i < runTables.length; ++i) {
            while (RunRowsCount < runTables[i].getRowCount())
                Utils.removeRow(RunRowsCount, runTables[i]);
            Utils.clearTable(runTables[i]);
        }
    } finally {
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }
}

From source file:AST.DesignPatternDetection.java

private void btRunActionPerformed(ActionEvent e)
        throws FileNotFoundException, IOException, InterruptedException {

    if (tfProjectName.getText().equals("") || tfProjectName.getText().equals(null)) {
        JOptionPane.showMessageDialog(null, "You have to enter the Project's name!");
        return;/*  www.  ja  va2  s  .  c  om*/
    }

    overlap = "";
    programPath = "";

    Cursor hourglassCursor = new Cursor(Cursor.WAIT_CURSOR);
    setCursor(hourglassCursor);

    //Baslangic parametreleri, mutlaka gir...
    Boolean sourceCodeGraph = true;
    Boolean sourceCodeGraphDetail = true;
    Boolean designPatternGraph = true;
    Boolean OnlyTerminalCommands = true;
    String designpatternName = cbSelectionDP.getSelectedItem().toString();
    String projectName = tfProjectName.getText();
    Double threshold = Double.parseDouble((tfThreshold.getText()));

    if (chbOverlap.isSelected() == true) {
        overlap = " -overlap ";
    } else {
        overlap = "";
    }

    if (chbInnerClass.isSelected() == true) {
        includeInnerClasses = "Yes";
    } else {
        includeInnerClasses = "No";
    }

    programPath = tfProgramPath.getText();

    //create "project" directory
    String directoryNameProject = programPath + "/Projects/" + projectName + "/";
    File directoryProject = new File(String.valueOf(directoryNameProject));
    if (!directoryProject.exists()) {
        directoryProject.mkdir();
    }

    //create "source" directory
    String directoryName = programPath + "/Projects/" + projectName + "/source/";
    File directory = new File(String.valueOf(directoryName));
    if (!directory.exists()) {
        directory.mkdir();
    } else {
        FileUtils.deleteDirectory(new File(directoryName));
        directory.mkdir();
    }

    //create "inputs" directory
    String directoryName2 = programPath + "/Projects/" + projectName + "/inputs/";
    File directory2 = new File(String.valueOf(directoryName2));
    if (!directory2.exists()) {
        directory2.mkdir();
    }

    //create "outputs" directory
    String directoryName3 = programPath + "/Projects/" + projectName + "/outputs/";
    File directory3 = new File(String.valueOf(directoryName3));
    if (!directory3.exists()) {
        directory3.mkdir();
    }

    //create "batch" directory
    String directoryName4 = programPath + "/Projects/" + projectName + "/batch/";
    File directory4 = new File(String.valueOf(directoryName4));
    if (!directory4.exists()) {
        directory4.mkdir();
    } else {
        FileUtils.deleteDirectory(new File(directoryName4));
        directory4.mkdir();
    }

    //create "designpatternName+inputs" directory
    String directoryName5 = programPath + "/Projects/" + projectName + "/inputs/" + designpatternName
            + "_inputs/";
    File directory5 = new File(String.valueOf(directoryName5));
    if (!directory5.exists()) {
        directory5.mkdir();
    } else {
        FileUtils.deleteDirectory(new File(directoryName5));
        directory5.mkdir();
    }

    //create "designpatternName+outputs" directory
    String directoryName6 = programPath + "/Projects/" + projectName + "/outputs/" + designpatternName
            + "_outputs/";
    File directory6 = new File(String.valueOf(directoryName6));
    if (!directory6.exists()) {
        directory6.mkdir();
    } else {
        FileUtils.deleteDirectory(new File(directoryName6));
        directory6.mkdir();
    }

    File dir = new File(tfPath.getText());
    FileWalker fw = new FileWalker();
    List<String> directoryListing = new ArrayList<String>();
    directoryListing.clear();

    directoryListing = fw.displayDirectoryContents(dir);

    // File[] directoryListing = dir.listFiles();           

    //1. visit 
    if (directoryListing != null) {
        for (String child : directoryListing) {

            if (child.toString().contains(".java") && !child.toString().contains("package-info")) {
                System.out.println(child);

                ANTLRInputStream input = new ANTLRInputStream(new FileInputStream(child));

                // we'll parse this file
                JavaLexer lexer = new JavaLexer(input);
                CommonTokenStream tokens = new CommonTokenStream(lexer);
                JavaParser parser = new JavaParser(tokens);
                ParseTree tree = parser.compilationUnit(); // see the grammar 

                MyVisitorBase visitorbase = new MyVisitorBase(); // extends JavaBaseVisitor<Void>
                // and overrides the methods
                // you're interested
                visitorbase.visit(tree);

            }

        }
    } else {
        JOptionPane.showMessageDialog(null, "Could not find the path...");
        return;
    }

    //2. visit 
    if (directoryListing != null) {
        for (String child : directoryListing) {

            if (child.toString().contains(".java") && !child.toString().contains("package-info")) {
                //System.out.println(child);

                ANTLRInputStream input = new ANTLRInputStream(new FileInputStream(child));

                // we'll parse this file
                JavaLexer lexer = new JavaLexer(input);
                CommonTokenStream tokens = new CommonTokenStream(lexer);
                JavaParser parser = new JavaParser(tokens);
                ParseTree tree = parser.compilationUnit(); // see the grammar 

                MyVisitor visitor = new MyVisitor(); // extends JavaBaseVisitor<Void>
                                                     // and overrides the methods
                                                     // you're interested
                visitor.includeInnerClasses = includeInnerClasses;
                visitor.modifiersSet();
                visitor.visit(tree);

            }

        }
    }

    //3.visit
    if (directoryListing != null) {
        for (String child : directoryListing) {

            if (child.toString().contains(".java") && !child.toString().contains("package-info")) {
                //System.out.println(child);

                ANTLRInputStream input = new ANTLRInputStream(new FileInputStream(child));

                // we'll parse this file
                JavaLexer lexer = new JavaLexer(input);
                CommonTokenStream tokens = new CommonTokenStream(lexer);
                JavaParser parser = new JavaParser(tokens);
                ParseTree tree = parser.compilationUnit(); // see the grammar 

                MyVisitor2 visitor2 = new MyVisitor2();
                visitor2.modifiersSet();
                visitor2.visit(tree);

            }

        }
    }

    try {
        Proba p = new Proba();
        p.start(sourceCodeGraph, sourceCodeGraphDetail, designPatternGraph, designpatternName,
                OnlyTerminalCommands, projectName, threshold, overlap, programPath);

    } catch (IOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }

    taInfo.setText("----------" + designpatternName + " PATTERN (" + projectName + ")-------------" + "\n");
    taInfo.append("1. Project's classes ASTs created." + "\n");
    taInfo.append(
            "2. After treewalk of ASTs, Graph Model is created.(/Projects/" + projectName + "/source)" + "\n");
    taInfo.append("3. Pool of Desing Pattern Templates is created.(/Projects/" + projectName + "/inputs/"
            + designpatternName + "_inputs)" + "\n");
    taInfo.append("4. Heuristic function of shell script file is created.(/Projects/" + projectName + "/batch)"
            + "\n");

    //p.start2();

    Cursor normalCursor = new Cursor(Cursor.DEFAULT_CURSOR);
    setCursor(normalCursor);

    vertices.clear();
    dugumler.clear();
    methods.clear();

    JOptionPane.showMessageDialog(null, "Graph Model is successfully completed!");
}

From source file:ro.nextreports.designer.action.report.layout.export.ExportAction.java

public void actionPerformed(ActionEvent event) {
    executorThread = new Thread(new Runnable() {

        public void run() {

            if (MessageUtil.showReconnect()) {
                return;
            }// ww  w . j  a v a2 s . c  o m

            DataSource runDS = Globals.getReportLayoutPanel().getRunDataSource();

            if (report != null) {
                ParameterManager.getInstance().setParameters(report.getParameters());
            }

            UIActivator activator = null;
            UIActivator activatorParam = null;
            UIActivator exporterActivator = null;
            QueryResult qr = null;

            activatorParam = new UIActivator(Globals.getMainFrame(),
                    I18NSupport.getString("generate.report.prepare"));
            activatorParam.start();

            try {
                FileUtil.copyImagesToClasspath(report);
            } catch (IOException e) {
                e.printStackTrace();
            }

            try {
                FileUtil.copyTemplateToClasspath(report);
            } catch (IOException e) {
                e.printStackTrace();
            }

            Connection con = null;
            try {
                Set<String> columns = BandUtil.getNotFoundColumns(report, runDS);
                if (columns.size() > 0) {
                    StringBuilder message = new StringBuilder();
                    message.append(I18NSupport.getString("band.column.notfound"));
                    message.append("\r\n");
                    for (String col : columns) {
                        message.append(col).append("\r\n");
                    }
                    if (activatorParam != null) {
                        activatorParam.stop();
                    }
                    Show.error(message.toString());
                    return;
                }

                Set<String> groupColumns = BandUtil.getNotFoundColumnsUsedByGroups(report, runDS);
                if (groupColumns.size() > 0) {
                    StringBuilder message = new StringBuilder();
                    message.append(I18NSupport.getString("band.column.group.notfound"));
                    message.append("\r\n");
                    for (String col : groupColumns) {
                        message.append(col).append("\r\n");
                    }
                    if (activatorParam != null) {
                        activatorParam.stop();
                    }
                    Show.error(message.toString());
                    return;
                }

                //NextReportsUtil.reloadReportIfNecessary();

                if (activatorParam != null) {
                    activatorParam.stop();
                    activatorParam = null;
                }

                // name when run from explorer tree (without open)
                String notLoadedName = null;
                if (report != null) {
                    notLoadedName = getNameWithoutExtension(report.getName());
                }

                ExportPropertiesPanel propsPanel = new ExportPropertiesPanel(notLoadedName, exportType,
                        layoutSelection);
                ExportPropertiesDialog dialog = new ExportPropertiesDialog(propsPanel);

                // we are interested only in layout property (generated report name is automatically set)
                // otherwise we do not show the dialog
                if (layoutSelection) {
                    Show.centrateComponent(Globals.getMainFrame(), dialog);
                    dialog.setVisible(true);
                }

                String name = dialog.getReportName();
                if (name == null) {
                    return;
                }

                if (layoutSelection && !dialog.okPressed() && (report == null)) {
                    return;
                }

                name = name.trim();
                if (name.length() == 0) {
                    name = "Report";
                }

                ParametersBean pBean = Globals.getMainFrame().getQueryBuilderPanel().selectParameters(report,
                        runDS);
                if (pBean == null) {
                    return;
                }

                if (QueryUtil.restrictQueryExecution(pBean.getQuery().getText())) {
                    Show.info(I18NSupport.getString("export.action.execute"));
                    return;
                }

                con = Globals.createTempConnection(runDS);
                boolean isProcedure = QueryUtil.isProcedureCall(pBean.getQuery().getText());
                if (isProcedure) {
                    if (!QueryUtil.isValidProcedureCall(pBean.getQuery().getText(),
                            DialectUtil.getDialect(con))) {
                        Show.info(I18NSupport.getString("export.action.execute.procedure"));
                        return;
                    }
                }

                activator = new UIActivator(Globals.getMainFrame(), I18NSupport.getString("generate.report"));
                activator.start(new ExportStopAction());

                qr = Globals.getMainFrame().getQueryBuilderPanel().runQuery(con, pBean, false);
                if (activator != null) {
                    activator.stop();
                    activator = null;
                }
                if (qr == null) {
                    return;
                }

                final int records = qr.getRowCount();
                if (records > RECORDS) {
                    eventThreshold = RECORDS_INCREMENT;
                }
                exporterActivator = new UIActivator(Globals.getMainFrame(),
                        I18NSupport.getString("generate.report.export"), records);
                exporterActivator.start(new ExportStopAction());

                //
                boolean ok = startExporter(name, qr, pBean, exporterActivator, isProcedure);
                if (!ok) {
                    Show.dispose(); // close a possible previous dialog message
                    Show.info(I18NSupport.getString("report.cancelled"));
                }
                //

            } catch (NoDataFoundException e) {
                Show.info(e.getMessage());
            } catch (InterruptedException e) {
                Show.dispose(); // close a possible previous dialog message
                Show.info(I18NSupport.getString("report.cancelled"));
            } catch (Exception e) {
                Show.error(e);
            } finally {
                stop = false;
                if (con != null) {
                    try {
                        con.close();
                    } catch (SQLException e) {
                        e.printStackTrace();
                    }
                }
                if (qr != null) {
                    qr.close();
                }
                Cursor normalCursor = new Cursor(Cursor.DEFAULT_CURSOR);
                Globals.getMainFrame().setCursor(normalCursor);
                if (activatorParam != null) {
                    activatorParam.stop();
                }
                if (activator != null) {
                    activator.stop();
                }
                if (exporterActivator != null) {
                    exporterActivator.stop();
                }
                if (oldParameters != null) {
                    ParameterManager.getInstance().setParameters(oldParameters);
                }
            }
        }

    }, "NEXT : " + getClass().getSimpleName());
    executorThread.setPriority(EngineProperties.getRunPriority());
    executorThread.start();
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.EditorComponent.java

/** 
 * Implemented as specified by the {@link Editor} interface.
 * @see Editor#setRootObject(Object)/*from   w w w . j a  v  a2 s . c o m*/
 */
public void setRootObject(Object refObject) {
    if (refObject == null)
        throw new IllegalArgumentException("Root object not valid.");
    Object oldObject = model.getRefObject();

    model.setRootObject(refObject);
    view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    view.setRootObject(oldObject);
}

From source file:com.ga.forms.DailyLogAddUI.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.//from  ww w.j a  v a2 s.c  o m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    group = new javax.swing.ButtonGroup();
    jPanel1 = new javax.swing.JPanel();
    mainTitleLbl = new javax.swing.JLabel();
    jSeparator1 = new javax.swing.JSeparator();
    exitButton = new javax.swing.JButton();
    viewButton = new javax.swing.JButton();
    dailyLogPanel = new javax.swing.JPanel();
    dateLbl = new javax.swing.JLabel();
    dateDisplayLbl = new javax.swing.JLabel();
    dayLbl = new javax.swing.JLabel();
    dayDisplayLbl = new javax.swing.JLabel();
    checkInLbl = new javax.swing.JLabel();
    checkoutLbl = new javax.swing.JLabel();
    breakLbl = new javax.swing.JLabel();
    checkInTimeCombo = new javax.swing.JComboBox();
    checkOutTimeCombo = new javax.swing.JComboBox();
    checkInOutButton = new javax.swing.JToggleButton();
    breakOptionPanel = new javax.swing.JPanel();
    yesRdButton = new javax.swing.JRadioButton();
    noRdButton = new javax.swing.JRadioButton();
    customRdButton = new javax.swing.JRadioButton();
    customBreakTimeTextField = new javax.swing.JTextField();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Daily Log Manager");
    setBounds(new java.awt.Rectangle(0, 0, 395, 389));
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    setMinimumSize(new java.awt.Dimension(395, 389));

    jPanel1.setMaximumSize(new java.awt.Dimension(395, 389));
    jPanel1.setMinimumSize(new java.awt.Dimension(395, 389));
    jPanel1.setPreferredSize(new java.awt.Dimension(464, 474));

    mainTitleLbl.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N
    mainTitleLbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    mainTitleLbl.setText("Daily Log Manager");
    mainTitleLbl.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

    exitButton.setText("Exit");
    exitButton.setMaximumSize(new java.awt.Dimension(72, 29));
    exitButton.setMinimumSize(new java.awt.Dimension(72, 29));
    exitButton.setPreferredSize(new java.awt.Dimension(72, 29));
    exitButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            exitButtonActionPerformed(evt);
        }
    });

    viewButton.setText("View");
    viewButton.setMaximumSize(new java.awt.Dimension(72, 29));
    viewButton.setMinimumSize(new java.awt.Dimension(72, 29));
    viewButton.setPreferredSize(new java.awt.Dimension(72, 29));
    viewButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            viewButtonActionPerformed(evt);
        }
    });

    dailyLogPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Add Daily Log"));
    dailyLogPanel.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dailyLogPanel.setName("Daily Log Entry"); // NOI18N
    dailyLogPanel.setPreferredSize(new java.awt.Dimension(240, 190));

    dateLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dateLbl.setText("Date");
    dateLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    dateDisplayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dateDisplayLbl.setEnabled(false);
    dateDisplayLbl.setMaximumSize(new java.awt.Dimension(144, 17));
    dateDisplayLbl.setMinimumSize(new java.awt.Dimension(144, 17));
    dateDisplayLbl.setPreferredSize(new java.awt.Dimension(144, 17));
    dateDisplayLbl.setRequestFocusEnabled(false);

    dayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dayLbl.setText("Day");
    dayLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    dayDisplayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dayDisplayLbl.setEnabled(false);
    dayDisplayLbl.setMaximumSize(new java.awt.Dimension(144, 17));
    dayDisplayLbl.setMinimumSize(new java.awt.Dimension(144, 17));
    dayDisplayLbl.setPreferredSize(new java.awt.Dimension(144, 17));
    dayDisplayLbl.setRequestFocusEnabled(false);

    checkInLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    checkInLbl.setText("In");
    checkInLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    checkoutLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    checkoutLbl.setText("Out");
    checkoutLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    breakLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    breakLbl.setText("Break");
    breakLbl.setVerticalAlignment(javax.swing.SwingConstants.TOP);
    breakLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    checkInTimeCombo.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    checkInTimeCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkInTimeComboActionPerformed(evt);
        }
    });

    checkOutTimeCombo.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    checkOutTimeCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkOutTimeComboActionPerformed(evt);
        }
    });

    checkInOutButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    checkInOutButton.setText("Check In");
    checkInOutButton.setMaximumSize(new java.awt.Dimension(102, 29));
    checkInOutButton.setMinimumSize(new java.awt.Dimension(102, 29));
    checkInOutButton.setPreferredSize(new java.awt.Dimension(102, 29));
    checkInOutButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkInOutButtonActionPerformed(evt);
        }
    });

    breakOptionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Options"));
    breakOptionPanel.setPreferredSize(new java.awt.Dimension(255, 98));

    yesRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    yesRdButton.setText("Yes");
    yesRdButton.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            yesRdButtonMouseClicked(evt);
        }
    });

    noRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    noRdButton.setSelected(true);
    noRdButton.setText("No");
    noRdButton.setPreferredSize(new java.awt.Dimension(51, 24));
    noRdButton.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            noRdButtonMouseClicked(evt);
        }
    });

    customRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    customRdButton.setText("Custom");
    customRdButton.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            customRdButtonItemStateChanged(evt);
        }
    });
    customRdButton.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            customRdButtonStateChanged(evt);
        }
    });
    customRdButton.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            customRdButtonMouseClicked(evt);
        }
    });

    customBreakTimeTextField.setText("00:30");
    customBreakTimeTextField.setEnabled(false);

    javax.swing.GroupLayout breakOptionPanelLayout = new javax.swing.GroupLayout(breakOptionPanel);
    breakOptionPanel.setLayout(breakOptionPanelLayout);
    breakOptionPanelLayout.setHorizontalGroup(breakOptionPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(breakOptionPanelLayout.createSequentialGroup().addGap(5, 5, 5)
                    .addGroup(breakOptionPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(customBreakTimeTextField, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(breakOptionPanelLayout.createSequentialGroup().addComponent(yesRdButton)
                                    .addGap(5, 5, 5)
                                    .addComponent(noRdButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(5, 5, 5).addComponent(customRdButton)
                                    .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    breakOptionPanelLayout.setVerticalGroup(breakOptionPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(breakOptionPanelLayout.createSequentialGroup().addGap(5, 5, 5)
                    .addGroup(breakOptionPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(yesRdButton)
                            .addComponent(noRdButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(customRdButton))
                    .addGap(5, 5, 5).addComponent(customBreakTimeTextField,
                            javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    yesRdButton.getAccessibleContext().setAccessibleName("breakRdButton");
    noRdButton.getAccessibleContext().setAccessibleName("breakRdButton");
    customRdButton.getAccessibleContext().setAccessibleName("breakRdButton");
    customBreakTimeTextField.getAccessibleContext().setAccessibleName("customBreakTimeTextField");

    javax.swing.GroupLayout dailyLogPanelLayout = new javax.swing.GroupLayout(dailyLogPanel);
    dailyLogPanel.setLayout(dailyLogPanelLayout);
    dailyLogPanelLayout.setHorizontalGroup(dailyLogPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dailyLogPanelLayout.createSequentialGroup().addContainerGap().addGroup(dailyLogPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dailyLogPanelLayout
                                            .createSequentialGroup()
                                            .addComponent(dayLbl, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(dayDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    304, Short.MAX_VALUE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dailyLogPanelLayout
                                            .createSequentialGroup()
                                            .addComponent(dateLbl, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(
                                                    dateDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                    .addGap(44, 44, 44))
                    .addGroup(dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(dailyLogPanelLayout.createSequentialGroup()
                                    .addComponent(checkInLbl, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(checkInTimeCombo, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(checkoutLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(breakLbl, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(dailyLogPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(checkOutTimeCombo,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(breakOptionPanel,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 220,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addContainerGap(152, Short.MAX_VALUE))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dailyLogPanelLayout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(checkInOutButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(21, 21, 21)));
    dailyLogPanelLayout.setVerticalGroup(dailyLogPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dailyLogPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(dateLbl, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE)
                            .addComponent(dateDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(dayLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(dayDisplayLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 18,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(checkInTimeCombo).addComponent(checkInLbl,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(checkOutTimeCombo).addComponent(checkoutLbl,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(dailyLogPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(dailyLogPanelLayout.createSequentialGroup()
                                    .addComponent(breakLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGap(47, 47, 47))
                            .addGroup(dailyLogPanelLayout.createSequentialGroup()
                                    .addComponent(breakOptionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 84,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 40,
                                            Short.MAX_VALUE)
                                    .addComponent(checkInOutButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap()))));

    dayLbl.getAccessibleContext().setAccessibleName("dayLbl");
    dayDisplayLbl.getAccessibleContext().setAccessibleName("dayDisplayLbl");
    checkInTimeCombo.getAccessibleContext().setAccessibleName("checkInTimeCombo");
    checkOutTimeCombo.getAccessibleContext().setAccessibleName("checkOutTimeCombo");
    checkInOutButton.getAccessibleContext().setAccessibleName("checkInOutButton");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(dailyLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 452,
                                    Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createSequentialGroup().addGap(0, 287, Short.MAX_VALUE)
                                    .addComponent(viewButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(mainTitleLbl, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addContainerGap())
            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addComponent(mainTitleLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 70,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(dailyLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 6,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(viewButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)));

    pack();
}

From source file:net.vanosten.dings.swing.SummaryView.java

/**
 * Places a chart object into the GUI and makes sure it is painted.
 * @param aChart/*from ww  w  .  j  a  va2  s . c  om*/
 */
private final void placeChart(JFreeChart aChart) {
    chartP.removeAll();
    chartP.add(new ChartPanel(aChart), BorderLayout.CENTER);
    this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    mainP.invalidate();
    mainP.validate();
    mainP.repaint();
}

From source file:edu.harvard.i2b2.patientMapping.ui.PatientIDConversionJFrame.java

private void jConvertButtonActionPerformed(java.awt.event.ActionEvent evt) {
    int inputIndex = jInputComboBox.getSelectedIndex() + 1;
    int outputIndex = jOutputComboBox.getSelectedIndex() + 1;

    if ((inputIndex == 2 && outputIndex != 2) || (inputIndex == 4 && outputIndex != 5)) {
        Display.getDefault().syncExec(new Runnable() {
            public void run() {
                MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_WARNING | SWT.OK);

                messageBox.setText("Not valid selections");
                messageBox.setMessage("Input and output pair selected is not valid.");
                messageBox.open();/* w w w.j a  va2 s . c om*/

            }
        });
        return;
    }
    //jConvertButton.setCursor(new Cursor(Cursor.WAIT_CURSOR));
    String inputFile = this.jInputFilePathTextField.getText();
    if (inputFile == null || inputFile.equalsIgnoreCase("")) {
        JOptionPane.showMessageDialog(this, "Please select a input file.");
        return;
    }

    final String outputFile = this.jOutputFilePathTextField.getText();
    if (outputFile == null || outputFile.equalsIgnoreCase("")) {
        JOptionPane.showMessageDialog(this, "Please select an output file.");
        return;
    }

    final File oDelete = new File(outputFile);

    Display.getDefault().syncExec(new Runnable() {
        public void run() {
            if (oDelete != null && oDelete.exists()) {
                MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_WARNING | SWT.YES | SWT.NO);

                messageBox.setText("Warning");
                messageBox.setMessage(outputFile + " already exists,\nDo you want to replace it?");
                int buttonID = messageBox.open();
                switch (buttonID) {
                case SWT.YES:
                    oDelete.delete();
                    break;
                case SWT.NO:
                    return;
                case SWT.CANCEL:
                    // does nothing ...
                }
            }
        }
    });
    log.info("Selected output file: " + outputFile);

    //if (fileName != null && fileName.trim().length() > 0) {
    log.info("Selected input file: " + inputFile);

    PatientIDConversionFactory converter = new PatientIDConversionFactory();
    if ((inputIndex == 1 && (outputIndex == 2 || outputIndex == 3))
            || (inputIndex == 3 && (outputIndex == 5 || outputIndex == 6))) {
        converter.sitename(jSiteTextField.getText());
    }
    FileReader fr;
    BufferedReader inbr = null;
    RandomAccessFile f = null;
    //append(f, resultFile.toString());
    jConvertButton.setCursor(new Cursor(Cursor.WAIT_CURSOR));
    try {
        f = new RandomAccessFile(outputFile, "rw");
        fr = new FileReader(new File(inputFile));
        inbr = new BufferedReader(fr);
        //String line = inbr.readLine();
        /*if(!line.startsWith("@@i2b2 patient mapping file@@")) {
           java.awt.EventQueue.invokeLater(new Runnable() {
          public void run() {
             //setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
             JOptionPane.showMessageDialog(jLabel1, "The file is not in a valid format.", "Error importing", JOptionPane.ERROR_MESSAGE);
          }
           });
           //JOptionPane.showMessageDialog(null, "The file is not a valid.", "Error importing", JOptionPane.ERROR_MESSAGE);
           return;
        }*/
        String line = inbr.readLine();
        //log.info("column name: "+line);         

        int rowCount = 0;

        while (line != null) {
            log.info(line);
            String outputline = "";
            /*String[] cols = line.split(",");
            String id;
            if(cols.length < 2) {
               id = "";
            }
            else {
               id = converter.convert(cols[1], 1, 1);               
            }*/
            outputline = converter.convertLine(line, inputIndex, outputIndex);
            append(f, outputline);//cols[0]+","+id+"\n");
            rowCount++;
            line = inbr.readLine();
        }

        log.info("From " + inputIndex + " to " + outputIndex + " total lines: " + rowCount);
        inbr.close();
        f.close();
    } catch (Exception e) {
        e.printStackTrace();
        if (inbr != null) {
            try {
                inbr.close();
            } catch (Exception e1) {
            }
        }

        if (f != null) {
            try {
                f.close();
            } catch (Exception e1) {
            }
        }
    }

    jConvertButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}