Example usage for java.awt Color orange

List of usage examples for java.awt Color orange

Introduction

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

Prototype

Color orange

To view the source code for java.awt Color orange.

Click Source Link

Document

The color orange.

Usage

From source file:nosqltools.MainForm.java

private void Import_FileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Import_FileActionPerformed
    Text_MessageBar.setText(Initializations.WAITINGFORCONNECTION);
    Text_MessageBar.setForeground(Color.ORANGE);
    if (dbcon.isConnectionSuccess()) {
        if (dbcon.checkDatabaseConnection()) {
            List<String> connectionStrings = dbcon.getAllCollectionsLessSystem();
            connectionStrings.add(0, "none");
            ImportFileDialog dlg_import = new ImportFileDialog(null, connectionStrings);
            dlg_import.setVisible(true);

            if (dlg_import.isToImport()) {
                String collectionToImport = dlg_import.collectionToImport();
                String typeToImport = dlg_import.typeToImport();
                String locToImport = dlg_import.locToImport();

                StringBuilder sb = new StringBuilder();

                if (locToImport != null && !locToImport.isEmpty()) {
                    //Converting JSON to CSV and export it to file is done in the dbcon.export method
                    //Exporting JSON on the other hand, is done here
                    if ("CSV".equals(typeToImport)) {
                        try {
                            if ("none".equals(collectionToImport)) {
                                textArea.setText("");
                                Panel_Text.setVisible(true);
                                JsonNode jNode = mapper.readTree(
                                        dbcon.import_CSV(collectionToImport, typeToImport, locToImport));
                                textArea.append(
                                        mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jNode));
                                Text_MessageBar.setForeground(Color.GREEN);
                                Text_MessageBar.setText("Import to " + typeToImport + " has been successful.");
                            } else if (connectionStrings.contains(collectionToImport)) {
                                sb = dbcon.getCollectionData(collectionToImport);

                                if (sb != null) {
                                    Panel_Text.setVisible(true);

                                    JsonNode jNode1;
                                    try {
                                        jNode1 = mapper.readTree(sb.toString());
                                        textArea.setText(mapper.writerWithDefaultPrettyPrinter()
                                                .writeValueAsString(jNode1));
                                        JsonNode jNode = mapper.readTree(dbcon.import_CSV(collectionToImport,
                                                typeToImport, locToImport));
                                        textArea.append(mapper.writerWithDefaultPrettyPrinter()
                                                .writeValueAsString(jNode));
                                    } catch (IOException ex) {
                                        Logger.getLogger(MainForm.class.getName()).log(Level.SEVERE, null, ex);
                                    }/*w w  w  .  j av a  2  s.  c  o  m*/

                                    Text_MessageBar.setText(Initializations.INITSTRING);
                                    // textArea.setText(sb.toString());
                                    validateDataPanel_text(sb);
                                } else {
                                    Panel_Text.setVisible(false);
                                    Text_MessageBar.setText(Initializations.SYSTEMCOLL);
                                    Text_MessageBar.setForeground(Color.RED);
                                }

                            }

                        } catch (IOException ex) {
                            Logger.getLogger(MainForm.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    } else {
                        Text_MessageBar.setForeground(Color.RED);
                        Text_MessageBar.setText("Import to " + typeToImport + " has been unsuccessful.");
                    }
                } else {
                    JOptionPane.showMessageDialog(this, Initializations.FILENOTFOUND,
                            Initializations.IMPORTERROR, JOptionPane.ERROR_MESSAGE);
                    Text_MessageBar.setForeground(Color.RED);
                    Text_MessageBar.setText("Import to " + typeToImport + " has been unsuccessful.");
                }

            }

            else {
                Text_MessageBar.setForeground(Color.ORANGE);
                Text_MessageBar.setText("Export action has been aborted");
            }
        } else {
            JOptionPane.showMessageDialog(null, Initializations.MONGOSERVERERROR, "Error",
                    JOptionPane.ERROR_MESSAGE);
            Text_MessageBar.setText(Initializations.MONGOSERVERERROR);
            Text_MessageBar.setForeground(Color.RED);
        }

    } else {

        // JOptionPane.showMessageDialog(this, Initializations.FILENOTFOUND , Initializations.IMPORTERROR , JOptionPane.ERROR_MESSAGE);

        JOptionPane.showMessageDialog(null, Initializations.NODBCONNECTION, "Error", JOptionPane.ERROR_MESSAGE);
        Text_MessageBar.setText(Initializations.NODBCONNECTION);

        Text_MessageBar.setForeground(Color.RED);
    }
}

From source file:finale.year.stage.responsable.ResponsableInterface.java

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

    recBtnGroup = new javax.swing.ButtonGroup();
    jPanel1 = new javax.swing.JPanel();
    photoLabel = new javax.swing.JLabel();
    emailLabel = new javax.swing.JLabel();
    addressLabel = new javax.swing.JLabel();
    telLabel = new javax.swing.JLabel();
    modifyBtn = new javax.swing.JButton();
    nameLabel = new javax.swing.JLabel();
    logoutBtn = new javax.swing.JButton();
    jSeparator2 = new javax.swing.JSeparator();
    jSeparator1 = new javax.swing.JSeparator();
    mainPane = new javax.swing.JTabbedPane();
    themesTabPane = new javax.swing.JTabbedPane();
    jPanel2 = new javax.swing.JPanel();
    listStudents = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    searchBtn = new javax.swing.JButton();
    searchField = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    jButton8 = new javax.swing.JButton();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel3 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    themeMainArea = new javax.swing.JTextArea();
    listThemeBtn = new javax.swing.JButton();
    addThemeBtn = new javax.swing.JButton();
    addThemePanel = new javax.swing.JPanel();
    themeTitleField = new javax.swing.JTextField();
    themeTitleLabel = new javax.swing.JLabel();
    jScrollPane3 = new javax.swing.JScrollPane();
    themeDescripArea = new javax.swing.JTextArea();
    descripLabel = new javax.swing.JLabel();
    submitThemeBtn = new javax.swing.JButton();
    cancelThemeBtn = new javax.swing.JButton();
    deleteThemeBtn = new javax.swing.JButton();
    modifyThemeBtn = new javax.swing.JButton();
    idFieldThemeDelete = new javax.swing.JTextField();
    idThemeLabel = new javax.swing.JLabel();
    reclammationsPane = new javax.swing.JTabbedPane();
    recPanel = new javax.swing.JPanel();
    jScrollPane4 = new javax.swing.JScrollPane();
    jTextArea2 = new javax.swing.JTextArea();
    ListRecBtn = new javax.swing.JButton();
    reclammationTransferPanel = new javax.swing.JPanel();
    idReclammation = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    transferRecBtn = new javax.swing.JButton();
    valideRBtn = new javax.swing.JRadioButton();
    invalidRBtn = new javax.swing.JRadioButton();
    ViewRecBtn = new javax.swing.JButton();
    reclammationIDViewField = new javax.swing.JTextField();
    jLabel6 = new javax.swing.JLabel();
    deleteRecBtn = new javax.swing.JButton();
    deliberationPane = new javax.swing.JTabbedPane();
    jPanel4 = new javax.swing.JPanel();
    jScrollPane5 = new javax.swing.JScrollPane();
    jTextArea3 = new javax.swing.JTextArea();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jTabbedPane2 = new javax.swing.JTabbedPane();
    jPanel6 = new javax.swing.JPanel();
    jScrollPane6 = new javax.swing.JScrollPane();
    jTextArea4 = new javax.swing.JTextArea();
    jButton4 = new javax.swing.JButton();
    jPanel7 = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jButton5 = new javax.swing.JButton();
    jButton6 = new javax.swing.JButton();
    jButton7 = new javax.swing.JButton();
    errorStatusBar = new javax.swing.JLabel();

    setBackground(new java.awt.Color(85, 172, 238));
    setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Gestion de Stage",
            javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.ABOVE_TOP,
            new java.awt.Font("Abyssinica SIL", 0, 14), new java.awt.Color(0, 0, 0))); // NOI18N
    setLayout(new java.awt.GridBagLayout());

    jPanel1.setBackground(new java.awt.Color(110, 210, 105));

    photoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/glyphicons_user.png"))); // NOI18N

    emailLabel.setText("Email  :");

    addressLabel.setText("Address :");

    telLabel.setText("Tel :");

    modifyBtn.setText("Modify ");
    modifyBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            modifyBtnActionPerformed(evt);
        }/*  ww w  .j ava2 s  . c  o  m*/
    });

    nameLabel.setText("Name :");

    logoutBtn.setText("Logout");
    logoutBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            logoutBtnActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(photoLabel, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jSeparator2)
                            .addGroup(jPanel1Layout.createSequentialGroup().addComponent(logoutBtn)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30,
                                            Short.MAX_VALUE)
                                    .addComponent(modifyBtn))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(emailLabel).addComponent(addressLabel)
                                            .addComponent(telLabel).addComponent(nameLabel))
                                    .addGap(0, 0, Short.MAX_VALUE)))
                            .addContainerGap()))));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addComponent(photoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 201,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(3, 3, 3)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 9,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(nameLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(emailLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(addressLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(telLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(modifyBtn).addComponent(logoutBtn))
                    .addContainerGap()));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.ipadx = 24;
    gridBagConstraints.ipady = 258;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(53, 6, 5, 5);
    add(jPanel1, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.ipadx = 21;
    gridBagConstraints.ipady = 627;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(53, 6, 5, 0);
    add(jSeparator1, gridBagConstraints);

    mainPane.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
    mainPane.setTabPlacement(javax.swing.JTabbedPane.LEFT);

    listStudents.setText("LIster Etudiants");

    jTextArea1.setColumns(20);
    jTextArea1.setRows(5);
    jScrollPane1.setViewportView(jTextArea1);

    searchBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/glyphicons-28-search.png"))); // NOI18N

    searchField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            searchFieldActionPerformed(evt);
        }
    });

    jLabel1.setText("Consult Information");

    jButton8.setText("Voir Etat");

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                            .addComponent(searchBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 52,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel2Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(searchField, javax.swing.GroupLayout.PREFERRED_SIZE, 474,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel1)
                                    .addGroup(jPanel2Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                    false)
                                            .addComponent(jButton8, javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(listStudents,
                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                            .addGap(0, 176, Short.MAX_VALUE)))
                    .addContainerGap()));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel2Layout.createSequentialGroup().addComponent(jLabel1)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(searchField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    28, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(searchBtn, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18).addComponent(listStudents).addGap(18, 18, 18).addComponent(jButton8)
                    .addGap(47, 47, 47)));

    themesTabPane.addTab("Etat de Stage", jPanel2);

    mainPane.addTab("Home", themesTabPane);

    themeMainArea.setEditable(false);
    themeMainArea.setColumns(20);
    themeMainArea.setRows(5);
    jScrollPane2.setViewportView(themeMainArea);

    listThemeBtn.setText("Lister");
    listThemeBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            listThemeBtnActionPerformed(evt);
        }
    });

    addThemeBtn.setText("Proposer ");
    addThemeBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addThemeBtnActionPerformed(evt);
        }
    });

    themeTitleLabel.setText("Titre : ");

    themeDescripArea.setColumns(20);
    themeDescripArea.setRows(5);
    jScrollPane3.setViewportView(themeDescripArea);

    descripLabel.setText("Description");

    submitThemeBtn.setText("Soumettre");
    submitThemeBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            submitThemeBtnActionPerformed(evt);
        }
    });

    cancelThemeBtn.setText("Annuler");
    cancelThemeBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelThemeBtnActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout addThemePanelLayout = new javax.swing.GroupLayout(addThemePanel);
    addThemePanel.setLayout(addThemePanelLayout);
    addThemePanelLayout.setHorizontalGroup(addThemePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(addThemePanelLayout.createSequentialGroup().addContainerGap().addGroup(addThemePanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(addThemePanelLayout.createSequentialGroup()
                            .addGroup(addThemePanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(themeTitleLabel).addComponent(descripLabel))
                            .addGap(25, 25, 25)
                            .addGroup(addThemePanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(themeTitleField).addComponent(jScrollPane3,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            addThemePanelLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(cancelThemeBtn).addGap(18, 18, 18)
                                    .addComponent(submitThemeBtn)))
                    .addContainerGap()));
    addThemePanelLayout.setVerticalGroup(addThemePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(addThemePanelLayout.createSequentialGroup().addContainerGap().addGroup(addThemePanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(themeTitleLabel).addComponent(themeTitleField,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(addThemePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(addThemePanelLayout.createSequentialGroup().addGap(10, 10, 10)
                                    .addComponent(descripLabel).addContainerGap(267, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addThemePanelLayout
                                    .createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 191,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(addThemePanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(submitThemeBtn).addComponent(cancelThemeBtn))
                                    .addGap(11, 11, 11)))));

    deleteThemeBtn.setText("Supprimer");
    deleteThemeBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteThemeBtnActionPerformed(evt);
        }
    });

    modifyThemeBtn.setText("Modifier");
    modifyThemeBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            modifyThemeBtnActionPerformed(evt);
        }
    });

    idFieldThemeDelete.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            idFieldThemeDeleteActionPerformed(evt);
        }
    });

    idThemeLabel.setText("ID Theme");

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jPanel3Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 698,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup().addComponent(addThemeBtn)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(listThemeBtn))
                            .addComponent(idThemeLabel)
                            .addGroup(jPanel3Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(idFieldThemeDelete, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                            jPanel3Layout.createSequentialGroup().addComponent(deleteThemeBtn)
                                                    .addGap(42, 42, 42).addComponent(modifyThemeBtn))))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(addThemePanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(34, Short.MAX_VALUE)));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 233,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(addThemePanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addContainerGap())
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(addThemeBtn).addComponent(listThemeBtn))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(idThemeLabel)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(idFieldThemeDelete, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(deleteThemeBtn).addComponent(modifyThemeBtn))
                                    .addGap(82, 82, 82)))));

    jTabbedPane1.addTab("Gestion de Themes", jPanel3);

    mainPane.addTab("Themes", jTabbedPane1);

    jTextArea2.setColumns(20);
    jTextArea2.setRows(5);
    jScrollPane4.setViewportView(jTextArea2);

    ListRecBtn.setText("Lister");

    reclammationTransferPanel
            .setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

    idReclammation.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            idReclammationActionPerformed(evt);
        }
    });

    jLabel2.setText("ID :");

    jLabel5.setForeground(new java.awt.Color(255, 51, 51));
    jLabel5.setText("Transfer Un Reclammation");

    transferRecBtn.setText("Transfer");

    recBtnGroup.add(valideRBtn);
    valideRBtn.setText("Valide");

    recBtnGroup.add(invalidRBtn);
    invalidRBtn.setText("invalide");

    javax.swing.GroupLayout reclammationTransferPanelLayout = new javax.swing.GroupLayout(
            reclammationTransferPanel);
    reclammationTransferPanel.setLayout(reclammationTransferPanelLayout);
    reclammationTransferPanelLayout.setHorizontalGroup(reclammationTransferPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(reclammationTransferPanelLayout.createSequentialGroup()
                    .addContainerGap(25, Short.MAX_VALUE)
                    .addGroup(reclammationTransferPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    reclammationTransferPanelLayout.createSequentialGroup()
                                            .addComponent(jLabel2).addGap(2, 2, 2)
                                            .addGroup(reclammationTransferPanelLayout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(idReclammation,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 135,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGroup(reclammationTransferPanelLayout
                                                            .createSequentialGroup().addComponent(valideRBtn)
                                                            .addPreferredGap(
                                                                    javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(invalidRBtn)))
                                            .addGap(147, 147, 147))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    reclammationTransferPanelLayout.createSequentialGroup()
                                            .addComponent(transferRecBtn).addContainerGap())
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    reclammationTransferPanelLayout.createSequentialGroup()
                                            .addComponent(jLabel5).addGap(88, 88, 88)))));
    reclammationTransferPanelLayout.setVerticalGroup(reclammationTransferPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(reclammationTransferPanelLayout.createSequentialGroup().addGap(6, 6, 6)
                    .addComponent(jLabel5).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(reclammationTransferPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(idReclammation, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(reclammationTransferPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(valideRBtn).addComponent(invalidRBtn))
                    .addGap(18, 18, 18).addComponent(transferRecBtn).addContainerGap(30, Short.MAX_VALUE)));

    ViewRecBtn.setText("Voir");

    jLabel6.setText("ID Reclammation");

    deleteRecBtn.setText("Supprimer");

    javax.swing.GroupLayout recPanelLayout = new javax.swing.GroupLayout(recPanel);
    recPanel.setLayout(recPanelLayout);
    recPanelLayout.setHorizontalGroup(recPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(recPanelLayout.createSequentialGroup().addContainerGap().addGroup(recPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane4)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            recPanelLayout.createSequentialGroup().addGroup(recPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(ListRecBtn)
                                    .addGroup(recPanelLayout.createSequentialGroup().addComponent(ViewRecBtn)
                                            .addGap(18, 18, 18).addComponent(deleteRecBtn))
                                    .addComponent(jLabel6).addComponent(reclammationIDViewField))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 185,
                                            Short.MAX_VALUE)
                                    .addComponent(reclammationTransferPanel,
                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    recPanelLayout.setVerticalGroup(recPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(recPanelLayout.createSequentialGroup().addContainerGap()
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 250,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(recPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(recPanelLayout.createSequentialGroup().addComponent(ListRecBtn)
                                    .addGap(36, 36, 36).addComponent(jLabel6)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(reclammationIDViewField,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(recPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(ViewRecBtn).addComponent(deleteRecBtn)))
                            .addComponent(reclammationTransferPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(162, Short.MAX_VALUE)));

    reclammationsPane.addTab("Gestion des Reclammations", recPanel);

    mainPane.addTab("Reclammations", reclammationsPane);

    jTextArea3.setColumns(20);
    jTextArea3.setRows(5);
    jScrollPane5.setViewportView(jTextArea3);

    jButton1.setText("Lancer Deliberation");

    jButton2.setText("Modify");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });

    jButton3.setText("supprimer");

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 720, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup().addComponent(jButton1).addGap(37, 37, 37)
                            .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 111,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(32, 32, 32)
                            .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 126,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 247,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton1).addComponent(jButton2).addComponent(jButton3))
                    .addContainerGap(292, Short.MAX_VALUE)));

    deliberationPane.addTab("Gestion des Deliberations", jPanel4);

    mainPane.addTab("Deliberations", deliberationPane);

    jTextArea4.setColumns(20);
    jTextArea4.setRows(5);
    jScrollPane6.setViewportView(jTextArea4);

    jButton4.setText("Enseignants");

    jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Ajouter _Supprimer Jurer",
            javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
            javax.swing.border.TitledBorder.DEFAULT_POSITION, null, java.awt.Color.orange));

    jLabel3.setText("ID Enseignant :");

    jButton5.setText("Ajouter");

    jButton6.setText("Supprimer");

    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(jPanel7Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addComponent(jLabel3)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 148,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(115, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton6).addGap(26, 26, 26).addComponent(jButton5).addContainerGap()));
    jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addGroup(jPanel7Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel3)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton5).addComponent(jButton6))
                    .addContainerGap(20, Short.MAX_VALUE)));

    jButton7.setText("List Jurers");

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout
            .setHorizontalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap().addGroup(jPanel6Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 704,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel6Layout.createSequentialGroup()
                                    .addGroup(jPanel6Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jButton4).addComponent(jButton7))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addContainerGap(28, Short.MAX_VALUE)));
    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 235,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel6Layout.createSequentialGroup().addGap(29, 29, 29)
                                    .addComponent(jButton4).addGap(18, 18, 18).addComponent(jButton7)))
                    .addContainerGap(220, Short.MAX_VALUE)));

    jTabbedPane2.addTab("Gestion de Jury", jPanel6);

    mainPane.addTab("Gerer le Jury", jTabbedPane2);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.ipadx = 18;
    gridBagConstraints.ipady = 47;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(53, 22, 5, 0);
    add(mainPane, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    add(errorStatusBar, gridBagConstraints);
}

From source file:com.manydesigns.portofino.actions.admin.appwizard.ApplicationWizard.java

protected void setupCalendar(List<ChildPage> childPages) throws Exception {
    List<List<String>> calendarDefinitions = new ArrayList<List<String>>();
    Color[] colors = { Color.RED, new Color(64, 128, 255), Color.CYAN.darker(), Color.GRAY,
            Color.GREEN.darker(), Color.ORANGE, Color.YELLOW.darker(), Color.MAGENTA.darker(), Color.PINK };
    int colorIndex = 0;
    for (Table table : allTables) {
        List<Column> dateColumns = new ArrayList<Column>();
        for (Column column : table.getColumns()) {
            if (column.getActualJavaType() != null && Date.class.isAssignableFrom(column.getActualJavaType())) {
                dateColumns.add(column);
            }//from w w  w .j a va  2 s .c o  m
        }
        if (!dateColumns.isEmpty()) {
            // ["Cal 1", "db1.schema1.table1", ["column1", "column2"], Color.RED]
            Color color = colors[colorIndex++ % colors.length];
            List<String> calDef = new ArrayList<String>();
            calDef.add('"' + Util.guessToWords(table.getActualEntityName()) + '"');
            calDef.add('"' + table.getQualifiedName() + '"');
            String cols = "[";
            boolean first = true;
            for (Column column : dateColumns) {
                if (first) {
                    first = false;
                } else {
                    cols += ", ";
                }
                cols += '"' + column.getActualPropertyName() + '"';
            }
            cols += "]";
            calDef.add(cols);
            calDef.add("new java.awt.Color(" + color.getRed() + ", " + color.getGreen() + ", " + color.getBlue()
                    + ")");
            calendarDefinitions.add(calDef);
        }
    }
    if (!calendarDefinitions.isEmpty()) {
        String calendarDefinitionsStr = "[";
        calendarDefinitionsStr += StringUtils.join(calendarDefinitions, ", ");
        calendarDefinitionsStr += "]";
        String baseName = "calendar-" + connectionProvider.getDatabase().getDatabaseName();
        File dir = new File(pagesDir, baseName);
        int retries = 1;
        while (dir.exists()) {
            retries++;
            dir = new File(pagesDir, baseName + "-" + retries);
        }
        if (dir.mkdirs()) {
            CalendarConfiguration configuration = new CalendarConfiguration();
            DispatcherLogic.saveConfiguration(dir, configuration);

            Page page = new Page();
            page.setId(RandomUtil.createRandomId());
            String calendarTitle = "Calendar (" + connectionProvider.getDatabase().getDatabaseName() + ")";
            if (retries > 1) {
                calendarTitle += " - " + retries;
            }
            page.setTitle(calendarTitle);
            page.setDescription(calendarTitle);

            DispatcherLogic.savePage(dir, page);
            File actionFile = new File(dir, "action.groovy");
            try {
                TemplateEngine engine = new SimpleTemplateEngine();
                Template template = engine
                        .createTemplate(ApplicationWizard.class.getResource("CalendarPage.groovy"));
                Map<String, Object> bindings = new HashMap<String, Object>();
                bindings.put("calendarDefinitions", calendarDefinitionsStr);
                FileWriter fw = new FileWriter(actionFile);
                template.make(bindings).writeTo(fw);
                IOUtils.closeQuietly(fw);
            } catch (Exception e) {
                logger.warn("Couldn't create calendar", e);
                SessionMessages.addWarningMessage("Couldn't create calendar: " + e);
                return;
            }

            ChildPage childPage = new ChildPage();
            childPage.setName(dir.getName());
            childPage.setShowInNavigation(true);
            childPages.add(childPage);
        } else {
            logger.warn("Couldn't create directory {}", dir.getAbsolutePath());
            SessionMessages.addWarningMessage(
                    ElementsThreadLocals.getText("couldnt.create.directory", dir.getAbsolutePath()));
        }
    }
}

From source file:net.sf.jasperreports.engine.xml.JRXmlConstants.java

/**
 * @deprecated Replaced by {@link ColorEnum}.
 *///from w  w w .ja va2s  . co  m
public static Map getColorMap() {
    if (colorMap == null) {
        Map map = new HashMap(35);
        map.put(COLOR_BLACK, Color.black);
        map.put(COLOR_BLUE, Color.blue);
        map.put(COLOR_CYAN, Color.cyan);
        map.put(COLOR_DARK_GRAY, Color.darkGray);
        map.put(COLOR_GRAY, Color.gray);
        map.put(COLOR_GREEN, Color.green);
        map.put(COLOR_LIGHT_GRAY, Color.lightGray);
        map.put(COLOR_MAGENTA, Color.magenta);
        map.put(COLOR_ORANGE, Color.orange);
        map.put(COLOR_PINK, Color.pink);
        map.put(COLOR_RED, Color.red);
        map.put(COLOR_YELLOW, Color.yellow);
        map.put(COLOR_WHITE, Color.white);
        map.put(Color.black, COLOR_BLACK);
        map.put(Color.blue, COLOR_BLUE);
        map.put(Color.cyan, COLOR_CYAN);
        map.put(Color.darkGray, COLOR_DARK_GRAY);
        map.put(Color.gray, COLOR_GRAY);
        map.put(Color.green, COLOR_GREEN);
        map.put(Color.lightGray, COLOR_LIGHT_GRAY);
        map.put(Color.magenta, COLOR_MAGENTA);
        map.put(Color.orange, COLOR_ORANGE);
        map.put(Color.pink, COLOR_PINK);
        map.put(Color.red, COLOR_RED);
        map.put(Color.yellow, COLOR_YELLOW);
        map.put(Color.white, COLOR_WHITE);
        colorMap = Collections.unmodifiableMap(map);
    }

    return colorMap;
}

From source file:edu.harvard.mcz.imagecapture.PositionTemplateEditor.java

/**
 * Draw boxes delimiting the various parts of the template on the current image.
 * Public so that it can be invoked from ButtonEditor().
 *//*from  ww w. jav  a 2  s .c o  m*/
public void drawLayers() {
    // draw the image bounds in black.
    if (template != null) {
        imagePanelForDrawing.clearOverlay();
        imagePanelForDrawing.drawBox(new Dimension(0, 0), template.getImageSize(), Color.BLACK,
                new BasicStroke(2F));
        // draw each template layer in a distinct color (keyed to UI text).
        imagePanelForDrawing.drawBox(template.getBarcodeULPosition(), template.getBarcodeSize(), Color.RED);
        imagePanelForDrawing.drawBox(template.getTextPosition(), template.getTextSize(), Color.BLUE);
        imagePanelForDrawing.drawBox(template.getSpecimenPosition(), template.getSpecimenSize(), Color.ORANGE);
        imagePanelForDrawing.drawBox(template.getUTLabelsPosition(), template.getUTLabelsSize(), Color.CYAN);
        imagePanelForDrawing.drawBox(template.getLabelPosition(), template.getLabelSize(), Color.MAGENTA);
        imagePanelForDrawing.drawBox(template.getUtBarcodePosition(), template.getUtBarcodeSize(), Color.BLACK);
    }
}

From source file:uk.ac.ucl.chem.ccs.clinicalgui.DisplayJobPanel.java

private void updateState() {

    switch (ajo.getState()) {
    case AHEJobObject.AHE_PREPARING:
        jobStatus.setForeground(Color.BLUE);
        jobStatus.setText("AHE PREPARING");
        break;//from  w w w .j  a v  a 2  s .  c om

    case AHEJobObject.AHE_FILES_STAGED:
        jobStatus.setForeground(Color.ORANGE);
        jobStatus.setText("AHE FILES STAGED");
        break;

    case AHEJobObject.AHE_JOB_BUILT:
        jobStatus.setForeground(Color.YELLOW);
        jobStatus.setText("AHE JOB BUILT");
        break;

    case AHEJobObject.GRIDSAM_PENDING:
        jobStatus.setForeground(Color.MAGENTA);
        jobStatus.setText("AHE PENDING");
        break;

    case AHEJobObject.GRIDSAM_STAGING_IN:
        jobStatus.setForeground(new Color(92, 201, 151));
        jobStatus.setText("AHE STAGING IN");
        break;

    case AHEJobObject.GRIDSAM_STAGED_IN:
        jobStatus.setForeground(new Color(1, 240, 242));
        jobStatus.setText("AHE STAGED IN");
        break;

    case AHEJobObject.GRIDSAM_STAGING_OUT:
        jobStatus.setForeground(new Color(188, 140, 217));
        jobStatus.setText("AHE STAGING OUT");
        break;

    case AHEJobObject.GRIDSAM_STAGED_OUT:
        jobStatus.setForeground(new Color(135, 90, 133));
        jobStatus.setText("AHE PREPARING");
        break;

    case AHEJobObject.GRIDSAM_ACTIVE:
        jobStatus.setForeground(new Color(207, 165, 92));
        jobStatus.setText("AHE ACTIVE");
        break;

    case AHEJobObject.GRIDSAM_EXECUTED:
        jobStatus.setForeground(new Color(127, 124, 133));
        jobStatus.setText("AHE EXECUTED");
        break;

    case AHEJobObject.GRIDSAM_FAILED:
        jobStatus.setForeground(Color.RED);
        jobStatus.setText("AHE FAILED");
        if (pollingButton.getText().equals("Stop Polling")) {
            pollTimer.stop();
            pollingButton.setText("Start Polling");
        }
        break;

    case AHEJobObject.GRIDSAM_DONE:
        jobStatus.setForeground(Color.GREEN);
        jobStatus.setText("AHE DONE");
        if (pollingButton.getText().equals("Stop Polling")) {
            pollTimer.stop();
            pollingButton.setText("Start Polling");
        }

        break;

    case AHEJobObject.GRIDSAM_TERMINATING:
        jobStatus.setForeground(new Color(242, 52, 154));
        jobStatus.setText("AHE TERMINATING");
        break;

    case AHEJobObject.GRIDSAM_TERMINATED:
        jobStatus.setForeground(new Color(76, 67, 20));
        jobStatus.setText("AHE TERMINATED");
        if (pollingButton.getText().equals("Stop Polling")) {
            pollTimer.stop();
            pollingButton.setText("Start Polling");
        }
        break;

    case AHEJobObject.GRIDSAM_UNDEFINED:
        jobStatus.setForeground(new Color(89, 9, 54));
        jobStatus.setText("AHE UNDEFINED");
        if (pollingButton.getText().equals("Stop Polling")) {
            pollTimer.stop();
            pollingButton.setText("Start Polling");
        }
        break;

    }

    if (AHEJobObject.GRIDSAM_PENDING <= ajo.getState() && ajo.getState() <= AHEJobObject.GRIDSAM_EXECUTED) {
        teminateJob.setEnabled(true);
    } else {
        teminateJob.setEnabled(false);
    }

    if (AHEJobObject.GRIDSAM_FAILED <= ajo.getState() && ajo.getState() <= AHEJobObject.GRIDSAM_UNDEFINED) {
        updateStatus.setEnabled(false);
        pollingButton.setText("Start Polling");
        pollingButton.setEnabled(false);
    } else {
        updateStatus.setEnabled(true);
    }

    if (ajo.getState() == AHEJobObject.AHE_JOB_BUILT) {
        updateStatus.setText("Start Job");
    } else {
        updateStatus.setText("Update Job");
    }

    if (ajo.getState() == AHEJobObject.GRIDSAM_DONE || ajo.getState() == AHEJobObject.GRIDSAM_STAGED_OUT) {
        downloadButton.setEnabled(true);
    } else {
        downloadButton.setEnabled(false);
    }

}

From source file:nosqltools.MainForm.java

private void Export_FileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Export_FileActionPerformed
    Text_MessageBar.setText(Initializations.WAITINGFORCONNECTION);
    Text_MessageBar.setForeground(Color.ORANGE);
    if (dbcon.isConnectionSuccess()) {
        if (dbcon.checkDatabaseConnection()) {
            List<String> connectionStrings = dbcon.getAllCollectionsLessSystem();
            ExportFileDialog dlg_export = new ExportFileDialog(null, connectionStrings);
            dlg_export.setVisible(true);

            if (dlg_export.isToExport()) {
                String collectionToExport = dlg_export.collectionToExport();
                String typeToExport = dlg_export.typeToExport();
                String locToExport = dlg_export.locToExport();

                if (locToExport != null && !locToExport.trim().equals("")) {
                    //Converting JSON to CSV and export it to file is done in the dbcon.export method
                    //Exporting JSON on the other hand, is done here
                    if (typeToExport.equals("CSV") || typeToExport.equals("TSV")) {
                        if (dbcon.export(collectionToExport, typeToExport, locToExport).equals("true")) {
                            Text_MessageBar.setForeground(Color.GREEN);
                            Text_MessageBar.setText("Export to " + typeToExport + " has been successful.");
                        } else {
                            Text_MessageBar.setForeground(Color.RED);
                            Text_MessageBar.setText("Export to " + typeToExport + " has been unsuccessful.");
                        }//from w  w w.  j a  v  a  2 s. c om
                    } else {
                        String dataToExport = dbcon.export(collectionToExport, typeToExport, locToExport);
                        if (util.writeToFile(locToExport, dataToExport)) {
                            Text_MessageBar.setForeground(Color.GREEN);
                            Text_MessageBar.setText("Export to " + typeToExport + " has been successful.");
                        } else {
                            Text_MessageBar.setForeground(Color.RED);
                            Text_MessageBar.setText("Export to " + typeToExport + " has been unsuccessful.");
                        }
                    }
                } else {
                    JOptionPane.showMessageDialog(this, Initializations.FILENOTFOUND,
                            Initializations.EXPORTERROR, JOptionPane.ERROR_MESSAGE);
                    Text_MessageBar.setForeground(Color.RED);
                    Text_MessageBar.setText("Export to " + typeToExport + " has been unsuccessful.");
                }
            } else {
                Text_MessageBar.setForeground(Color.ORANGE);
                Text_MessageBar.setText("Export action has been aborted");
            }
        } else {
            JOptionPane.showMessageDialog(null, Initializations.MONGOSERVERERROR, "Error",
                    JOptionPane.ERROR_MESSAGE);
            Text_MessageBar.setText(Initializations.MONGOSERVERERROR);
            Text_MessageBar.setForeground(Color.RED);
        }
    } else {
        JOptionPane.showMessageDialog(null, Initializations.NODBCONNECTION, "Error", JOptionPane.ERROR_MESSAGE);
        Text_MessageBar.setText(Initializations.NODBCONNECTION);
        Text_MessageBar.setForeground(Color.RED);
    }
}

From source file:nl.strohalm.cyclos.services.transactions.PaymentServiceImpl.java

@Override
public StatisticalResultDTO getSimulateConversionGraph(final ConversionSimulationDTO input) {
    final LocalSettings localSettings = settingsService.getLocalSettings();
    final byte precision = (byte) localSettings.getPrecision().getValue();

    // get series
    final TransactionFeePreviewForRatesDTO temp = simulateConversion(input);
    final int series = temp.getFees().size();
    // get range of points, but without values for A < 0
    BigDecimal initialARate = null;
    RatesResultDTO rates = new RatesResultDTO();
    if (input.isUseActualRates()) {
        rates = rateService.getRatesForTransferFrom(input.getAccount(), input.getAmount(), null);
        rates.setDate(input.getDate());//from  ww w  .ja  v  a 2 s  .  c  om
        initialARate = rates.getaRate();
    } else {
        initialARate = input.getArate();
    }

    // lowerlimit takes care that values for A < 0 are left out of the graph
    final Double lowerLimit = (initialARate == null) ? null : initialARate.negate().doubleValue();
    final Number[] xRange = GraphHelper.getOptimalRangeAround(0, 33, 0, 0.8, lowerLimit);

    // Data structure to build the table
    final Number[][] tableCells = new Number[xRange.length][series];
    // initialize series names and x labels
    final String[] seriesNames = new String[series];
    final byte[] seriesOrder = new byte[series];
    final Calendar[] xPointDates = new Calendar[xRange.length];
    final Calendar now = Calendar.getInstance();
    BigDecimal inputARate = temp.getARate();
    BigDecimal inputDRate = temp.getDRate();
    // assign data
    for (int i = 0; i < xRange.length; i++) {
        final ConversionSimulationDTO inputPointX = (ConversionSimulationDTO) input.clone();
        final Calendar date = (Calendar) ((input.isUseActualRates()) ? input.getDate().clone() : now.clone());
        date.add(Calendar.DAY_OF_YEAR, xRange[i].intValue());
        xPointDates[i] = date;
        // Set useActualRates for this input to false, otherwise simulateConversion will use the account's the balance and rates of that date, and
        // we don't want that.
        inputPointX.setUseActualRates(false);
        if (inputARate != null) {
            final BigDecimal aRate = inputARate.add(new BigDecimal(xRange[i].doubleValue()));
            inputPointX.setArate(aRate);
        }
        if (inputDRate != null) {
            final BigDecimal dRate = inputDRate.subtract(new BigDecimal(xRange[i].doubleValue()));
            inputPointX.setDrate(dRate);
        }

        final TransactionFeePreviewDTO tempResult = simulateConversion(inputPointX);
        int j = 0;
        for (final TransactionFee fee : tempResult.getFees().keySet()) {
            tableCells[i][j] = new StatisticalNumber(tempResult.getFees().get(fee).doubleValue(), precision);
            byte index;
            switch (fee.getChargeType()) {
            case D_RATE:
                index = 2;
                break;
            case A_RATE:
            case MIXED_A_D_RATES:
                index = 3;
                break;
            default:
                index = 1;
                break;
            }
            seriesOrder[j] = index;
            seriesNames[j++] = fee.getName();
        }
    }

    // create the graph object
    final StatisticalResultDTO result = new StatisticalResultDTO(tableCells);
    result.setBaseKey("conversionSimulation.result.graph");
    result.setHelpFile("account_management");
    // date labels along x-axis
    final String[] rowKeys = new String[xRange.length];
    Arrays.fill(rowKeys, "");
    result.setRowKeys(rowKeys);
    for (int i = 0; i < rowKeys.length; i++) {
        final String rowHeader = localSettings.getDateConverterForGraphs().toString(xPointDates[i]);
        result.setRowHeader(rowHeader, i);
    }
    // mark the actual date upon which the x-axis is based as a vertical line
    final Calendar baseDate = (input.isUseActualRates()) ? (Calendar) input.getDate().clone() : now;
    final String baseDateString = localSettings.getDateConverterForGraphs().toString(baseDate);
    final Marker[] markers = new Marker[1];
    markers[0] = new CategoryMarker(baseDateString);
    markers[0].setPaint(Color.ORANGE);
    final String todayString = localSettings.getDateConverterForGraphs().toString(now);
    if (todayString.equals(baseDateString)) {
        markers[0].setLabel("global.today");
    }
    result.setDomainMarkers(markers);

    // Series labels indicate fee names
    final String[] columnKeys = new String[series];
    Arrays.fill(columnKeys, "");
    result.setColumnKeys(columnKeys);
    for (int j = 0; j < columnKeys.length; j++) {
        result.setColumnHeader(seriesNames[j], j);
    }

    // order the series
    result.orderSeries(seriesOrder);

    final TransferType tt = fetchService.fetch(input.getTransferType(),
            RelationshipHelper.nested(TransferType.Relationships.FROM, AccountType.Relationships.CURRENCY));
    result.setYAxisUnits(tt.getCurrency().getSymbol());
    result.setShowTable(false);
    result.setGraphType(StatisticalResultDTO.GraphType.STACKED_AREA);
    return result;
}

From source file:com.haulmont.cuba.desktop.sys.DesktopWindowManager.java

protected void showNotificationPopup(String popupText, NotificationType type) {
    JPanel panel = new JPanel(new MigLayout("flowy"));
    panel.setBorder(BorderFactory.createLineBorder(Color.gray));

    switch (type) {
    case WARNING:
    case WARNING_HTML:
        panel.setBackground(Color.yellow);
        break;//www  . ja v  a  2s  . c o  m
    case ERROR:
    case ERROR_HTML:
        panel.setBackground(Color.orange);
        break;
    default:
        panel.setBackground(Color.cyan);
    }

    JLabel label = new JLabel(popupText);
    panel.add(label);

    Dimension labelSize = DesktopComponentsHelper.measureHtmlText(popupText);

    int x = frame.getX() + frame.getWidth() - (50 + labelSize.getSize().width);
    int y = frame.getY() + frame.getHeight() - (50 + labelSize.getSize().height);

    PopupFactory factory = PopupFactory.getSharedInstance();
    final Popup popup = factory.getPopup(frame, panel, x, y);
    popup.show();

    panel.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            popup.hide();
        }
    });

    PointerInfo pointerInfo = MouseInfo.getPointerInfo();
    if (pointerInfo != null) {
        final Point location = pointerInfo.getLocation();
        final Timer timer = new Timer(3000, null);
        timer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                PointerInfo currentPointer = MouseInfo.getPointerInfo();
                if (currentPointer == null) {
                    timer.stop();
                } else if (!currentPointer.getLocation().equals(location)) {
                    popup.hide();
                    timer.stop();
                }
            }
        });
        timer.start();
    }
}

From source file:biogenesis.Organism.java

private static int getTypeColor(Color c) {
    if (c.equals(Color.RED) || c.equals(Utils.ColorDARK_RED))
        return RED;
    if (c.equals(Color.GREEN) || c.equals(Utils.ColorDARK_GREEN))
        return GREEN;
    if (c.equals(Color.CYAN) || c.equals(Utils.ColorDARK_CYAN))
        return CYAN;
    if (c.equals(Color.BLUE) || c.equals(Utils.ColorDARK_BLUE))
        return BLUE;
    if (c.equals(Color.MAGENTA) || c.equals(Utils.ColorDARK_MAGENTA))
        return MAGENTA;
    if (c.equals(Color.PINK) || c.equals(Utils.ColorDARK_PINK))
        return PINK;
    if (c.equals(Color.ORANGE) || c.equals(Utils.ColorDARK_ORANGE))
        return ORANGE;
    if (c.equals(Color.WHITE) || c.equals(Utils.ColorDARK_WHITE))
        return WHITE;
    if (c.equals(Color.GRAY) || c.equals(Utils.ColorDARK_GRAY))
        return GRAY;
    if (c.equals(Color.YELLOW) || c.equals(Utils.ColorDARK_YELLOW))
        return YELLOW;
    if (c.equals(Utils.ColorBROWN))
        return BROWN;
    return NOCOLOR;
}