Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2004

Tip: Looking for answers? Try searching our database.

Zoom shapes

Thread view: 
Mario - 26 Dec 2004 12:41 GMT
Hello everybody,
i 'have developped an application tha shows shapes (lines ) on canvas,
now  I need to perform such grafics like (zoomin, moving ecc..).
I'm confused because there are various ways to perform this:
AffineTransform
JViewport
JScrollpane
or Manually calucte coordinates.

What is the best way,..

Thank you for suggestiones.

Bye Mario
Andrew Thompson - 26 Dec 2004 13:21 GMT
> i 'have developped an application tha shows shapes (lines ) on canvas,

Please locate you shift key Mario.  Is that an AWT
based Canvas that you are talking about?  I usually find
it easier to avoid Canvas and render directly to a Container.

> now  I need to perform such grafics like (zoomin, moving ecc..).

Moving in what sense?  Do you mean that parts of the image
will move relative to other parts, like this simple 'dots
moving across a grid' for example,..
<http://www.physci.org/launcher.jsp#JAnimateFrame> ?

If you mean that type of moving, then..

> AffineTransform
> JViewport
> JScrollpane

..none of these will not do what you want.

> or Manually calucte coordinates.

That sounds like the only way if I understand your description.

Can you provide a short Java code example of what you mean?

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Mario - 26 Dec 2004 14:20 GMT
Ok,
It is a java.awt.Canvas, added to an JFrame.

On this Canvas I painted lines, this reppresents the streets of my city.
I' need zooming on that lines, to view streets that are invisible in a
1:1 scale.

I need moving the Canvas because when the user zooms on lines, the lines
go out of the view screen, and it is necessary that user can with
dragging mouse move through the entire map.

I hope is more clear, my English is terrible.

Thanks.

Mario
Chris Smith - 26 Dec 2004 15:48 GMT
> On this Canvas I painted lines, this reppresents the streets of my city.
> I' need zooming on that lines, to view streets that are invisible in a
[quoted text clipped - 3 lines]
> go out of the view screen, and it is necessary that user can with
> dragging mouse move through the entire map.

If you're talking about a wide variety of scale in drawing, then I'd
avoid trying to do this with AffineTransform or any other tricks.  The
main problem is that you don't just want to draw bigger if when you're
zoomed in, but actually to draw more detail.  In the end, you need to
customize your drawing code based on the scale anyway, so I'd zust zoom
or pan the view by hand.  (Similar logic applies to panning; you
probably don't want to draw the entire map if someone's only going to
see a small potion of it.)

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

John McGrath - 27 Dec 2004 06:42 GMT
> (Similar logic applies to panning; you probably don't want to draw
> the entire map if someone's only going to see a small potion of it.)

If you just paint the area defined by the Graphics Context's clip region,
this would not apply.  So using a JScrollPane for panning *might* be
appropriate, depending on the requirements for the UI.

Signature

Regards,

John McGrath

Chas Douglass - 26 Dec 2004 20:15 GMT
Mario <mario.g-calastri@swissonline.ch> wrote in news:41ceb0f1$1_4@
127.0.0.1:

> Hello everybody,
> i 'have developped an application tha shows shapes (lines ) on canvas,
[quoted text clipped - 10 lines]
>
> Bye Mario

Have a look at piccolo:
<http://www.cs.umd.edu/hcil/jazz/>

Chas Douglass


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.