use of javafx.beans.value.ObservableValue 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 javafx.beans.value.ObservableValue in project Board-Instrumentation-Framework by intel.
the class ButtonWidget method Create.
@Override
public boolean Create(GridPane pane, DataManager dataMgr) {
SetParent(pane);
_Button.disableProperty().set(!_InitiallyEnabled);
ConfigureDimentions();
ConfigureAlignment();
SetupPeekaboo(dataMgr);
_Button.setText(getTitle());
if (false == SetupImage()) {
return false;
}
pane.add(_Button, getColumn(), getRow(), getColumnSpan(), getRowSpan());
dataMgr.AddListener(getMinionID(), getNamespace(), new ChangeListener() {
@Override
public void changed(ObservableValue o, Object oldVal, Object newVal) {
String strVal = newVal.toString();
_Button.setText(strVal);
}
});
SetupTaskAction();
return ApplyCSS();
}
use of javafx.beans.value.ObservableValue in project Board-Instrumentation-Framework by intel.
the class ProgressIndicatorWidget method Create.
@Override
public boolean Create(GridPane pane, DataManager dataMgr) {
SetParent(pane);
ConfigureDimentions();
ConfigureAlignment();
SetupPeekaboo(dataMgr);
pane.add(_Indicator, getColumn(), getRow(), getColumnSpan(), getRowSpan());
dataMgr.AddListener(getMinionID(), getNamespace(), new ChangeListener() {
@Override
public void changed(ObservableValue o, Object oldVal, Object newVal) {
if (IsPaused()) {
return;
}
double newDialValue = 0;
String strVal = newVal.toString();
try {
newDialValue = Double.parseDouble(strVal);
} catch (Exception ex) {
LOGGER.severe("Invalid data for Progress Indicator received: " + strVal);
return;
}
if (newDialValue != 100.0) {
while (newDialValue >= 10) {
newDialValue /= 10.0;
}
}
_Indicator.setProgress(newDialValue / 10);
}
});
SetupTaskAction();
return ApplyCSS();
}
use of javafx.beans.value.ObservableValue in project Board-Instrumentation-Framework by intel.
the class QuickViewLCDWidget method Create.
@Override
public boolean Create(GridPane pane, DataManager dataMgr) {
SetParent(pane);
_dataMgr = dataMgr;
getGridPane().setAlignment(getPosition());
pane.add(getGridPane(), getColumn(), getRow(), getColumnSpan(), getRowSpan());
if (gethGap() > -1) {
getGridPane().setHgap(gethGap());
}
if (getvGap() > -1) {
getGridPane().setVgap(getvGap());
}
dataMgr.AddWildcardListener(getMinionID(), getNamespace(), new ChangeListener() {
@Override
public void changed(ObservableValue o, Object oldVal, Object newVal) {
if (IsPaused()) {
return;
}
String strVal = newVal.toString();
String[] parts = strVal.split(":");
if (parts.length > 1) {
String ID = parts[0];
String Value = parts[1];
if (_DataPointMap.containsKey(ID.toLowerCase())) {
// already made one for this!
return;
}
if (_ExclusionList.containsKey(ID.toLowerCase())) {
// not wanted
return;
}
// add the key to the map don't care about the stored value, just the key
_DataPointMap.put(ID.toLowerCase(), ID);
// didn't find it, so go make one
CreateDataWidget(ID, Value);
}
}
});
SetupPeekaboo(dataMgr);
SetupTaskAction();
return true;
}
use of javafx.beans.value.ObservableValue in project Board-Instrumentation-Framework by intel.
the class QuickViewWidget method Create.
@Override
public boolean Create(GridPane pane, DataManager dataMgr) {
SetParent(pane);
_dataMgr = dataMgr;
getGridPane().setAlignment(getPosition());
pane.add(getGridPane(), getColumn(), getRow(), getColumnSpan(), getRowSpan());
if (gethGap() > -1) {
getGridPane().setHgap(gethGap());
}
if (getvGap() > -1) {
getGridPane().setVgap(getvGap());
}
dataMgr.AddWildcardListener(getMinionID(), getNamespace(), new ChangeListener() {
@Override
public void changed(ObservableValue o, Object oldVal, Object newVal) {
if (IsPaused()) {
return;
}
String strVal = newVal.toString();
String[] parts = strVal.split(":");
if (// check to see if we have already created the widget
parts.length > 1) {
String ID = parts[0];
String Value = parts[1];
if (_DataPointMap.containsKey(ID.toLowerCase())) {
// already made one for this!
return;
}
if (_ExclusionList.containsKey(ID.toLowerCase())) {
// not wanted
return;
}
// add the key to the map don't care about the stored value, just the key
_DataPointMap.put(ID.toLowerCase(), ID);
// didn't find it, so go make one
CreateDataWidget(ID, Value);
}
}
});
SetupPeekaboo(dataMgr);
SetupTaskAction();
return true;
}
Aggregations