Skip to content

Commit

Permalink
Commit for v0.92 Alpha+ prerelease.
Browse files Browse the repository at this point in the history
  • Loading branch information
DC37 committed Dec 30, 2014
1 parent 1a6c9db commit b52aee5
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions src/smp/SuperMarioPaint.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
* Robby Mulvany's Mario Paint Composer 1.0 / 2.0 (2007-2008) <br>
* FordPrefect's Advanced Mario Sequencer (2009) <br>
* The GUI is primarily written with JavaFX2.2. <br>
*
*
* @author RehdBlob
* @since 2012.08.16
* @version 0.95
* @version 0.92
*/
public class SuperMarioPaint extends Application {

Expand Down Expand Up @@ -83,7 +83,7 @@ public class SuperMarioPaint extends Application {
* Starts three <code>Thread</code>s. One of them is currently a dummy
* splash screen, the second an <code>ImageLoader</code>, and the third one
* a <code>SoundfontLoader</code>.
*
*
* @see ImageLoader
* @see SoundfontLoader
* @see SplashScreen
Expand Down Expand Up @@ -113,7 +113,7 @@ public void init() {
/**
* Starts the application and loads the FXML file that contains a lot of the
* class hierarchy.
*
*
* @param primaryStage
* The primary stage that will be showing the main window of
* Super Mario Paint.
Expand Down Expand Up @@ -164,7 +164,7 @@ public void stop() {
* appears quite useful as a 'really exit?' type thing. This dialog
* currently needs some work, so we're not going to include it in the alpha
* release.
*
*
* @param primaryStage
* The main stage of interest.
*/
Expand Down Expand Up @@ -222,52 +222,52 @@ public void handle(ActionEvent event) {
* Creates the keyboard listeners that we will be using for various other
* portions of the program. Ctrl, alt, and shift are of interest here, but
* the arrow keys will also be considered.
*
*
* @param primaryScene
* The main window.
*/
private void makeKeyboardListeners(Scene primaryScene) {
primaryScene.addEventHandler(KeyEvent.KEY_PRESSED,
new EventHandler<KeyEvent>() {

@Override
public void handle(KeyEvent ke) {
KeyCode n = ke.getCode();
if (n == KeyCode.CONTROL) {
StateMachine.setCtrlPressed();
} else if (n == KeyCode.ALT || n == KeyCode.ALT_GRAPH) {
StateMachine.setAltPressed();
} else if (n == KeyCode.SHIFT) {
StateMachine.setShiftPressed();
}
StateMachine.updateFocusPane();
ke.consume();
}
});
@Override
public void handle(KeyEvent ke) {
KeyCode n = ke.getCode();
if (n == KeyCode.CONTROL) {
StateMachine.setCtrlPressed();
} else if (n == KeyCode.ALT || n == KeyCode.ALT_GRAPH) {
StateMachine.setAltPressed();
} else if (n == KeyCode.SHIFT) {
StateMachine.setShiftPressed();
}
StateMachine.updateFocusPane();
ke.consume();
}
});

primaryScene.addEventHandler(KeyEvent.KEY_RELEASED,
new EventHandler<KeyEvent>() {

@Override
public void handle(KeyEvent ke) {
KeyCode n = ke.getCode();
if (n == KeyCode.CONTROL) {
StateMachine.resetCtrlPressed();
} else if (n == KeyCode.ALT || n == KeyCode.ALT_GRAPH) {
StateMachine.resetAltPressed();
} else if (n == KeyCode.SHIFT) {
StateMachine.resetShiftPressed();
}
StateMachine.updateFocusPane();
ke.consume();
}
});
@Override
public void handle(KeyEvent ke) {
KeyCode n = ke.getCode();
if (n == KeyCode.CONTROL) {
StateMachine.resetCtrlPressed();
} else if (n == KeyCode.ALT || n == KeyCode.ALT_GRAPH) {
StateMachine.resetAltPressed();
} else if (n == KeyCode.SHIFT) {
StateMachine.resetShiftPressed();
}
StateMachine.updateFocusPane();
ke.consume();
}
});

}

/**
* Launches the application.
*
*
* @param args
* Sets debug options on or off.
*/
Expand Down

0 comments on commit b52aee5

Please sign in to comment.