Search in sources :

Example 1 with Trace2DLtd

use of info.monitorenter.gui.chart.traces.Trace2DLtd in project ACS by ACS-Community.

the class PlotWidget method initialize.

/**
	 * This method initializes this
	 * 
	 */
private void initialize() {
    if (position == 0) {
        LayoutFactory lfct = LayoutFactory.getInstance();
        lfct.setShowTraceNameMenu(false);
        lfct.setShowPhysicalUnitsMenu(false);
        chart = new ZoomableChart();
        // Changing X Axis for time presentation
        IAxis xAxis = new AxisLinear();
        IAxis yAxis = new AxisLinear();
        chart.setAxisXBottom((AAxis) xAxis, 0);
        chart.setAxisYLeft((AAxis) yAxis, 0);
        chart.setGridColor(Color.BLACK);
        xAxis.setFormatter((IAxisLabelFormatter) new LabelFormatterDate(new SimpleDateFormat("H:mm:ss")));
        xAxis.getAxisTitle().setTitle("Time [seconds]");
        yAxis.getAxisTitle().setTitle("Property Value");
        traces = new ArrayList<Trace2DLtd>();
        chart.setSize(800, 600);
        // add the chart to the panel
        this.setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.anchor = GridBagConstraints.CENTER;
        gbc.ipadx = 10;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1;
        gbc.weighty = 1;
        ChartPanel cp = new ChartPanel(chart);
        this.add(cp, gbc);
        // create new trace for the data.
        //now are seconds no minutes
        Trace2DLtd tempTrace = new Trace2DLtd(timewindow * (int) frequency);
        tempTrace.setColor(colors[currentColor]);
        currentColor++;
        if (currentColor >= colors.length) {
            currentColor = 0;
        }
        //trace.setPhysicalUnits("Ticks", "Voltage");
        chart.addTrace(tempTrace);
        traces.add(tempTrace);
    }
}
Also used : LabelFormatterDate(info.monitorenter.gui.chart.labelformatters.LabelFormatterDate) Trace2DLtd(info.monitorenter.gui.chart.traces.Trace2DLtd) GridBagConstraints(java.awt.GridBagConstraints) ZoomableChart(info.monitorenter.gui.chart.ZoomableChart) ChartPanel(info.monitorenter.gui.chart.views.ChartPanel) GridBagLayout(java.awt.GridBagLayout) LayoutFactory(info.monitorenter.gui.chart.controls.LayoutFactory) AxisLinear(info.monitorenter.gui.chart.axis.AxisLinear) SimpleDateFormat(java.text.SimpleDateFormat) IAxis(info.monitorenter.gui.chart.IAxis)

Example 2 with Trace2DLtd

use of info.monitorenter.gui.chart.traces.Trace2DLtd in project ACS by ACS-Community.

the class TrendPnl method initialize.

/**
	 * Initialize the GUI
	 */
private void initialize() {
    setLayout(new BorderLayout());
    JPanel upperPnl = new JPanel(new BorderLayout());
    upperPnl.setBorder(BorderFactory.createTitledBorder("Number of logs in " + LogDetailsDispatcher.NUMBER_LISTENERS_INTERVAL + " secs"));
    upperPnl.add(chart, BorderLayout.CENTER);
    add(upperPnl, BorderLayout.CENTER);
    IAxis.AxisTitle xTitle = new IAxis.AxisTitle("secs");
    IAxis.AxisTitle yTitle = new IAxis.AxisTitle("num. of logs");
    chart.getAxisX().setAxisTitle(xTitle);
    chart.getAxisY().setAxisTitle(yTitle);
    // build (and add to the charts) the ITrace2D
    for (int i = 0; i < logTraces.length; i++) {
        logTraces[i] = new Trace2DLtd(pointsPerTrace, LogTypeHelper.values()[i].toString());
        chart.addTrace(logTraces[i]);
    }
}
Also used : JPanel(javax.swing.JPanel) Trace2DLtd(info.monitorenter.gui.chart.traces.Trace2DLtd) BorderLayout(java.awt.BorderLayout) IAxis(info.monitorenter.gui.chart.IAxis)

Example 3 with Trace2DLtd

use of info.monitorenter.gui.chart.traces.Trace2DLtd in project ACS by ACS-Community.

the class RemoteResponseWindow method getTrend.

/**
 * Return the Trend property value.
 * @return com.cosylab.gui.chart.BaseChart
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private Chart2D getTrend() {
    if (ivjTrend == null) {
        try {
            ivjTrend = new Chart2D();
            ivjTrend.setName("Trend");
            ivjTrend.getAxisX().getAxisTitle().setTitle("");
            ivjTrend.getAxisY().getAxisTitle().setTitle("");
            trace = new Trace2DLtd(maxLines);
            trace.setName("");
            ivjTrend.addTrace(trace);
            trace.addTracePainter(new TracePainterDisc());
        // user code begin {1}
        // user code end
        } catch (java.lang.Throwable ivjExc) {
            // user code begin {2}
            // user code end
            handleException(ivjExc);
        }
    }
    return ivjTrend;
}
Also used : Trace2DLtd(info.monitorenter.gui.chart.traces.Trace2DLtd) TracePainterDisc(info.monitorenter.gui.chart.traces.painters.TracePainterDisc) Chart2D(info.monitorenter.gui.chart.Chart2D)

Example 4 with Trace2DLtd

use of info.monitorenter.gui.chart.traces.Trace2DLtd in project ACS by ACS-Community.

the class PlotWidget method removeTrace.

public void removeTrace(String component, String property) {
    int index = 0;
    for (Trace2DLtd trace : traces) {
        if (trace.getName().equals(component + "#" + property)) {
            chart.removeTrace(trace);
            //chart.setPaintLabels(false);
            traces.remove(index);
            break;
        }
        index++;
    }
}
Also used : Trace2DLtd(info.monitorenter.gui.chart.traces.Trace2DLtd)

Example 5 with Trace2DLtd

use of info.monitorenter.gui.chart.traces.Trace2DLtd in project ACS by ACS-Community.

the class PlotWidget method initializeNewPosition.

public void initializeNewPosition(int position) {
    if (position != 0) {
        //now are seconds no minutes
        Trace2DLtd tempTrace = new Trace2DLtd(timewindow * (int) frequency);
        tempTrace.setColor(colors[currentColor]);
        currentColor++;
        if (currentColor >= colors.length) {
            currentColor = 0;
        }
        //trace.setPhysicalUnits("Ticks", "Voltage");
        chart.addTrace(tempTrace);
        traces.add(tempTrace);
    }
}
Also used : Trace2DLtd(info.monitorenter.gui.chart.traces.Trace2DLtd)

Aggregations

Trace2DLtd (info.monitorenter.gui.chart.traces.Trace2DLtd)5 IAxis (info.monitorenter.gui.chart.IAxis)2 Chart2D (info.monitorenter.gui.chart.Chart2D)1 ZoomableChart (info.monitorenter.gui.chart.ZoomableChart)1 AxisLinear (info.monitorenter.gui.chart.axis.AxisLinear)1 LayoutFactory (info.monitorenter.gui.chart.controls.LayoutFactory)1 LabelFormatterDate (info.monitorenter.gui.chart.labelformatters.LabelFormatterDate)1 TracePainterDisc (info.monitorenter.gui.chart.traces.painters.TracePainterDisc)1 ChartPanel (info.monitorenter.gui.chart.views.ChartPanel)1 BorderLayout (java.awt.BorderLayout)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 SimpleDateFormat (java.text.SimpleDateFormat)1 JPanel (javax.swing.JPanel)1