##02/13/15 How to Make a Cool Netbeans Module Description##
On the Programming Side and Artistic sides, wouldn’t it be cool to have an awesome looking plugin description for when you contribute? It’s okay to have the one liner description… just sayin’. I touch upon a lot of things to consider when deploying a netbeans module, but the key thing I’m focusing on is The Netbeans Long Description.
On to the video!
edit: oh wow, I just found an “easier way” :chimpanzee_facepalm: see below
So things to take away from this video:
- bundle.properties is the key file to focus on for making things look cool. and the long description is the one to heavily customize.
- the rest is pretty much educated guesses: I’m still learning. … see below
- including this statement: Keystores are stored on servers and certificates are verified upon the servers. for .nbms it may be called tokens… see below…
4: including this statement: It’s probably easiest to set your project license in the project properties window… from somewhere… edit: found it… see below…
- including this statement: localization is more done with something like:
OpenIDE-Module-Long-Description_fr=Something with french fries…
Supporting Links referenced in Video:
https://vellum.googlecode.com/svn-history/r377/wiki/blog/swing/Webstart.html
and below,
… yeah, project properties… probably easier, and more reliable. oh well, I learned me something new…
Next up, I think I’ll tackle correct reference for Modules vs normal app. edit: scratch that I’ll just give a heads up on the uberest cool thing that I learned for java so far… edit: double scratch that I’ll just put it here.
edit: now that I’ve rested from my coding/video producing bing I have a bit more brains to add to this blog post. Ok so in the following code, I went with a public static method, because it serves as a utility function that is specifically geared to netbeans class loader system. In netbeans, every module gets its own class loader. I think that the Lookup is mostly an openIDE class… I think. So, to cover both Netbeans and non-open IDE situations this method takes the calling object’s class loader as the base refObj, and uses the classloader, instead of a typical lookup. This is especially useful for LookAndFeels which need the ability to run in a non-netbeans environment, yet this one will support additional modules to be able to be tacked on. In other words, this is part of the architecture for the modification page slated for future dev. Read: I may make an API for Darkmonkey where folks can override w/e drawing components that they want.
Typical Simple Usage envisioned: Image overridenCloseIcon = DMUtils.loadImagefromJar(this, “resources/myCloseIcon.png”).getImage.getScaledInstance(myDesiredWidth, myDesiredHeight, Image.SCALE_SMOOTH);
Processing Result: It will look in the jar file of the refObj, and look for a folder in that classes package… so if the refObj is for example: com.jumpy.herp.derp.DerpyLaFIconFactory.class…
it would look for: com.jumpy.herp.derp.resources.myCloseIcon.png. And then with the .getImage(), convert from BufferedImage to Image, and then with the getScaledInstance(), create a new Image scaled down to w/e size is in myDesiredWidth, myDesiredHeight, and finally assign it to the Image overridenCloseIcon.
Yay! I love having some sleep n rest! LOL
public static BufferedImage loadImagefromJar(Object refObj, String fileName){
BufferedImage bi = null;
try {
bi = ImageIO.read(refObj.getClass().getResourceAsStream(fileName));
} catch (IOException e) {
// File is probably referenced wrong... lol.
e.printStackTrace();
}
return bi;
}
and done… I’m heading back to code now… I want to keep going on learning draw calls so I can show off the processing for that image…