[Java]I don't know what this is for (need help with source)

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
LWZ
Kobold
Posts: 10
Joined: Sun Jan 13, 2013 9:36 pm

[Java]I don't know what this is for (need help with source)

Post by LWZ »

I'm trying to rework the zone code (package net.rptools.maptool.client.ui.zone) but I've run into a few problems with understanding the code. Namely, I have no idea what zones are. More specifically, I don't know what many of these classes are for.

For example:
* What is the "vbl" folder and do I need to change stuff in it?
* What is AreaData and how is it different from AreaTree? What do they represent? What behavior do I need to maintain?
* Why are areas being broken up in the above two classes?
* Where do I get net.rptools.lib.GeometryUtil?

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

Re: [Java]I don't know what this is for (need help with sour

Post by Azhrei »

This is better covered in the Developer Notes forum. (Hm, actually in the Java Programming Info subforum. I'll move it there.)

You'll find that there is little or no overall architectural documentation regarding MT. That means we all learn it the same way: from scratch.

I've been trying to add javadoc to any classes I modify so at least the individual classes will have some kind of documentation, but that's it.

To find how some of these classes work, I suggest starting from the UI. For example, if you check in AppMenuBar.java you'll see that's where the menu is built. You could look at the New_Map operation and follow the code (put the cursor on a class or method name and hit F3). As you follow it, you'll begin to understand the context of the various packages and classes.
LWZ wrote:For example:
* What is the "vbl" folder and do I need to change stuff in it?
It's the implementation of the Vision Blocking Layer.
* What is AreaData and how is it different from AreaTree? What do they represent? What behavior do I need to maintain?
I have no idea. I'm not an expert with VBL. I believe Craig has worked on it more, but to truly grok it you'll need to start with a code walk through. Visit the Zone.render() method and watch for calls to the VBL classes. As you learn how the map is drawn, you'll have the context for how the VBL classes are used.
* Why are areas being broken up in the above two classes?
Beats me. :roll:
* Where do I get net.rptools.lib.GeometryUtil?
It's in a separate project called rplib. You'll find that MT uses rplib and parser and dependency projects. If you put the cursor on GeometryUtil and hit F3 it'll bring up a page with no source. Read it carefully and it'll reference the file rplib-1.0.b133.jar (or something like that). And that file is the result of building the rplib project.

Post Reply

Return to “Java Programming Info”