Jamie Burrell

Greenhorn
+ Follow
since Oct 05, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jamie Burrell

Hi,

I have a thorny problem someone here may be able to help me with:

I have a package "Nomad", with various classes, but driven from an Applet - "Tracker". Part of my package is a subclass of Canvas ("MapDisplay") which I use to display a map of the world. Given a list of cities into Tracker, it uses the MapDisplay component to scroll from city to city (the map is bigger than the MapDisplay area), in order, and draw a red line between each one (like on the Indiana Jones movies).

All this works fine, but what I'd like to do is have a group of buttons at the bottom of the applet to control direction of travel along the route, pausing it so that comments can be read, etc. My problem is that when I add these buttons, it doesn't register any clicks until after the map has finished scrolling to its last city (which is a bit late).

Now some structure info:
-My components are created as part of a separate Thread within init(), which is also where the city list is loaded.
-My scrolling code is in paint(), and basically gets a ListIterator and steps through the list of cities and scrolls from one to the next.

I can't help but think my code needs to be moved around a bit. This is my first applet since "Hello World", so I'm not sure of the structure of what functions kick off when, and which are in separate Threads etc.
I tried moving my scrolling code into start(), but that ended up taking longer to load, before just showing the map at the last city, red line already drawn.


What I need is the map to start scrolling as it does at the moment, but to register a button click immediately and perform the appropriate action. If no buttons are pressed, it just runs to the end and stops.

Any ideas? I'm sort of lost here.

Thanks in advance,
J

BTW, I'm using JDK1.5.0
15 years ago
Hi,

I know the Thread and synchronize functionality allows me to lock objects between multiple threads within the same process, but is there anyway to lock an object between processes?

Case Study:
Process A calls class AccessResource. It utilises this class for 10 seconds before ending.
Process B calls class AccessResource. It cannot access it because class A is using it, and it is locked. It waits for it to be freed, then uses it itself.

Any ideas?

Thanks,
Jamie
Hi all,

I'm a first time writer, long time reader, and I have a question for you all.
Does anyone know of any efforts to define coding standards using XML? Be aware here, I definitely mean using XML, as opposed to standards for (as in "while using") XML.

For example, we'd like to define standards across a multidisciplinary shop. We use lots of things, from Java, through Oracle, even some MS products, and a lot of them share common guidelines:
"Each indent is two characters"
"Use spaces, never tabs"
"Open block brace to sit on separate line"

That sort of thing. I've been looking around, but can't find anything. I'm a bit wary of going in and creating my own schema/DTD without making 100% sure I'm not reinventing the wheel, but this is as far as I got with an XML doc in a couple of minutes, but it lacks rigidity - it may as well me HTML.
Let me know any thoughts, please!

J