private Composite parent;
private Button disableUpdatesButton;
+ private Button resetVisualisationButton;
+ private Button hoveringVertexEnabledButton;
+ private Button hoveringEdgesEnabledButton;
private List<Supplier<Pair<String, DynamicArrowContribution>>> edgeArrowSuppliers;
Group group = new Group(parent, SWT.NONE);
group.setText("Interval");
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
- GridLayoutFactory.fillDefaults().numColumns(4).margins(5, 5).applyTo(group);
+ GridLayoutFactory.fillDefaults().numColumns(6).margins(5, 5).applyTo(group);
createIntervalElements(group);
}
disableUpdatesButton.setText("Disable updates");
addSelectionListener(disableUpdatesButton);
+ resetVisualisationButton = new Button(parent, SWT.CHECK);
+ resetVisualisationButton.setText("Reset Visualisation");
+ addSelectionListener(resetVisualisationButton);
+
+ hoveringVertexEnabledButton = new Button(parent, SWT.CHECK);
+ hoveringVertexEnabledButton.setText("Vertex Key Variables on Hover");
+ addSelectionListener(hoveringVertexEnabledButton);
+
+ hoveringEdgesEnabledButton = new Button(parent, SWT.CHECK);
+ hoveringEdgesEnabledButton.setText("Edge Key Variables on Hover");
+ addSelectionListener(hoveringEdgesEnabledButton);
}
private void initializeHideElements(Composite parent) {
boolean dynamicSymbolsPumpingStations = dynamicSymbolsPumpingStationsButton.getSelection();
boolean disabled = disableUpdatesButton.getSelection();
+ boolean resetVisualisation = resetVisualisationButton.getSelection();
Long interval;
try {
interval = Long.parseLong(intervalText.getText());
// ignore
interval = 2000L;
}
- long ii = interval;
+ final long finalInterval = interval;
+
+ boolean hoverVertex = hoveringVertexEnabledButton.getSelection();
+ boolean hoverEdges = hoveringEdgesEnabledButton.getSelection();
Simantics.getSession().asyncRequest(new WriteRequest() {
} else {
exist = DynamicVisualisations.createVisualisation(graph, parentResource, templateName);
}
- DynamicVisualisations.setIntervalAndDisabled(graph, exist, ii, disabled);
+ DynamicVisualisations.setIntervalAndDisabled(graph, exist, finalInterval, disabled, resetVisualisation);
DynamicVisualisations.setColorContributions(graph, exist, colorCollect);
DynamicVisualisations.setColorBarOptions(graph, exist, colorBarOptions);
DynamicVisualisations.setSizeContributions(graph, exist, sizeCollect);
dynamicSymbolsValves,
dynamicSymbolsPumpingStations
);
+ DynamicVisualisations.setKeyVariablesHover(graph, exist, hoverVertex, hoverEdges);
}
});
}
intervalText.setText(Long.toString(visualisation.getInterval()));
disableUpdatesButton.setSelection(visualisation.disabledUpdates());
+ hoveringVertexEnabledButton.setSelection(visualisation.isKeyVariablesVertexHover());
+ hoveringEdgesEnabledButton.setSelection(visualisation.isKeyVariablesEdgesHover());
+
Map<String, DynamicColorContribution> colorContributions = visualisation.getColorContributions();
for (Entry<String, DynamicColorContribution> entry : colorContributions.entrySet()) {