From bbf2ddc17233d7a721fe124e35a9192913e232ed Mon Sep 17 00:00:00 2001 From: Paulo Dias Date: Tue, 23 Jul 2024 18:11:20 +0100 Subject: [PATCH] console/plugins/planning/MissionTreePanel: Cleanup. Changed of the cherry-pick: Removed reference to addForMainVehiclePlan yet not yet added. --- .../console/plugins/planning/MissionTreePanel.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/java/pt/lsts/neptus/console/plugins/planning/MissionTreePanel.java b/src/java/pt/lsts/neptus/console/plugins/planning/MissionTreePanel.java index d7706c5d7e..8ad0d9da08 100644 --- a/src/java/pt/lsts/neptus/console/plugins/planning/MissionTreePanel.java +++ b/src/java/pt/lsts/neptus/console/plugins/planning/MissionTreePanel.java @@ -267,15 +267,16 @@ private void updatePlanDBListener(String id) { } private void removePlanDBListener() { - if (pdbControl != null) - pdbControl.removeListener(planDBListener); + if (pdbControl != null) { + pdbControl.removeListener(planDBListener); + } } @Override public Vector getSelectedPlans() { ArrayList selectedItems = browser.getSelectedItems(); Vector plans = new Vector(); - if (selectedItems.size() > 0) { + if (!selectedItems.isEmpty()) { for (NameId o : selectedItems) { if (o instanceof PlanType) plans.add((PlanType) o); @@ -334,7 +335,7 @@ public void on(PlanSpecification msg) { @Subscribe public void on(PlanControlState msg) { - // If vehicle stops, the timers stop as well + // If vehicle stops, the timers stop as well if (msg.getState() == STATE.READY || msg.getState() == STATE.BLOCKED) { browser.transStopTimers(); this.running = false; @@ -586,8 +587,9 @@ public void mousePressed(MouseEvent e) { switch (selecType) { case Plans: - if (selectedItems.size() == 1) + if (selectedItems.size() == 1) { addActionRenamePlan(getConsole(), selectedItems, popupMenu); + } popupMenu.addSeparator(); // New @@ -669,7 +671,7 @@ public void mousePressed(MouseEvent e) { // Switch JMenu switchM = new JMenu(I18n.text("Switch")); ArrayList transponders = browser.getTransponders(); - if (transponders.size() > 0) { + if (!transponders.isEmpty()) { TransponderElement transA, transB; for (int iA = 0; iA < transponders.size(); iA++) { transA = transponders.get(iA);