DarkMonkey Dev Blog - [Completed]

Continuing the discussion from DarkMonkey Theme:

And here is where I will be putting my blogs for this project. It’s complete now, and this topic contains some cool random stuff I came across while developing it.

##We can start off with the first video:##

and its related build:

##or you can just jump to my latest post:##
Latest: DarkMonkey Dev Blog - [Completed] - #34 by Relic724

4 Likes

Will it be possible to use DarkMonkey Theme with standard Netbeans also?
Good job! :slight_smile:

You already can actually.
That’s a laf and it comes as a netbeans plugin.

02/13/15 Talkin’ bout some Icons, Github “Releases”, and other Stuff

Hi All,

So I learned about Github and “Releases” and the version that I’m using as reference is this build:

Just know that I will arbitrarily keep switching between alpha n beta tabs due to my own opinion of stability/project garbage, not in actual relation to any true project completion. I personally think that I am at 20% of full functionality atm soooo 0.2 and “beta” to reflect that garbage/extraneous code is at a minimum, and testing was done by me. I think that tagging without an alpha or beta means that other folks had written back that it works on their machines/installations on top of the testing that I do. So, there we go for general things that need to be written down.

On to the Video!

Yeah, the thing to take away from this blog is that Folks of the “artist variety” who want to jump in on this project will have a static method available to them that processes an “odd looking picture” into a color-scheme coordinated icon, *that will shift to the magic colors" of that color scheme. I use good ol’ Gimp for the example, but I think that this principle can be used in photoshop or other layer based graphics application that supports layer blend modes.

on the programming side, Java tends to store colors as ARGB8 or 0xFFFFFFFF or 32-bit “ints” and the break down is:
0xFF000000 : alpha-channel mask
0x00FF0000 : red-channel mask
0x0000FF00 : green-channel mask
0x000000FF : blue-channel mask

But, I will go into more detail on this in the next blog. This one’s more for the Artist types who want to join in.

3 Likes

02/13/15 This one’s 3 handy tips for Module development in Netbeans.

Hi all,

On the programming side, I thought it would be nice to mention a few tips that I think are handy for Module development. Yeppers, and though this is Netbeans stuff, it also applies to folks looking to program their own tools for JME3. We don’t have all the cool tools? No problem, these tips might help you get your feet wet and get started. And if you think you’ve got a good tool and want folks to be able to use it, you can! Also, wouldn’t it be handy to have a preview module ready that folks can get their hands on? You can get some early feedback and, if it becomes really popular and well documented, you could even toss it over to core to become part of the Main Package.

And now for the Video!

Yeah, the 4 major things I think are handy to take away from this video are:

  1. Why not go with a Module Suite, rather than just a Module? I guess you could probably go with something like MainModuleNameSuite for the name if you want it to look pretty. It doesn’t seem to hurt the whole “making a module” process, and I personally like the ability to expand functionality with inter-module communications.
  2. You can run/reload in development IDE if you know your module will run sweetly, but while you are developing, try to just hit the play button or “reload in target platform”. If you do end up nuking your development IDE, you could just delete the user config directory rather than reinstall netbeans to recover.
  3. There are 2 magic locations that I know of in Netbeans… the system config directory, and the user config directory. The system config directory also contains the Working directory, or where the Netbeans system starts from. So if you are adapting code from, say, a standalone Applet and something is going wrong… It’s most likely because your applet is in the user config directory, but some relative path is looking in the Working directory which is somewhere else, and protected to boot. Also, I’ve heard mention of a module cluster setup that Netbeans uses: it might be possible to just delete a line of reference XML in some file, and delete the guilty module directory to recover from an accidental IDE nuke, but I don’t know that information yet… so I can’t say for sure… I can only guess it would be possible from what I’ve learned, so far. Oh, and you don’t have to worry about “losing it all” on a nuke, your project directory is usually different from the other 2 directories, unless… for some reason you thought it would be cool if… No, just no.
  4. and when you deploy an NBM it shows up in the ProjectName’s build directory ready for you to share with friends.

Next up, I think I’ll go over making a module all “pretty/cool” for folks.

1 Like

##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:

  1. bundle.properties is the key file to focus on for making things look cool. and the long description is the one to heavily customize.
  2. the rest is pretty much educated guesses: I’m still learning. … see below
  3. 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…
  4. 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…

##02/20/15 - palletSwapARGB8 is finally functional…##

though I consider it’s behavior to be buggy/incomplete. The work around that I have going on at the moment is to send a “clear to” color alongside the pallette of colors, for better blending purposes. The main problem seems to stem from my usage of a Method that I believed would return the Alpha value that was set along with the color… this is not the case… it defaults to 1f. grrr. oh well.

So, the first half of the vid is showing @nehon how his artwork got processed, and some of the immediate “tweaks” that I could suggest. The second half is a breakdown of the palletSwapARGB8 method.

On to the Video!

And the two things I forgot were:

  1. to show the bug in action with the blending… the demo was with workaround active. Thus, my problem was not viewable.
  2. oh, right… the “done once” … it stores a copy of the final result before painting on the factory level. so draw calls after that first processing…is only called for the already processed result… It will reprocesses when told to by a null constructor call (UIResource Interface)

##02/27/15 Talkin’ bout Netbeans FAC and modules.##

Premumble:
So, when I thought of the whole “Dark Theme” I knew that I would be covering the LAF for the major interactions and the FAC for Netbeans editor to profile the full theme for the upcoming SDK. So, though the LAF could be detached from the project and used in other java programs through proper class pathing and the --laf switch from the command line… The FAC only applies to Netbeans and it’s Editor. So, when i went to find an example in module form, @venkatram_akkineni’s ez-on-da-ice plugin was the only one I found that did so. He did it very well, and this is more a comment on the form. I studied his source and saw that it was his learner’s project: Something that you do in a form that retains errors and artifacts for people to learn from. Clean design is best for a community project and relies upon heavy documentation so others can “get up to speed” and “pick up the ball” with what you had in mind. However, you can’t really learn from that type of format (which is why it HAS to have heavy documentation). So, let’s get more specific about FAC, now.

FAC themes can be shared by users by exporting netbeans settings in a .zip file. That was the form that I originally received obsidian in. It is also the form that I received @nehon’s latest color corrections for the FAC side.

This is not the form that a module wants to try to accept, however. The Fonts and colors api for editor settings is a “friend” status or better type thing over at netbeans. Most likely because the settings has two sides as well… the FAC side and the Keyboard Shortcuts side…(@normen I can help ya out with that proper emacs shortcut declaration if you haven’t got it already taken care of). So yeah, they probably didn’t want the public running around making inadvertent architecture calls on a forming system.

So, here is the best way to include a complete FAC in a nebeans module, atm.
include a layer.xml file to your project and simply place the appropriate FontColors-for-editor.xml files in the right spots and make sure to add the appropriate attr tag for the editor module’s benefit (it’s token, highlight, or annotation, atm) Token is based upon the idea of a “word” or assemblage of characters to represent a full idea. Highlight is based more upon positions in the document. Annotation is based more upon “stuff that gets sent to other modules from the editor” like the editor’s sidebar, ant, pom, debugging, git, subversion… etc. So that’s the rough structure of FAC and how it goes into netbeans, if it made any sense.

That pretty much wraps up the text bit… onwards to the video that you don’t really want to do midproject because you look kinda stupid afterwards but also is the best time to show why certain decisions are being made! ← worst sentences… me.

-Yeah, I realized that I had an error in code… lol. After watching the video… (I also saw where I seriously “derped” and got derailed… It’s a bit of the balancing beam act to present the knowledge as fast and as sensibly as possible…) I had forgotten to remove an ‘s’ from the:
file name=“DarkMonkeyFAC-text-x-java-tokens.xml” url=“fac/DarkMonkeyFAC-text-x-java-tokens.xml”
so… uh… yeah…
file name=“DarkMonkeyFAC-text-x-java–token.xml” url=“fac/DarkMonkeyFAC-text-x-java–token.xml”
and fixed.

2 Likes

Hey

Thanks for the tip. I knew that there is no need for specific directory structure inside the code. What you are looking at is what netbeans calls a file system, specifically XMLFileSystem. It has more than one file system. Look at File System APIs for more detail.

However I created those directories to make my life easier. I developed the theme inside my development IDE, I mean, I would go to the Options window and change colors save, verify inside the editor & repeat the process until I was done with all the colors.

Then I would export it, unzip it & then just paste it inside the source directory, that’s all I had to do. If I used just one file, with each iteration of improvement of the theme I would have to manually add those colors to that one XML file which is a massive pain. So, once I had that directory structure in place, I would never have to touch it again, or the xml file. I would merely fix the colors in the Dev-IDE export-unzip-paste into source directory.

Nice, your laf seems to be coming along nicely. I see you have used NimROD. ez-on-da-ice used NimROD in the beginning. I had to take it out because it has some compatibility problems with Netbeans. Hoping you realized that and fixed them.

Goodluck
Venkat

3 Likes

Amen to this:

IKR!?

yeah, that’s the biggest advantage of single responsibily / single author projects… We can get stuff (<- may not be the actual word I used) DONE, and we know what we’ve done. Sigh, hopefully I prep this project correctly with javadoc and readme so that this “one-shotter” is easily community maintainable. Well, here’s to the “hoping I get it right” adjustment to code n stuff.

But yeah! glad you enjoyed the tip!

edit: oh, almost forgot!

yes, I have. The big solution can be found in the DMUtils loadImageFromJar method. I mention it in one of my other dev blogs ^up there somewhere^ to adapt resource calling properly in a multi classloader system. I figure the rest is some area draw calls that doesn’t take GridBagLayout into account, like metal does, on an override. I’ll be sharing that solution with Nilo, as well.

2 Likes

##03/03/15 Talkin’ bout some Font testing, Github pull requests, and an Eye-Gouging nbm that is probably best left on video.##

Howdy Folks,

I’ve been in communications with some helpful people here at the jMonkeyEngine forums and I am now “learned up” on a convenient way (for me) to work with Github and the Github client.
I’ve also been working on Font code for installing an included ttf file into the JRE without installing it on a computer. That way, if the font is not actually wanted… it won’t hang around, and glare at you the next time you go to change fonts in your word processing program of choice.
To test it out, I’ve made a special nbm (which I’ve tagged for folks who are masochists) as a way of having fun, and sending a special nod to the cute Gooseface.png I received:


“aaawwww… sooo cuuuute!” :smile:

So with that in mind, I present… The Video! (safer this way)

Mainly because you probably don’t want to use this:

If you are a severe masochist, here’s your link:

03/04/15 Project ready for community contribution:

Okay, so I’ve got all the base functionality that I believe I need finished up, and I’ve got things documented nicely… I think. :sweat_smile:
I just have one big bug hunt to go and I can call this project done!
So, I’ll be opening up this project to the jMonkeyEngine community to poke, prod, and play with, in the mean time. It’ll work with the latest ver. of Netbeans, as that the Downloadable SDK I got a hold of (Netbeans 7.3.1) doesn’t have the LookAndFeel tab in Appearance. So, woooo! We are ramping up to 3.1! yay!

And as always, The Video:

and the quick link to this build:

1 Like

@nehon: just a quick side note: I’m going to play a little dwarf fortress and then get started tomorrow… I know that this one will toast my brain. Initial eta: 4-6 days. It depends upon how quickly I can find the guilty Override.

WHAT???
You mean you are actually gonna spend your spare time to entertain yourself instead of coding for others???
How dare you???

Have fun :wink:

1 Like

Yay DF, if only it had a better user interface (i can bear the grafics) never managed to get a actually reliable working military squad:)

1 Like

@Empire_Phoenix

Yo, dis how I roll on my Dwarf Fortress! Yo. My Dwarf Fortress is Pimpin’, Yo. Cribz fo’ shizzle.

Edit: This has nothing to do with DarkMonkey… I am abusing my privilege as main Dev for this project… and after playing today… I am heading back to serious posts n stuff.

Yo.

Yay i’m getting mentiond :slight_smile: Must watch in peace complete later, and then I will probably sink the next day in a d̶e̶a̶t̶h̶ ̶t̶r̶a̶p̶fortress.

03/07/15 - The Final Bug Hunt, part 1##

Hi all,

This video just shows me during my process of a typical bug hunt and reflects some of the logic I use to locate and troubleshoot. I was about to enact my first series of tests / fixes upon the included nimROD source files… And I realized that I’d better show what the bugs are… before I squish them. The next video will be the “after” where I discuss my solution.

So… Here’s the bugs! woot!:

My initial guess to the solution at this point in time relies upon these known tidbits:

  • The “bugs” all involve a common problem of proper sizing for display. ← functionality clue
  • The “bugs” may contain “container” within “container” situations. <— logical clue, possibly associated
  • The “bugs” start with the introduction of NimROD on top of Metal. <— location clue
  • Previous personal experience: Java architecture is heavily event driven due to consideration for threads… Things can go wrong due to “timing” of calculations for rendered area. <— logical clue… most likely “cause” of bug.

Extra known “tidbits”

  • The class UIDefaults is essentially a Hashtable<Object,Object> due to two modes, default and localized… it has an interface declared that is called UIDefaults.LazyValue, This may bear upon the circumstances directly due to Netbeans
  • Netbeans extends some JComponent classes and derives new UIDefaults through inheritance and adds “nb.” prefixes to the several new UIDefault entries… this inheritance probably requires LazyValues to function properly. AKA the Timing issue…

There may be a deeper systemic issue involved… so I just wanted to list the bugs “just in case” I’m right… cause its tough to show something that is no longer there… yeppers

04/11/15 It’s Spring and I’m Distracted

I’ve been playing with Lightworks/CleaningHouse/Taxes/OtherStuff/Etc/Etc/Etc

and not DarkMonkey debugging… So… I’m trying to get back on track. Here’s my vid… back to staring at my screen and trying to get enthused.

Ugh… I’ve found like 15 things that don’t work so far, though… :hankey:

2 Likes

05/01/15 Registering Arbitrary Actions with Netbeans

Ok, so I’ve proven to myself that I have horrible googlings skills, and I can’t seem to focus for anything to hunt down these silly bugs. So, I’ve made an action to help me figure out where these bugs might be stemming from. Github is updated for those folks wanting to grab a snapshot of the project in it’s current state. I’m not doing a release or anything until I get this figured out and solved… still the action is handy for this type of thing so grab a copy if ya want.

I am putting, at most, two more weeks on this hunt. If I can’t figure it out, by then… I will be sad, on top of frustrated with myself. Good luck to me, I’ll probably need it.

Game on,
Charles

1 Like