Skip to content

Commit

Permalink
console/plugins/planning/MissionTreePanel: Cleanup.
Browse files Browse the repository at this point in the history
Changed of the cherry-pick:
Removed reference to addForMainVehiclePlan yet not yet added.
  • Loading branch information
paulosousadias committed Jul 24, 2024
1 parent a1cc428 commit bbf2ddc
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<PlanType> getSelectedPlans() {
ArrayList<NameId> selectedItems = browser.getSelectedItems();
Vector<PlanType> plans = new Vector<PlanType>();
if (selectedItems.size() > 0) {
if (!selectedItems.isEmpty()) {
for (NameId o : selectedItems) {
if (o instanceof PlanType)
plans.add((PlanType) o);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -669,7 +671,7 @@ public void mousePressed(MouseEvent e) {
// Switch
JMenu switchM = new JMenu(I18n.text("Switch"));
ArrayList<TransponderElement> 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);
Expand Down

0 comments on commit bbf2ddc

Please sign in to comment.