Example usage for java.awt Cursor HAND_CURSOR

List of usage examples for java.awt Cursor HAND_CURSOR

Introduction

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

Prototype

int HAND_CURSOR

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

Click Source Link

Document

The hand cursor type.

Usage

From source file:simMPLS.ui.simulator.JVentanaHija.java

/** Este mtodo se ejecuta cuando se mueve el ratn dentro del rea de diseo,
 * en la pantalla de Diseo. Entre otras cosas, cambia el cursor del ratn al pasar
 * sobre un elemento, permite mostrar mens emergentes coherentes con el contexto
 * de donde se encuentra el ratn, etctera.
 * @since 1.0//from  ww  w.  ja va2s .co m
 * @param evt Evento que hace que se dispare este mtodo.
 */
private void ratonSobrePanelDisenio(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonSobrePanelDisenio
    TTopology topo = escenario.getTopology();
    TTopologyElement et = topo.obtenerElementoEnPosicion(evt.getPoint());
    if (et != null) {
        this.setCursor(new Cursor(Cursor.HAND_CURSOR));
        if (et.getElementType() == TTopologyElement.NODO) {
            TNode nt = (TNode) et;
            panelDisenio.setToolTipText(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes")
                    .getString("JVentanaHija.PanelDisenio.IP") + nt.getIPAddress());
        } else if (et.getElementType() == TTopologyElement.LINK) {
            TLink ent = (TLink) et;
            panelDisenio.setToolTipText(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes")
                    .getString("JVentanaHija.panelDisenio.Retardo") + ent.obtenerDelay()
                    + java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes")
                            .getString("JVentanaHija.panelDisenio.ns"));
        }
    } else {
        this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        panelDisenio.setToolTipText(null);
    }
}

From source file:simMPLS.ui.simulator.JVentanaHija.java

/** Este mtodo se llama automticamente cuando el ratn pasa por el icono de
 * detener en la pantalla de simulacin.//w  w  w .  jav  a2s. c o m
 * @since 1.0
 * @param evt Evento que hace que se dispare este mtodo.
 */
private void ratonEntraEnIconoPausar(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonEntraEnIconoPausar
    iconoPausar.setIcon(dispensadorDeImagenes.obtenerIcono(TImagesBroker.BOTON_PAUSA_BRILLO));
    this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}

From source file:simMPLS.ui.simulator.JVentanaHija.java

/** Este mtodo se llama automticamente cuando el ratn pasa por el icono de finalizar
 * en la pantalla de simulacin./*from w w w . j  a  va  2 s.co  m*/
 * @since 1.0
 * @param evt Evento que hace que se dispare este mtodo.
 */
private void ratonEntraEnIconoFinalizar(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonEntraEnIconoFinalizar
    iconoFinalizar.setIcon(dispensadorDeImagenes.obtenerIcono(TImagesBroker.BOTON_PARAR_BRILLO));
    this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}

From source file:simMPLS.ui.simulator.JVentanaHija.java

/** Este mtodo se llama automticamente cuando el ratn pasa por el icono de
 * comenzar en la pantalla de simulacin.
 * @since 1.0/*w w  w .  j a  v  a 2s .  com*/
 * @param evt Evento que hace que se dispare este mtodo.
 */
private void ratonEntraEnIconoReanudar(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonEntraEnIconoReanudar
    iconoReanudar.setIcon(dispensadorDeImagenes.obtenerIcono(TImagesBroker.BOTON_COMENZAR_BRILLO));
    this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}

From source file:simMPLS.ui.simulator.JVentanaHija.java

/** Este mtodo se llama automticamente cuando el ratn pasa por el icono generar en
 * la pantalla de simulacin.//  w  w  w  .ja  v  a  2 s.com
 * @since 1.0
 * @param evt Evento que hace que se dispare este mtodo.
 */
private void ratonEntraEnIconoComenzar(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonEntraEnIconoComenzar
    iconoComenzar.setIcon(dispensadorDeImagenes.obtenerIcono(TImagesBroker.BOTON_GENERAR_BRILLO));
    this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}

From source file:simMPLS.ui.simulator.JVentanaHija.java

/** Este mtodo se llama automticamente cuando el ratn pasa por el icono enlace en
 * la pantalla de diseo./*from  w  w w.j av  a  2s.  c o m*/
 * @since 1.0
 * @param evt El evento que hace que se dispare este mtodo.
 */
private void ratonEntraEnIconoEnlace(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonEntraEnIconoEnlace
    iconoEnlace.setIcon(dispensadorDeImagenes.obtenerIcono(TImagesBroker.ENLACE_MENU_BRILLO));
    this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}

From source file:simMPLS.ui.simulator.JVentanaHija.java

/** Este mtodo se llama automticamente cuando el ratn pasa por el icono LSRA en
 * la pantalla de diseo./*from   ww w. j  a  v a  2 s.c  o  m*/
 * @since 1.0
 * @param evt El evento que hace que se dispare este mtodo.
 */
private void ratonEntraEnIconoLSRA(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonEntraEnIconoLSRA
    iconoLSRA.setIcon(dispensadorDeImagenes.obtenerIcono(TImagesBroker.LSRA_MENU_BRILLO));
    this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}

From source file:simMPLS.ui.simulator.JVentanaHija.java

/** Este mtodo se llama automticamente cuando el ratn pasa por el icono LSR en
 * la pantalla de diseo./*from w w w  .j a  va  2 s  .  c  om*/
 * @since 1.0
 * @param evt El evento que hace que se dispare este mtodo.
 */
private void ratonEntraEnIconoLSR(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonEntraEnIconoLSR
    iconoLSR.setIcon(dispensadorDeImagenes.obtenerIcono(TImagesBroker.LSR_MENU_BRILLO));
    this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}

From source file:Tcpbw100.java

public void testResults(String tmpstr) {
    StringTokenizer tokens;//from w  w  w .ja  va 2s  . c o  m
    int i = 0;
    String sysvar, strval;
    int sysval, Zero = 0, bwdelay, minwin;
    double sysval2, j;
    String osName, osArch, osVer, javaVer, javaVendor, client;

    tokens = new StringTokenizer(tmpstr);
    sysvar = null;
    strval = null;
    while (tokens.hasMoreTokens()) {
        if (++i % 2 == 1) {
            sysvar = tokens.nextToken();
        } else {
            strval = tokens.nextToken();
            diagnosis.append(sysvar + " " + strval + "\n");
            //we load all the key value pairs to the report, too
            //may come in handy in the future
            //TODO: strip the trailing ':' from sysvar
            report.put("web100_" + sysvar.replaceAll(":$", ""), strval);
            emailText += sysvar + " " + strval + "\n%0A";
            if (strval.indexOf(".") == -1) {
                sysval = Integer.parseInt(strval);
                save_int_values(sysvar, sysval);
            } else {
                sysval2 = Double.valueOf(strval).doubleValue();
                save_dbl_values(sysvar, sysval2);
            }
        }
    }

    // Grab some client details from the applet environment
    osName = System.getProperty("os.name");
    pub_osName = osName;

    osArch = System.getProperty("os.arch");
    pub_osArch = osArch;

    osVer = System.getProperty("os.version");
    pub_osVer = osVer;

    javaVer = System.getProperty("java.version");
    pub_javaVer = javaVer;

    javaVendor = System.getProperty("java.vendor");

    if (osArch.startsWith("x86") == true) {
        client = messages.getString("pc");
    } else {
        client = messages.getString("workstation");
    }

    // Calculate some variables and determine path conditions
    // Note: calculations now done in server and the results are shipped
    //    back to the client for printing.

    if (CountRTT > 0) {
        // Now write some messages to the screen
        if (c2sData < 3) {
            if (c2sData < 0) {
                results.append(messages.getString("unableToDetectBottleneck") + "\n");
                emailText += "Server unable to determine bottleneck link type.\n%0A";
                pub_AccessTech = "Connection type unknown";

            } else {
                results.append(messages.getString("your") + " " + client + " "
                        + messages.getString("connectedTo") + " ");
                emailText += messages.getString("your") + " " + client + " " + messages.getString("connectedTo")
                        + " ";
                if (c2sData == 1) {
                    results.append(messages.getString("dialup") + "\n");
                    emailText += messages.getString("dialup") + "\n%0A";
                    mylink = .064;
                    pub_AccessTech = "Dial-up Modem";
                } else {
                    results.append(messages.getString("cabledsl") + "\n");
                    emailText += messages.getString("cabledsl") + "\n%0A";
                    mylink = 3;
                    pub_AccessTech = "Cable/DSL modem";
                }
            }
        } else {
            results.append(messages.getString("theSlowestLink") + " ");
            emailText += messages.getString("theSlowestLink") + " ";
            if (c2sData == 3) {
                results.append(messages.getString("10mbps") + "\n");
                emailText += messages.getString("10mbps") + "\n%0A";
                mylink = 10;
                pub_AccessTech = "10 Mbps Ethernet";
            } else if (c2sData == 4) {
                results.append(messages.getString("45mbps") + "\n");
                emailText += messages.getString("45mbps") + "\n%0A";
                mylink = 45;
                pub_AccessTech = "45 Mbps T3/DS3 subnet";
            } else if (c2sData == 5) {
                results.append("100 Mbps ");
                emailText += "100 Mbps ";
                mylink = 100;
                pub_AccessTech = "100 Mbps Ethernet";

                if (half_duplex == 0) {
                    results.append(messages.getString("fullDuplex") + "\n");
                    emailText += messages.getString("fullDuplex") + "\n%0A";
                } else {
                    results.append(messages.getString("halfDuplex") + "\n");
                    emailText += messages.getString("halfDuplex") + "\n%0A";
                }
            } else if (c2sData == 6) {
                results.append(messages.getString("622mbps") + "\n");
                emailText += messages.getString("622mbps") + "\n%0A";
                mylink = 622;
                pub_AccessTech = "622 Mbps OC-12";
            } else if (c2sData == 7) {
                results.append(messages.getString("1gbps") + "\n");
                emailText += messages.getString("1gbps") + "\n%0A";
                mylink = 1000;
                pub_AccessTech = "1.0 Gbps Gigabit Ethernet";
            } else if (c2sData == 8) {
                results.append(messages.getString("2.4gbps") + "\n");
                emailText += messages.getString("2.4gbps") + "\n%0A";
                mylink = 2400;
                pub_AccessTech = "2.4 Gbps OC-48";
            } else if (c2sData == 9) {
                results.append(messages.getString("10gbps") + "\n");
                emailText += messages.getString("10gbps") + "\n%0A";
                mylink = 10000;
                pub_AccessTech = "10 Gigabit Ethernet/OC-192";

            }
        }

        if (mismatch == 1) {
            results.append(messages.getString("oldDuplexMismatch") + "\n");
            emailText += messages.getString("oldDuplexMismatch") + "\n%0A";
        } else if (mismatch == 2) {
            results.append(messages.getString("duplexFullHalf") + "\n");
            emailText += messages.getString("duplexFullHalf") + "\n%0A";
        } else if (mismatch == 4) {
            results.append(messages.getString("possibleDuplexFullHalf") + "\n");
            emailText += messages.getString("possibleDuplexFullHalf") + "\n%0A";
        } else if (mismatch == 3) {
            results.append(messages.getString("duplexHalfFull") + "\n");
            emailText += messages.getString("duplexHalfFull") + "\n%0A";
        } else if (mismatch == 5) {
            results.append(messages.getString("possibleDuplexHalfFull") + "\n");
            emailText += messages.getString("possibleDuplexHalfFull") + "\n%0A";
        } else if (mismatch == 7) {
            results.append(messages.getString("possibleDuplexHalfFullWarning") + "\n");
            emailText += messages.getString("possibleDuplexHalfFullWarning") + "\n%0A";
        }

        if (mismatch == 0) {
            if (bad_cable == 1) {
                results.append(messages.getString("excessiveErrors ") + "\n");
                emailText += messages.getString("excessiveErrors") + "\n%0A";
            }
            if (congestion == 1) {
                results.append(messages.getString("otherTraffic") + "\n");
                emailText += messages.getString("otherTraffic") + "\n%0A";
            }
            if (((2 * rwin) / rttsec) < mylink) {
                j = (float) ((mylink * avgrtt) * 1000) / 8 / 1024;
                if (j > (float) MaxRwinRcvd) {
                    results.append(messages.getString("receiveBufferShouldBe") + " " + prtdbl(j)
                            + messages.getString("toMaximizeThroughput") + " \n");
                    emailText += messages.getString("receiveBufferShouldBe") + " " + prtdbl(j)
                            + messages.getString("toMaximizeThroughput") + "\n%0A";
                }
            }
        }

        if ((tests & TEST_C2S) == TEST_C2S) {
            if (sc2sspd < (c2sspd * (1.0 - VIEW_DIFF))) {
                // TODO:  distinguish the host buffering from the middleboxes buffering
                JLabel info = new JLabel(messages.getString("information"));
                info.addMouseListener(new MouseAdapter() {

                    public void mouseClicked(MouseEvent e) {
                        showBufferedBytesInfo();
                    }

                });
                info.setForeground(Color.BLUE);
                info.setCursor(new Cursor(Cursor.HAND_CURSOR));
                info.setAlignmentY((float) 0.8);
                results.insertComponent(info);
                results.append(messages.getString("c2sPacketQueuingDetected") + "\n");
            }
        }

        if ((tests & TEST_S2C) == TEST_S2C) {
            if (s2cspd < (ss2cspd * (1.0 - VIEW_DIFF))) {
                // TODO:  distinguish the host buffering from the middleboxes buffering
                JLabel info = new JLabel(messages.getString("information"));
                info.addMouseListener(new MouseAdapter() {

                    public void mouseClicked(MouseEvent e) {
                        showBufferedBytesInfo();
                    }

                });
                info.setForeground(Color.BLUE);
                info.setCursor(new Cursor(Cursor.HAND_CURSOR));
                info.setAlignmentY((float) 0.8);
                results.insertComponent(info);
                results.append(messages.getString("s2cPacketQueuingDetected") + "\n");
            }
        }

        statistics.append("\n\t------  " + messages.getString("clientInfo") + "------\n");
        statistics.append(messages.getString("osData") + " " + messages.getString("name") + " = " + osName
                + ", " + messages.getString("architecture") + " = " + osArch);
        statistics.append(", " + messages.getString("version") + " = " + osVer + "\n");
        statistics.append(messages.getString("javaData") + ": " + messages.getString("vendor") + " = "
                + javaVendor + ", " + messages.getString("version") + " = " + javaVer + "\n");

        report.put("os_name", osName);
        report.put("os_architecture", osArch);
        report.put("os_version", osVer);
        statistics.append("Java data: Vendor = " + javaVendor + ", Version = " + javaVer + "\n");
        report.put("java_vendor", javaVendor);
        report.put("java_version", javaVer);

        // statistics.append(" java.class.version=" + System.getProperty("java.class.version") + "\n");

        statistics.append("\n\t------  " + messages.getString("web100Details") + "  ------\n");
        if (c2sData == -2)
            statistics.append(messages.getString("insufficient") + "\n");
        else if (c2sData == -1)
            statistics.append(messages.getString("ipcFail") + "\n");
        else if (c2sData == 0)
            statistics.append(messages.getString("rttFail") + "\n");
        else if (c2sData == 1)
            statistics.append(messages.getString("foundDialup") + "\n");
        else if (c2sData == 2)
            statistics.append(messages.getString("foundDsl") + "\n");
        else if (c2sData == 3)
            statistics.append(messages.getString("found10mbps") + "\n");
        else if (c2sData == 4)
            statistics.append(messages.getString("found45mbps") + "\n");
        else if (c2sData == 5)
            statistics.append(messages.getString("found100mbps") + "\n");
        else if (c2sData == 6)
            statistics.append(messages.getString("found622mbps") + "\n");
        else if (c2sData == 7)
            statistics.append(messages.getString("found1gbps") + "\n");
        else if (c2sData == 8)
            statistics.append(messages.getString("found2.4gbps") + "\n");
        else if (c2sData == 9)
            statistics.append(messages.getString("found10gbps") + "\n");

        if (half_duplex == 0)
            statistics.append(messages.getString("linkFullDpx") + "\n");
        else
            statistics.append(messages.getString("linkHalfDpx") + "\n");

        if (congestion == 0)
            statistics.append(messages.getString("congestNo") + "\n");
        else
            statistics.append(messages.getString("congestYes") + "\n");

        if (bad_cable == 0)
            statistics.append(messages.getString("cablesOk") + "\n");
        else
            statistics.append(messages.getString("cablesNok") + "\n");

        if (mismatch == 0)
            statistics.append(messages.getString("duplexOk") + "\n");
        else if (mismatch == 1) {
            statistics.append(messages.getString("duplexNok") + " ");
            emailText += messages.getString("duplexNok") + " ";
        } else if (mismatch == 2) {
            statistics.append(messages.getString("duplexFullHalf") + "\n");
            emailText += messages.getString("duplexFullHalf") + "\n%0A ";
        } else if (mismatch == 3) {
            statistics.append(messages.getString("duplexHalfFull") + "\n");
            emailText += messages.getString("duplexHalfFull") + "\n%0A ";
        }

        statistics.append("\n" + messages.getString("web100rtt") + " =  " + prtdbl(avgrtt) + " " + "ms" + "; ");
        emailText += "\n%0A" + messages.getString("web100rtt") + " = " + prtdbl(avgrtt) + " " + "ms" + "; ";

        statistics.append(messages.getString("packetsize") + " = " + CurrentMSS + " "
                + messages.getString("bytes") + "; " + messages.getString("and") + " \n");
        emailText += messages.getString("packetsize") + " = " + CurrentMSS + " " + messages.getString("bytes")
                + "; " + messages.getString("and") + " \n%0A";

        report.put("rtt", prtdbl(avgrtt));
        rttLbl.setText(prtdbl(avgrtt));
        rttLbl.setText(String.format(padding + "%.0f msec", avgrtt));
        report.put("mss", Integer.toString(CurrentMSS));
        report.put("retransmissions", Integer.toString(PktsRetrans));
        report.put("sack_blocks", Integer.toString(SACKsRcvd));
        report.put("duplicate_acks", Integer.toString(DupAcksIn));
        report.put("timeouts", Integer.toString(Timeouts));
        report.put("wait_seconds", Double.toString(waitsec));
        report.put("out_of_order", Double.toString(order));
        report.put("loss", Double.toString(loss));
        report.put("jitter", get_jitter());
        lossLbl.setText(String.format(padding + "%.0f %%", loss * 100));
        jitterLbl.setText(padding + get_jitter() + " msec");

        if (PktsRetrans > 0) {
            statistics.append(PktsRetrans + " " + messages.getString("pktsRetrans"));
            statistics.append(", " + DupAcksIn + " " + messages.getString("dupAcksIn"));
            statistics.append(", " + messages.getString("and") + " " + SACKsRcvd + " "
                    + messages.getString("sackReceived") + "\n");
            emailText += PktsRetrans + " " + messages.getString("pktsRetrans");
            emailText += ", " + DupAcksIn + " " + messages.getString("dupAcksIn");
            emailText += ", " + messages.getString("and") + " " + SACKsRcvd + " "
                    + messages.getString("sackReceived") + "\n%0A";
            if (Timeouts > 0) {
                statistics.append(messages.getString("connStalled") + " " + Timeouts + " "
                        + messages.getString("timesPktLoss") + "\n");
            }

            statistics.append(messages.getString("connIdle") + " " + prtdbl(waitsec) + " "
                    + messages.getString("seconds") + " (" + prtdbl((waitsec / timesec) * 100)
                    + messages.getString("pctOfTime") + ")\n");
            emailText += messages.getString("connStalled") + " " + Timeouts + " "
                    + messages.getString("timesPktLoss") + "\n%0A";
            emailText += messages.getString("connIdle") + " " + prtdbl(waitsec) + " "
                    + messages.getString("seconds") + " (" + prtdbl((waitsec / timesec) * 100)
                    + messages.getString("pctOfTime") + ")\n%0A";
        } else if (DupAcksIn > 0) {
            statistics.append(messages.getString("noPktLoss1") + " - ");
            statistics.append(messages.getString("ooOrder") + " " + prtdbl(order * 100)
                    + messages.getString("pctOfTime") + "\n");
            emailText += messages.getString("noPktLoss1") + " - ";
            emailText += messages.getString("ooOrder") + " " + prtdbl(order * 100)
                    + messages.getString("pctOfTime") + "\n%0A";
        } else {
            statistics.append(messages.getString("noPktLoss2") + ".\n");
            emailText += messages.getString("noPktLoss2") + ".\n%0A";
        }

        if ((tests & TEST_C2S) == TEST_C2S) {
            if (c2sspd > sc2sspd) {
                if (sc2sspd < (c2sspd * (1.0 - VIEW_DIFF))) {
                    statistics.append(messages.getString("c2s") + " " + messages.getString("qSeen") + ": "
                            + prtdbl(100 * (c2sspd - sc2sspd) / c2sspd) + "%\n");
                } else {
                    statistics.append(messages.getString("c2s") + " " + messages.getString("qSeen") + ": "
                            + prtdbl(100 * (c2sspd - sc2sspd) / c2sspd) + "%\n");
                }
            }
        }

        if ((tests & TEST_S2C) == TEST_S2C) {
            if (ss2cspd > s2cspd) {
                if (s2cspd < (ss2cspd * (1.0 - VIEW_DIFF))) {
                    statistics.append(messages.getString("s2c") + " " + messages.getString("qSeen") + ": "
                            + prtdbl(100 * (ss2cspd - s2cspd) / ss2cspd) + "%\n");
                } else {
                    statistics.append(messages.getString("s2c") + " " + messages.getString("qSeen") + ": "
                            + prtdbl(100 * (ss2cspd - s2cspd) / ss2cspd) + "%\n");
                }
            }
        }

        if (rwintime > .015) {
            statistics.append(messages.getString("thisConnIs") + " " + messages.getString("limitRx") + " "
                    + prtdbl(rwintime * 100) + messages.getString("pctOfTime") + ".\n");
            emailText += messages.getString("thisConnIs") + " " + messages.getString("limitRx") + " "
                    + prtdbl(rwintime * 100) + messages.getString("pctOfTime") + ".\n%0A";
            pub_pctRcvrLimited = rwintime * 100;

            // I think there is a bug here, it sometimes tells you to increase the buffer
            // size, but the new size is smaller than the current.

            if (((2 * rwin) / rttsec) < mylink) {
                statistics.append("  " + messages.getString("incrRxBuf") + " (" + prtdbl(MaxRwinRcvd / 1024)
                        + " KB) " + messages.getString("willImprove") + "\n");
            }
        }
        if (sendtime > .015) {
            statistics.append(messages.getString("thisConnIs") + " " + messages.getString("limitTx") + " "
                    + prtdbl(sendtime * 100) + messages.getString("pctOfTime") + ".\n");
            emailText += messages.getString("thisConnIs") + " " + messages.getString("limitTx") + " "
                    + prtdbl(sendtime * 100) + messages.getString("pctOfTime") + ".\n%0A";
            if ((2 * (swin / rttsec)) < mylink) {
                statistics.append("  " + messages.getString("incrTxBuf") + " (" + prtdbl(Sndbuf / 2048)
                        + " KB) " + messages.getString("willImprove") + "\n");
            }
        }
        if (cwndtime > .005) {
            statistics.append(messages.getString("thisConnIs") + " " + messages.getString("limitNet") + " "
                    + prtdbl(cwndtime * 100) + messages.getString("pctOfTime") + ".\n");
            emailText += messages.getString("thisConnIs") + " " + messages.getString("limitNet") + " "
                    + prtdbl(cwndtime * 100) + messages.getString("pctOfTime") + ".\n%0A";
            // if (cwndtime > .15)
            //   statistics.append("  Contact your local network administrator to report a network problem\n");
            // if (order > .15)
            //   statistics.append("  Contact your local network admin and report excessive packet reordering\n");
        }
        if ((spd < 4) && (loss > .01)) {
            statistics.append(messages.getString("excLoss") + "\n");
        }

        statistics.append("\n" + messages.getString("web100tcpOpts") + " \n");
        statistics.append("RFC 2018 Selective Acknowledgment: ");
        if (SACKEnabled == Zero)
            statistics.append(messages.getString("off") + "\n");
        else
            statistics.append(messages.getString("on") + "\n");

        statistics.append("RFC 896 Nagle Algorithm: ");
        if (NagleEnabled == Zero)
            statistics.append(messages.getString("off") + "\n");
        else
            statistics.append(messages.getString("on") + "\n");

        statistics.append("RFC 3168 Explicit Congestion Notification: ");
        if (ECNEnabled == Zero)
            statistics.append(messages.getString("off") + "\n");
        else
            statistics.append(messages.getString("on") + "\n");

        statistics.append("RFC 1323 Time Stamping: ");
        if (TimestampsEnabled == 0)
            statistics.append(messages.getString("off") + "\n");
        else
            statistics.append(messages.getString("on") + "\n");

        statistics.append("RFC 1323 Window Scaling: ");
        if (MaxRwinRcvd < 65535)
            WinScaleRcvd = 0;
        if ((WinScaleRcvd == 0) || (WinScaleRcvd > 20)) {
            statistics.append(messages.getString("off") + "\n");
            report.put("window_scaling", "0");
        } else {
            statistics.append(messages.getString("on") + "; " + messages.getString("scalingFactors") + " -  "
                    + messages.getString("server") + "=" + WinScaleRcvd + ", " + messages.getString("client")
                    + "=" + WinScaleSent + "\n");
            report.put("window_scaling", "1");
        }
        statistics.append("\n");

        if ((tests & TEST_SFW) == TEST_SFW) {
            switch (c2sResult) {
            case SFW_NOFIREWALL:
                statistics.append(messages.getString("server") + " '" + host + "' "
                        + messages.getString("firewallNo") + "\n");
                emailText += messages.getString("server") + " '" + host + "' "
                        + messages.getString("firewallNo") + "\n%0A";
                break;
            case SFW_POSSIBLE:
                statistics.append(messages.getString("server") + " '" + host + "' "
                        + messages.getString("firewallYes") + "\n");
                emailText += messages.getString("server") + " '" + host + "' "
                        + messages.getString("firewallYes") + "\n%0A";
                break;
            case SFW_UNKNOWN:
            case SFW_NOTTESTED:
                break;
            }
            switch (s2cResult) {
            case SFW_NOFIREWALL:
                statistics
                        .append(messages.getString("client2") + " " + messages.getString("firewallNo") + "\n");
                emailText += messages.getString("client2") + " " + messages.getString("firewallNo") + "\n%0A";
                break;
            case SFW_POSSIBLE:
                statistics
                        .append(messages.getString("client2") + " " + messages.getString("firewallYes") + "\n");
                emailText += messages.getString("client2") + " " + messages.getString("firewallYes") + "\n%0A";
                break;
            case SFW_UNKNOWN:
            case SFW_NOTTESTED:
                break;
            }
        }

        //         diagnosis.append("\nEstimate = " + prtdbl(estimate) + " based on packet size = "
        //            + (CurrentMSS*8/1024) + "kbits, RTT = " + prtdbl(avgrtt) + "msec, " + "and loss = " + loss + "\n");
        diagnosis.append("\n");

        diagnosis.append(messages.getString("theoreticalLimit") + " " + prtdbl(estimate) + " " + "Mbps\n");
        emailText += messages.getString("theoreticalLimit") + " " + prtdbl(estimate) + " Mbps\n%0A";

        diagnosis.append(messages.getString("ndtServerHas") + " " + prtdbl(Sndbuf / 2048) + " "
                + messages.getString("kbyteBufferLimits") + " " + prtdbl(swin / rttsec) + " Mbps\n");
        emailText += messages.getString("ndtServerHas") + " " + prtdbl(Sndbuf / 2048) + " "
                + messages.getString("kbyteBufferLimits") + " " + prtdbl(swin / rttsec) + " Mbps\n%0A";

        diagnosis.append(messages.getString("yourPcHas") + " " + prtdbl(MaxRwinRcvd / 1024) + " "
                + messages.getString("kbyteBufferLimits") + " " + prtdbl(rwin / rttsec) + " Mbps\n");
        emailText += messages.getString("yourPcHas") + " " + prtdbl(MaxRwinRcvd / 1024) + " "
                + messages.getString("kbyteBufferLimits") + " " + prtdbl(rwin / rttsec) + " Mbps\n%0A";

        diagnosis.append(messages.getString("flowControlLimits") + " " + prtdbl(cwin / rttsec) + " Mbps\n");
        emailText += messages.getString("flowControlLimits") + " " + prtdbl(cwin / rttsec) + " Mbps\n%0A";

        diagnosis.append("\n" + messages.getString("clientDataReports") + " '" + prttxt(c2sData) + "', "
                + messages.getString("clientAcksReport") + " '" + prttxt(c2sAck) + "'\n"
                + messages.getString("serverDataReports") + " '" + prttxt(s2cData) + "', "
                + messages.getString("serverAcksReport") + " '" + prttxt(s2cAck) + "'\n");
        pub_diagnosis = diagnosis.getText();

    }
}

From source file:simMPLS.ui.simulator.JVentanaHija.java

/** Este mtodo se llama automticamente cuando el ratn pasa por el icono LERA en
 * la pantalla de diseo.//from   w  w  w  .j  a v a2 s  .  co  m
 * @since 1.0
 * @param evt El evento que hace que se dispare este mtodo.
 */
private void ratonEntraEnIconoLERA(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonEntraEnIconoLERA
    iconoLERA.setIcon(dispensadorDeImagenes.obtenerIcono(TImagesBroker.LERA_MENU_BRILLO));
    this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}