Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'JMRI/master' into eb-help-img
- Loading branch information
Showing
19 changed files
with
200 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
java/src/jmri/jmrit/operations/automation/actions/MessageYesNoAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package jmri.jmrit.operations.automation.actions; | ||
|
||
|
||
public class MessageYesNoAction extends Action { | ||
|
||
private static final int _code = ActionCodes.MESSAGE_YES_NO; | ||
|
||
@Override | ||
public int getCode() { | ||
return _code; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return Bundle.getMessage("MessageYesNo"); | ||
} | ||
|
||
@Override | ||
public String getActionSuccessfulString() { | ||
return Bundle.getMessage("Yes"); | ||
} | ||
|
||
@Override | ||
public String getActionFailedString() { | ||
return Bundle.getMessage("No"); | ||
} | ||
|
||
@Override | ||
public void doAction() { | ||
setRunning(true); | ||
int response = sendMessage(getAutomationItem().getMessage(), new Object[]{Bundle.getMessage("Yes"), Bundle.getMessage("No")}, true); | ||
getAutomationItem().setActionSuccessful(response != 1); | ||
setRunning(false); | ||
firePropertyChange(ACTION_COMPLETE_CHANGED_PROPERTY, false, true); | ||
} | ||
|
||
@Override | ||
public void cancelAction() { | ||
// no cancel for this action | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
java/src/jmri/jmrit/operations/automation/actions/PrintSwitchListAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package jmri.jmrit.operations.automation.actions; | ||
|
||
import jmri.jmrit.operations.locations.Location; | ||
import jmri.jmrit.operations.locations.LocationManager; | ||
import jmri.jmrit.operations.trains.Train; | ||
import jmri.jmrit.operations.trains.TrainManager; | ||
import jmri.jmrit.operations.trains.TrainSwitchLists; | ||
|
||
public class PrintSwitchListAction extends Action { | ||
|
||
private static final int _code = ActionCodes.PRINT_SWITCHLIST; | ||
|
||
@Override | ||
public int getCode() { | ||
return _code; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
if (TrainManager.instance().isPrintPreviewEnabled()) { | ||
return Bundle.getMessage("PreviewSwitchList"); | ||
} else { | ||
return Bundle.getMessage("PrintSwitchList"); | ||
} | ||
} | ||
|
||
@Override | ||
public void doAction() { | ||
if (getAutomationItem() != null) { | ||
setRunning(true); | ||
TrainSwitchLists trainSwitchLists = new TrainSwitchLists(); | ||
for (Location location : LocationManager.instance().getLocationsByNameList()) { | ||
if (location.isSwitchListEnabled()) { | ||
trainSwitchLists.buildSwitchList(location); | ||
trainSwitchLists.printSwitchList(location, TrainManager.instance().isPrintPreviewEnabled()); | ||
} | ||
} | ||
// set trains switch lists printed | ||
TrainManager.instance().setTrainsSwitchListStatus(Train.PRINTED); | ||
} | ||
finishAction(true); | ||
} | ||
|
||
@Override | ||
public void cancelAction() { | ||
// no cancel for this action | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.