-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* page rework * src import optimization * pom and readme update
- Loading branch information
1 parent
c15b56d
commit dec140e
Showing
61 changed files
with
542 additions
and
368 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
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
8 changes: 4 additions & 4 deletions
8
src/main/java/graphicsEngine/input/listeners/KeyboardListenerAdder.java
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
9 changes: 5 additions & 4 deletions
9
src/main/java/graphicsEngine/input/listeners/ListenerAdder.java
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
6 changes: 3 additions & 3 deletions
6
src/main/java/graphicsEngine/input/listeners/MouseListenerAdder.java
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
11 changes: 6 additions & 5 deletions
11
src/main/java/graphicsEngine/input/listeners/WindowListenerAdder.java
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,84 @@ | ||
package graphicsEngine.pages; | ||
|
||
import java.util.List; | ||
import java.awt.Color; | ||
import java.awt.BorderLayout; | ||
import java.awt.event.ActionListener; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import graphicsEngine.colors.ColorUtilities; | ||
import graphicsEngine.colors.SimpleColorScheme; | ||
import graphicsEngine.panels.BorderProperties; | ||
import graphicsEngine.panels.SimplePanel; | ||
import graphicsEngine.panels.DynamicPanel; | ||
import graphicsEngine.pages.panels.PanelLocation; | ||
import graphicsEngine.pages.panels.AbstractLeftPanel; | ||
import graphicsEngine.pages.panels.AbstractRightPanel; | ||
|
||
//TODO: add javadocs | ||
public abstract class FullyPaneledPage extends HeaderAndFooterPage implements HorizontalDivisionInterface { | ||
private @Nullable AbstractLeftPanel leftPanel; | ||
private @Nullable AbstractRightPanel rightPanel; | ||
private @Nullable DynamicPanel centralPanel; | ||
|
||
// | ||
public FullyPaneledPage(@Nullable List<ActionListener> actionListenerList, | ||
@Nullable Color backgroundColor) { | ||
super(actionListenerList, backgroundColor); | ||
} | ||
|
||
// | ||
@Override | ||
public final @NotNull DynamicPanel getBody(@Nullable SimpleColorScheme colors, | ||
@Nullable BorderProperties borderProperties) { | ||
return new DynamicPanel(new SimpleColorScheme( | ||
ColorUtilities.DEFAULT_COLOR_TRANSPARENT, | ||
null)) { | ||
{ | ||
setLayout(new BorderLayout(0, 0)); | ||
setSidePanels(colors, borderProperties); | ||
addSidePanels(this); | ||
setCentralPanel(borderProperties); | ||
addCentralPanel(this); | ||
} | ||
}; | ||
} | ||
|
||
private void setSidePanels(@Nullable SimpleColorScheme colors, | ||
@Nullable BorderProperties borderProperties) { | ||
leftPanel = getLeftPanel(colors, borderProperties); | ||
rightPanel = getRightPanel(colors, borderProperties); | ||
} | ||
|
||
private void addSidePanels(@NotNull DynamicPanel body) { | ||
if (leftPanel != null) { | ||
body.add(leftPanel, BorderLayout.WEST); | ||
} | ||
if (rightPanel != null) { | ||
body.add(rightPanel, BorderLayout.EAST); | ||
} | ||
} | ||
|
||
private void setCentralPanel(@Nullable BorderProperties borderProperties) { | ||
centralPanel = getCentralPanel(borderProperties); | ||
} | ||
|
||
private void addCentralPanel(@NotNull DynamicPanel body) { | ||
if (centralPanel != null) { | ||
body.add(centralPanel, BorderLayout.CENTER); | ||
} | ||
} | ||
|
||
// | ||
@Override | ||
public final @Nullable SimplePanel getPanelByLocation(@NotNull PanelLocation location) { | ||
return switch (location) { | ||
case WEST -> leftPanel; | ||
case EAST -> rightPanel; | ||
case CENTER -> centralPanel; | ||
default -> super.getPanelByLocation(location); | ||
}; | ||
} | ||
} |
Oops, something went wrong.