+ }
+
+ private void initializeIntervalElements(Composite parent) {
+ 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);
+
+ createIntervalElements(group);
+ }
+
+ private void createIntervalElements(Composite parent) {
+
+ Label label = new Label(parent, SWT.NONE);
+ label.setText("Generic");
+ intervalText = new Text(parent, SWT.BORDER);
+ addSelectionListener(intervalText);
+
+ disableUpdatesButton = new Button(parent, SWT.CHECK);
+ disableUpdatesButton.setText("Disable updates");
+ addSelectionListener(disableUpdatesButton);
+
+ }
+
+ private void initializeHideElements(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setText("Hide Elements");
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
+ GridLayoutFactory.fillDefaults().numColumns(8).margins(5, 5).applyTo(group);
+
+ createHideElements(group);
+ }
+
+ private void createHideElements(Composite parent) {
+
+ hideEdgesButton = new Button(parent, SWT.CHECK);
+ hideEdgesButton.setText("Edges");
+ addSelectionListener(hideEdgesButton);
+
+ hidePointsButton = new Button(parent, SWT.CHECK);
+ hidePointsButton.setText("Points");
+ addSelectionListener(hidePointsButton);
+
+ hideConsumersButton = new Button(parent, SWT.CHECK);
+ hideConsumersButton.setText("Consumers");
+ addSelectionListener(hideConsumersButton);
+
+ hideProducersButton = new Button(parent, SWT.CHECK);
+ hideProducersButton.setText("Producers");
+ addSelectionListener(hideProducersButton);
+
+ hideValvesButton = new Button(parent, SWT.CHECK);
+ hideValvesButton.setText("Valves");
+ addSelectionListener(hideValvesButton);
+
+ hidePumpingStationsButton = new Button(parent, SWT.CHECK);
+ hidePumpingStationsButton.setText("Pumping Stations");
+ addSelectionListener(hidePumpingStationsButton);
+ }
+
+ private void initializeStaticProperties(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setText("Static Properties");
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
+ GridLayoutFactory.fillDefaults().numColumns(8).margins(5, 5).applyTo(group);
+
+ createStaticProperties(group);
+ }
+
+ private void createStaticProperties(Composite parent) {
+
+ networkBranchesStaticPropertiesButton = new Button(parent, SWT.CHECK);
+ networkBranchesStaticPropertiesButton.setText("Network Branches");
+ addSelectionListener(networkBranchesStaticPropertiesButton);
+
+ pointsStaticPropertiesButton = new Button(parent, SWT.CHECK);
+ pointsStaticPropertiesButton.setText("Points");
+ addSelectionListener(pointsStaticPropertiesButton);
+
+ consumersStaticPropertiesButton = new Button(parent, SWT.CHECK);
+ consumersStaticPropertiesButton.setText("Consumers");
+ addSelectionListener(consumersStaticPropertiesButton);
+
+ }
+
+ private void initializeDynamicSymbols(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setText("Dynamic Symbols");
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
+ GridLayoutFactory.fillDefaults().numColumns(8).margins(5, 5).applyTo(group);
+
+ createDynamicSymbols(group);
+ }
+
+ private void createDynamicSymbols(Composite parent) {
+
+ dynamicSymbolsEdgesButton = new Button(parent, SWT.CHECK);
+ dynamicSymbolsEdgesButton.setText("Shutoff Valves in Pipes");
+ addSelectionListener(dynamicSymbolsEdgesButton);
+
+ dynamicSymbolsProducersButton = new Button(parent, SWT.CHECK);
+ dynamicSymbolsProducersButton.setText("Producers");
+ addSelectionListener(dynamicSymbolsProducersButton);
+
+ dynamicSymbolsValvesButton = new Button(parent, SWT.CHECK);
+ dynamicSymbolsValvesButton.setText("Valves");
+ addSelectionListener(dynamicSymbolsValvesButton);
+
+ dynamicSymbolsPumpingStationsButton = new Button(parent, SWT.CHECK);
+ dynamicSymbolsPumpingStationsButton.setText("Pumping Stations");
+ addSelectionListener(dynamicSymbolsPumpingStationsButton);
+ }
+
+ private void initializeEdgeArrows(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setText("Edge Arrows");
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
+ GridLayoutFactory.fillDefaults().numColumns(6).margins(5, 5).applyTo(group);
+
+ createEdgeArrowsHeaderRow(group);
+
+ edgeArrowSuppliers = new ArrayList<>();
+ {
+ try {
+ Collection<DynamicArrowObject> result = Simantics.getSession().syncRequest(new UniqueRead<Collection<DynamicArrowObject>>() {
+
+ @Override
+ public Collection<DynamicArrowObject> perform(ReadGraph graph) throws DatabaseException {
+ return DynamicVisualisationsContributions.dynamicEdgeArrowObjects(graph);
+ }
+ });
+
+ for (DynamicArrowObject object : result) {
+ edgeArrowSuppliers.add(createEdgeArrowRow(group, object));
+ }
+ } catch (DatabaseException e) {
+ LOGGER.error("Could not create coloring objecst", e);
+ }
+ }
+ }
+
+
+ private void createEdgeArrowsHeaderRow(Composite parent) {
+
+ Label label = new Label(parent, SWT.NONE);
+ label.setText("Label");
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(label);
+
+ label = new Label(parent, SWT.NONE);
+ label.setText("Used");
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(label);
+
+ label = new Label(parent, SWT.NONE);
+ label.setText("Variable");
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(label);
+
+ label = new Label(parent, SWT.NONE);
+ label.setText("Gain");
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(label);