Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [GEF4] ScrollPaneEx overlap other widgets
[GEF4] ScrollPaneEx overlap other widgets [message #1713409] Tue, 03 November 2015 20:20 Go to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
I use this JavaFX code to create a window with a button on the top, and a GEF4 viewer below. When i use the mouse wheel, i can scroll the content of the viewer over the button.

I would expect, that the content is clipped, but it isn't.

I am new to FX, so this might be a obvious problem. Or a bug in ScrollPaneEx?

		AnchorPane paneCtrl = new AnchorPane();
		AnchorPane paneDraw = new AnchorPane();
		VBox vbox = new VBox( paneCtrl, paneDraw );

		btnUpdateModel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
		paneCtrl.getChildren().add(btnUpdateModel);
		AnchorPane.setTopAnchor(btnUpdateModel, 10d);
		AnchorPane.setLeftAnchor(btnUpdateModel, 10d);
		AnchorPane.setRightAnchor(btnUpdateModel, 10d);

		ScrollPaneEx drawingPane = viewer.getScrollPane();
		paneDraw.getChildren().add(drawingPane);
		paneDraw.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
		AnchorPane.setTopAnchor(drawingPane, 10d);
		AnchorPane.setLeftAnchor(drawingPane, 10d);
		AnchorPane.setRightAnchor(drawingPane, 10d);
		AnchorPane.setBottomAnchor(drawingPane, 10d);
		
		primaryStage.setScene(new Scene(vbox));

		primaryStage.setResizable(true);
		primaryStage.setWidth(640);
		primaryStage.setHeight(480);
		primaryStage.show();


This is how it looks like after scrolling:
index.php/fa/23824/0/

Can someone help?

[Updated on: Tue, 03 November 2015 21:27]

Report message to a moderator

Re: [GEF4] Clipping of ScrollPaneEx contents [message #1713437 is a reply to message #1713409] Wed, 04 November 2015 07:44 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
You are right, our ScrollPaneEx does not clip the contents by default (which it should probably do). In addition, the AnchorPane you use does not clip its children either.
Quote:
AnchorPane does not clip its content by default, so it is possible that childrens' bounds may extend outside its own bounds if the anchor pane is resized smaller than its preferred size.


You may solve this by setting a clip to the AnchorPane containing the ScrollPaneEx of the viewer:
Rectangle clipRectangle = new Rectangle();
paneDraw.setClip(clipRectangle);
paneDraw.layoutBoundsProperty().addListener((observable, oldValue, newValue) -> {
  clipRectangle.setWidth(newValue.getWidth());
  clipRectangle.setHeight(newValue.getHeight());
});


In either case I think our ScrollPaneEx should already clip its contents by default (or at least make this configurable). Can you please create a bugzilla for this? We are currently working on refactoring the ScrollPaneEx anyway (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=479395) and could directly take care of this as well.
Re: [GEF4] Clipping of ScrollPaneEx contents [message #1713892 is a reply to message #1713437] Sat, 07 November 2015 15:52 Go to previous message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Worth to note for others, that this is now fixed.
ScrolledPaneEx is now InfiniteCanvas, and it does the clipping.
Previous Topic:Cannot resolve Draw2D/GEF bundle for Eclipse Application
Next Topic:[GEF4 MVC] concept for adding items
Goto Forum:
  


Current Time: Thu Apr 18 15:57:15 GMT 2024

Powered by FUDForum. Page generated in 0.02167 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top