SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
David Newton wrote:What's a "real world coordinate"? Latitude and longitude? Translate between viewport coordinates.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
David Newton wrote:So you're asking how to scale your viewport?
vinod cmt wrote:I tried it,but failed to point exact location.
Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
Peter Taucher wrote:
vinod cmt wrote:I tried it,but failed to point exact location.
What exactly did you try and how have you failed? Maybe you could provide your implementation of paintComponent() method?
Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
Peter Taucher wrote:1) Use code tags
2) What do you expect, and how does the result differ from your expectations? -> TellTheDetails
Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Peter Taucher wrote:I'm providing a small example (using code tags):
I think (because you didn't really explain it) your problem might be the scaling. You have to translate the coords and size of the rectangles the same way you scale your image.
Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
Peter Taucher wrote:1) Don't make a fullquote when you don't need one
2) TellTheDetails -> ShowSomeEffort -> Provide a SSCCE
You still didn't provide a valid problem description. What exactly are you expecting and how does the behaviour differ from your expectations (in detail!). Simply saying 'it doesn't paint where I want it to' makes no sense to anyone but you. Providing an example that shows the misbehaviour (SSCCE) might give us all the possibility to comprehend...
David Newton wrote:What do you mean "draw it exactly by loading in the JSP page"? Most of the red marks seem to be located correctly, no?
David Newton wrote:Why do you have to make the marks after loading in JSP? Why not before? I don't understand why the coordinate transformation is difficult; can you explain what's actually happening? Where are the marks ending up? Can you post *just* the coordinate transformation code?
David Newton wrote:What are lines 7 and 8 supposed to do?
David Newton wrote:Okay, don't, but don't expect much help if you're not willing to explain what your code is doing--the code you posted is trying to parse two strings as doubles. If that isn't your real code, then how do I know the *rest* of it is real?
Why do you subtract 20? Why do you subtract y from the boardheight? Why are you doing more beyond getting the "scaled" x, y coordinates? You didn't even say where the origin is for the board measurements, nor show where the boxes *were* being drawn so we'd know if it was something simple like different origins.
Roll your eyes all you want--but if you can't or won't provide the information asked for, or the information that's necessary, or the actual code that isn't working, I'm not sure what you expect people to do.
Ever since I found this suit I've felt strange new needs. And a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
|