Article View: aus.computers.java
Article #311Re: Java program to simulate circuits.. help with graphics area ..
From: Joel Wellington
Date: Mon, 07 May 2001 05:12
Date: Mon, 07 May 2001 05:12
39 lines
2661 bytes
2661 bytes
You by any chance dont go to Curtin University in Perth do you? I did a unit where I had to do the exact same program. I made each type of gate an object. The gates methods included draw, position and logic state. Draw a staright line to an input pin on a gate and have seperate applet 'state' which calculates the login. This way only need an edit state and a calculaate state so you dont need to calculate at every drawing update. Joel On Sat, 5 May 2001 10:54:48 +0800, "Aaron T" <toddam@dingoblue.net.au> wrote: >Okay I have got to build a program that will be able to draw gates to the >screen (such as AND, OR, NOT etc) and flip flips, sources etc, pretty basic >stuff. Also pins must be recorded on the canvas as the gates should be able >to be connected. > >I've been hard pressed to find a tutorial that deals with anything past the >very basics of 2DGraphics in java, like drawing to screeen and so forth.. > >What I need to be able to do is draw to screen, but then later have the user >able to select any gate and move it around. I kind of know how to do the >moving with a update() or paint() method that is called by a mouse movement, >but how do I make each shape (I'm using GeneralPath as the shape for a >certain gate) a seperate 'object' that is able to be selected at will? > >Any help on the forum, email or pointers to websites would be great.. I've >sifted the sun site, used the books I've bought and nothing seems to go into >any great detail on this. > >Thanks very much >Aaron Todd > > > >
Technical Details
Message-ID:
<3af62e6c.14109778@news-server.bigpond.net.au>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.stealth.net!intgwpad.nntp.telstra.net!news-server.bigpond.net.au!not-for-mailReferences:
<3af36d74$0$25514$7f31c96c@news01.syd.optusnet.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,b3cb45071f1608e7 X-Google-Attributes: gid10d6db,public X-Google-Thread: 113ae9,b3cb45071f1608e7 X-Google-Attributes: gid113ae9,public X-Google-ArrivalTime: 2001-05-06 22:12:53 PST Path: arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.stealth.net!intgwpad.nntp.telstra.net!news-server.bigpond.net.au!not-for-mail From: pulsarsss@my-deja.com (Joel Wellington) Newsgroups: aus.computers.java,comp.lang.java.help Subject: Re: Java program to simulate circuits.. help with graphics area .. Message-ID: <3af62e6c.14109778@news-server.bigpond.net.au> References: <3af36d74$0$25514$7f31c96c@news01.syd.optusnet.com.au> X-Newsreader: Forte Free Agent 1.21/32.243 Lines: 40 Date: Mon, 07 May 2001 05:12:51 GMT NNTP-Posting-Host: 61.9.173.169 X-Complaints-To: news@bigpond.net.au X-Trace: news-server.bigpond.net.au 989212371 61.9.173.169 (Mon, 07 May 2001 15:12:51 EST) NNTP-Posting-Date: Mon, 07 May 2001 15:12:51 EST Organization: BigPond Internet Services (http://www.bigpond.net.au)