only reload with new seed if simulation exists
This commit is contained in:
parent
adbe225132
commit
ac11dc90d8
1 changed files with 5 additions and 3 deletions
|
@ -24,7 +24,7 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: GUI.java,v 1.140 2009/06/30 13:10:14 nifi Exp $
|
* $Id: GUI.java,v 1.141 2009/06/30 13:31:42 nifi Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja;
|
package se.sics.cooja;
|
||||||
|
@ -4009,9 +4009,11 @@ public class GUI extends Observable {
|
||||||
GUIAction reloadRandomSimulationAction = new GUIAction("new random seed", KeyEvent.VK_N, KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK | ActionEvent.SHIFT_MASK)) {
|
GUIAction reloadRandomSimulationAction = new GUIAction("new random seed", KeyEvent.VK_N, KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK | ActionEvent.SHIFT_MASK)) {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
/* Replace seed before reloading */
|
/* Replace seed before reloading */
|
||||||
|
if (getSimulation() != null) {
|
||||||
getSimulation().setRandomSeed(getSimulation().getRandomSeed()+1);
|
getSimulation().setRandomSeed(getSimulation().getRandomSeed()+1);
|
||||||
reloadSimulationAction.actionPerformed(null);
|
reloadSimulationAction.actionPerformed(null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public boolean shouldBeEnabled() {
|
public boolean shouldBeEnabled() {
|
||||||
return getSimulation() != null;
|
return getSimulation() != null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue