-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
presentation refactor and slide primary struct
- Loading branch information
Showing
26 changed files
with
775 additions
and
598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
package graphical.basics.behaviors; | ||
|
||
import graphical.basics.gobject.struct.Gobject; | ||
import graphical.basics.presentation.Presentation; | ||
import graphical.basics.presentation.Animation; | ||
|
||
public class AlwaysOnTop { | ||
|
||
public static Runnable onTop(Gobject gobject) { | ||
return () ->{ | ||
Presentation.staticReference.remove(gobject); | ||
Presentation.staticReference.add(gobject); | ||
Animation.staticReference.remove(gobject); | ||
Animation.staticReference.add(gobject); | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package graphical.basics.gobject; | ||
|
||
import graphical.basics.presentation.RTAnimation; | ||
|
||
import java.awt.event.KeyEvent; | ||
import java.util.ArrayList; | ||
|
||
public abstract class Presentation extends RTAnimation { | ||
ArrayList<SaturnSlide> slideSequence = new ArrayList<>(); | ||
int index = 0; | ||
|
||
|
||
@Override | ||
public void buildAnimation() { | ||
addKeyPressedListener(x -> { | ||
if (x.getKeyCode() == KeyEvent.VK_RIGHT) { | ||
if (index < slideSequence.size() - 1) { | ||
slideSequence.get(index).perform(); | ||
if (index > 0) | ||
slideSequence.get(index - 1).remove(); | ||
index++; | ||
} | ||
} | ||
}); | ||
addKeyPressedListener(x -> { | ||
if (x.getKeyCode() == KeyEvent.VK_LEFT) { | ||
if (index > 0) { | ||
if (index > 1) { | ||
slideSequence.get(index - 2).add(); | ||
slideSequence.get(index - 1).release(); | ||
index--; | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
|
||
public void addSlide(SaturnSlide saturnSlide) { | ||
slideSequence.add(saturnSlide); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package graphical.basics.gobject; | ||
|
||
import graphical.basics.presentation.AnimationStaticReference; | ||
|
||
public interface SaturnSlide { | ||
void perform(); | ||
|
||
void revert(); | ||
|
||
void remove(); | ||
|
||
void add(); | ||
|
||
void release(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.