Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blue area position issue #34

Closed
lovky opened this issue Apr 4, 2018 · 8 comments
Closed

Blue area position issue #34

lovky opened this issue Apr 4, 2018 · 8 comments

Comments

@lovky
Copy link

lovky commented Apr 4, 2018

Hello, I have this issue with Dock as you can see the blue area is moved down for size of menu and tcs (200 heigh). I found out if I change dockAreaDrag.localToScene(0, 0); to y = -200 blue area is fixed but buttons are the moved down.
How can I hotfix it ?
bug

@RobertBColton
Copy link
Owner

RobertBColton commented Apr 19, 2018

I understand, the docking area does not include the list at the bottom and the docking indicator is going outside of that area. The relevant code is here:

if (dockPosDrag != null) {

The blue rectangle with dotted border is called the dockAreaIndicator and it is moved to the node you are dragging over:
dockAreaIndicator.setTranslateY(dockAreaDrag.getLayoutBounds().getHeight() / 2);

@xhuutrix
Copy link

Hi RobertBColton and lovky,

I am new JavaFX developer, I am trying to do JavaFX docking UI and see DockFX is very good framework to use.

But i don't sure how to add menu file and tools bar with DockFX source demo.

Can you guide me how to do? Above i see lovky has done very good UI looking include Menu Toolbar and Menu file.

Thanks,

@RobertBColton
Copy link
Owner

@xhuutrix I don't mean to be rude when I say this, but please try not to takeover other people's tickets with unrelated questions. In the future, please open a new ticket if you have questions that are not related to any issue. Regardless, I'll answer your question anyway this one time.

Following the Layouts tutorial here: https://docs.oracle.com/javafx/2/layout/builtin_layouts.htm
The MenuBar example here: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/MenuBar.html
The MenuBar tutorial here: https://docs.oracle.com/javafx/2/ui_controls/menu_controls.htm
And the ToolBar example here: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/ToolBar.html

NOTE: It seems there is a mistake in the ToolBar example about the type of Separator's constructor parameter.

I was able to add a MenuBar and ToolBar to the scene, however, this reproduces the problem reported by the OP with the blue areas:
MenuBar and ToolBar

This is the modified demo code:

    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));

@RobertBColton
Copy link
Owner

If I happen to find the time this weekened, I may update the demo and push a fix for the blue areas.

@RobertBColton
Copy link
Owner

RobertBColton commented Apr 27, 2018

Alright, I've a pushed a fix: f369da8

I simply needed to subtract the DockPane's position in the scene from the dockAreaDrag's position in the scene. This works whether you use a MenuBar, ToolBar, or have only a DockPane in the scene.

A MenuBar and ToolBar are both included in the demo now. You can find the 0.4 Beta, with this fix included, on the releases page: https://github.com/RobertBColton/DockFX/releases/tag/0.4b

dockAreaIndicator Position Fixed

@pianoboy11
Copy link

I have scenebuilder 2.0, when I try to import into scene builder for the version 4.0 betea dockfx, no controls are loaded

@JohanHormaza
Copy link

When I move a window I get this error, this is because I use Java 11. How could that problem be solved with Java 11?
Thank you.

java.lang.IllegalAccessError: class org.dockfx.DockEvent (in unnamed module @0x204594b6) cannot access class com.sun.javafx.scene.input.InputEventUtils (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.scene.input to unnamed module @0x204594b6
at org.dockfx.DockEvent.(DockEvent.java:289)
at org.dockfx.DockEvent.(DockEvent.java:260)
at org.dockfx.DockTitleBar.handle(DockTitleBar.java:366)
at org.dockfx.DockTitleBar.handle(DockTitleBar.java:1)
at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventFilterRecord.handleCapturingEvent(CompositeEventHandler.java:282)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchCapturingEvent(CompositeEventHandler.java:98)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(EventHandlerManager.java:223)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(EventHandlerManager.java:180)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3851)
at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1200(Scene.java:3579)
at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1849)

@schelldorfer
Copy link

add "--add-exports=javafx.graphics/com.sun.javafx.scene.input=ALL-UNNAMED" to VM arguments when using Java 11+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants