aspose file tools
The moose likes Swing / AWT / SWT and the fly likes A question that is not final but is my final question about AffineTransforms - hopefu Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "A question that is not final but is my final question about AffineTransforms - hopefu" Watch "A question that is not final but is my final question about AffineTransforms - hopefu" New topic
Author

A question that is not final but is my final question about AffineTransforms - hopefu

Kieran Murray
Ranch Hand

Joined: May 18, 2008
Posts: 47
Dear Ranchers,

I think if I can answer this I will have about wrapped it up for my Drawing Canvas.
I can now dynamically draw a line on a canvas - yippee.
I can also lengthen or shorten the line.

The only problem is when I lengthen or shorten the line and the line has been translated on the canvas before then the start point of the line - when it is being lengthened returns to its original start point - where it was before I moved it a couple of minutes ago.

I am pretty sure this is because my methods under the boolean tranLineExtending do not take into account that the line has previously been
Affine transformed.

Would one of you guys mind taking a look at the code snippets.
Any suggestions would be most gratefully appreciated.



Kind regards,

Kieran
[ August 04, 2008: Message edited by: Rob Prime ]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19214

Kieran,

Could you please reduce the number of enters in your code? I don't know if you insert those manually or if something just goes wrong while copy-pasting from your IDE / editor, but it really makes your posts long.

I've removed several enters your post, and the code part has been reduced from 249 lines to 127 - a reduction of almost 50%.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Kieran Murray
Ranch Hand

Joined: May 18, 2008
Posts: 47
Dear Ranchers,

I managed to solve this problems by continuously updating the start point and end point of my line so that I know where the start point of the line is always.

That now works.

I am going to send the zoom method - because unfortunately this is moving my cursor out slightly and this is having a knock on effect when I redraw the line when zoomed.

If this one can be solved then it really is good night Vienna.

Kind regards,

Kieran

 
I agree. Here's the link: jrebel
 
subject: A question that is not final but is my final question about AffineTransforms - hopefu
 
Similar Threads
Is there anyway of overriding the default signal for PopupMenus
Zooming in and out - cursor not in the right place
Moving clickedShapes and only clickedShapes on a panel
Problems moving shapes when set up own Shapes class extending Path2D.Double
Can move shapes individually but not as a group