Skip to content

Commit

Permalink
Hadn't actually tested modules properly and oh boy were they broken (…
Browse files Browse the repository at this point in the history
…and maybe still are).
  • Loading branch information
andrewauclair committed Dec 12, 2023
1 parent 4262c21 commit 865317b
Show file tree
Hide file tree
Showing 32 changed files with 160 additions and 120 deletions.
3 changes: 1 addition & 2 deletions demo-multi-app/src/basic/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ of this software and associated documentation files (the "Software"), to deal
import ModernDocking.exception.DockingLayoutException;
import ModernDocking.layouts.ApplicationLayout;
import ModernDocking.layouts.DockingLayouts;
import ModernDocking.api.WindowLayoutBuilderAPI;
import ModernDocking.settings.Settings;
import com.formdev.flatlaf.FlatDarkLaf;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.FlatLightLaf;
import com.formdev.flatlaf.intellijthemes.FlatSolarizedDarkIJTheme;
import com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubDarkIJTheme;
import docking.ui.DockingUI;
import ModernDocking.ext.ui.DockingUI;
import exception.FailOnThreadViolationRepaintManager;
import picocli.CommandLine;

Expand Down
6 changes: 0 additions & 6 deletions demo-multi-app/src/basic/MultipleInstances.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ of this software and associated documentation files (the "Software"), to deal
*/
package basic;

import docking.ui.DockingUI;
import picocli.CommandLine;

import javax.swing.*;
import java.io.File;

public class MultipleInstances {

}
2 changes: 1 addition & 1 deletion demo-single-app/src/basic/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ of this software and associated documentation files (the "Software"), to deal
package basic;

import ModernDocking.Dockable;
import ModernDocking.Docking;
import ModernDocking.app.Docking;

import javax.swing.*;
import java.awt.*;
Expand Down
2 changes: 2 additions & 0 deletions demo-single-app/src/basic/DialogWithDocking.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ of this software and associated documentation files (the "Software"), to deal

import ModernDocking.*;
import ModernDocking.api.RootDockingPanelAPI;
import ModernDocking.app.Docking;
import ModernDocking.app.RootDockingPanel;

import javax.swing.*;

Expand Down
3 changes: 3 additions & 0 deletions demo-single-app/src/basic/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ of this software and associated documentation files (the "Software"), to deal
package basic;

import ModernDocking.*;
import ModernDocking.app.AppState;
import ModernDocking.app.Docking;
import ModernDocking.app.RootDockingPanel;
import ModernDocking.exception.DockingLayoutException;

import javax.swing.*;
Expand Down
4 changes: 2 additions & 2 deletions demo-single-app/src/basic/FloatingSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ of this software and associated documentation files (the "Software"), to deal
package basic;

import ModernDocking.Dockable;
import ModernDocking.Docking;
import ModernDocking.app.Docking;
import ModernDocking.DockingRegion;
import ModernDocking.RootDockingPanel;
import ModernDocking.app.RootDockingPanel;

import javax.swing.*;
import java.awt.*;
Expand Down
3 changes: 2 additions & 1 deletion demo-single-app/src/basic/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ of this software and associated documentation files (the "Software"), to deal
package basic;

import ModernDocking.*;
import ModernDocking.app.*;
import ModernDocking.exception.DockingLayoutException;
import ModernDocking.layouts.ApplicationLayout;
import ModernDocking.layouts.DockingLayouts;
Expand All @@ -31,7 +32,7 @@ of this software and associated documentation files (the "Software"), to deal
import com.formdev.flatlaf.FlatLightLaf;
import com.formdev.flatlaf.intellijthemes.FlatSolarizedDarkIJTheme;
import com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubDarkIJTheme;
import docking.ui.DockingUI;
import ModernDocking.ext.ui.DockingUI;
import exception.FailOnThreadViolationRepaintManager;
import picocli.CommandLine;

Expand Down
2 changes: 1 addition & 1 deletion demo-single-app/src/basic/OutputPanel.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package basic;

import ModernDocking.AppState;
import ModernDocking.app.AppState;
import ModernDocking.DockableStyle;
import ModernDocking.DockingProperty;

Expand Down
3 changes: 1 addition & 2 deletions demo-single-app/src/basic/PropertiesDemoPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ of this software and associated documentation files (the "Software"), to deal
*/
package basic;

import ModernDocking.AppState;
import ModernDocking.app.AppState;
import ModernDocking.DockingProperty;
import ModernDocking.DockingRegion;
import ModernDocking.internal.DockableProperties;

import javax.swing.*;
import javax.swing.text.*;
Expand Down
4 changes: 2 additions & 2 deletions demo-single-app/src/examples/Docking_dock.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ of this software and associated documentation files (the "Software"), to deal
package examples;

import ModernDocking.Dockable;
import ModernDocking.Docking;
import ModernDocking.app.Docking;
import ModernDocking.DockingRegion;
import ModernDocking.RootDockingPanel;
import ModernDocking.app.RootDockingPanel;

import javax.swing.*;
import java.awt.*;
Expand Down
6 changes: 3 additions & 3 deletions demo-single-app/src/examples/NewWindow.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package examples;

import ModernDocking.Docking;
import ModernDocking.app.Docking;
import ModernDocking.DockingRegion;
import ModernDocking.RootDockingPanel;
import ModernDocking.app.RootDockingPanel;
import ModernDocking.ui.DefaultDockingPanel;
import docking.ui.DockingUI;
import ModernDocking.ext.ui.DockingUI;

import javax.swing.*;
import java.awt.*;
Expand Down
8 changes: 4 additions & 4 deletions demo-single-app/src/packets/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ of this software and associated documentation files (the "Software"), to deal
*/
package packets;

import ModernDocking.AppState;
import ModernDocking.DockableMenuItem;
import ModernDocking.Docking;
import ModernDocking.RootDockingPanel;
import ModernDocking.app.AppState;
import ModernDocking.app.DockableMenuItem;
import ModernDocking.app.Docking;
import ModernDocking.app.RootDockingPanel;
import ModernDocking.exception.DockingLayoutException;
import com.formdev.flatlaf.FlatDarkLaf;
import com.formdev.flatlaf.FlatLaf;
Expand Down
2 changes: 1 addition & 1 deletion demo-single-app/src/packets/PacketBytesPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ of this software and associated documentation files (the "Software"), to deal

import ModernDocking.Dockable;
import ModernDocking.DockableStyle;
import ModernDocking.Docking;
import ModernDocking.app.Docking;

import javax.swing.*;

Expand Down
2 changes: 1 addition & 1 deletion demo-single-app/src/packets/PacketInfoPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ of this software and associated documentation files (the "Software"), to deal

import ModernDocking.Dockable;
import ModernDocking.DockableStyle;
import ModernDocking.Docking;
import ModernDocking.app.Docking;

import javax.swing.*;

Expand Down
2 changes: 1 addition & 1 deletion demo-single-app/src/packets/PacketListPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ of this software and associated documentation files (the "Software"), to deal
package packets;

import ModernDocking.Dockable;
import ModernDocking.Docking;
import ModernDocking.app.Docking;

import javax.swing.*;

Expand Down
6 changes: 3 additions & 3 deletions demo-single-app/src/tests/DeregisterTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ of this software and associated documentation files (the "Software"), to deal
*/
package tests;

import ModernDocking.Docking;
import ModernDocking.app.Docking;
import ModernDocking.DockingRegion;
import ModernDocking.RootDockingPanel;
import ModernDocking.app.RootDockingPanel;
import ModernDocking.ui.DefaultDockingPanel;
import docking.ui.DockingUI;
import ModernDocking.ext.ui.DockingUI;

import javax.swing.*;
import java.awt.*;
Expand Down
5 changes: 4 additions & 1 deletion demo-single-app/src/tests/WindowLayoutBuilderTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ of this software and associated documentation files (the "Software"), to deal
package tests;

import ModernDocking.*;
import ModernDocking.app.ApplicationLayoutMenuItem;
import ModernDocking.app.Docking;
import ModernDocking.app.RootDockingPanel;
import ModernDocking.app.WindowLayoutBuilder;
import ModernDocking.event.DockingLayoutEvent;
import ModernDocking.event.DockingLayoutListener;
import ModernDocking.layouts.ApplicationLayout;
import ModernDocking.layouts.DockingLayouts;
import basic.SimplePanel;
import com.formdev.flatlaf.FlatDarkLaf;
Expand Down
15 changes: 15 additions & 0 deletions docking-api/src/ModernDocking/api/WindowLayoutBuilderAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ of this software and associated documentation files (the "Software"), to deal
import ModernDocking.DockingRegion;
import ModernDocking.layouts.*;

import java.util.HashMap;
import java.util.Map;

/**
* Utility to help create layouts without directly applying them to the actual app
*/
public class WindowLayoutBuilderAPI {
private final DockingLayoutRootNode rootNode;

private final Map<String, Map<String, String>> properties = new HashMap<>();

/**
* Start building a new layout
*
Expand Down Expand Up @@ -106,6 +111,16 @@ public WindowLayoutBuilderAPI display(String persistentID) {
return this;
}

public WindowLayoutBuilderAPI addProperty(String persistentID, String property, String value) {
Map<String, String> props = properties.getOrDefault(persistentID, new HashMap<>());

props.put(property, value);

properties.put(persistentID, props);

return this;
}

// build a WindowLayout using the rootNode
public WindowLayout build() {
return new WindowLayout(rootNode.getNode());
Expand Down
3 changes: 2 additions & 1 deletion docking-api/src/module-info.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Module for the Modern Docking framework
*/
module modern_docking {
module modern.docking.api {
requires java.desktop;
requires java.logging;

Expand All @@ -12,4 +12,5 @@
exports ModernDocking.persist;
exports ModernDocking.ui;
exports ModernDocking.api;
exports ModernDocking.internal;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package ModernDocking;
package ModernDocking.app;

import ModernDocking.Dockable;
import ModernDocking.api.AppStateAPI;
import ModernDocking.exception.DockingLayoutException;
import ModernDocking.layouts.ApplicationLayout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package ModernDocking;
package ModernDocking.app;

import ModernDocking.layouts.ApplicationLayout;
import ModernDocking.layouts.DockingLayouts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package ModernDocking;
package ModernDocking.app;

import ModernDocking.Dockable;
import ModernDocking.exception.DockableRegistrationFailureException;
import ModernDocking.internal.DockingInternal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package ModernDocking;
package ModernDocking.app;

import ModernDocking.Dockable;
import ModernDocking.DockingRegion;
import ModernDocking.api.DockingAPI;
import ModernDocking.api.RootDockingPanelAPI;
import ModernDocking.event.DockingListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package ModernDocking;
package ModernDocking.app;

import ModernDocking.api.DockingStateAPI;
import ModernDocking.layouts.ApplicationLayout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package ModernDocking;
package ModernDocking.app;

import ModernDocking.api.LayoutPersistenceAPI;
import ModernDocking.exception.DockingLayoutException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package ModernDocking;
package ModernDocking.app;

import ModernDocking.event.DockingLayoutEvent;
import ModernDocking.event.DockingLayoutListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package ModernDocking;
package ModernDocking.app;

import ModernDocking.api.RootDockingPanelAPI;
import ModernDocking.ui.ToolbarLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package ModernDocking;
package ModernDocking.app;

import ModernDocking.api.WindowLayoutBuilderAPI;

Expand Down
9 changes: 9 additions & 0 deletions docking-single-app/src/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Module for the Modern Docking framework
*/
module modern.docking.ui {
requires modern.docking.api;
requires java.desktop;

exports ModernDocking.app;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package docking.ui;
package ModernDocking.ext.ui;

import ModernDocking.internal.DockedTabbedPanel;
import ModernDocking.internal.DockingInternal;
Expand Down
Loading

0 comments on commit 865317b

Please sign in to comment.