Skip to content

Commit

Permalink
refactor method and remove functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Dec 3, 2024
1 parent 66cf841 commit c8564e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/main/java/ai/nets/samj/gui/LoadingButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public LoadingButton(String text, String filePath, String filename, double anima
@Override
public void mouseReleased(MouseEvent e) {
if (isEnabled()) {
setPressed(!isSelected());
showAnimation(!isSelected());
fireActionPerformed(
new ActionEvent(LoadingButton.this,
ActionEvent.ACTION_PERFORMED,
Expand Down Expand Up @@ -163,13 +163,11 @@ private static File findJarFile(Class<?> clazz) {
}

/**
* Set the button as pressed or not pressed, changing the image displayed
* @param isPressed
* whether the button is pressed or not
* Show the animation
* @param show
* whether the animation is shown or not
*/
public void setPressed(boolean isPressed) {
super.setEnabled(!isPressed);
gifLabel.setVisible(isPressed);
this.setSelected(isPressed);
public void showAnimation(boolean show) {
gifLabel.setVisible(show);
}
}
1 change: 1 addition & 0 deletions src/main/java/ai/nets/samj/gui/MainGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ private void loadModel() {
} catch (IOException | RuntimeException | InterruptedException ex) {
ex.printStackTrace();
}
this.go.showAnimation(false);
}).start();
}

Expand Down

0 comments on commit c8564e6

Please sign in to comment.