Skip to content

Commit

Permalink
updated code with source link
Browse files Browse the repository at this point in the history
  • Loading branch information
pauls4GE committed Oct 16, 2023
1 parent 336341e commit ad1cc7b
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

<children>

<ListView fx:id="interfaceList" prefHeight="312.0" prefWidth="285.0" HBox.hgrow="ALWAYS">
<ListView fx:id="interfaceList" onMouseClicked="#intrfaceListSelectionAction" prefHeight="312.0" prefWidth="285.0" HBox.hgrow="ALWAYS">
<HBox.margin>
<Insets />
</HBox.margin>
Expand Down Expand Up @@ -143,7 +143,7 @@
</HBox>
<HBox VBox.vgrow="ALWAYS">
<children>
<ListView fx:id="itemList" prefHeight="312.0" prefWidth="285.0" HBox.hgrow="ALWAYS">
<ListView fx:id="itemList" onMouseClicked="#itemListSelectionAction" prefHeight="312.0" prefWidth="285.0" HBox.hgrow="ALWAYS">
<HBox.margin>
<Insets />
</HBox.margin>
Expand Down Expand Up @@ -247,7 +247,7 @@
</HBox>
<HBox VBox.vgrow="ALWAYS">
<children>
<ListView fx:id="systemList" prefHeight="312.0" prefWidth="285.0" HBox.hgrow="ALWAYS">
<ListView fx:id="systemList" onMouseClicked="#systemListSelectionAction" prefHeight="312.0" prefWidth="285.0" HBox.hgrow="ALWAYS">
<HBox.margin>
<Insets />
</HBox.margin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ private void createEvidenceObjects(String rackDir) {
Artifacts.getSystemObjs().add(newEvidenceObj);
System.out.println("Created Object for " + newEvidenceObj.getId());
}

System.out.println(
"---- Creating Objects for DOCUMENT ----"); // TODO: Add description field
for (String[] row : allDOCUMENT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,21 +595,24 @@ public void populateListSystem(String filterKey, String searchKey) {
systemChart.getData().clear();

// store children releationship for this objective
systemChildrenRelation = "I/O";
systemChildrenRelation = "Interfaces";

// TODO: objective-based setting of children
for (Evidence system : currentObjObject.getOutputs().getSystemObjs()) {
if (filterKey.equalsIgnoreCase("All")
&& ((searchKey == null) || (system.getId().contains(searchKey)))) {
Label evidenceLabel = new Label();
if(system.getType().equalsIgnoreCase("System")) { // exclude items
Label evidenceLabel = new Label();

String evidenceText = system.getId() + " | Interfaces: ";
for (Evidence intrface : system.getHasInterfaces()) {
evidenceText = evidenceText + intrface.getId() + ", ";
}
String evidenceText = system.getId() + " | Interfaces: ";
for (Evidence intrface : system.getHasInterfaces()) {
evidenceText = evidenceText + intrface.getId() + ", ";
}

evidenceLabel.setText(evidenceText);
systemList.getItems().add(evidenceLabel);
evidenceLabel.setText(evidenceText);
systemList.getItems().add(evidenceLabel);

}
}
}
}
Expand Down Expand Up @@ -867,9 +870,98 @@ private void reqListSelectionAction(MouseEvent event) {
}
});
}

// Contextmenu for reqList
ContextMenu reqListContext = new ContextMenu();
MenuItem menuItemGoToSource = new MenuItem("Go to Entity Source");
reqListContext.getItems().add(menuItemGoToSource);
requirementList.setContextMenu(reqListContext);
// show source of requirement in reqchildren if right click context selected
menuItemGoToSource.setOnAction(
(rightClickEvent) -> {
// Open URL on browser

ViewUtils.openUrlInDefaultApp(
"https://github.com/ge-high-assurance/RITE/blob/arp4754/examples/ingestion-packages/OEM-Ingestion-Package-v2/data_source/requirements.pdf");
});
}
}

@FXML
private void intrfaceListSelectionAction(MouseEvent event) {

// The selected label
Label selectedLabel = interfaceList.getSelectionModel().getSelectedItem();

if (selectedLabel != null) {

// get selection
String selectedIntrfaceLine = selectedLabel.getText();
System.out.println("The selected interface line: " + selectedIntrfaceLine);
ContextMenu intrfaceListContext = new ContextMenu();
MenuItem menuItemGoToSource = new MenuItem("Go to Entity Source");
intrfaceListContext.getItems().add(menuItemGoToSource);
interfaceList.setContextMenu(intrfaceListContext);
menuItemGoToSource.setOnAction(
(rightClickEvent) -> {
// Open URL on browser

ViewUtils.openUrlInDefaultApp(
"https://github.com/ge-high-assurance/RITE/blob/arp4754/examples/ingestion-packages/OEM-Ingestion-Package-v2/data_source/interfaces.pdf");
});
}
}

@FXML
private void itemListSelectionAction(MouseEvent event) {

// The selected label
Label selectedLabel = itemList.getSelectionModel().getSelectedItem();

if (selectedLabel != null) {

// get selection
String selectedItemLine = selectedLabel.getText();
System.out.println("The selected item line: " + selectedItemLine);
ContextMenu itemListContext = new ContextMenu();
MenuItem menuItemGoToSource = new MenuItem("Go to Entity Source");
itemListContext.getItems().add(menuItemGoToSource);
itemList.setContextMenu(itemListContext);
menuItemGoToSource.setOnAction(
(rightClickEvent) -> {
// Open URL on browser

ViewUtils.openUrlInDefaultApp(
"https://github.com/ge-high-assurance/RITE/blob/arp4754/examples/ingestion-packages/OEM-Ingestion-Package-v2/data_source/systems.pdf");
});
}
}

@FXML
private void systemListSelectionAction(MouseEvent event) {

// The selected label
Label selectedLabel = systemList.getSelectionModel().getSelectedItem();

if (selectedLabel != null) {

// get selection
String selectedSystemLine = selectedLabel.getText();
System.out.println("The selected system line: " + selectedSystemLine);
ContextMenu systemListContext = new ContextMenu();
MenuItem menuSystemGoToSource = new MenuItem("Go to Entity Source");
systemListContext.getItems().add(menuSystemGoToSource);
systemList.setContextMenu(systemListContext);
menuSystemGoToSource.setOnAction(
(rightClickEvent) -> {
// Open URL on browser

ViewUtils.openUrlInDefaultApp(
"https://github.com/ge-high-assurance/RITE/blob/arp4754/examples/ingestion-packages/OEM-Ingestion-Package-v2/data_source/systems.pdf");
});
}
}

@FXML
private void docListSelectionAction(MouseEvent event) {

Expand Down

0 comments on commit ad1cc7b

Please sign in to comment.