Package info.monitorenter.gui.chart.traces

Examples of info.monitorenter.gui.chart.traces.Trace2DSimple


        eixoX.setAxisTitle(new IAxis.AxisTitle("Data da Consulta"));
       
        eixoY.setAxisTitle(new IAxis.AxisTitle("Medida"));
       
        // Create an ITrace:
        ITrace2D traceMin = new Trace2DSimple("Valores Mínimos");
        traceMin.setColor(Color.blue);
        ITrace2D traceAvg = new Trace2DSimple("Valores Médios");
        traceAvg.setColor(Color.green);
        ITrace2D traceMax = new Trace2DSimple("Valores Máximos");
        traceMax.setColor(Color.red);
       
        // Add the trace to the chart. This has to be done before adding points (deadlock prevention):
        if (chkValorMinimo.isSelected()){
            chart.addTrace(traceMin);
            traceMin.addTracePainter(new TracePainterDisc());
        }
        if (chkValorMedio.isSelected()){
            chart.addTrace(traceAvg);
            traceAvg.addTracePainter(new TracePainterDisc());
        }
        if (chkValorMax.isSelected()){
            chart.addTrace(traceMax);
            traceMax.addTracePainter(new TracePainterDisc());
        }
           
        // Add all points, as it is static:
        Object[] values = listSessoes.getSelectedValues();
        String medida = "";
        if (! listGraficos.isSelectionEmpty())
            medida = listGraficos.getSelectedValue().toString();
        double min = 180, max = 0;
        for(int i = values.length - 1; i>=0; i-- ){
            Sessao s = (Sessao) values[i];
            s.carregaMedicoes();
            if (s != null && s.getMedicoes() != null){
                for (Medicao m : s.getMedicoes()){
                    if (m.getNome().equals(medida + "min") && chkValorMinimo.isSelected()){
                        traceMin.addPoint(s.getData().getTime(), m.getValor());
                        min = (m.getValor() < min)?m.getValor():min;
                        max = (m.getValor() > max)?m.getValor():max;
                    }
                    if (m.getNome().equals(medida + "avg") && chkValorMedio.isSelected()){
                        traceAvg.addPoint(s.getData().getTime(), m.getValor());
                        min = (m.getValor() < min)?m.getValor():min;
                        max = (m.getValor() > max)?m.getValor():max;
                    }
                    if (m.getNome().equals(medida + "max") && chkValorMax.isSelected()){
                        traceMax.addPoint(s.getData().getTime(), m.getValor());
                        min = (m.getValor() < min)?m.getValor():min;
                        max = (m.getValor() > max)?m.getValor():max;
                    }
                }
            }
View Full Code Here


                        // Begin audio capture.
                        line.start();

                        runs = true;

                        Trace2DSimple g = new Trace2DSimple("bytes");
                        //g.setTracePainter(new TracePainterDisc(1));
                        chart2D1.addTrace(g);

                        // Here, stopped is a global boolean set by another thread.
                        while (runs) {
                            // Read the next chunk of data from the TargetDataLine.
                            numBytesRead =  line.read(data, 0, data.length);
                            // Save this chunk of data.
                            // out.write(data, 0, numBytesRead);
                            try {
                                g.removeAllPoints();
                                int i = new AudioInputStream(line).read(data);
                                ExtensionGUI.Input = data;
                                for (int j = 0; j < numBytesRead; j++)
                                    if (j % 100 == 0)
                                        g.addPoint(j/(float)i, data[j]);
                            } catch (Exception ex) {
                                System.out.print(ex.getMessage());
                            }
                        }
                        ExtensionGUI.Input = null;
View Full Code Here

TOP

Related Classes of info.monitorenter.gui.chart.traces.Trace2DSimple

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.