Results 1 to 9 of 9
Thread: Helped needed to modify code
- 07-21-2010, 06:00 PM #1
Member
- Join Date
- Jul 2010
- Posts
- 4
- Rep Power
- 0
Helped needed to modify code
Hi Java-coders! I'm totally new to Java and have a request. I am writing an opensource app in AutoHotKey script which will help severely physically disabled (e.g. twitch a finger/single muscle etc) people paint using a computer. I don't know how to draw bezier curves that go THROUGH chosen points and so I've stumbled across the opensource Java project "Cusp":
Cusp - CubicSpliner | Download Cusp - CubicSpliner software for free at SourceForge.net
This app basically is a gui in which you click some points and a curve is made going through those points, the entire coordinates of which are saved to a text file and read by my app. This process is very visually intrusive and I require something more like a command line program. i.e.call the program with the coordinates and automatically save a text file with the curve's coordinates (all done invisibly). To be honest I am not willing to become a Java master to solve this one problem but if it is simple to modify the code it would be much appreciated if someone could point me in the right direction or help me write something that works.
Also, I've already contacted the author of "Cusp" to no avail.
Thanks in advance, Evs.
- 07-21-2010, 06:21 PM #2
Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
The Ubiquitous Newbie Tips
- 07-21-2010, 10:04 PM #3
Have you done any work on it? Are you having problems?
If so post them here with your questions?
- 07-21-2010, 11:33 PM #4
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
Like Norm said just post whatever attempt you have so far even if you think it is rubbish, you wont get help unless you have made some kind of effort
- 07-22-2010, 07:29 AM #5
Member
- Join Date
- Jul 2010
- Posts
- 4
- Rep Power
- 0
That's fair enough, I read tonnes of comments similar to PhHein's on the AutoHotkey forums as well so that was expected - just thought I'd put the request out there, but thanks to the rest of you for responding with a better attitude.
I already downloaded the Netbeans IDE and I've opened up the source file cubicspliner.java (I've attached the source).
The first step I guess I need to do is change the program so that it could either read a text file with my coordinates in it so that the program starts with a curve already drawn or to be run like a command line prog and call it along with the coordinates as parameters, which option do you suggest?
I don't know how to do the command line way so...
If I go for a text file read I need a loop which will run and read each line which will look like this:
x1,y1
x2,y2
x3,y3
xn,yn
Can anyone tell me where this loop should be put in the code and why? I'm guessing about line 238 in cubicspliner.java which is after the gui has been setup. I'm not on my com at the moment - I'll post some code when i get home.
Any comments?
Thanks, Evs
- 07-22-2010, 01:04 PM #6
Waiting for the posted code.
- 08-02-2010, 05:41 PM #7
Member
- Join Date
- Jul 2010
- Posts
- 4
- Rep Power
- 0
Sorry it took me so long to get back on here, busy organising a wedding and I thought I'd better see if I could teach myself. Anyway, after spending DAYS trying to learn Java I've realised it's harder than it looked at first glance. I dabbled in C++ years ago and the AutoHotkey language I know and love is a bit more user friendly to the likes of me. So this is where my learning (or lack of) has brought me to...
Questions:
1.
What is the difference between when a mouse is 'clicked' and when it is 'pressed'? The action takes place after I click the canvas but it is under the 'pressed' method.
2.
At line 1362 in cubicspliner.java there is the method call
addPoint(new Vector2D(mx, my));
with the word 'Vector2D' in italics - is this for a reason?
3. I realised that Java doesn't just run through its code at its beginning (unless constructors are used...) which is unlike what I'm used to so this seems to make sense to me:
When I add at line 574:
public void mouseEntered(MouseEvent e)
{
574 addPoint(new Vector2D(100, 100));
}
would this make a point at 100,100 whenever I enter the mouse into the canvas?
4. How do I compile the source files in netbeans? whenever i hit run main project the .java file I have open isn't compiled but a project from the left window which lists my past projects. i just want to modify the .java file and see if my changes work.
Thanks, Evs
- 08-02-2010, 05:51 PM #8
What does the API doc say on that?What is the difference between when a mouse is 'clicked' and when it is 'pressed'?
Write a small program and add mouse listeners
and have each method print out when it is called. It will show you what happens when.
Sorry about the rest of the questions. I haven't seen the code you talk about and I don't use your IDE.
- 08-09-2010, 09:38 AM #9
Member
- Join Date
- Jul 2010
- Posts
- 4
- Rep Power
- 0
Hi Norm! Thankyou for your advice, after spending ages trying to learn java I've decided to change strategy. Because life tends to get in the way (funerals/my wedding/renovations etc) of my hobbies it's taking too long to get anywhere while dragging you along for the ride. I'll just go at my slow pace and post the occassional specific question (as opposed to a general 'help me!') in the forums.
Thanks again, Evs.
Similar Threads
-
needed code for this output
By rajivjoshi in forum New To JavaReplies: 4Last Post: 05-31-2010, 05:54 PM -
[SOLVED] Assistence is needed with my code. ty
By JOSCMS_JAVANEWB in forum Other IDEsReplies: 6Last Post: 04-18-2009, 11:21 AM -
Hi code needed for JCA adaptor
By lavanya82 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 03-04-2009, 10:34 AM -
My code is not working properly ..modify it
By Shyam Singh in forum New To JavaReplies: 14Last Post: 07-16-2008, 05:48 PM -
Help needed with java arrays code
By d24706 in forum New To JavaReplies: 2Last Post: 03-07-2008, 01:11 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks