Last change
on this file since 1102 was 1102, checked in by davidb, 6 years ago |
Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING
|
-
Property svn:executable
set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | package org.expeditee.items.widgets;
|
---|
2 |
|
---|
3 | import java.awt.event.ActionEvent;
|
---|
4 | import java.awt.event.ActionListener;
|
---|
5 |
|
---|
6 | import org.expeditee.gui.DisplayController;
|
---|
7 | import org.expeditee.gui.Frame;
|
---|
8 | import org.expeditee.gui.FrameGraphics;
|
---|
9 | import org.expeditee.gui.FrameIO;
|
---|
10 | import org.expeditee.items.Text;
|
---|
11 |
|
---|
12 | //Creates a button that when pressed, restores the previous action
|
---|
13 | public class RefreshButton extends ButtonWidget{
|
---|
14 |
|
---|
15 | public RefreshButton(Text source, String[] args){
|
---|
16 |
|
---|
17 | super(78, "org/expeditee/assets/images/reset.svg", source, args);
|
---|
18 |
|
---|
19 | clicked_.addActionListener(new ActionListener() {
|
---|
20 | public void actionPerformed(ActionEvent e) {
|
---|
21 |
|
---|
22 | Frame f = DisplayController.getCurrentFrame();
|
---|
23 | try{
|
---|
24 | FrameIO.ForceSaveFrame(f);
|
---|
25 | Frame g = FrameIO.LoadRestoreFrame(f);
|
---|
26 | DisplayController.setCurrentFrame(g, false);
|
---|
27 | DisplayController.requestRefresh(true);
|
---|
28 | }
|
---|
29 | catch(Exception e1){
|
---|
30 |
|
---|
31 | e1.printStackTrace();
|
---|
32 | }
|
---|
33 |
|
---|
34 | }
|
---|
35 | });
|
---|
36 | }
|
---|
37 |
|
---|
38 | @Override
|
---|
39 | protected String[] getArgs() {
|
---|
40 | // TODO Auto-generated method stub
|
---|
41 | return null;
|
---|
42 | }
|
---|
43 |
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.