Example usage for javax.swing JOptionPane INFORMATION_MESSAGE

List of usage examples for javax.swing JOptionPane INFORMATION_MESSAGE

Introduction

In this page you can find the example usage for javax.swing JOptionPane INFORMATION_MESSAGE.

Prototype

int INFORMATION_MESSAGE

To view the source code for javax.swing JOptionPane INFORMATION_MESSAGE.

Click Source Link

Document

Used for information messages.

Usage

From source file:fs.MainWindow.java

public void XYZScatterPlot(int f1, int f2, int f3) {
    JOptionPane.showMessageDialog(null,
            "Execution Information: The 3D " + "Scatter Plot was not implemented yet.", "Application Warning",
            JOptionPane.INFORMATION_MESSAGE);
    //to be implemented
}

From source file:com.iucosoft.eavertizare.gui.MainJFrame.java

private void jButtonDeleteFirmaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeleteFirmaActionPerformed
    int index = jListFirma.getSelectedIndex();
    if (index != -1) {
        Object numeFirma = jListFirma.getModel().getElementAt(index);
        firma = firmaDao.findByName((String) numeFirma);

        int rez = JOptionPane.showConfirmDialog(this, "Esti sigur vrei sa sterg firma ?", "Question",
                JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

        switch (rez) {
        case JOptionPane.YES_OPTION:

            int idConfiguratie = firma.getConfiguratii().getId();
            firmaDao.dropTableClients(firma.getTabelaClientiLocal());
            System.out.println("conf id = " + idConfiguratie);
            firmaDao.delete(firma.getId());
            configuratiiDao.delete(idConfiguratie);
            JOptionPane.showMessageDialog(this, "Firma stersa cu success", "Succes",
                    JOptionPane.INFORMATION_MESSAGE);
            break;
        case JOptionPane.NO_OPTION:
        case JOptionPane.CLOSED_OPTION:
            break;
        }/* ww  w. ja v a  2s .  c o m*/
        refreshFrame();
    } else {
        JOptionPane.showMessageDialog(this, "Selectati firma!", "Info", JOptionPane.INFORMATION_MESSAGE);
    }
}

From source file:Interfaz.rubiktimer.java

private void Limpiar2x2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Limpiar2x2ActionPerformed
    // TODO add your handling code here:
    if (img == 4) {
        ConsultaLimpiar dialog = new ConsultaLimpiar(new javax.swing.JFrame(), true, "2 x 2");
        dialog.setVisible(true);/*from   w ww  . ja  va  2 s  . co m*/
        if (dialog.verif == 1) {
            listaT = new Lista();
            listaT2x2 = new Lista();
            lista5mej = new Lista();
            lista5mej2x2 = new Lista();
            lista10mej = new Lista();
            lista10mej2x2 = new Lista();
            panel2x2.removeAll();
            panel2x2.updateUI();
            panelGrafica.removeAll();
            panelGrafica.validate();
            dialog.verif = 0;
            actualizar_estad();
        }
    } else {
        JOptionPane.showMessageDialog(null,
                "Para eliminar la informacion de esta Categoria tiene que estar dentro de la misma (2x2)",
                "Ingrese en la categoria 2x2", JOptionPane.INFORMATION_MESSAGE);
    }
}

From source file:GUI.simplePanel.java

public void textParser(String input) {
    boolean served = false;
    jTextArea1.setText(input + "\n" + jTextArea1.getText());

    getjLabel1().setText("Awaiting Command");
    if (input.contains("temperature")) {
        try {/*  w  w w.j  ava 2  s.c o  m*/
            String reply = util.httpRequest.sendPost("127.0.0.1", 8383, "", "/getServices");
            JSONObject obj;

            obj = new JSONObject(reply);
            JSONArray services = obj.getJSONArray("services");
            boolean found = false;
            for (int i = 0; i < services.length(); i++) {
                if (found) {
                    served = true;
                    return;
                }
                Object pref = services.getJSONObject(i).get("url");
                String url = (String) pref;
                if (url.contains("temp")) {
                    // http://127.0.0.1:8181/sensor/1/temp
                    String serviceHost = (url.split(":")[1].substring(2));
                    int Port = Integer.parseInt((url.split(":")[2]).split("/")[0]);
                    String servicePath = (url.split(":")[2].substring(url.split(":")[2].indexOf("/")));
                    String serviceReply = util.httpRequest.sendPost(serviceHost, Port, "", servicePath);

                    JSONObject temperature;

                    obj = new JSONObject(serviceReply);
                    String temp = obj.getJSONObject("sensor").getString("Temperature");
                    if (temp.length() > 4) {
                        JOptionPane.showMessageDialog(self,
                                "Temperature is " + temp.substring(0, temp.indexOf(".") + 2) + " Celsius");
                    } else {
                        JOptionPane.showMessageDialog(self, "Temperature is " + temp + " Celsius");
                    }

                    found = true;
                }
            }
            JOptionPane.showMessageDialog(self, "I can't know! There are no sensors for that!");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    if (input.contains("light") || input.startsWith("li")) {
        try {
            String reply = util.httpRequest.sendPost("127.0.0.1", 8383, "", "/getServices");
            JSONObject obj;

            obj = new JSONObject(reply);
            JSONArray services = obj.getJSONArray("services");
            boolean found = false;
            for (int i = 0; i < services.length(); i++) {
                if (found) {
                    served = true;
                    return;
                }
                Object pref = services.getJSONObject(i).get("url");
                String url = (String) pref;
                if (url.contains("light")) {
                    // http://127.0.0.1:8181/sensor/1/temp
                    String serviceHost = (url.split(":")[1].substring(2));
                    int Port = Integer.parseInt((url.split(":")[2]).split("/")[0]);
                    String servicePath = (url.split(":")[2].substring(url.split(":")[2].indexOf("/")));
                    String serviceReply = util.httpRequest.sendPost(serviceHost, Port, "", servicePath);

                    JSONObject temperature;

                    obj = new JSONObject(serviceReply);
                    String temp = obj.getJSONObject("sensor").getString("Light");
                    JOptionPane.showMessageDialog(self, "Light levels are at " + temp + " of 1023 ");
                    found = true;
                }
            }
            JOptionPane.showMessageDialog(self, "I can't know! There are no sensors for that!");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
    if ((input.contains("turn on") || input.contains("turn off")) && input.contains("number")) {
        int numberIndex = input.indexOf("number ") + "number ".length();
        String number = input.substring(numberIndex).split(" ")[0];
        if (number.equals("for") || number.equals("four")) {
            number = "4";
        }
        if (number.equals("to") || number.equals("two") || number.equals("cho")) {
            number = "2";
        }
        if (number.equals("one")) {
            number = "1";
        }
        if (number.equals("three")) {
            number = "3";
        }

        try {
            String reply = util.httpRequest.sendPost("127.0.0.1", 8383, "", "/getServices");
            JSONObject obj;

            obj = new JSONObject(reply);
            JSONArray services = obj.getJSONArray("services");
            boolean found = false;
            for (int i = 0; i < services.length(); i++) {
                if (found) {
                    served = true;
                    return;
                }
                Object pref = services.getJSONObject(i).get("url");
                String url = (String) pref;
                if (url.contains("sensor/" + number)) {
                    // http://127.0.0.1:8181/sensor/1/temp
                    String serviceHost = (url.split(":")[1].substring(2));
                    int Port = Integer.parseInt((url.split(":")[2]).split("/")[0]);
                    String servicePath = (url.split(":")[2].substring(url.split(":")[2].indexOf("/")));
                    String serviceReply = util.httpRequest.sendPost(serviceHost, Port, "", servicePath);

                    JSONObject temperature;

                    obj = new JSONObject(serviceReply);
                    String temp = obj.getJSONObject("sensor").getString("Switch");
                    if (!(temp.equals("0") || temp.equals("1"))) {
                        JOptionPane.showMessageDialog(self, "Sensor does not provide a switch service man");
                    } else if (input.contains("turn on") && temp.equals("1")) {
                        JOptionPane.showMessageDialog(self, "Switch is already on at sensor " + number + "!");
                    } else if (input.contains("turn off") && temp.equals("0")) {
                        JOptionPane.showMessageDialog(self, "Switch is already off at sensor " + number + "!");
                    } else if (input.contains("turn on") && temp.equals("0")) {
                        String serviceReply2 = util.httpRequest.sendPost(serviceHost, Port, "",
                                "/sensor/" + number + "/switch");
                        JOptionPane.showMessageDialog(self, "Request for switch sent");
                    } else if (input.contains("turn off") && temp.equals("1")) {
                        String serviceReply2 = util.httpRequest.sendPost(serviceHost, Port, "",
                                "/sensor/" + number + "/switch");
                        JOptionPane.showMessageDialog(self, "Request for switch sent");
                    }

                    found = true;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
    if (input.contains("change") && input.contains("number")) {

        int numberIndex = input.indexOf("number ") + "number ".length();
        String number = input.substring(numberIndex).split(" ")[0];
        if (number.equals("for") || number.equals("four")) {
            number = "4";
        }
        if (number.equals("to") || number.equals("two") || number.equals("cho")) {
            number = "2";
        }
        if (number.equals("one")) {
            number = "1";
        }
        if (number.equals("three")) {
            number = "3";
        }

        try {
            String reply = util.httpRequest.sendPost("127.0.0.1", 8383, "", "/getServices");
            JSONObject obj;

            obj = new JSONObject(reply);
            JSONArray services = obj.getJSONArray("services");
            boolean found = false;
            for (int i = 0; i < services.length(); i++) {
                if (found) {
                    served = true;
                    return;
                }
                Object pref = services.getJSONObject(i).get("url");
                String url = (String) pref;
                if (url.contains("sensor/" + number)) {
                    // http://127.0.0.1:8181/sensor/1/temp
                    String serviceHost = (url.split(":")[1].substring(2));
                    int Port = Integer.parseInt((url.split(":")[2]).split("/")[0]);
                    String servicePath = (url.split(":")[2].substring(url.split(":")[2].indexOf("/")));
                    String serviceReply = util.httpRequest.sendPost(serviceHost, Port, "", servicePath);

                    JSONObject temperature;

                    obj = new JSONObject(serviceReply);
                    String temp = obj.getJSONObject("sensor").getString("Switch");
                    if (!(temp.equals("0") || temp.equals("1"))) {
                        JOptionPane.showMessageDialog(self, "Sensor does not provide a switch service man");
                    } else {
                        String serviceReply2 = util.httpRequest.sendPost(serviceHost, Port, "",
                                "/sensor/" + number + "/switch");
                        JOptionPane.showMessageDialog(self, "Request for switch sent");
                    }

                    found = true;
                }
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(self, e.getLocalizedMessage());
        }
    }
    if (input.contains("get all")) {

        try {
            String reply = util.httpRequest.sendPost("127.0.0.1", 8383, "", "/getServices");
            JSONObject obj;
            served = true;
            obj = new JSONObject(reply);
            JSONArray services = obj.getJSONArray("services");
            boolean found = false;
            String servicesString = "";
            for (int i = 0; i < services.length(); i++) {
                Object pref = services.getJSONObject(i).get("url");
                String url = (String) pref;
                servicesString += url + "\n";

            }
            JOptionPane.showMessageDialog(self, servicesString);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
    if (input.contains("humidity") || input.startsWith("humidity")) {
        try {
            String reply = util.httpRequest.sendPost("127.0.0.1", 8383, "", "/getServices");
            JSONObject obj;

            obj = new JSONObject(reply);
            JSONArray services = obj.getJSONArray("services");
            boolean found = false;
            for (int i = 0; i < services.length(); i++) {
                if (found) {
                    served = true;
                    return;
                }
                Object pref = services.getJSONObject(i).get("url");
                String url = (String) pref;
                if (url.contains("humi")) {
                    // http://127.0.0.1:8181/sensor/1/temp
                    String serviceHost = (url.split(":")[1].substring(2));
                    int Port = Integer.parseInt((url.split(":")[2]).split("/")[0]);
                    String servicePath = (url.split(":")[2].substring(url.split(":")[2].indexOf("/")));
                    String serviceReply = util.httpRequest.sendPost(serviceHost, Port, "", servicePath);

                    JSONObject temperature;

                    obj = new JSONObject(serviceReply);
                    String temp = obj.getJSONObject("sensor").getString("Humidity");
                    JOptionPane.showMessageDialog(self, "Humidity levels are at " + temp + " of 1023 ");
                    found = true;
                }
            }
            JOptionPane.showMessageDialog(self, "I can't know! There are no sensors for that!");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
    if (input.contains("pressure") || input.startsWith("pressure")) {
        try {
            String reply = util.httpRequest.sendPost("127.0.0.1", 8383, "", "/getServices");
            JSONObject obj;

            obj = new JSONObject(reply);
            JSONArray services = obj.getJSONArray("services");
            boolean found = false;
            for (int i = 0; i < services.length(); i++) {
                if (found) {
                    served = true;
                    return;
                }
                Object pref = services.getJSONObject(i).get("url");
                String url = (String) pref;
                if (url.contains("pres")) {
                    // http://127.0.0.1:8181/sensor/1/temp
                    String serviceHost = (url.split(":")[1].substring(2));
                    int Port = Integer.parseInt((url.split(":")[2]).split("/")[0]);
                    String servicePath = (url.split(":")[2].substring(url.split(":")[2].indexOf("/")));
                    String serviceReply = util.httpRequest.sendPost(serviceHost, Port, "", servicePath);

                    JSONObject temperature;

                    obj = new JSONObject(serviceReply);
                    String temp = obj.getJSONObject("sensor").getString("Pressure");
                    JOptionPane.showMessageDialog(self, "Pressure levels are at " + temp + " of 1023 ");
                    found = true;
                }
            }
            JOptionPane.showMessageDialog(self, "I can't know! There are no sensors for that!");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
    if (!served) {
        try {
            ChatterBotFactory factory = new ChatterBotFactory();
            ChatterBot bot1 = factory.create(CLEVERBOT);
            ChatterBotSession bot1session = bot1.createSession();
            String s = input;
            String response = bot1session.think(s);
            JOptionPane.showMessageDialog(self, response, "Jarvis says", JOptionPane.INFORMATION_MESSAGE);
        } catch (Exception e) {
        }
    }

}

From source file:com.iucosoft.eavertizare.gui.MainJFrame.java

private void jButtonCautaClientiiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCautaClientiiActionPerformed
    String nume = jTextFieldCautaNumeClient.getText();
    String prenume = jTextFieldCautaPrenumeClient.getText();
    if (nume.equals("") && prenume.equals("")) {
        JOptionPane.showMessageDialog(this, "Introduceti numele si/sau prenumele!", "Info",
                JOptionPane.INFORMATION_MESSAGE);
    } else {/*from   www . j  a  va2s . c  o m*/
        if (!nume.equals("") && prenume.equals("")) {
            clientiTableModel.findClient(this, nume);
            jTextFieldCautaNumeClient.setText("");
            System.out.println("aici");
        }
        if (!nume.equals("") && !prenume.equals("")) {
            clientiTableModel.findClient(this, nume, prenume);
            jTextFieldCautaNumeClient.setText("");
            jTextFieldCautaPrenumeClient.setText("");
        }
    }

}

From source file:com.biosis.biosislite.vistas.inventario.MantenimientoBien.java

private void btneliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btneliminarActionPerformed
    // TODO add your handling code here:
    accion = AbstractControlador.ELIMINAR;
    if (tblbienes.getSelectedRow() != -1) {

        Integer codigo = tblbienes.getSelectedRow();

        Bien bien = bienControlador.buscarPorId(lista.get(codigo).getId());

        if (bien != null) {
            if (JOptionPane.showConfirmDialog(null, "Desea Eliminar la Bien?", "Mensaje del Sistema",
                    JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {

                int[] filas = tblbienes.getSelectedRows();
                for (int i = 0; i < filas.length; i++) {
                    Bien bien2 = lista.get(filas[0]);
                    lista.remove(bien2);
                    bienControlador.setSeleccionado(bien2);
                    bienControlador.accion(accion);
                }/*from  w w w.jav  a 2  s.c o  m*/
                if (bienControlador.accion(accion) == 3) {
                    JOptionPane.showMessageDialog(null, "Bien eliminada correctamente", "Mensaje del Sistema",
                            JOptionPane.INFORMATION_MESSAGE);

                } else {
                    JOptionPane.showMessageDialog(null, "Bien no eliminada", "Mensaje del Sistema",
                            JOptionPane.ERROR_MESSAGE);
                }
            } else {
                JOptionPane.showMessageDialog(null, "Bien no eliminada", "Mensaje del Sistema",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    } else {
        JOptionPane.showMessageDialog(null, "Debe seleccionar un Bien", "Mensaje del Sistema",
                JOptionPane.ERROR_MESSAGE);
    }
}

From source file:edu.harvard.i2b2.patientSet.ui.PatientSetJPanel.java

public String loadPatientSets() {
    System.out.println("Loading patient sets for: " + System.getProperty("user"));
    this.patientSets = new ArrayList<QueryResultData>();

    for (int i = 0; i < this.previousQueries.size(); i++) {
        QueryMasterData qdata = previousQueries.get(i);
        try {//from w  w  w. ja  v  a 2  s. c om
            String xmlRequest = qdata.writeContentQueryXML();

            String xmlResponse = null;
            if (System.getProperty("webServiceMethod").equals("SOAP")) {
                xmlResponse = QueryListNamesClient.sendQueryRequestSOAP(xmlRequest);
            } else {
                xmlResponse = QueryListNamesClient.sendQueryRequestREST(xmlRequest, false);
            }
            if (xmlResponse.equalsIgnoreCase("CellDown")) {
                final JPanel parent = this;
                java.awt.EventQueue.invokeLater(new Runnable() {
                    public void run() {
                        JOptionPane.showMessageDialog(parent,
                                "Trouble with connection to the remote server, "
                                        + "this is often a network error, please try again",
                                "Network Error", JOptionPane.INFORMATION_MESSAGE);
                    }
                });
                return null;
            }

            try {
                JAXBUtil jaxbUtil = PatientSetJAXBUtil.getJAXBUtil();
                JAXBElement jaxbElement = jaxbUtil.unMashallFromString(xmlResponse);
                ResponseMessageType messageType = (ResponseMessageType) jaxbElement.getValue();

                BodyType bt = messageType.getMessageBody();
                InstanceResponseType instanceResponseType = (InstanceResponseType) new JAXBUnWrapHelper()
                        .getObjectByClass(bt.getAny(), InstanceResponseType.class);

                for (QueryInstanceType queryInstanceType : instanceResponseType.getQueryInstance()) {
                    // change later for working with new xml schema
                    // RunQuery runQuery =

                    QueryInstanceData runData = new QueryInstanceData();

                    runData.visualAttribute("FA");
                    if (queryInstanceType.getQueryStatusType().getName().equalsIgnoreCase("completed")) {
                        XMLGregorianCalendar sCldr = queryInstanceType.getStartDate();
                        XMLGregorianCalendar eCldr = queryInstanceType.getEndDate();
                        long diff = eCldr.toGregorianCalendar().getTimeInMillis()
                                - sCldr.toGregorianCalendar().getTimeInMillis();
                        runData.tooltip("All results are available, run " + (diff / 1000) + " seconds");
                    }
                    runData.id(queryInstanceType.getQueryInstanceId());
                    // runData.patientRefId(new
                    // Integer(queryInstanceType.getRefId()).toString());
                    // runData.patientCount(new
                    // Long(queryInstanceType.getCount()).toString());
                    // XMLGregorianCalendar cldr =
                    // queryInstanceType.getStartDate();
                    /*
                     * runData.name("Results of "+
                     * "["+addZero(cldr.getMonth(
                     * ))+"-"+addZero(cldr.getDay())+"-"
                     * +addZero(cldr.getYear())+"
                     * "+addZero(cldr.getHour())+":"
                     * +addZero(cldr.getMinute())
                     * +":"+addZero(cldr.getSecond())+"]");
                     */
                    runData.name("Results of " + qdata.name().substring(0, qdata.name().indexOf("[")));
                    runData.queryName(qdata.name());
                    qdata.runs.add(runData);
                    if (!queryInstanceType.getQueryStatusType().getName().equalsIgnoreCase("completed")) {
                        runData.name(
                                runData.name() + " --- " + queryInstanceType.getQueryStatusType().getName());
                        runData.tooltip("The results of the query run");
                    }
                    //addNode(runData, node);
                    /////////////get patient sets//////////////////////
                    try {
                        xmlRequest = runData.writeContentQueryXML();

                        xmlResponse = null;
                        if (System.getProperty("webServiceMethod").equals("SOAP")) {
                            xmlResponse = QueryListNamesClient.sendQueryRequestSOAP(xmlRequest);
                        } else {
                            xmlResponse = QueryListNamesClient.sendQueryRequestREST(xmlRequest, false);
                        }
                        if (xmlResponse.equalsIgnoreCase("CellDown")) {
                            final JPanel parent = this;
                            java.awt.EventQueue.invokeLater(new Runnable() {
                                public void run() {
                                    JOptionPane.showMessageDialog(parent,
                                            "Trouble with connection to the remote server, "
                                                    + "this is often a network error, please try again",
                                            "Network Error", JOptionPane.INFORMATION_MESSAGE);
                                }
                            });
                            return null;
                        }

                        //JAXBUtil jaxbUtil = PatientSetJAXBUtil.getJAXBUtil();

                        jaxbElement = jaxbUtil.unMashallFromString(xmlResponse);
                        messageType = (ResponseMessageType) jaxbElement.getValue();
                        bt = messageType.getMessageBody();
                        ResultResponseType resultResponseType = (ResultResponseType) new JAXBUnWrapHelper()
                                .getObjectByClass(bt.getAny(), ResultResponseType.class);

                        for (QueryResultInstanceType queryResultInstanceType : resultResponseType
                                .getQueryResultInstance()) {
                            String status = queryResultInstanceType.getQueryStatusType().getName();

                            QueryResultData resultData = new QueryResultData();
                            if (queryResultInstanceType.getQueryResultType().getName().equalsIgnoreCase(
                                    "PATIENTSET") && UserInfoBean.getInstance().isRoleInProject("DATA_LDS")) {
                                resultData.visualAttribute("FA");
                            } else {
                                resultData.visualAttribute("LAO");
                            }
                            // resultData.queryId(data.queryId());
                            resultData.patientRefId(queryResultInstanceType.getResultInstanceId());// data.patientRefId());
                            resultData
                                    .patientCount(new Integer(queryResultInstanceType.getSetSize()).toString());// data.patientCount());
                            String resultname = "";
                            if ((resultname = queryResultInstanceType.getQueryResultType()
                                    .getDescription()) == null) {
                                resultname = queryResultInstanceType.getQueryResultType().getName();
                            }
                            // if (status.equalsIgnoreCase("FINISHED")) {
                            if (queryResultInstanceType.getQueryResultType().getName().equals("PATIENTSET")
                            /*|| queryResultInstanceType.getQueryResultType().getName()
                            .equals("PATIENT_COUNT_XML")*/) {
                                // if (UserInfoBean.getInstance().isRoleInProject(
                                // "DATA_OBFSC")) {
                                // resultData.name(resultname + " - "
                                // + resultData.patientCount() + " Patients");
                                // resultData.tooltip(resultData.patientCount()
                                // + " Patients");
                                // } else {
                                if (queryResultInstanceType.getDescription() != null) {
                                    resultname = queryResultInstanceType.getDescription();
                                    resultData.name(queryResultInstanceType.getDescription());
                                } else {
                                    resultData
                                            .name(resultname + " - " + resultData.patientCount() + " Patients");
                                }
                                resultData.tooltip(resultData.patientCount() + " Patients");
                                // }

                                resultData.xmlContent(xmlResponse);
                                resultData.queryName(runData.queryName());
                                resultData.type(queryResultInstanceType.getQueryResultType().getName());
                                if (!status.equalsIgnoreCase("FINISHED")) {
                                    resultData.name(resultData.name() + " --- " + status);
                                }
                                //addNode(resultData, node);
                                this.patientSets.add(resultData);
                            }
                        }
                        // }
                        // jTree1.scrollPathToVisible(new TreePath(node.getPath()));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    /////////////get patient sets//////////////////////
                }
            } catch (Exception e) {
                e.printStackTrace();
            }

            // jTree1.scrollPathToVisible(new TreePath(node.getPath()));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return "Done";
}

From source file:net.sf.taverna.cagrid.activity.CaGridActivity.java

/**
 * Load the trusted caGrid CAs' certificates and store them in 
 * the Truststore and in a special folder (inside Taverna's security 
 * conf folder) so that globus can look them up as well.
 */// ww  w  .j  a  v  a 2 s. c  o  m
private static void loadCaGridCAsCertificates() {

    // If not already done, import the caGrid Trusted CAs' certificates into Taverna's truststore
    // Get the location of Taverna's security configuration directory
    File secConfigDirectory = CMUtil.getSecurityConfigurationDirectory();
    File caGridSecConfigDirectory = new File(secConfigDirectory, "cagrid");
    caGridSecConfigDirectory.mkdirs();
    // Tructes CAs folder
    File trustedCertsDirectory = new File(caGridSecConfigDirectory, "trusted-certificates");
    trustedCertsDirectory.mkdirs();

    // Set the system property read by Globus to determine the location 
    // of the folder containing the caGrid trusted CAs' certificates 
    System.setProperty("X509_CERT_DIR", trustedCertsDirectory.getAbsolutePath());

    // Get the file which existence implies that caGrid trusted CAs have been loaded
    File caCertsLoadedFile = new File(caGridSecConfigDirectory, "trustedCAsLoaded.txt");

    if (!caCertsLoadedFile.exists() || System.getenv("TWS_USER_PROXY") != null) {
        logger.info("caGrid plugin is loading trusted certificates \n of caGrid CAs into Credential Manager.");

        if (System.getenv("TWS_USER_PROXY") == null) {
            JOptionPane.showMessageDialog(null,
                    "caGrid plugin is loading trusted certificates \n of caGrid CAs into Credential Manager.",
                    "CaGrid plugin message", JOptionPane.INFORMATION_MESSAGE);
        }
        List<String> certificateResources = new ArrayList<String>();
        certificateResources.add("1c3f2ca8.0");
        certificateResources.add("62f4fd66.0");
        certificateResources.add("68907d53.0");
        certificateResources.add("8e3e7e54.0");
        certificateResources.add("d1b603c3.0");
        certificateResources.add("ed524cf5.0");
        certificateResources.add("0ad31d10.0");
        certificateResources.add("17e36bb5.0");
        certificateResources.add("f3b3491b.0");
        certificateResources.add("d0b62510.0");//to be replaced by its CA cert

        CredentialManager cm = null;
        try {
            //TODO something wrong here, needs correction
            cm = CredentialManager.getInstance();

        } catch (CMException cmex) {
            // We are in deep trouble here - something's wrong with Credential Manager
            String exMessage = "Failed to instantiate Credential Manager - cannot load caGrid CAs' certificates.";
            JOptionPane.showMessageDialog(null, exMessage, "CaGrid plugin message", JOptionPane.ERROR_MESSAGE);
            cmex.printStackTrace();
            logger.error(exMessage);
            return;
        }

        for (String certificate : certificateResources) {
            InputStream certStream = null;
            try {
                String certificateResourcePath = "/trusted-certificates/" + certificate;
                certStream = CaGridActivity.class.getResourceAsStream(certificateResourcePath);
                CertificateFactory cf = CertificateFactory.getInstance("X.509");
                // The following should be able to load PKCS #7 certificate chain files
                // as well as ASN.1 DER or PEM-encoded (sequences of) certificates
                Collection<? extends Certificate> chain = cf.generateCertificates(certStream);
                certStream.close();
                // Use only the first cert in the chain - we know there will be only one inside 
                X509Certificate cert = (X509Certificate) chain.iterator().next();
                // Save to Credential Manager's Truststore
                cm.saveTrustedCertificate(cert);
                // Save to the trusted-certificates directory inside cagrid security conf directory
                File certificateFile = new File(trustedCertsDirectory, certificate);
                InputStream certStreamNew = null;
                BufferedOutputStream fOut = null;
                try {
                    // Reload the certificate resource
                    certStreamNew = CaGridActivity.class.getResourceAsStream(certificateResourcePath);
                    fOut = new BufferedOutputStream(new FileOutputStream(certificateFile));
                    IOUtils.copy(certStreamNew, fOut);
                } catch (Exception ex) {
                    String exMessage = "Failed to save caGrid CA's certificate " + certificate
                            + " to cagrid security folder " + certificateFile + " for globus.";
                    logger.error(exMessage, ex);
                } finally {
                    if (fOut != null) {
                        try {
                            fOut.close();
                        } catch (Exception ex) {
                            logger.error("Can't close certificate resource " + certificateFile, ex);
                        }
                    }
                    if (certStreamNew != null) {
                        try {
                            certStreamNew.close();
                        } catch (Exception ex) {
                            logger.error("Can't close certificate resource " + certificate, ex);
                        }
                    }
                }
            } catch (Exception ex) {
                String exMessage = "Failed to load or save caGrid CA's certificate " + certificate
                        + " to Truststore.";
                logger.error(exMessage, ex);
            }
        }
        Writer out = null;
        try {
            out = new BufferedWriter(new FileWriter(caCertsLoadedFile));
            out.write("true"); // just write anything to the file
        } catch (IOException e) {
            // ignore
        }
        if (out != null) {
            try {
                out.close();
            } catch (Exception ex) {
                // ignore
            }
        }
    }
}

From source file:Interfaz.rubiktimer.java

private void Limpiar4x4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Limpiar4x4ActionPerformed
    // TODO add your handling code here:
    if (img == 3) {
        ConsultaLimpiar dialog = new ConsultaLimpiar(new javax.swing.JFrame(), true, "4 x 4");
        dialog.setVisible(true);/* w w  w  .j a v  a2s.c  o m*/
        if (dialog.verif == 1) {
            listaT = new Lista();
            listaT4x4 = new Lista();
            lista5mej = new Lista();
            lista5mej4x4 = new Lista();
            lista10mej = new Lista();
            lista10mej4x4 = new Lista();
            panel4x4.removeAll();
            panel4x4.updateUI();
            panel.updateUI();
            panelGrafica.removeAll();
            panelGrafica.validate();
            dialog.verif = 0;
            actualizar_estad();
        }
    } else {
        JOptionPane.showMessageDialog(null,
                "Para eliminar la informacion de esta Categoria tiene que estar dentro de la misma (4x4)",
                "Ingrese en la categoria 4x4", JOptionPane.INFORMATION_MESSAGE);
    }
}

From source file:ca.uhn.hl7v2.testpanel.controller.Controller.java

public void showDialogInfo(String message) {
    JOptionPane.showMessageDialog(provideViewFrameIfItExists(), message, DIALOG_TITLE,
            JOptionPane.INFORMATION_MESSAGE);
}