Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Size of editor default viewport
Size of editor default viewport [message #1444936] Tue, 14 October 2014 19:46 Go to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
Right now I am using IDimension dimensions = layoutService.calculateSize(getDiagram().getGraphicsAlgorithm(), true), but I am not sure if it's correct way to get the size as it gives me constant 1000 for width regardless of the screen size.

Also, in situation where Eclipse workbench window is resized, what and how should I resize figures in the editor?
Re: Size of editor default viewport [message #1449560 is a reply to message #1444936] Tue, 21 October 2014 14:27 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Alex,

the 1000 px is just the dummy default size of the rectangle behind the
diagram Graphiti uses to visualize the diagram; the real sizes are adapted
dynamically on need but are not reflected back into those properties.

To get the real size of the current viewport you would need to ask the GEF
viewer for its size from within the editor but thi sis only possible using
non-APIs, something like:
GFFigureCanvas canvas =
(GFFigureCanvas)diagramEditor.getDiagramBehavior().getControl();
Dimension dimension = canvas .getViewport().getSize();

Michael
Previous Topic:Shape Resize On Selection
Next Topic:Custom Feature Context Menu Shortcuts
Goto Forum:
  


Current Time: Fri Apr 26 11:57:00 GMT 2024

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

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

Back to the top