corefx - updated details panel css, changed how graph toolbar node/device selection works

This commit is contained in:
Blake J. Harnden 2018-11-30 10:21:14 -08:00
parent 467b1ea2a8
commit 4675f3a836
3 changed files with 21 additions and 26 deletions

View file

@ -168,50 +168,48 @@ public class GraphToolbar extends VBox {
private void setupNodesButton() { private void setupNodesButton() {
nodesButton.setTooltip(new Tooltip("Network Nodes (host, pc, etc)")); nodesButton.setTooltip(new Tooltip("Network Nodes (host, pc, etc)"));
nodesList.getSelectionModel().selectedItemProperty().addListener((ov, old, current) -> { nodesList.setOnMouseClicked(event -> {
if (current == null) { Label selectedLabel = nodesList.getSelectionModel().getSelectedItem();
if (selectedLabel == null) {
return; return;
} }
updateButtonValues(nodesButton, current); updateButtonValues(nodesButton, selectedLabel);
selectedNodeType = NodeType.get((int) current.getUserData()); selectedNodeType = NodeType.get((int) selectedLabel.getUserData());
logger.info("selected node type: {}", selectedNodeType); logger.info("selected node type: {}", selectedNodeType);
setSelectedEditButton(nodesButton); setSelectedEditButton(nodesButton);
devicesList.getSelectionModel().clearSelection(); devicesList.getSelectionModel().clearSelection();
controller.getNetworkGraph().setNodeType(selectedNodeType); controller.getNetworkGraph().setNodeType(selectedNodeType);
logger.info("node selected: {} - type: {}", current, selectedNodeType); logger.info("node selected: {} - type: {}", selectedLabel, selectedNodeType);
setEditMode();
}); });
JFXPopup popup = new JFXPopup(nodesList); JFXPopup popup = new JFXPopup(nodesList);
nodesButton.setOnAction(event -> { nodesButton.setOnAction(event -> popup.show(nodesButton, JFXPopup.PopupVPosition.TOP,
setEditMode(); JFXPopup.PopupHPosition.LEFT, nodesButton.getWidth(), 0));
popup.show(nodesButton, JFXPopup.PopupVPosition.TOP,
JFXPopup.PopupHPosition.LEFT, nodesButton.getWidth(), 0);
});
} }
private void setupDevicesButton() { private void setupDevicesButton() {
devicesButton.setTooltip(new Tooltip("Device Nodes (WLAN, EMANE, Switch, etc)")); devicesButton.setTooltip(new Tooltip("Device Nodes (WLAN, EMANE, Switch, etc)"));
devicesList.getSelectionModel().selectedItemProperty().addListener((ov, old, current) -> { devicesList.setOnMouseClicked(event -> {
if (current == null) { Label selectedLabel = devicesList.getSelectionModel().getSelectedItem();
if (selectedLabel == null) {
return; return;
} }
updateButtonValues(devicesButton, current); updateButtonValues(devicesButton, selectedLabel);
selectedNodeType = NodeType.get((int) current.getUserData()); selectedNodeType = NodeType.get((int) selectedLabel.getUserData());
logger.info("selected node type: {}", selectedNodeType); logger.info("selected node type: {}", selectedNodeType);
controller.getNetworkGraph().setNodeType(selectedNodeType); controller.getNetworkGraph().setNodeType(selectedNodeType);
setSelectedEditButton(devicesButton); setSelectedEditButton(devicesButton);
nodesList.getSelectionModel().clearSelection(); nodesList.getSelectionModel().clearSelection();
logger.info("device selected: {} - type: {}", current, selectedNodeType); logger.info("device selected: {} - type: {}", selectedLabel, selectedNodeType);
setEditMode();
}); });
JFXPopup popup = new JFXPopup(devicesList); JFXPopup popup = new JFXPopup(devicesList);
devicesButton.setOnAction(event -> { devicesButton.setOnAction(event -> popup.show(devicesButton, JFXPopup.PopupVPosition.TOP,
setEditMode(); JFXPopup.PopupHPosition.LEFT, devicesButton.getWidth(), 0));
popup.show(devicesButton, JFXPopup.PopupVPosition.TOP,
JFXPopup.PopupHPosition.LEFT, devicesButton.getWidth(), 0);
});
} }
@FXML @FXML

View file

@ -80,12 +80,9 @@ public class SessionsDialog extends StageDialog {
} }
public void showDialog() throws IOException { public void showDialog() throws IOException {
sessionsTable.getItems().clear();
List<SessionOverview> sessions = getCoreClient().getSessions(); List<SessionOverview> sessions = getCoreClient().getSessions();
sessionsTable.getItems().addAll(sessions.stream() List<SessionRow> rows = sessions.stream().map(SessionRow::new).collect(Collectors.toList());
.map(SessionRow::new) sessionsTable.getItems().setAll(rows);
.collect(Collectors.toList()));
show(); show();
} }
} }

View file

@ -12,7 +12,7 @@
} }
.details-label { .details-label {
-fx-background-color: slategrey; -fx-background-color: black;
-fx-pref-width: Infinity; -fx-pref-width: Infinity;
-fx-text-fill: white; -fx-text-fill: white;
-fx-alignment: center; -fx-alignment: center;