Docking framework for JavaFX platform

Related tags

GUI AnchorFX
Overview

Anchorfx logo

Docking framework for JavaFX platform

Anchorfx logo

AnchorFX is a gratis and open source library for JavaFX to create graphical interfaces with docking features

Anchorfx logo

AnchorFX and its source code is licensed under the GNU Lesser General Public License version 3 and you can make adaptations of this work

Features

  • Stations and sub stations support
  • Dockable and floatable panels
  • Splitter and Tabs containers support
  • CSS styling

Usage

Create a DockStation
DockStation station = AnchorageSystem.createStation();

Once created the station, we can create the panels and hook them to the station

Create a DockNode
Pane myPanel...
DockNode dockNode = AnchorageSystem.createDock("My Title", myPanel);
dockNode.dock(station, DockNode.DOCK_POSITION.CENTER);

A DockNode is the window built around your panel. This window has a title and an icon and it can be defined as:

  • Closeable
  • Resizable
  • Maximizable
  • Floatable

If we want to create a node that can not be closed, we will write

dockNode.closeableProperty().set(false);
Get ower DockNode from content panel

To know the reference of DockNode that contains your panel, implements the DockNodeCreationListener interface in your panel.

class MyPanel extends Pane implements DockNodeCreationListener {
 
    @Override
    public void onDockNodeCreated(DockNode node) {
         // now you can work with events of your DockNode 
    }

}
Add a DockNode to a Dockstation

To be visible, a node must be associated with a station. To do this procedure, we use the function dock (...) of DockNode

dockNode.dock(station, DockNode.DOCK_POSITION.CENTER);

In this case, the node will be added to the station in a central position. When a station is empty, the location will always be central, otherwise, will be taken the position provided and will be changed the layout

You may also add a node by specifying the percentage of placement of the divider. This percentage is only effective if the position is provided different from the central

dockNode.dock(station, DockNode.DOCK_POSITION.CENTER, 0.8);

Adding a node over another specific node

AnchorFX provides the possibility to add a node in a generic position respect to another node already present in the station. This feature lets you design a custom layout when your application starts

dockNode.dock(otherNode, DockNode.DOCK_POSITION.CENTER);
Create a DockSubStation

A Dock SubStation is a station that also has the functionality of DockNode The nodes that are associated with a DockSubStation can only be moved within the DockSubStation associated.

 DockSubStation subStation = AnchorageSystem.createSubStation(station, "SubStation");
 dockSubNode.dock(subStation, DockNode.DOCK_POSITION.CENTER);
 
 subStation.dock(station, DockNode.DOCK_POSITION.LEFT,0.7);
Styling with AnchorFX.css

The file AnchorFX.css located within resource, defines a simple default style

.docknode-title-bar {
   -fx-background-color: rgb(100,100,100);
}

.docknode-title-text{
   -fx-text-fill: rgb(255,255,255);
}

.docknode-content-panel{
   -fx-background-color: rgb(100,100,100);
   -fx-padding: 0
}

.docknode-floating-stack-container-panel {
   -fx-background-color: rgb(100,100,100);
   -fx-padding: 4
}

.docknode-split-pane {  
   -fx-padding: 0;  
} 

.docknode-split-pane *.split-pane-divider {  
   -fx-padding: 2;  
   -fx-border-color:transparent;
   -fx-color: darkgray;
} 

.docknode-tab-panel{
   -fx-padding: 0;
}

.docknode-command-button{
   -fx-background-color:transparent;
   -fx-background-radius: 0,0,0;
}

.docknode-command-button:hover{
   -fx-background-color:darkgray;
}

.docknode-command-button:pressed{
   -fx-background-color:darkgray;
}

.docknode-command-button:focused{
   -fx-background-color:transparent;
}

.docknode-command-button-close{
   -fx-background-color:transparent;
   -fx-background-radius: 0,0,0;
}

.docknode-command-button-close:pressed{
   -fx-background-color:red;
}

.docknode-command-button-close:hover{
   -fx-background-color:red;
}

.docknode-command-button-close:focused{
   -fx-background-color:transparent;
} 

.station {
   -fx-background-color: rgb(0,0,0);
   -fx-padding: 0
}

.substation-title-bar {
   -fx-background-color: rgb(0,0,0);
}

.substation-title-text{
   -fx-text-fill: rgb(255,255,255);
}

.dockzone-circle-container-selectors {
   -fx-fill: rgba(0,0,0,0.7);
}

.dockzone-circle-selector {
   -fx-fill: rgba(0,0,0,0.8);
}

.dockzone-rectangle-preview {
   -fx-fill: rgba(63,138,163,0.8);
}

Explore the examples on test package

The examples will use the functionality described

  • AnchorFX_test.java
  • AnchorFX_substations.java
  • AnchorFX_settings.java
  • AnchorFX_events.java
  • AnchorFX_CommonStations.java
Comments
  • DockSplitterContainer dividerPositions

    DockSplitterContainer dividerPositions

    When attempting to build an Eclipse/Netbeans style multiple document interface, it would be beneficial to have access to DockSplitterContainer's set/get DividerPositions.

    This would allow resizing of the DockStation (or SubStation) to prioritize the document Pane.

    opened by ruckc 6
  • DockStation.restore(DockNode node) NullPointerException

    DockStation.restore(DockNode node) NullPointerException

    In trying a single DockNode on a DockStation, I pressed maximize button twice, on the second press, it invoked restore(DockNode node). I got a NPE at line 190, panelParent is null.

    Not sure the best approach to solve, as it was technically already maximized, so should the maximized be disabled? Or should the restore() have a != null check.

    Either way, please keep up the good work, it is highly appreciated.

    opened by ruckc 4
  • Pop-out transparent title-bar

    Pop-out transparent title-bar

    On the pop-out windows, the text isn't intuitive as the drag location. In my first attempt at popping the window out the editor window landed on a black background which hid it fairly well.

    image

    bug 
    opened by ruckc 3
  • nodes disappearing in CommonStations test/example

    nodes disappearing in CommonStations test/example

    1. start the AnchorFX_CommonStations test application
    2. drag a node (e.g. tree4) out of both windows (i.e. out by itself)
    3. drag that node back onto one of the two original windows (stations)
    4. the dragged node disappears

    Is this the expected outcome, or a bug?

    Everything seems to work fine, as long as the nodes are not dragged out of their stations.

    Looks like a good project that will be very useful in my app. Nice job!

    Also - is there any built-in support for saving the size/position/layout of nodes for restoring when the app is re-opened?

    opened by ChrisLMerrill 0
  • Gradle build

    Gradle build

    This PR adds support for Gradle as a build tool, with the following additions:

    • license plgin to keep file headers up to date
    • maven plugin to generate POM
    • bintray plugin to publish to bintray.com (relates to #11)
    • jacoco plugin for code coverage
    opened by aalmiray 0
  • JFXCentral Entry

    JFXCentral Entry

    Would be great if this library could be added to JFXCentral at jfx-central.com. Data needs to be added to the data repository: https://github.com/dlemmermann/jfxcentral-data

    opened by dlemmermann 0
  • Percentage is not correct

    Percentage is not correct

    Here is my code `DockStation dockStation = AnchorageSystem.createStation(); DockNode dock1 = AnchorageSystem.createDock("DOCK 1", new BorderPane()); DockNode dock2 = AnchorageSystem.createDock("DOCK 2", new BorderPane()); DockNode dock3 = AnchorageSystem.createDock("DOCK 3", new BorderPane()); DockNode dock4 = AnchorageSystem.createDock("DOCK 4", nnew BorderPane()); DockNode dock5 = AnchorageSystem.createDock("DOCK 5", new BorderPane());

    dock1.dock(dockStation, DockNode.DockPosition.CENTER); dock2.dock(dock1, DockNode.DockPosition.RIGHT,0.25); dock3.dock(dockStation, DockNode.DockPosition.RIGHT,0.75); dock4.dock(dock2, DockNode.DockPosition.BOTTOM,0.75); dock5.dock(dock1, DockNode.DockPosition.BOTTOM,0.5);`

    When I use only dock1->dock3, layout will have 3 column with percent was 25% 50% 25% But when I use dock1->dock5 layout will change to 3 column with percent was 37.5% 37.5% 25% Percent is not correct. Please check this problem,

    opened by worldofagility 1
  • Tab didn't invoke DockNodeCloseRequestHandler.canClose()

    Tab didn't invoke DockNodeCloseRequestHandler.canClose()

    dockNode.setCloseRequestHandler(new DockNodeCloseRequestHandler() {
    			@Override
    			public boolean canClose() {
    				return trueOrFalse();
    			}
    		});
    

    I set this handler to every node that I docked. But only the first and the second tab docked invoke canClose(), I found out that this is because DockTabberContainer didn't put this

            newTab.setOnCloseRequest(event -> {
                if (node.getCloseRequestHandler() == null || node.getCloseRequestHandler().canClose()) {
                	node.undock();
                    event.consume();
                }
            });
    

    in putDock method like DockCommons did in createTabber method.

    opened by cece2048 0
  • run AnchorFX_CommonStations exception

    run AnchorFX_CommonStations exception

    Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at com.anchorage.docks.containers.zones.DockZones.makePreview(DockZones.java:385) at com.anchorage.docks.containers.zones.DockZones.searchArea(DockZones.java:257) at com.anchorage.docks.stations.DockStation.searchTargetNode(DockStation.java:159) at com.anchorage.system.AnchorageSystem.lambda$searchTargetNode$3(AnchorageSystem.java:104) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at com.anchorage.system.AnchorageSystem.searchTargetNode(AnchorageSystem.java:104) at com.anchorage.docks.node.ui.DockUIPanel.manageDragEvent(DockUIPanel.java:153) at com.anchorage.docks.node.ui.DockUIPanel.lambda$installDragEventMananger$1(DockUIPanel.java:122) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Scene$MouseHandler.process(Scene.java:3757) at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485) at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:380) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:294) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:416) at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:415) at com.sun.glass.ui.View.handleMouseEvent(View.java:555) at com.sun.glass.ui.View.notifyMouse(View.java:937) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191) at java.lang.Thread.run(Thread.java:745) Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at com.anchorage.docks.node.DockNode.dock(DockNode.java:332) at com.anchorage.docks.stations.DockStation.manageDockDestination(DockStation.java:222) at com.anchorage.docks.stations.DockStation.finalizeDrag(DockStation.java:198) at com.anchorage.system.AnchorageSystem.finalizeDragging(AnchorageSystem.java:124) at com.anchorage.docks.node.ui.DockUIPanel.manageReleaseEvent(DockUIPanel.java:161) at com.anchorage.docks.node.ui.DockUIPanel.lambda$installDragEventMananger$2(DockUIPanel.java:127) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Scene$MouseHandler.process(Scene.java:3757) at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485) at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:380) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:294) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:416) at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:415) at com.sun.glass.ui.View.handleMouseEvent(View.java:555) at com.sun.glass.ui.View.notifyMouse(View.java:937) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191) at java.lang.Thread.run(Thread.java:745)

    opened by huanghanhuikkx 0
Owner
Alessio Vinerbi
Alessio Vinerbi
Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE 8 and provides the functionalities to use and handle easily Tiles in your JavaFX application.

Lib-Tile Intention Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE and provides the functionalities to use and handle easily Tile

Peter Rogge 13 Apr 13, 2022
DataFX - is a JavaFX frameworks that provides additional features to create MVC based applications in JavaFX by providing routing and a context for CDI.

What you’ve stumbled upon here is a project that intends to make retrieving, massaging, populating, viewing, and editing data in JavaFX UI controls ea

Guigarage 110 Dec 29, 2022
A collection of tools and libraries for easier development on the JavaFX platform!

This project is archived I do not realistically have the time to take care of this project, unfortunately. It originally was built along a Twitter cli

Tristan Deloche 100 Dec 13, 2022
An image annotation desktop-application written in Java using the JavaFX application platform.

This is an image annotation desktop-application written in Java using the JavaFX application platform. It allows you to create bounding box annotations using rectangular and polygonal shapes. Annotations can be imported and saved from/to JSON files, Pascal VOC format XML-files or YOLO format TXT-files.

Markus Fleischhacker 31 Dec 4, 2022
To quickly integrate your applications into the EdgeGallery platform, we provide the toolchain project to help developers quickly modify code and migrate applications to the platform.

Toolchain 工具链 工具链是MEC Developer开发者平台中的一个重要特性,当x86平台的App想要上车ARM平台时,底层的代码不可避免的需要进行修改或重写。 App提供者可以通过MEC Developer开发者平台中集成的工具链进行源代码分析,定位需要修改的源代码并根据指导意见进行修

EdgeGallery 19 Jan 7, 2022
A Java framework for creating sophisticated calendar views (JavaFX 8, 9, 10, and 11)

CalendarFX A Java framework for creating sophisticated calendar views based on JavaFX. A detailed developer manual can be found online: CalendarFX 8 D

DLSC Software & Consulting GmbH 660 Jan 6, 2023
A JavaFX UI framework to create fully customized undecorated windows

CustomStage A JavaFX undecorated stage which can fully be customized Donations If this project is helpful to you and love my work and feel like showin

Oshan Mendis 186 Jan 6, 2023
A framework for easily creating forms for a JavaFX UI.

FormsFX Forms for business application made easy. Creating forms in Java has never been this easy! Maven To use this framework as part of your Maven b

DLSC Software & Consulting GmbH 534 Dec 30, 2022
Desktop/Mobile JavaFX application framework

Basilisk is desktop/mobile application development platform for the JVM. Inspired by Griffon, Basilisk leverages JavaFX and JavafXPorts to bring the s

Basilisk 55 Feb 10, 2022
an Application Framework for implementing the MVVM Pattern with JavaFX

mvvmFX is an application framework which provides you necessary components to implement the MVVM pattern with JavaFX. MVVM is the enhanced version of

Alexander Casall 438 Dec 28, 2022
Lightweight JavaFX Framework for Kotlin

TornadoFX JavaFX Framework for Kotlin Important: TornadoFX is not yet compatible with Java 9/10 Oracle is intending to decouple JavaFX from the JDK. W

Edvin Syse 3.6k Dec 29, 2022
A lightweight RCP framework for JavaFX applications.

WorkbenchFX The one and only framework to build large JavaFX Applications! Maven To use this framework as part of your Maven build simply add the foll

DLSC Software & Consulting GmbH 471 Jan 8, 2023
😉PrettyZoo is a GUI for Zookeeper created by JavaFX and Apache Curator Framework.

?? Pretty nice Zookeeper GUI, Support Win / Mac / Linux Platform

vran 2.4k Jan 5, 2023
JavaFX micro-framework that follows MVVM Pattern with Google Guice dependency Injection

ReactiveDeskFX (JavaFX and Google Guice MVVM Pattern micro-framework) JavaFX micro-framework to develop very fast JavaFX components with minimal code

TangoraBox 3 Jan 9, 2022
Collection of Binding helpers for JavaFX(8)

Advanced-Bindings for JavaFX (8) advanced-bindings is a collection of useful helpers and custom binding implementations to simplify the development of

Manuel Mauky 63 Nov 19, 2022
A library of +70 ready-to-use animations for JavaFX

AnimateFX A library of ready-to-use animations for JavaFX Features: Custom animations Custom interpolators Play/Stop animation Play an animation after

Loïc Sculier 366 Jan 5, 2023
BootstrapFX: Bootstrap for JavaFX

BootstrapFX BootstrapFX is a partial port of Twitter Bootstrap for JavaFX. It mainly provides a CSS stylesheet that closely resembles the original whi

Kordamp 810 Dec 28, 2022
Allow runtime modification of JavaFX CSS

cssfx ⚠ WARNING ⚠ In version 11.3.0 we have relocated & refactored the project. maven groupId has been changed to fr.brouillard.oss java module name h

Matthieu Brouillard 134 Jan 2, 2023
MDI components for JavaFX

DesktopPaneFX DesktopPaneFX is a JavaFX version of Swing’s JDesktopPane which can be used as a container for individual "child" similar to JInternalFr

Kordamp 58 Sep 23, 2022