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

setFloatable use #37

Open
shipmodeller opened this issue Oct 2, 2018 · 1 comment
Open

setFloatable use #37

shipmodeller opened this issue Oct 2, 2018 · 1 comment

Comments

@shipmodeller
Copy link

shipmodeller commented Oct 2, 2018

Like the concept. I set one of the docknodes in the demo to setFloatable(false); I expected it not to be able to be floated on the screen, but only to be docked... at best. But I still was able to float it . It would seem that it should be locked to this mode. ( Version 0.4 )

So, as a quick test, I modified the docknode a bit

*/
public void setFloating(boolean floating, Point2D translation) {
if (floating && !this.isFloatable()) {
return;
}

And it prevented the node from being picked up, which is great! Almost there, but it spewed forth a ton of error messages.. so I don't think that is "The fix" .. So I added this code in the DockTitleBar handle( MouseEvent event){
............

if (!dockNode.isFloating()) {
if( !dockNode.isFloatable()){
event.consume();
return;
}

That seemed to take care of the issue.. won't drag now, no errors.. The other thing I would like to see is not to be able to drop a drag on a specific DockNode. Maybe a setTargetable( false ) ??

@shipmodeller
Copy link
Author

I also handled the not drop issue.. not as plain as I would have wanted. But I set up a targetableProperty and during the drop search of the DockTitleBar, I checked the flag.

// depth first traversal to find the deepest node or parent with no children
// that intersects the point of interest
while (!stack.isEmpty()) {
Parent parent = stack.pop();
// if this parent contains the mouse click in screen coordinates in its local bounds
// then traverse its children
if( parent instanceof DockNode ){
if( !((DockNode)parent).isTargetable()){
// don't drop on this pane
continue;
}
}

TheDoctorOne added a commit to TheDoctorOne/DockFX that referenced this issue Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant