Implemented right click, delete ability for the flight raw data paths
This commit is contained in:
@@ -210,6 +210,19 @@ public class FlightRDController extends Controller {
|
|||||||
flightTableView.setItems(FXCollections.observableArrayList(flightPoints));
|
flightTableView.setItems(FXCollections.observableArrayList(flightPoints));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deletePath() {
|
||||||
|
String toDeleteStr = flightPathListView.getSelectionModel().getSelectedItem();
|
||||||
|
String[] segments = toDeleteStr.split("_");
|
||||||
|
String pathIdClicked = segments[0];
|
||||||
|
|
||||||
|
int toDeleteIndex = theDataSet.getFlightPaths().indexOf(theDataSet.getFlightPathDictionary()
|
||||||
|
.get(Integer.parseInt(pathIdClicked)));
|
||||||
|
|
||||||
|
theDataSet.deleteFlightPath(toDeleteIndex);
|
||||||
|
flightPathListView.getItems().clear();
|
||||||
|
flightPathListView();
|
||||||
|
}
|
||||||
|
|
||||||
public void flightAnalyser(){
|
public void flightAnalyser(){
|
||||||
JOptionPane.showMessageDialog(null, "This is not Implemented yet");
|
JOptionPane.showMessageDialog(null, "This is not Implemented yet");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,14 @@
|
|||||||
<Pane prefHeight="505.0" prefWidth="162.0">
|
<Pane prefHeight="505.0" prefWidth="162.0">
|
||||||
<children>
|
<children>
|
||||||
<Button layoutX="32.0" layoutY="480.0" mnemonicParsing="false" onAction="#newPath" prefHeight="25.0" prefWidth="99.0" text="New" />
|
<Button layoutX="32.0" layoutY="480.0" mnemonicParsing="false" onAction="#newPath" prefHeight="25.0" prefWidth="99.0" text="New" />
|
||||||
<ListView fx:id="flightPathListView" layoutX="19.0" layoutY="25.0" prefHeight="444.0" prefWidth="125.0" />
|
<ListView fx:id="flightPathListView" layoutX="19.0" layoutY="25.0" prefHeight="444.0" prefWidth="125.0">
|
||||||
|
<contextMenu>
|
||||||
|
<ContextMenu>
|
||||||
|
<items>
|
||||||
|
<MenuItem mnemonicParsing="false" onAction="#deletePath" text="Delete" />
|
||||||
|
</items>
|
||||||
|
</ContextMenu>
|
||||||
|
</contextMenu></ListView>
|
||||||
<Label layoutX="16.0" text="Flight Path File(s)">
|
<Label layoutX="16.0" text="Flight Path File(s)">
|
||||||
<font>
|
<font>
|
||||||
<Font size="15.0" />
|
<Font size="15.0" />
|
||||||
|
|||||||
Reference in New Issue
Block a user