Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ScaledGraphics : problem with Zoom
ScaledGraphics : problem with Zoom [message #236372] Wed, 27 June 2007 01:05 Go to next message
Eclipse UserFriend
Originally posted by:

Hi guys,

I have a problem with my source code. I can't write the whole code source
here cause 1)the code is very specific to my data, 2)my boss don't want to

So i have a SystemeFigure class :
public class SystemeFigure extends Figure implements{



in which i put some kind of Shape (Rectangle or Ellipse).
I'm also able to move these shapes, or to detect when the mouse come in
(the "selected shape" change colour, and a tooltip appears).
It works well.

Now i'm trying to setup a zoom in order to scale the shapes. So i
redefined the method called paintClientArea (I have found this solution on
a website).

protected void paintClientArea(Graphics graphics) {

if (getChildren().isEmpty())

boolean optimizeClip = getBorder() == null || getBorder().isOpaque();

ScaledGraphics g = new ScaledGraphics(graphics);

if (!optimizeClip)
g.translate(getBounds().x + getInsets().left, getBounds().y +



It's almost work : when i click on ZoomIn or ZoomOut button, the size of
shapes increase (or decrase). But i can't anymore move them. The position
seems to be the same whereas it's not the same place (cause of zoom) at
screen. ToolTip confirm : they appears at the old position of the shape.

Any ideas ?

ps : sorry for my english
Re: ScaledGraphics : problem with Zoom [message #237482 is a reply to message #236372] Thu, 02 August 2007 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by:

Still can't figure how to solve this ....
Do someone have a tutorial or source code about this ?
Re: ScaledGraphics : problem with Zoom [message #237523 is a reply to message #237482] Fri, 03 August 2007 11:16 Go to previous message
Manuel Selva is currently offline Manuel SelvaFriend
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
Have a look on the in org.eclipse.draw2d.examples.zoom,
it is very helpful


Previous Topic:layout
Next Topic:How can it be done.
Goto Forum:

Current Time: Thu Sep 29 22:01:41 GMT 2022

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

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

Back to the top