Updating the map view

The RPTools applications are written in Java. If you're interested in contributing to any project here by submitting patches to the source code, this is the forum to ask questions about how to do so. Please put the two-letter tool name abbreviation in your thread Title. To enter this group, go to the Usergroups page of your User Control Panel and join the Java Developer group.

Moderators: dorpond, trevor, Azhrei

Post Reply
User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Updating the map view

Post by Azhrei »

Continued from http://forums.rptools.net/viewtopic.php ... 79#p153854
Rumble wrote:The biggest problem is I suck at the Java graphics stuff, so I don't know how to show when you've left-clicked or right-clicked on something.
Should be pretty easy. There's a List<Token> field in the Zone (or ZoneRenderer, or ZoneView) that keeps track of which tokens are selected. Add your token to that list and then call ZoneView.repaint().

I believe the ZoneView class has a static field called currentZone and that could be used to call repaint().

I'm sure there's a more efficient way of handling this than calling repaint(), but that would require digging into the ZoneView class in more detail. I'll do that when I get a chance.

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Updating the map view

Post by Rumble »

Azhrei wrote:Continued from http://forums.rptools.net/viewtopic.php ... 79#p153854
Rumble wrote:The biggest problem is I suck at the Java graphics stuff, so I don't know how to show when you've left-clicked or right-clicked on something.
Should be pretty easy. There's a List<Token> field in the Zone (or ZoneRenderer, or ZoneView) that keeps track of which tokens are selected. Add your token to that list and then call ZoneView.repaint().

I believe the ZoneView class has a static field called currentZone and that could be used to call repaint().

I'm sure there's a more efficient way of handling this than calling repaint(), but that would require digging into the ZoneView class in more detail. I'll do that when I get a chance.

Ah, okay. The biggest problem is that I can dope out what happens in most places, but the painting and repainting and rendering of things is this big incestuous mess of inheritance and implementation and I tend to lose my place backtracking through the classes to see how the concepts relate to each other. So I end up with small things working but the overall goal not being reached.

However, it seems I may have been looking in the wrong places anyway, so maybe it will clear itself up when I take a look later today.

Post Reply

Return to “Java Programming Info”