Blame view

src/mior/controler/ResetAction.java 640 Bytes
89f70c1ec   glaville   import current mc...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  package mior.controler;
  
  import java.awt.event.ActionEvent;
  
  import javax.swing.SwingWorker;
  
  import mior.model.IMiorModel;
  
  public class ResetAction extends AbstractMiorAction<IMiorModel> {
  	
  	private static final long serialVersionUID = 1L;
  	
  	public ResetAction(IMiorModel model) {
  		super(model, "Reset");
  	}
  	
  	@Override
  	public void actionPerformed(ActionEvent e) {
  		setEnabled(false);
  		new SwingWorker<Void, Void>() {
  			
  			@Override
  			protected Void doInBackground() throws Exception {
  				getData().reset();
  				return null;
  			}
  			
  			@Override
  			protected void done() {
  				setEnabled(true);
  			};
  			
  		}.execute();
  	}
  
  }