use of kutch.biff.marvin.utility.SeriesDataSet in project Board-Instrumentation-Framework by intel.
the class LineChartWidget_MS method HandleWidgetSpecificSettings.
@Override
public boolean HandleWidgetSpecificSettings(FrameworkNode node) {
if (true == HandleChartSpecificAppSettings(node)) {
return true;
}
if (node.getNodeName().equalsIgnoreCase("Series")) {
String ID, Namespace, Label;
if (node.hasAttribute("Label")) {
Label = node.getAttribute("Label");
} else {
Label = "";
}
for (FrameworkNode newNode : node.getChildNodes()) {
if (newNode.getNodeName().equalsIgnoreCase("MinionSrc")) {
Utility.ValidateAttributes(new String[] { "ID", "Namespace" }, newNode);
if (newNode.hasAttribute("ID")) {
ID = newNode.getAttribute("ID");
} else {
LOGGER.severe("Series defined with invalid MinionSrc - no ID");
return false;
}
if (newNode.hasAttribute("Namespace")) {
Namespace = newNode.getAttribute("Namespace");
} else {
LOGGER.severe("Series defined with invalid MinionSrc - no Namespace");
return false;
}
SeriesDataSet objDS = new SeriesDataSet(Label, ID, Namespace);
getSeries().add(objDS);
}
}
return true;
}
return false;
}
use of kutch.biff.marvin.utility.SeriesDataSet in project Board-Instrumentation-Framework by intel.
the class LineChartWidget_MS method _CreateMSChart.
/**
* @param pane
* @param dataMgr
* @return
*/
@SuppressWarnings("unchecked")
protected boolean _CreateMSChart(GridPane pane, DataManager dataMgr) {
_CreateChart();
ConfigureDimentions();
ConfigureAlignment();
SetupPeekaboo(dataMgr);
ConfigureSynchronizationForMultiSource();
pane.add(getChart(), getColumn(), getRow(), getColumnSpan(), getRowSpan());
if (0 == _SeriesOrder.size()) {
for (SeriesDataSet ds : getSeries()) {
dataMgr.AddListener(ds.getID(), ds.getNamespace(), new ChangeListener() {
@Override
public void changed(ObservableValue o, Object oldVal, Object newVal) {
if (IsPaused()) {
return;
}
String strVal = newVal.toString();
double newValue = 0;
try {
newValue = Double.parseDouble(strVal);
} catch (Exception ex) {
LOGGER.severe("Invalid data for Chart received: " + strVal);
return;
}
OnDataArrived(ds, strVal);
}
});
}
} else {
SetupSeriesSets(dataMgr);
}
SetupTaskAction();
return ApplyCSS();
}
use of kutch.biff.marvin.utility.SeriesDataSet in project Board-Instrumentation-Framework by intel.
the class BaseChartWidget method SetupSeriesSets.
protected void SetupSeriesSets(DataManager dataMgr) {
for (String key : _SeriesOrder) {
SeriesSet objSeriesSet = _SeriesMap.get(key);
if (null == objSeriesSet) {
return;
}
XYChart.Series objSeries = new XYChart.Series();
String strTitle = objSeriesSet.getTitle();
if (null == strTitle) {
return;
}
objSeries.setName(strTitle);
for (SeriesDataSet objDs : objSeriesSet.getSeriesList()) {
XYChart.Data objChartDataSet;
if (isHorizontal()) {
objChartDataSet = new XYChart.Data<>(0, objDs.getTitle());
} else {
objChartDataSet = new XYChart.Data<>(objDs.getTitle(), 0);
}
objSeries.getData().add(objChartDataSet);
dataMgr.AddListener(objDs.getID(), objDs.getNamespace(), new ChangeListener() {
@Override
public void changed(ObservableValue o, Object oldVal, Object newVal) {
if (IsPaused()) {
return;
}
String strVal = newVal.toString();
double newValue;
try {
newValue = Double.parseDouble(strVal);
} catch (NumberFormatException ex) {
LOGGER.severe("Invalid data for Line Chart received: " + strVal);
return;
}
if (isHorizontal()) {
objChartDataSet.XValueProperty().set(newValue);
} else {
objChartDataSet.YValueProperty().set(newValue);
}
}
});
}
boolean fReturn = ((XYChart) getChart()).getData().add(objSeries);
}
}
use of kutch.biff.marvin.utility.SeriesDataSet in project Board-Instrumentation-Framework by intel.
the class BaseChartWidget method PushSynchronizedData.
protected void PushSynchronizedData() {
String strVal;
for (// create an entry for all
SeriesDataSet ds : // create an entry for all
getSeries()) {
strVal = SyncronizeDataSetsMap.put(ds, null);
AddNewData(ds, strVal);
}
}
use of kutch.biff.marvin.utility.SeriesDataSet in project Board-Instrumentation-Framework by intel.
the class StackedAreaChartWidget method _CreateChart.
@Override
@SuppressWarnings("unchecked")
protected void _CreateChart() {
CreateChart();
for (SeriesDataSet ds : getSeries()) {
// Stacked Charts will crash if you don't have any data in a series.
ds.getSeries().getData().add(new XYChart.Data<>(0, 0));
((StackedAreaChart) (getChart())).getData().add(ds.getSeries());
}
}
Aggregations