From dd6fec890606c85d5017b004aec916b81c2886de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zkan=20Pakdil?= Date: Sun, 10 Mar 2024 15:38:04 +0000 Subject: [PATCH 01/19] - javafx moved to 21 - java moved to 17 - demo moved to test --- .idea/codeStyles/Project.xml | 7 + .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/compiler.xml | 13 ++ .idea/copilot/chatSessions/00000000000.xd | Bin 0 -> 5451 bytes .idea/copilot/chatSessions/blobs/version | Bin 0 -> 4 bytes .idea/copilot/chatSessions/xd.lck | 47 ++++++ .idea/encodings.xml | 7 + .idea/jarRepositories.xml | 20 +++ .idea/misc.xml | 12 ++ .idea/runConfigurations/DockFX.xml | 18 +++ .idea/vcs.xml | 6 + .idea/workspace.xml | 143 ++++++++++++++++++ README.md | 15 ++ pom.xml | 140 ++++++++++++++++- src/main/java/org/dockfx/DockEvent.java | 7 +- src/main/java/org/dockfx/demo/DockFX.java | 168 --------------------- src/test/java/org/dockfx/DockNodeTest.java | 11 ++ src/test/java/org/dockfx/demo/DockFX.java | 156 +++++++++++++++++++ 18 files changed, 593 insertions(+), 182 deletions(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/copilot/chatSessions/00000000000.xd create mode 100644 .idea/copilot/chatSessions/blobs/version create mode 100644 .idea/copilot/chatSessions/xd.lck create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/runConfigurations/DockFX.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml delete mode 100644 src/main/java/org/dockfx/demo/DockFX.java create mode 100644 src/test/java/org/dockfx/DockNodeTest.java create mode 100644 src/test/java/org/dockfx/demo/DockFX.java diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..919ce1f --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..ad8297a --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copilot/chatSessions/00000000000.xd b/.idea/copilot/chatSessions/00000000000.xd new file mode 100644 index 0000000000000000000000000000000000000000..dcd853de35584f608d4e1805c0b72368ceecf3ae GIT binary patch literal 5451 zcmcIoYiv{39Y4NK{I(O4ux>nBkFWt1N#nerXh=Y5Ml(oJJEfG0RgQf_E-|+22at+R zJ}36^>&8hS?-vmAgi;DrnmWF0)jq79Hci_;OxrYRt+Wr-KA??h+SCvGpL=a{o#eW% zrbWv6-}67e`+wha{>KE92*#0U1RukM!1G8yj*uukkQf^%8{%w8uptSaMX-zraSrDjSXOvC;H^jpiS*(ejYu+siJWU-0-sb*>&~ zsJ;&V1aF8Bc%7d5ARh_|-m^i*L?{B9Zp;>-yF9+GHo?Om=e=h`Jwe1p`YE29D!}mG zkPzyt5B2%^AP9+4yfm*0s15KJ_&|^cV2t9Ki2|TU@b>2ABq(0EuClCyjcx2);Y^E{6`GHgp`lf=;0yAU8UP{OAI@j0k!k{SN(8^R(um#;wU{exmt|v*AeW znWz|uQE_&nBkb`&D%}D|vj_NYrz_+O@NU!x!igBegyUYPIEpQOQFTQeR#jw(iEmIU z-k3Q8MG)L&_bT=I1AGt?pH&toQI7j4tFAj%MBO7*br)k|dz^~z-^sah6!Q4ud4H(y zWI#CY4D=m`>iE91%fknE@3A}meviPM1y_^(RMM_>Nbb6+x_+%+T|X7u6I6Wfc255Z zXD|Om=LPzZ*==QY~X(L`3e_MW7_D_%r@5&z?2dvdM*lMn;hXI1?Ju~c4vnH+(x zgt`S~0o4ffCB)+?Dt>S;7lAh6QU`z584@n=Z62R9blB@Y>I*{#m|1JHFi6F$9c2%+ z_p+9pOBS)@3spz=6eUbd9#r6S8Zr&)^O{C3L;DfMLXE%=822={l z0jLG_eK;>qL&?0_Hk${5tfgYRTpnm5gw>mj+pmq8~l%|ug-9cR*4j~C%cN=83VV9h7Y?|1#8H|N;lw$|yF!vWErW)Gd;paZI+-5h^r!UQ z`mjExpVQydf2jXh|6BcM`o{pm2sF`n9BU-WG(Lbig=8AfV69RzgO*8>Xa4c{@GFuZ2yHiQgO!-!#- zCX#WNoJ2$t?6@)fi6)a6Wtk)?@g9v2#4tt}(ab7Ah_vo&Y-)BiwbpgJT3vO`-4176 zS8GdmT|;AQYlE|;ao_%CDBa900;SQxU$n!%#~KFMgnVB631`67V|O&{wKq02HrpLd z2bx;}EE2?#>}LbhG(lQ&)aUALI|Z{L0-5l=-Rt!FoxN_sBjd|)1Zgt6XGe|F>$<|J zK0hTH_MICo#{EX#7%~#$sByvgU~rK3BaH^*|M6jHFg~m?J;j-96NBT44>cw`XDZhk zzbG^Qqultp&iEI-@%Q6HgE*~$KTxRQKq(m?mN_tCJPqz2zmmi;X@)Vm%DTuA9HFDj zizP)Hkx`Z^(>ru*WyuRMcPV2INALQWBQhqva+i*$61m7DGA=Pcr4z}x8{*%62@*ab z@%}|8GomsJh)l8tvzbn%61iL;G9@v0(rG1gT4Fv=XOzqtiPn!bbZ(d+BWY}Es&_Ou?`x@V+z-4#f=t9w-%{UD-{NTAkH{Qr zCCt6%q)M(|(i1egR^?I62O`Y%t}V zU2yZxC#E2>C|Uk*x->XYU=SipY{jyjE)S#?W+AdH@%N3d+`>zxeL?WOLF>l_1{f); z%`j5lArajV2iZ)22(A=SZ0M1Q@v=m$Wmg!}cH}A}70-@P93z#LM`gOHQ>IltGOZ5D zw5Cs{n|Hze1n^%wEz_rbGX1)COyYlIn@qPjWV*FYrrX|->2{Y)pMGv!!avg~Q@dNH z-|Ug;4v$Q0{W9Gdmg%=PPe|{5`#G8J`mRiOzYKJ8wBTT6H=7`wr6>ZfZgA^?wOXgg z^QPdwgtQUxZ^QQ;@cvDe_Z^D&;g+`Mu9G|1!2~V>SyEee!1C-m?d+z+tk*_{)@jeK zDYQdQ*Lax2(U74t;LjdgcNIN#V^4H_IN6;PjR?v6@; z!Xv2Q)y0B*7630eJz<`ut^sKxP=h659e{=UD+${OSg5&@uuXu4`YQ?B4A{vMu`Pgw zUjj;!+X~p}60!RLJ5wxEtmx;8WlC8W@GHfwCACaBYV(A3XBMQ1?Z=H`M!F%LGzai+Rj?&%ecr2!FK$sZJ4uMMs1dUOUg2AnXp{5EV27} z`6J66%LkT+mX9o-Sbk&qgXL4p=a#=){$u5=CTo>-i*<+fS!<*9fc1#A-TI34w6)86 z&Kj`3Z6)mbVNF?=te;r_YBSmPY)fVSCs1bKBo4Dk~fnrz>d1{fa+Vnkri> zyDBr4Kd$`arm{_rO=mROUjsHJrQZV%-dx$cSZaT6F6_^%1WFTB@cP3cWF~Z4oG55l ztLBvrYXX~PB#ATN#$936FK8x4Ko}yK(d3nNom180e9JU3IF^THfz1$iU<;K4DRf2coU)wQPeN0Yq z^~=?r$`n_hsdj($6j%3tl_XaOOG>kSd9`x2pjVx~zdpn@CyfuP9zW@xrtc#nbx$=H irE~qw6)8?z%f8h08d1&lnyc#7{eN+N>*}ic_J0A}bE5VD literal 0 HcmV?d00001 diff --git a/.idea/copilot/chatSessions/blobs/version b/.idea/copilot/chatSessions/blobs/version new file mode 100644 index 0000000000000000000000000000000000000000..720d64f4baafc33efdf971f02084aca5f25b34a5 GIT binary patch literal 4 LcmZQzU|<9Q00jU7 literal 0 HcmV?d00001 diff --git a/.idea/copilot/chatSessions/xd.lck b/.idea/copilot/chatSessions/xd.lck new file mode 100644 index 0000000..5d40252 --- /dev/null +++ b/.idea/copilot/chatSessions/xd.lck @@ -0,0 +1,47 @@ +Private property of Exodus: 261420@ozmint-MACH-WX9 + +jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:88) +jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:39) +jetbrains.exodus.io.FileDataWriter.lock(FileDataWriter.kt:70) +jetbrains.exodus.log.Log.tryLock(Log.kt:804) +jetbrains.exodus.log.Log.(Log.kt:117) +jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:117) +jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:81) +jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:77) +jetbrains.exodus.env.Environments$newInstance$4.invoke(Environments.kt:46) +jetbrains.exodus.env.Environments$newInstance$4.invoke(Environments.kt:46) +jetbrains.exodus.env.Environments.prepare(Environments.kt:120) +jetbrains.exodus.env.Environments.newInstance(Environments.kt:46) +kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore(EntityStoreHelper.kt:40) +kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore(EntityStoreHelper.kt:31) +kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore$default(EntityStoreHelper.kt:30) +com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.initStore(XdChatSessionPersistenceService.kt:115) +com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.(XdChatSessionPersistenceService.kt:22) +com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.(XdChatSessionPersistenceService.kt:15) +com.github.copilot.chat.session.persistence.ChatSessionPersistenceServiceKt.ChatSessionPersistenceService(ChatSessionPersistenceService.kt:43) +com.github.copilot.chat.session.persistence.ChatSessionPersistenceServiceKt.chatSessionsPersistenceService(ChatSessionPersistenceService.kt:53) +com.github.copilot.chat.session.ChatSessionManager.(ChatSessionManager.kt:45) +com.github.copilot.chat.session.ChatSessionManager.(ChatSessionManager.kt:25) +com.github.copilot.chat.window.CopilotChatToolWindow.onCopilotReady(CopilotChatToolWindow.kt:133) +com.github.copilot.chat.window.CopilotChatToolWindow.access$onCopilotReady(CopilotChatToolWindow.kt:40) +com.github.copilot.chat.window.CopilotChatToolWindow$initCopilotStatusListener$1.invoke(CopilotChatToolWindow.kt:118) +com.github.copilot.chat.window.CopilotChatToolWindow$initCopilotStatusListener$1.invoke(CopilotChatToolWindow.kt:115) +com.github.copilot.status.CopilotAuthStatusKt.subscribeToCopilotAuthStatus$lambda$0(CopilotAuthStatus.kt:44) +com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:700) +com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:664) +com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:423) +com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:402) +com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1) +com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:461) +jdk.proxy8/jdk.proxy8.$Proxy189.onCopilotStatus(Unknown Source) +com.github.copilot.status.CopilotStatusService.notifyApplication(CopilotStatusService.java:76) +com.github.copilot.status.CopilotStatusService.notifyApplication(CopilotStatusService.java:64) +com.github.copilot.github.GitHubAuthStartupActivity.handleAuthNotifications(GitHubAuthStartupActivity.java:54) +com.github.copilot.github.GitHubAuthStartupActivity.execute(GitHubAuthStartupActivity.java:35) +com.intellij.ide.startup.impl.StartupManagerImplKt$launchActivity$1.invokeSuspend(StartupManagerImpl.kt:482) +kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) +kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) +kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) +kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) +kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) +kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..512b2e9 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/DockFX.xml b/.idea/runConfigurations/DockFX.xml new file mode 100644 index 0000000..fc1eb32 --- /dev/null +++ b/.idea/runConfigurations/DockFX.xml @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..65c6987 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "associatedIndex": 8 +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1710064958983 + + + + + + + true + + \ No newline at end of file diff --git a/README.md b/README.md index ee397f0..7214dd3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ +# how it looks +[Local screen record](https://github.com/ozkanpakdil/DockFX/assets/604405/2a6e7c72-9fe8-45ed-a036-f99fbcae724f) + +# requirements +Download the SDK from https://gluonhq.com/products/javafx/ and extract it to a folder, then add the path to the folder to the module path in the command below. in my case /home/oz-mint/tools/javafx-sdk-21.0.2/lib + +# demo.dockFX local run command +I am leaving the all parameters below for linux below, change it accordingly to your system + +```bash +/home/oz-mint/.sdkman/candidates/java/22.1.0.1.r17-gln/bin/java --module-path /home/oz-mint/tools/javafx-sdk-21.0.2/lib --add-modules=javafx.controls,javafx.web --add-exports=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.css=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.scene.input=ALL-UNNAMED -javaagent:/home/oz-mint/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate/lib/idea_rt.jar=36879:/home/oz-mint/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate/bin -Dfile.encoding=UTF-8 -classpath /home/oz-mint/Downloads/DockFX/target/classes:/home/oz-mint/.m2/repository/org/openjfx/javafx-web/21/javafx-web-21.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-web/21/javafx-web-21-linux.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-media/21/javafx-media-21.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-media/21/javafx-media-21-linux.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-controls/21/javafx-controls-21.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-controls/21/javafx-controls-21-linux.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-graphics/21/javafx-graphics-21.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-graphics/21/javafx-graphics-21-linux.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-base/21/javafx-base-21.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-base/21/javafx-base-21-linux.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-fxml/21/javafx-fxml-21.jar:/home/oz-mint/.m2/repository/org/openjfx/javafx-fxml/21/javafx-fxml-21-linux.jar org.dockfx.demo.DockFX +``` + +I added run configuration and intellij files just for future, configuring javafx in local is complex. + # DockFX [![Build Status](https://goombert.visualstudio.com/DockFX/_apis/build/status/RobertBColton.DockFX?branchName=master)](https://goombert.visualstudio.com/DockFX/_build/latest?definitionId=1&branchName=master) diff --git a/pom.xml b/pom.xml index 1b45b96..489cbc3 100644 --- a/pom.xml +++ b/pom.xml @@ -3,20 +3,77 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.dockfx + io.github.ozkanpakdildockfxjar - 0.4-SNAPSHOT + 0.0.4DockFX - https://github.com/RobertBColton/DockFX.git + https://github.com/ozkanpakdil/DockFX.git + A fully featured docking library for the JavaFX platform. - 1.8 - 1.8 + 17 + 17 + 21 true UTF-8 java, properties, xml + 5.9.2 + + + ozkanpakdil + Ozkan Pakdil + ozkan.pakdil@gmail.com + + + RobertBColton + Robert B Colton + dontknow@gmail.com + + + + + org.openjfx + javafx-web + ${javafx.version} + + + org.openjfx + javafx-controls + ${javafx.version} + + + org.openjfx + javafx-fxml + ${javafx.version} + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.testfx + testfx-junit5 + 4.0.17 + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} + test + + @@ -36,7 +93,7 @@ org.apache.felix maven-bundle-plugin - 2.5.4 + 5.1.2 bundle-manifest @@ -71,6 +128,60 @@ ${project.build.sourceEncoding} + + org.sonatype.central + central-publishing-maven-plugin + 0.4.0 + true + + central + true + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + 32A65A9470BFA1B8988518199F3E019D85FD0E15 + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + + + @@ -79,12 +190,12 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 2.8 + 3.5.0 org.apache.maven.plugins maven-checkstyle-plugin - 2.16 + 3.3.1 @@ -98,4 +209,17 @@ + + + + Mozilla Public License Version 2.0 + https://www.mozilla.org/en-US/MPL/2.0/ + repo + + + + + https://github.com/ozkanpakdil/DockFX + + diff --git a/src/main/java/org/dockfx/DockEvent.java b/src/main/java/org/dockfx/DockEvent.java index bda8d38..f0a8199 100644 --- a/src/main/java/org/dockfx/DockEvent.java +++ b/src/main/java/org/dockfx/DockEvent.java @@ -24,17 +24,12 @@ * an event type. The event source specifies for an event handler the object on which that handler * has been registered and which sent the event to it. The event target defines the path through * which the event will travel when posted. The event type provides additional classification to - * events of the same {@code DockEvent} class. Like a {@link MouseEvent} the event will be + * events of the same {@code DockEvent} class. Like a {@link javafx.scene.input.MouseEvent} the event will be * associated with an x and y coordinate local to the node as well as to the screen. * * @since DockFX 0.1 */ public class DockEvent extends Event { - /** - * Generated Serial Version UID - */ - private static final long serialVersionUID = 4413700316447127355L; - /** * Common supertype for all dock event types. */ diff --git a/src/main/java/org/dockfx/demo/DockFX.java b/src/main/java/org/dockfx/demo/DockFX.java deleted file mode 100644 index 5cf8935..0000000 --- a/src/main/java/org/dockfx/demo/DockFX.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * @file DockFX.java - * @brief Driver demonstrating basic dock layout with prototypes. Maintained in a separate package - * to ensure the encapsulation of org.dockfx private package members. - * - * @section License - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - **/ - -package org.dockfx.demo; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.Random; - -import org.dockfx.DockNode; -import org.dockfx.DockPane; -import org.dockfx.DockPos; - -import javafx.application.Application; -import javafx.scene.Scene; -import javafx.scene.control.Button; -import javafx.scene.control.Menu; -import javafx.scene.control.MenuBar; -import javafx.scene.control.Separator; -import javafx.scene.control.Tab; -import javafx.scene.control.TabPane; -import javafx.scene.control.TableColumn; -import javafx.scene.control.TableView; -import javafx.scene.control.ToolBar; -import javafx.scene.control.TreeItem; -import javafx.scene.control.TreeView; -import javafx.scene.image.Image; -import javafx.scene.image.ImageView; -import javafx.scene.layout.Priority; -import javafx.scene.layout.VBox; -import javafx.scene.web.HTMLEditor; -import javafx.stage.Stage; - -public class DockFX extends Application { - - public static void main(String[] args) { - launch(args); - } - - @SuppressWarnings("unchecked") - @Override - public void start(Stage primaryStage) { - primaryStage.setTitle("DockFX"); - - // create a dock pane that will manage our dock nodes and handle the layout - DockPane dockPane = new DockPane(); - - // create a default test node for the center of the dock area - TabPane tabs = new TabPane(); - HTMLEditor htmlEditor = new HTMLEditor(); - try { - htmlEditor.setHtmlText(new String(Files.readAllBytes(Paths.get("readme.html")))); - } catch (IOException e) { - e.printStackTrace(); - } - - // empty tabs ensure that dock node has its own background color when floating - tabs.getTabs().addAll(new Tab("Tab 1", htmlEditor), new Tab("Tab 2"), new Tab("Tab 3")); - - TableView tableView = new TableView(); - // this is why @SupressWarnings is used above - // we don't care about the warnings because this is just a demonstration - // for docks not the table view - tableView.getColumns().addAll(new TableColumn("A"), - new TableColumn("B"), new TableColumn("C")); - - // load an image to caption the dock nodes - Image dockImage = new Image(DockFX.class.getResource("docknode.png").toExternalForm()); - - // create and dock some prototype dock nodes to the middle of the dock pane - // the preferred sizes are used to specify the relative size of the node - // to the other nodes - - // we can use this to give our central content a larger area where - // the top and bottom nodes have a preferred width of 300 which means that - // when a node is docked relative to them such as the left or right dock below - // they will have 300 / 100 + 300 (400) or 75% of their previous width - // after both the left and right node's are docked the center docks end up with 50% of the width - - DockNode tabsDock = new DockNode(tabs, "Tabs Dock", new ImageView(dockImage)); - tabsDock.setPrefSize(300, 100); - tabsDock.dock(dockPane, DockPos.TOP); - DockNode tableDock = new DockNode(tableView); - // let's disable our table from being undocked - tableDock.setDockTitleBar(null); - tableDock.setPrefSize(300, 100); - tableDock.dock(dockPane, DockPos.BOTTOM); - - final Menu menu1 = new Menu("File"); - final Menu menu2 = new Menu("Options"); - final Menu menu3 = new Menu("Help"); - - MenuBar menuBar = new MenuBar(); - menuBar.getMenus().addAll(menu1, menu2, menu3); - - ToolBar toolBar = new ToolBar( - new Button("New"), - new Button("Open"), - new Button("Save"), - new Separator(), - new Button("Clean"), - new Button("Compile"), - new Button("Run"), - new Separator(), - new Button("Debug"), - new Button("Profile") - ); - - VBox vbox = new VBox(); - vbox.getChildren().addAll(menuBar, toolBar, dockPane); - VBox.setVgrow(dockPane, Priority.ALWAYS); - - primaryStage.setScene(new Scene(vbox, 800, 500)); - primaryStage.sizeToScene(); - - primaryStage.show(); - - // can be created and docked before or after the scene is created - // and the stage is shown - DockNode treeDock = new DockNode(generateRandomTree(), "Tree Dock", new ImageView(dockImage)); - treeDock.setPrefSize(100, 100); - treeDock.dock(dockPane, DockPos.LEFT); - treeDock = new DockNode(generateRandomTree(), "Tree Dock", new ImageView(dockImage)); - treeDock.setPrefSize(100, 100); - treeDock.dock(dockPane, DockPos.RIGHT); - - // test the look and feel with both Caspian and Modena - Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA); - // initialize the default styles for the dock pane and undocked nodes using the DockFX - // library's internal Default.css stylesheet - // unlike other custom control libraries this allows the user to override them globally - // using the style manager just as they can with internal JavaFX controls - // this must be called after the primary stage is shown - // https://bugs.openjdk.java.net/browse/JDK-8132900 - DockPane.initializeDefaultUserAgentStylesheet(); - - // TODO: after this feel free to apply your own global stylesheet using the StyleManager class - } - - private TreeView generateRandomTree() { - // create a demonstration tree view to use as the contents for a dock node - TreeItem root = new TreeItem("Root"); - TreeView treeView = new TreeView(root); - treeView.setShowRoot(false); - - // populate the prototype tree with some random nodes - Random rand = new Random(); - for (int i = 4 + rand.nextInt(8); i > 0; i--) { - TreeItem treeItem = new TreeItem("Item " + i); - root.getChildren().add(treeItem); - for (int j = 2 + rand.nextInt(4); j > 0; j--) { - TreeItem childItem = new TreeItem("Child " + j); - treeItem.getChildren().add(childItem); - } - } - - return treeView; - } -} diff --git a/src/test/java/org/dockfx/DockNodeTest.java b/src/test/java/org/dockfx/DockNodeTest.java new file mode 100644 index 0000000..2ff3dbd --- /dev/null +++ b/src/test/java/org/dockfx/DockNodeTest.java @@ -0,0 +1,11 @@ +package org.dockfx; + + +import org.junit.jupiter.api.Test; + +class DockNodeTest { + + @Test + void setFloating() { + } +} \ No newline at end of file diff --git a/src/test/java/org/dockfx/demo/DockFX.java b/src/test/java/org/dockfx/demo/DockFX.java new file mode 100644 index 0000000..8c9b853 --- /dev/null +++ b/src/test/java/org/dockfx/demo/DockFX.java @@ -0,0 +1,156 @@ +/** + * @file DockFX.java + * @brief Driver demonstrating basic dock layout with prototypes. Maintained in a separate package + * to ensure the encapsulation of org.dockfx private package members. + * @section License + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + **/ + +package org.dockfx.demo; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.*; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.Priority; +import javafx.scene.layout.VBox; +import javafx.scene.web.HTMLEditor; +import javafx.stage.Stage; +import org.dockfx.DockNode; +import org.dockfx.DockPane; +import org.dockfx.DockPos; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Random; + +public class DockFX extends Application { + + public static void main(String[] args) { + launch(args); + } + + @SuppressWarnings("unchecked") + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("DockFX"); + + // create a dock pane that will manage our dock nodes and handle the layout + DockPane dockPane = new DockPane(); + + // create a default test node for the center of the dock area + TabPane tabs = new TabPane(); + HTMLEditor htmlEditor = new HTMLEditor(); + try { + htmlEditor.setHtmlText(new String(Files.readAllBytes(Paths.get("readme.html")))); + } catch (IOException e) { + e.printStackTrace(); + } + + // empty tabs ensure that dock node has its own background color when floating + tabs.getTabs().addAll(new Tab("Tab 1", htmlEditor), new Tab("Tab 2"), new Tab("Tab 3")); + + TableView tableView = new TableView(); + // this is why @SupressWarnings is used above + // we don't care about the warnings because this is just a demonstration + // for docks not the table view + tableView.getColumns().addAll(new TableColumn("A"), + new TableColumn("B"), new TableColumn("C")); + + // load an image to caption the dock nodes + Image dockImage = new Image(DockFX.class.getResource("docknode.png").toExternalForm()); + + // create and dock some prototype dock nodes to the middle of the dock pane + // the preferred sizes are used to specify the relative size of the node + // to the other nodes + + // we can use this to give our central content a larger area where + // the top and bottom nodes have a preferred width of 300 which means that + // when a node is docked relative to them such as the left or right dock below + // they will have 300 / 100 + 300 (400) or 75% of their previous width + // after both the left and right node's are docked the center docks end up with 50% of the width + + DockNode tabsDock = new DockNode(tabs, "Tabs Dock", new ImageView(dockImage)); + tabsDock.setPrefSize(300, 100); + tabsDock.dock(dockPane, DockPos.TOP); + DockNode tableDock = new DockNode(tableView); + // let's disable our table from being undocked + tableDock.setDockTitleBar(null); + tableDock.setPrefSize(300, 100); + tableDock.dock(dockPane, DockPos.BOTTOM); + + final Menu menu1 = new Menu("File"); + final Menu menu2 = new Menu("Options"); + final Menu menu3 = new Menu("Help"); + + MenuBar menuBar = new MenuBar(); + menuBar.getMenus().addAll(menu1, menu2, menu3); + + ToolBar toolBar = new ToolBar( + new Button("New"), + new Button("Open"), + new Button("Save"), + new Separator(), + new Button("Clean"), + new Button("Compile"), + new Button("Run"), + new Separator(), + new Button("Debug"), + new Button("Profile") + ); + + VBox vbox = new VBox(); + vbox.getChildren().addAll(menuBar, toolBar, dockPane); + VBox.setVgrow(dockPane, Priority.ALWAYS); + + primaryStage.setScene(new Scene(vbox, 800, 500)); + primaryStage.sizeToScene(); + + primaryStage.show(); + + // can be created and docked before or after the scene is created + // and the stage is shown + DockNode treeDock = new DockNode(generateRandomTree(), "Tree Dock", new ImageView(dockImage)); + treeDock.setPrefSize(100, 100); + treeDock.dock(dockPane, DockPos.LEFT); + treeDock = new DockNode(generateRandomTree(), "Tree Dock", new ImageView(dockImage)); + treeDock.setPrefSize(100, 100); + treeDock.dock(dockPane, DockPos.RIGHT); + + // test the look and feel with both Caspian and Modena + Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA); + // initialize the default styles for the dock pane and undocked nodes using the DockFX + // library's internal Default.css stylesheet + // unlike other custom control libraries this allows the user to override them globally + // using the style manager just as they can with internal JavaFX controls + // this must be called after the primary stage is shown + // https://bugs.openjdk.java.net/browse/JDK-8132900 + DockPane.initializeDefaultUserAgentStylesheet(); + + // TODO: after this feel free to apply your own global stylesheet using the StyleManager class + } + + private TreeView generateRandomTree() { + // create a demonstration tree view to use as the contents for a dock node + TreeItem root = new TreeItem("Root"); + TreeView treeView = new TreeView(root); + treeView.setShowRoot(false); + + // populate the prototype tree with some random nodes + Random rand = new Random(); + for (int i = 4 + rand.nextInt(8); i > 0; i--) { + TreeItem treeItem = new TreeItem("Item " + i); + root.getChildren().add(treeItem); + for (int j = 2 + rand.nextInt(4); j > 0; j--) { + TreeItem childItem = new TreeItem("Child " + j); + treeItem.getChildren().add(childItem); + } + } + + return treeView; + } +} From 19d7105438533ffd6219114e41dd6a88ee8475fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zkan=20Pakdil?= Date: Sun, 10 Mar 2024 15:40:28 +0000 Subject: [PATCH 02/19] - javafx moved to 21 - java moved to 17 - demo moved to test --- README.md | 4 ++-- pom.xml | 5 ----- src/main/java/org/dockfx/DockEvent.java | 10 +++++----- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7214dd3..b4865b9 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ I added run configuration and intellij files just for future, configuring javafx # DockFX [![Build Status](https://goombert.visualstudio.com/DockFX/_apis/build/status/RobertBColton.DockFX?branchName=master)](https://goombert.visualstudio.com/DockFX/_build/latest?definitionId=1&branchName=master)
- - + +
look 1look 2
diff --git a/pom.xml b/pom.xml index 489cbc3..6fd5ea4 100644 --- a/pom.xml +++ b/pom.xml @@ -187,11 +187,6 @@ - - org.apache.maven.plugins - maven-project-info-reports-plugin - 3.5.0 - org.apache.maven.plugins maven-checkstyle-plugin diff --git a/src/main/java/org/dockfx/DockEvent.java b/src/main/java/org/dockfx/DockEvent.java index f0a8199..9d15a68 100644 --- a/src/main/java/org/dockfx/DockEvent.java +++ b/src/main/java/org/dockfx/DockEvent.java @@ -33,7 +33,7 @@ public class DockEvent extends Event { /** * Common supertype for all dock event types. */ - public static final EventType ANY = new EventType(Event.ANY, "DOCK"); + public static final EventType ANY = new EventType<>(Event.ANY, "DOCK"); /** * This event occurs when a dock window is being dragged by its title bar and the mouse enters a @@ -41,7 +41,7 @@ public class DockEvent extends Event { * be interested in receiving the dock pane. */ public static final EventType DOCK_ENTER = - new EventType(DockEvent.ANY, "DOCK_ENTER"); + new EventType<>(DockEvent.ANY, "DOCK_ENTER"); /** * This event occurs when a dock window is being dragged by its title bar and the mouse is @@ -49,7 +49,7 @@ public class DockEvent extends Event { * stages that may be interested in receiving the dock pane. */ public static final EventType DOCK_OVER = - new EventType(DockEvent.ANY, "DOCK_OVER"); + new EventType<>(DockEvent.ANY, "DOCK_OVER"); /** * This event occurs when a dock window is being dragged by its title bar and the mouse exits a @@ -57,7 +57,7 @@ public class DockEvent extends Event { * be interested in receiving the dock pane. */ public static final EventType DOCK_EXIT = - new EventType(DockEvent.ANY, "DOCK_EXIT"); + new EventType<>(DockEvent.ANY, "DOCK_EXIT"); /** * This event occurs when a dock window is being dragged by its title bar and the mouse is @@ -65,7 +65,7 @@ public class DockEvent extends Event { * stages that may be interested in receiving the dock pane. */ public static final EventType DOCK_RELEASED = - new EventType(DockEvent.ANY, "DOCK_RELEASED"); + new EventType<>(DockEvent.ANY, "DOCK_RELEASED"); /** * Horizontal x position of the event relative to the origin of the DockEvent's node. From 895293c8f0336d9c83bbd7c1e6ea386cdd56fcf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zkan=20Pakdil?= Date: Sun, 10 Mar 2024 16:04:45 +0000 Subject: [PATCH 03/19] - pom clean up --- .idea/workspace.xml | 54 ++++++++++++++++++++++++++++++++------------- pom.xml | 33 +-------------------------- 2 files changed, 40 insertions(+), 47 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 65c6987..7d63a4c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,21 +4,9 @@