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);
}
}
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]);
}
}
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;
}
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++;
}
}
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);
}
}
Aggregations