Download NetBeans!

20091031 Saturday October 31, 2009

OMiSCID GUI on the NetBeans Platform

O3MiSCID GUI is an extensible graphical user interface for visualizing, controling, and interacting with O3MiSCID services. Existing extensions range from generic service manipulators to dedicated service viewers and controllers.

Here's a screenshot:

O3MiSCID can be really helpful in the following areas:

  • you are looking for an easy way to design an application with a Service Oriented Architecture
  • you want to design peer to peer or client/server distributed applications
  • you need a cross-platform cross-language (Java, C++, Python, Matlab) library for network communications and service advertisement and discovery
  • you want a cross-platform C++ library for system abstraction (threads, Mutex, ...), containers (lists, ...) and network Sockets (UDP and TCP)

O3MiSCID is born in the PRIMA project from INRIA Rhône-Alpes.

For further information, go here.

Oct 31 2009, 02:43:30 AM PDT Permalink

Download NetBeans!

20091030 Friday October 30, 2009

Energy Consumption Analysis on the NetBeans Platform

URSUS is a NetBeans Platform application for bioclimatic design and energy consumption optimization in town planning. URSUS lets the designer create a residential area composed of a perimeter, plots, streets, and buildings. The streets divide the perimeter surface into different plots where the user can drag and drop buildings.

The program calculates heating and refrigeration demands in different ways, while taking account of factors such as shade, enclosure characteristics, and solar gains. The designer estimates how to distribute the different elements in the best way in order to reduce energy consumption.

The application is being developed by GEE (Grupo de energía y edificiación) at the Universidad de Zaragoza in Spain.

Oct 30 2009, 04:47:57 AM PDT Permalink

Download NetBeans!

20091029 Thursday October 29, 2009

Saab Systems Grintek on the NetBeans Platform

Kaizen Integrated Tactical Technologies (KITT) is the result of a Saab Systems Grintek (SSG) South Africa (SA) Research and Development (R&D) programme to cater for the requirements of a modern tactical Command, Control, Communication & Information (C3I) environment for the South African National Defence Force (SANDF). KITT is part of the long-term SSG strategy for the development of a common application development platform for current and future projects.

The above is info that is publicly available at kitt.co.za.

Like what Northrop Grumman, Boeing, ND SatCom, and many others provide, SSG has a centralized platform, called KORE, where the NetBeans Platform plays a central role. On top of KORE, various applications are created.

Here are the two current products:

  • Tactical Geographical Information System (TGIS). Based on a C3I system product developed for the South African Navy (SAN) for an Operational Boat Squadron (OBS) base camp. The TGIS component has now been ported onto the KITT platform as a NetBeans module.

    The TGIS can be used in the following environments:

    • Situational Awareness on a tactical level for peacekeeping missions.
    • Real-time Common Operating Picture (COP) of ground, maritime and air platforms.
    • Military operations other than conventional warfare.

  • Symmetry. A generic analysis tool for determining interoperability between nodes on a tactical network. The focus of the tool is currently to determine the level of semantic interoperability between consort systems on different network nodes implementing the Link-ZA standard. Link-ZA is the tactical data link standard that forms a part of the CNIS. This product allows for an NxN comparison of all defence platforms making use of Link-ZA.

Now have a look at the future projects and read about the various new features and applications that are being planned.

Oct 29 2009, 05:45:47 AM PDT Permalink

Download NetBeans!

20091028 Wednesday October 28, 2009

Stop That YANPA!

And the YANPA's (Yet Another NetBeans Platform Application) just keep on coming in! I don't even need to use google to find them anymore, now they're crawling right into my inbox. For example, recently Dave Gilbert from the (awesome) JFreeChart project drew my attention to one seriously cool NetBeans Platform application, which you'll hopefully hear more about soon, once the interview with the related developers is complete.

Then, today, literally within the space of a half hour, Sven Reimers and Nicolas Dumoulin, both of whom work on YANPA's themselves, sent me e-mails (i.e., separately, unbeknown to each other, from different countries) about YANPA's they've recently come across.

So, in order of appearance in my inbox a few hours ago:

  • Gephi. I never knew of this application until Nicolas from SimExplorer told me about it. (More on SimExplorer in a future blog entry.) "Gephi is an open-source software for visualizing and analyzing large networks graphs. Gephi uses a 3D render engine to display graphs in real-time and speed up the exploration."

    Here's one of several screenshots available on the related site:

    Now, read here about NetBeans Platform on the Gephi site. In his e-mail to me, Nicolas adds: "It's NetBeans Platform based, and it rocks!"

  • Amphinicy Technologies. The next e-mail, i.e., not half an hour later, was from NetBeans Dream Team member and Duke Award Winner Sven Reimers. He writes that he "just came across two YANPA's". They're from Amphinicy Technologies, "a premium provider of complex and technologically advanced software solutions. Amphinicy’s team of experts designs advanced solutions for satellite machinery which help the satellites run in orbit and enhances their utility."

    Here are the screenshots that Sven referred me to:

Pretty cool, need to add them to the NetBeans Platform Showcase soon, which currently has 99 screenshots, over 20 more waiting to be added, and several more in the pipeline from companies that have been requested to show off their cool work on the NetBeans Platform!

Oct 28 2009, 11:35:46 AM PDT Permalink

Download NetBeans!

20091027 Tuesday October 27, 2009

How to use getNewTypes?

Here is a very odd thing. Look at the explorer view in the left of this pic:

And now look at the explorer view in the RIGHT of this pic:

The same module installed twice. But... look at "Add System Property" in the left of the top window and then compare that to "Add" (which is greyed out and inactive) in the right of the second window. Those are the SAME menu items.

Why is getNewTypes rendered DIFFERENTLY when it is in the Services (a.k.a. Runtime) window compared to when it is rendered in my own custom explorer view?

And I am not alone with this question:

How to use getNewTypes?

Solution: Hook the explorer manager of your own component to the component's action map and then add that to the context of your component:

Lookup lkp = ExplorerUtils.createLookup(em, getActionMap());
associateLookup(lkp);

Do the above in the constructor of the TopComponent. Now run the module again and when the node appears in your own component, its actions will behave correctly.

Oct 27 2009, 03:46:54 PM PDT Permalink

Download NetBeans!

20091026 Monday October 26, 2009

Calling an Action in the Layer from a Button in a Local Toolbar

I have a window with a toolbar containing a button:

When I click the button, an action that is registered in the layer is invoked. That's great, means that I can integrate my standard Swing components with the NetBeans System FileSystem. Plus that lets me empower the action declaratively with, for example, asynchronous processing by adding a single attribute to the related layer entry (see elsewhere in this blog for this 6.8 enhancement).

How is all this possible?

Well, this is how the action is registered in the layer:

<folder name="Actions">
    <folder name="Bla">
        <file name="org-demo-globloc-GlobLocAction.instance">
            <attr name="delegate" newvalue="org.demo.globloc.GlobLocAction"/>
            <attr name="displayName" bundlevalue="org.demo.globloc.Bundle#CTL_GlobLocAction"/>
            <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
            <attr name="noIconInMenu" boolvalue="false"/>
        </file>
    </folder>
</folder>
<folder name="Menu">
    <folder name="File">
        <file name="org-demo-globloc-GlobLocAction.shadow">
            <attr name="originalFile" stringvalue="Actions/Bla/org-demo-globloc-GlobLocAction.instance"/>
            <attr name="position" intvalue="0"/>
        </file>
    </folder>
</folder>

Take note of the bits in bold above. Now, this is in the button's action performed:

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

   ActionListener al = Lookups.forPath("/Actions/Bla/").lookup(ActionListener.class);
   al.actionPerformed(evt);

}

Here the scenario is very simple, since we know exactly where the action listener is registered and that there is only one file registered in the folder.

More complex scenarios, where you have separators as well as other actions registered in the same folder, require you to do some testing of the instances. See Layer-Based Popup Menus in TopComponents and the other references you find there for further details, if needed.

Also see this discussion from today, which includes code from Fabrizio.

In other news. What's the deal with OSGi and the NetBeans Platform? Watch this brand new screencast for all the details.

Oct 26 2009, 09:08:31 AM PDT Permalink

Download NetBeans!

20091025 Sunday October 25, 2009

Yet Another Return for Marilyn Monroe

The only reason I worked on the checkable/filter sample yesterday was because someone called Markus (could it be Markus Jahn?) asked about the code for the Marilyn Video Store sample, in the comments here. I looked at the source code of that sample and then saw that the checkboxes weren't working correctly. So that's how I ended up creating the sample yesterday, so that I'd have a starting point for integrating that into the Video Store sample.

And so I integrated it today and here's how the Video Store sample now looks:

The checkboxes work as you'd expect—check a checkbox and then the movie is added to the list on the right; uncheck a checkbox and then the movie is removed from the list on the right.

This is where the whole sample can be found:

http://kenai.com/projects/nbvideostore

And here's the source structure:

Next steps are to add selection handling, i.e., when a movie is selected in the left window, the corresponding movie on the right should be selected and vice versa. Then, after that, split the application into three modules, one for each window, sharing a third module that provides the domain objects.

Hope it helps, Markus.

In other news. For an example of the extreme vibrancy of the NetBeans Platform community, read this brand new interview with Peter Rogge, hero of every multilingual NetBeans Platform developer.

Oct 25 2009, 05:02:25 AM PDT Permalink

Download NetBeans!

20091024 Saturday October 24, 2009

Filtering an Explorer View via CheckableNode

This took me a really long time to figure out, but now it's working—and here it is as a sample:

http://kenai.com/projects/nbfiltersample

The scenario is where you have a list in one explorer view and you'd like to use checkboxes to add/remove selected items from that explorer view to/from another explorer view in a different TopComponent:

I spent most of the time trying to use FilterNode.Children, but that's probably not even the purpose of that class. I was trying to use it because I wanted one explorer view to provide a FilterNode on top of a Node from a different explorer view. It didn't work because both views ended up with the same nodes, i.e., the CreateNodes in the FilterNode.Children didn't enable me to create different nodes for the different views. Ultimately I gave up on that approach and simply added/removed items to/from a list that the second children object used to create new nodes in the lower window.

This is how the source structure looks. You can see the two sets of classes for the windows selected. The other classes are "Movie" (which is the domain object), "RootNode" (which includes an action for adding new items to the top window), "CheckNode" (which implements CheckableNode and is added to the Lookup of the node in the top window), and "Utils" (which provides the lists and ChangeSupport that is shared between the other classes).

So not, as intended, a sample of FilterNode.Children. But still very useful, I believe.

Oct 24 2009, 03:04:38 PM PDT Permalink

Download NetBeans!

20091023 Friday October 23, 2009

Rat Brain Analysis on the NetBeans Platform

A famous man once said: "If your framework can't let you analyze rat brains, then it isn't really a framework."

OK. No one ever said that. Nevertheless, since it's Friday, the YANPA of the day needs to be slightly off the wall, so here it is...

Yes. That, my friends, is what a rat brain analyzer (apparently) looks like. It is built on the NetBeans Platform (from several releases ago).

"The Virtual RatBrain Project formed in 2004 in order to build a repository of peer reviewed 3-D cellular anatomical data of the rat brain, collected at multiple levels and from multiple brain regions, including point-to-point coordinate connections, cell populations of different neurochemical phenotype and dendritic and axonal arborizational patterns." Read all about it here, on the slightly squeamishly named http://www.virtualratbrain.org/.

Software architecture:

A number of different people have been involved in this project, from institutions like the Center for Molecular and Behavioral Neuroscience and the Institute of Adaptive and Neural Computation. So... that's yet another bioinformatics application on the NetBeans Platform!

Oct 23 2009, 12:11:42 AM PDT Permalink

Download NetBeans!

20091022 Thursday October 22, 2009

Urban Surveillance Research on the NetBeans Platform

Yet another NetBeans Platform application is part of the Centibots project. This project, a.k.a. the "100 Robots Project", funded by the Defense Advanced Research Projects Agency (DARPA), is aimed at developing new technology to support the coordinated deployment of as many as 100 robots for missions such as urban surveillance.

And guess what? They used the NetBeans Platform: "For the GUI we chose the NetBeans Platform. NetBeans provides us with a plug and play IDE with services common to almost all desktop applications – windows, menus, settings management and storage, file access and more."

Screenshots:

Though the work seems to have been done in and around 2004, the website makes for an interesting read.

Oct 22 2009, 05:50:43 PM PDT Permalink

Download NetBeans!

20091021 Wednesday October 21, 2009

Want to Help Translate/Publish the Next NetBeans Platform Book?

Good news! Today I received word from Jürgen Petri that O'Reilly has given him the translation & publication rights for his German NetBeans Platform book that they published:

NetBeans RCP - Das Entwicklerheft

I have a bunch of copies of that book. It's great. It fills exactly the gap that many seem to have recognized: though there are several books at this point describing the main NetBeans APIs, there are none that show you how to create an application on the NetBeans Platform from beginning to end. And that's exactly what this book does! Each chapter has you adding new features to a Task Manager application, which is what you'll have, ready to be used at the end of the story.

Several translators of the previous book, the one by Heiko, have already expressed their interest in participating. If anyone else wants to get involved, leave a message at the end of this blog entry. You MUST speak/write very good German, though the quality of your English can be less than that.

The book will also... be updated to NetBeans Platform 6.8! That will be the contribution by Jaroslav Tulach (among others).

Finally, if anyone out there knows of a publisher who'd be interested in publishing this book, please let me know! Otherwise, I'm sure I'll have a few interested publishers up my sleeve soon.

Here's the Wiki page:

http://wiki.netbeans.org/PetriEnglishTranslation

Oct 21 2009, 09:45:05 AM PDT Permalink

Download NetBeans!

20091020 Tuesday October 20, 2009

org.openide.nodes.FilterNode

No references to FilterNode in this blog, so let's change that. Here's a great reference by Tom Wheeler:

http://wiki.netbeans.org/DevFaqNodesDecorating

In my example, we'll filter the children of the root node, using the code referenced above. If a node display name is set to "Tom" it will not be displayed:

import java.util.ArrayList;
import java.util.List;
import org.openide.nodes.FilterNode;
import org.openide.nodes.Node;

public class ProxyChildren extends FilterNode.Children {

    public ProxyChildren(Node owner) {
        super(owner);
    }

    @Override
    protected Node[] createNodes(Node object) {
        List<Node> result = new ArrayList<Node>();
        for (Node node : super.createNodes(object)) {
            if (accept(node)) {
                result.add(node);
            }
        }
        return result.toArray(new Node[0]);
    }

    private boolean accept(Node node) {
        if (node.getDisplayName().equals("Tom")){
            return false;
        } else {
            return true;
        }
    }
    
}

And here's the TopComponent constructor that constructs the filtered children above:

public DemoTopComponent() {
    ...
    ...
    ...
    Node filterNode = new FilterNode(new RootNode(), new ProxyChildren(new RootNode()));
    em.setRootContext(filterNode);
}

public class RootNode extends AbstractNode {
    public RootNode() {
        super(Children.create(new DemoChildFactory(), true));
        setDisplayName("Root");
    }
}

More about this can be found here:

http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.html

Oct 20 2009, 04:10:33 PM PDT Permalink

Download NetBeans!

20091019 Monday October 19, 2009

Possibly Another NetBeans Platform Application? (Part 1)

In some recent searches across the internet, searching for some of the many examples I suspected were out there of NetBeans Platform applications, I came across several that LOOK like NetBeans Platform applications. Though I can't be certain that these applications are in fact NetBeans Platform applications, there are several indications pointing in that direction. As in many cases, the website has no reference to "NetBeans" or "NetBeans Platform". And e-mails sent in that direction remained unanswered in these particular cases. So, one can only go by the general appearance of the application's screenshots on the site.

A typical giveaway is the window system. The NetBeans window system, for good or ill, is pretty distinct. The tabs look very different to the tabs from other frameworks (and there are many frameworks for window systems out there). Plus, if the application can run on more than just Windows, there's a reasonable chance that we're in the Java world. And there's also something "je ne sais quoi" about NetBeans Platform applications, something that extends beyond the sum of its parts. Whatever that means.

So, here's screenshots of the first application (of several more that will follow in future blog entries) that I think might be based on the NetBeans Platform. What's the worst that can happen? Someone saying "you're wrong, it's actually not based on the NetBeans Platform"? Or someone saying: "In fact, we considered the NetBeans Platform and we loathe it in every possible way?" Well, OK. Possible. Still, those kind of reactions are valuable too. Plus, hey, I'm giving someone free advertizing for their product, so there's no way their derision for my error can top their gratitude for their 15 seconds of eternal fame in my blog.

And, when properly attributed, there can't be a question of copyright or some such either. Here are the first screenshots of "possibly another NetBeans Platform application" (PANPA), by Envitel in Spain:

SEC-Viewer is all about the analysis of people counting data from multiple premises simultaneously. It is an application that can collect, analyze and graph count data from various facilities from any PC. This system allows you to view and compare, simultaneously, data from as many people counters as needed, create custom variables using several counters and perform advanced macro operations on different counters.

Read more about it here on the Envitel site.

Oct 19 2009, 06:19:26 AM PDT Permalink

Download NetBeans!

20091018 Sunday October 18, 2009

Is Oracle's JDeveloper a Platform?

There is an interesting mini-discussion on Javalobby, about whether Oracle's JDeveloper is a platform. And, as someone in that discussion points out: "JDeveloper is a platform." Indeed, the JDeveloper Wikipedia page makes it very clear:

Oracle JDeveloper is the main development platform for Oracle's tools. The core IDE exposes an API that other teams in Oracle use to build extensions to JDeveloper. BPEL, Portal, BI and other components of the Oracle platform all build their design time tool on top of JDeveloper. The same IDE platform also serves as the basis of another Oracle product, SQL Developer, which is geared specifically at PL/SQL and database developers.

It is statements such as these that continue to throw confusion into the discussion. Because, after all, yes, Oracle has an IDE (JDeveloper), just like Sun has an IDE (NetBeans IDE). And, yes, Oracle has a development platform (JDeveloper), just like Sun has a development platform (NetBeans Platform).

If you like, that's where the story ends.

However, I'd like to see examples of military, financial, and geological applications on the JDeveloper platform before the story ends for me. Applications such as Agile Client by Northrop Grumman:

Or, in fact, applications like any of these:

http://platform.netbeans.org/screenshots.html

Yes, Oracle JDeveloper is a platform. But only if you're interested in creating development tools. Not if you're interested in creating sales systems, for example, such as the Sepix Sales System:

The NetBeans Platform doesn't simply offer APIs for extending its IDE (as JDeveloper does). It offers APIs for creating your own desktop applications, of any kind at all... and financial institutions, military organizations, oil & gas software providers, retailers, and on and on, have been making use of it for MANY years already. And making money off it too, by selling their software created on top of the NetBeans Platform. Typically, all these applications are very large, since the NetBeans Platform's main contribution is modularity/scalability, which is a concern specifically for applications that are either (1) large or (2) will potentially be large at some stage in the future. (And unlike Eclipse RCP, you get to keep your investment in Swing, as a brand new interview with an ex-Eclipse fan shows and this 3rd-party slideshow confirms.)

The word "platform" has been used and abused for so long, that the complete manifold differences between NetBeans Platform and the JDeveloper platform should not really be news. But it's worth mentioning for those who take pride in making superficial comparisons between apples and oranges. Oracle has nothing, in any shape or form, like the NetBeans Platform. The latter does not compete with any of the former's products in any way at all.

Oct 18 2009, 01:39:23 AM PDT Permalink

Download NetBeans!

20091016 Friday October 16, 2009

The Desktop in a Mobile World

What I find very interesting about the NetBeans Zone article Agricultural Management on the NetBeans Platform is the workflow of the FarmLinx Software Suite. First, agri-consultants walk around a farm, with a mobile phone in their hand. They record the number of sheep, or whatever, in their phone, and later they download all their data onto their laptops where further processing takes place... in a desktop application. Obviously. Since they're not necessarily on-line in the first place.

The shortsighted perspective of the web being the only place of interest for application development is proven yet again. Another scenario might be where you're polling people in the street about their prediction of who is going to win an election (in this case, below, Tom, Dick, or Harry). Afterwards, you download all your data from your phone and then compare the result in a graph for further analysis:

The above scenario enabled me to use the brilliant JFreeChart for the first time, in the context of a NetBeans Platform application.

In the application above, I have 5 modules. One module for each of the three windows you see, one module for the domain object (a "Vote" object, with the voter's name, and an int for each of "predictionForTom", "predictionForDick", and "predictionForHarry"), as well as a module that contains the two JARs from the JFreeChart distribution (jfreechart-1.0.13.jar and jcommon-1.0.16.jar).

Whenever OK is clicked in the window on the left, a "Vote" object is added to the context of the window. The other two modules are listening to that context and whenever a new "Vote" object is added there, something changes within each of those two other modules. In the case of the module providing the middle window, the JFreeChart implementation is updated (by recalculating the total prediction percentages), while the window on the right has a new voter added to the list.

Only the center window has a dependency on the JFreeChart module. Here's all the relevant code, in the middle window's definition:

public final class ChartTopComponent extends TopComponent implements LookupListener {

    private static ChartTopComponent instance;

    private static final String PREFERRED_ID = "ChartTopComponent";

    private Result<Vote> res;

    DefaultPieDataset dataSet = new DefaultPieDataset();

    public ChartTopComponent() {

        initComponents();
        setName(NbBundle.getMessage(ChartTopComponent.class, "CTL_ChartTopComponent"));
        setToolTipText(NbBundle.getMessage(ChartTopComponent.class, "HINT_ChartTopComponent"));

        PieDataset group = dataSet;
        JFreeChart chart = createChart(group, "Combined Likelihood of Winning");
        ChartPanel chartPanel = new ChartPanel(chart);
        chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
        add(chartPanel, BorderLayout.CENTER);

    }

    private JFreeChart createChart(PieDataset dataset, String title) {

        JFreeChart chart = ChartFactory.createPieChart3D(
                title, // chart title
                dataset, // data
                true, // include legend
                true,
                false);

        PiePlot3D plot = (PiePlot3D) chart.getPlot();
        plot.setStartAngle(290);
        plot.setDirection(Rotation.CLOCKWISE);
        plot.setForegroundAlpha(0.5f);
        return chart;
    }

    @Override
    public void resultChanged(LookupEvent ev) {
        Collection<? extends Vote> coll = res.allInstances();
        TotalVote total = new TotalVote();
        for (Vote vote : coll) {
            total.setTom(vote.getTom());
            total.setDick(vote.getDick());
            total.setHarry(vote.getHarry());
        }
        dataSet.setValue("Tom", total.getTom());
        dataSet.setValue("Dick", total.getDick());
        dataSet.setValue("Harry", total.getHarry());
    }

    @Override
    public void componentOpened() {
        res = WindowManager.getDefault().findTopComponent("VoteTopComponent").getLookup().
                lookupResult(Vote.class);
        res.addLookupListener(this);
        resultChanged(new LookupEvent(res));
    }

    ...
    ...
    ...

And that's a simple example of how to integrate JFreeChart in a NetBeans Platform application!

Oct 16 2009, 02:24:04 AM PDT Permalink