Help: Generating instances of different Objects

True, the documentation on that front is a bit lacking here and there but rumor has it that Visual Paradigm are busy looking into ways to expand on their documentation and manuals. Of course that’s hear say on my end (treat it as a rumor), but I think 2018 is going to be a very interesting year for Visual Paradigm.

But… back to the issue at hand.

First stop: get the Java documentation. You can access and/or download that here. I strongly suggest that you download the ZIP file and then add it to your IDE so that you can use that.

In all fairness: there isn’t as much explanation in the documentation as I’d hoped for, but it does a good job in giving you a solid overview and a brief description of what methods and properties do.

A good source of information is VP’s Know How site. I suggest that you specifically check out the Open API section because it has some really good articles which explain some of the basic development concepts in good detail.

I’ve made a few plugins myself in the past months and well… I basically went with trial and error combined with the know how section I mentioned above. I spend a lot of time just going over the methods in the API (I’m a NetBeans user myself, and you can expand any assigned libraries to get a good overview of its packages and classes).

It basically boiled down to skimming the library and finding some recognizable aspects for me. For example… When I looked over com.vp.plugin I discovered the ApplicationManager class (basically an abstract class). That stood out for me because the majority of the API consists of interfaces. So when I noticed an instance() method I knew I was onto something.

Maybe this can help… I made 3 plugins so far and eventually combined them into what I like to call the Catslair VP Suite (still thinking of a better name). Click the link to download, it contains all 3 my plugins as well as their source code.

I think you may especially enjoy “PluginReloader” because it does exactly what its name implies: it tells VP to reload the currently loaded plugins. Meaning that if you work on a plugin, make changes and then immediately deploy those changes into your VP Plugin directory then they will become immediately active. Check this thread for more info on that.

Next it contains a plugin which I made for another forum member: it resets the formatting of all the model elements in the currently active diagram. It does this by creating a model element of the same type, then copying all its formatting properties. I think this may also be of interest to you because I’m basically creating model elements.

And finally, being a really big fan of VPository myself I wanted an easier way to open its control panel. So I wrote a plugin for that :wink: If you’re using VPository then this gets saved in your data directory. My plugin checks that information and then uses it to open your default browser with your personal VPository URL.

Hope this can give you some ideas.

And don’t forget: if you have specific questions you can also ask 'm here on this forum :slight_smile:

1 Like