Friday May 31, 2013

Integrating with the NetBeans Platform Recent File Infrastructure

If a CloneableTopComponent has a DataObject in its Lookup, the DataObject will be added to "File | Open Recent File", after the CloneableTopComponent has closed.

The relevant classes are in the "org.netbeans.modules.openfile" package in the NetBeans sources. To include the package in your application, put a checkmark next to "User Utilities" in the "ide" cluster, in the Project Properties dialog of your application.

The RecentFiles class, in the "org.netbeans.modules.openfile" package, maintains a list of recently closed files. In the Installer class of the module, a call is made to RecentFiles.init(), which adds a WindowListener to the TopComponent.Registry. Whenever a TopComponent closes, its DataObject is added to the recent files list, while it is removed when the TopComponent opens.

However, here's the catch:

private static void addFile(TopComponent tc) {
    if (tc instanceof CloneableTopComponent) {
        addFile(obtainPath(tc));
    }
}

Let's say that you're creating a GUI editor (i.e., not a text editor). You have a TopComponent, within which you have GUI components, on top of a DataObject. I.e., there's an actual file beneath the TopComponent but you don't want a text editor to be available to the user. The above code shows that if you want your DataObject to be included in "File | Open Recent File", you need to extend CloneableTopComponent, rather than simply TopComponent.

Next, make very sure that there's a DataObject in the Lookup of the TopComponent. Otherwise the code below, again in the RecentFiles class, will fail:

private static String obtainPath(TopComponent tc) {
    DataObject dObj = tc.getLookup().lookup(DataObject.class);
    if (dObj != null) {
        FileObject fo = dObj.getPrimaryFile();
        if (fo != null) {
            return convertFile2Path(fo);
        }
    }
    return null;
}

So, now you have a CloneableTopComponent with a DataObject in its Lookup and, when the CloneableTopComponent closes, its DataObject is added to "File | Open Recent File". All seems to be well and good at this point. However, there's still a catch. Because you're extending CloneableTopComponent, the Clone action in the tab of your CloneableTopComponent is automatically enabled. When the user invokes that action, you need to be sure to have a no-arg constructor in your CloneableTopComponent, because that's what the Clone action invokes. The solution to this is simply to get the current DataObject from the Lookup and pass that into the constructor that receives the DataObject.

At the same time, though, another problem is that you need to make sure that when the user opens your CloneableTopComponent a subsequent time for the same file, the same CloneableTopComponent should be opened, rather than creating a new one. And possibly the reopening is done from the Favorites window, which automatically has the DataObject in its Lookup when you select the file. Hence, you need to put a new Object, I've named it Reopenable, into the Lookup of the CloneableTopComponent, so that when a new attempt is made to open it, the correct one is found.

In short, I end up with a file editor as follows:

@TopComponent.Description(
        preferredID = "MyFileEditor",
        iconBase = "com/example/singleview/filetype/myImageIcon.png",
        persistenceType = TopComponent.PERSISTENCE_NEVER)
@TopComponent.Registration(
        mode = "editor",
        openAtStartup = false)
@ActionID(
        category = "Window",
        id = "org.example.singleview.filetype.MyFileEditor")
@ActionReferences({
    @ActionReference(
            path = "Menu/Window",
            position = 0),
    @ActionReference(
            path = "Toolbars/File",
            position = 0)
})
@Messages({
    "CTL_OpenMyImageAction=My Image Data"})
public class MyFileEditor extends CloneableTopComponent {

    public MyFileEditor() {
        this(Utilities.actionsGlobalContext().lookup(MyCustomDataObject.class));
    }

    public MyFileEditor(final MyCustomDataObject mcdo) {
        initComponents();
        setDisplayName(mcdo.getPrimaryFile().getNameExt());
        associateLookup(Lookups.fixed(mcdo, new Reopenable() {
            @Override
            public MyCustomDataObject reopen() {
                return mcdo;
            }
        }));
    }

    ...
    ...
    ...

And here's the related DataObject (minus all the annotations at the top):

public class MyCustomDataObject extends MultiDataObject implements Openable {

    public MyCustomDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
        super(pf, loader);
    }

    @Override
    public void open() {
        TopComponent tc = findTopComponent();
        if (tc == null) {
            tc = new MyFileEditor(this);
            tc.open();
        }
        tc.requestActive();
    }

    private TopComponent findTopComponent() {
        Set<TopComponent> openTopComponents = WindowManager.getDefault().getRegistry().getOpened();
        for (TopComponent tc : openTopComponents) {
            if (tc.getLookup().lookup(Reopenable.class) != null
                    && tc.getLookup().lookup(Reopenable.class).reopen()
                    == this.getLookup().lookup(MyCustomDataObject.class)) {
                return tc;
            }
        }
        return null;
    }

}

Thursday May 30, 2013

Wednesday, June 12, 2013: Java EE 7 Launch

The introduction of Java EE 7 is a free online event where you can connect with Java users from all over the world as you learn about the power and capabilities of Java EE 7. Join us for presentations from Oracle technical leaders and Java users from both large and small enterprises, deep dives into the new JSRs, and scheduled chats with Java experts.

Plus, the highlights of NetBeans IDE support for Java EE 7 will be demonstrated during the event!

Wednesday May 29, 2013

Sales Data Analysis Software on the NetBeans Platform

Since 1998, Itransition has been a software development innovator providing full-cycle high quality services to its customers in over 30 countries worldwide. One of its many applications is Eltim Reporter, a sales-data analysis application on the NetBeans Platform:

Mihail Rukavishnikov, Eltim Reporter's lead developers states:

We developed Eltim Reporter as a desktop application for sales data analysis. It was great to use the NetBeans Platform for making the application flexible. We've made module templates for data access, reports, and business logic implementations, so that by adding plugins to the application we're able to receive additional data sources which are dynamically added to the existing ones - and that's cool. The development process is like: "You need an additional report ?" - "OK, here is a plugin with it". And clients are so happy that they don't need to reinstall the application and configure things by themselves. In my mind, the NetBeans Platform is the best way to develop desktop applications in Java. 

Tuesday May 28, 2013

Data Mining and Social Network Analysis Software on the NetBeans Platform

AdvancedMiner Professional is developed by StatConsulting in Warsaw, Poland, on the NetBeans Platform. It is a modern and advanced analysis application that provides a wide range of tools for data transformations, construction of data mining models, advanced data analysis, and reporting.

AdvancedMiner SNA, where "SNA" stands for "social network analysis", is a subset of AdvancedMiner Professional. It provides a completely new way of looking at your customer–not only as a separate entity but as a member of a society.

Monday May 27, 2013

First Java-Based Office Suite on the NetBeans Platform

A launch of a NetBeans Platform application that has generated even more buzz than NetBeans IDE launches is that of Joeffice, Anthony Goubard's open source office suite, the first Java-based office suite, which he created in only 30 days on the NetBeans Platform:

You can read about the above application at the following URLs:

On YouTube, he documented the development process over 30 days, here, especially this one is interesting in that it shows an introductory demo of the app:

The launch party will be held this Thursday, in Amsterdam, as can be read here

Many congratulations to Anthony, who created the application so that other open source developers can contribute to it. Have a look around on the site, lots of information can be found there, to help you get started.

And now there's yet another NetBeans Platform screenshot in the massive backlog I reported on a few days ago... 

Sunday May 26, 2013

Math Skill Development Software on the NetBeans Platform

Mike Gordon is a secondary math-science teacher at Piedra Vista High School in the state of New Mexico, USA. He's put together an application that was originally intended to simply save time on grading student work by allowing the computer to do it for him. It has evolved over time and, while it has not met the original intent, it has saved Mike's colleagues and co-workers many hours. Over the course of 5 years, Mike and his colleagues have tested and refined the application through daily use at their school. It has evolved to become more of a data gathering and reporting tool for student performance than a grading application.

A little over a year ago Mike decided to begin using the NetBeans Platform to produce a more professional looking application. It turned out to be a wise decision. Users have approved the transition, though there is still a large amount of work to be done.

The application has two parts, one that students use and one that instructors use. The student software is used for formal testing and less formal assignments, directed at math skill development. The teacher software involves interaction with a MYSQL question database and a variety of student records.

The idea behind what the software does is this:

  • The majority of questions use a random number generator to select numerical values presented in the question. The application strives for a minimum of 60 numerical variations on each question. This significantly reduces student dishonesty. Because the questions are not static, students can be given multiple chances to achieve success on formative assessments. Each attempt however comes at a cost. The maximum score that they can earn decreases exponentially.

  • Each question is tagged with standards information. Standards are are like architectural blueprints in that they clearly define the expectations for the end product. The blueprints define the form and function of a building, while the standards define what a proficient math student should be able to do. These are produced on a national scale.

  • The data collected is used to inform all stakeholders. Teachers are also given the ability to compare student scores with those of other teacher-student groups that use the same assessment. This promotes conversations among teachers and encourages the sharing of best practices.
Mike is working this summer to provide a simple survey capability. Professional learning communities will be able to produce a survey and get electronic feedback that is easy to tabulate and statistically analyze.

Saturday May 25, 2013

No Expansion Icon When No Children (Part 2)

In part 1, the problem of the superfluous expansion icon is discussed and solved. However, the solution is incomplete as Michael Bishop indicates in the comment to part 1:

I recently implemented this solution. The explorer tree appeared correctly, but no longer updates correctly; adding and removing nodes don't seem to be triggering the refresh() method in the factory class. For instance, when adding a new child, the underlying data model updates and I can confirm the child is added, but nothing happens in the tree.

The solution to the above is to (1) detect when a new child is added and to (2) then call Node.setChildren to update the node hierarchy. Set a PropertyChangeListener on the node and then call setChildren when you detect that a new child has been added.

@Override
public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getPropertyName().equals("ADD")) {
        setChildren(Children.create(new ObjectChildFactory(bean), false));
    }
} 

This technique lets you show the user the true hierarchical state of each node, i.e., only if a node has children is an expansion icon shown.

The whole solution, i.e., a complete application that shows all the pieces fitted together, is available here:

https://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.3/misc/ObjectViewer

Friday May 24, 2013

Over 100 Images To Be Added To NetBeans Platform Showcase

There's a folder in the NetBeans repo where NetBeans Platform application screenshots are stored, one per application (together with a thumbnail image) for publication on the NetBeans Platform Showcase. New images are added there whenever we identify new NetBeans Platform applications. Once in a while, I go to that folder, identify the newest images, and then include them, together with a description, in the showcase, i.e., manually, simply by typing in an HTML file.

However, recently, there have been SO many newly identified NetBeans Platform applications (small tip of the iceberg here), that there's a massive backlog of screenshots that have yet to be published. And, over the years, some screenshots made their way in there without being published in the showcase. Therefore, I needed to create a new plugin that lets me, inside NetBeans IDE, right-click on the folder containing the images, after which a dialog lets me specify the showcase file, which is then searched. If the showcase file does not contain a reference to the name of the image, then that's an image that I need to include in the file.

Via this plugin, I have identified over 100 images that are in the folder but have not yet been included in the showcase. Therefore, if yours hasn't been added yet, please be patient, there's just a massive backlog due to the wide usage of the NetBeans Platform through all kinds of software around the world.

Here's the code for the plugin that lets me do this analysis:

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle.Messages;

@ActionID(
        category = "Tools",
        id = "org.netbeans.i2f.LocateImagesInFileAction")
@ActionRegistration(
        displayName = "#CTL_LocateImagesInFileAction")
@ActionReference(path = "Loaders/folder/any/Actions", position = 250)
@Messages("CTL_LocateImagesInFileAction=Locate Images in File")
public final class LocateImagesInFileAction implements ActionListener {

    private final FileObject context;
    private final List<String> notFoundWords = new ArrayList<String>();

    public LocateImagesInFileAction(FileObject context) {
        this.context = context;
    }

    @Override
    public void actionPerformed(ActionEvent ev) {
        NotifyDescriptor.InputLine inputLine = new NotifyDescriptor.InputLine("Path to file: ", "Locate Images in File");
        Object dialog = DialogDisplayer.getDefault().notify(inputLine);
        if (dialog == NotifyDescriptor.OK_OPTION) {
            File fileToAnalyze = new File(inputLine.getInputText());
            if (fileToAnalyze.exists()) {
                FileObject fo = FileUtil.toFileObject(fileToAnalyze);
                try {
                    String textOfFile = fo.asText();
                    for (FileObject onePic : context.getChildren()) {
                        String nameToFind = onePic.getNameExt();
                        if (!nameToFind.contains("thumb")) {
                            if (!textOfFile.contains(nameToFind)) {
                                notFoundWords.add(nameToFind);
                            }
                        }
                    }
                    for (int i = 0; i < notFoundWords.size(); i++) {
                        String onePic = notFoundWords.get(i);
                        System.out.println(i + ": " + onePic);
                    }
                } catch (IOException ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
        }
    }
    
}

The output, when the Action above is invoked, i.e., it is available on any folder (which I have open in the IDE via the Favorites window), starts as follows, then goes on to over 100 images (well, 135 to be exact, but some are duplicates, e.g., "blaCompanyImage.png" and "blaCompanyImage_1.png", which need to be investigated), hence I estimate at least 100 that are genuinely relevant yet missing from the showcase.

0: STORXCom.png
1: lm-wrkbnch.jpg
2: salesSuite.png
3: ircClient.png
4: safetymatch.jpg
5: MercureDashboard.jpg
6: imagegrid-abdomen.jpg
7: NetQuest-Autocompletion-large.gif

Only thing missing is a Browse button, so that one doesn't need to type the path to the file. However, one doesn't need to type the path to the file. Just open it in the IDE and then choose "Copy File Path" in the tab of the file and paste it into the dialog. Then press OK and the selected file is checked to see whether it contains the name of each of the files (not just images, but that doesn't really matter in my case, since the folder that I need to analyze only contains images anyway) in the folder.

Another nice addition is to add an OutputListener, which creates hyperlinks in the Output window for each image not found in the file which, when clicked, opens the image in the IDE:


Thursday May 23, 2013

Undoable Property Sheet

Sometimes there's a need to integrate undo/redo functionality into the NetBeans Properties window. In other words, when the user types something in the Properties window, and presses Enter, you want the "Undo" action to become enabled, and later the "Redo" after you've undone the change.

Tim Boudreau once sent me, quite some time ago, a module that adds this behavior to the Properties window. About his solution, Tim wrote:

The solution consists of replacing the property sheet window with a custom one, which wraps every node in a FilterNode with properties which proxy the original and write them into a global undo/redo manager;  and replace the standard undo/redo actions with ones which work over that global manager.  The nice thing is that this will work over any node, without any changes to the nodes or their properties (within limits - if you have a property which is, say, a number that can only ever be increased, undoing such a change might fail - but that's a pretty rare situation).

It's still useful without the replacement undo/redo actions and without the global undo/redo manager, it just means that you have to give the property sheet window focus if you want to undo/redo (which may or may not be intuitive, but it's the way the window system works).

Here you see the solution in action in the Movie Analyzer example that was used at a NetBeans Platform Training held at MIT:

And this is where you can find the above sample, i.e., it includes Tim's Undoable Property Sheet:

https://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.3/misc/MovieAnalyzer

Adding a Savable to it would be the next step so that the Save action is enabled when the user changes a property in the Properties window.

Wednesday May 22, 2013

Coalescent Theory Calculation Software on the NetBeans Platform

Coalescent is an open source tool in coalescent theory.

It provides solutions for the exact calculation of likelihood under infinite sites and infinite alleles models of mutations in population genetics.

Additionally, it checks phylogeny and draws gene trees for infinite sites data.


Planned features for the upcoming releases will focus on the following areas:

  1. Importance sampling under infinite sites model.
  2. MCMC under infinite sites model model.
  3. Exact calculation with infinite sites/alleles and various migration models.
  4. Exact calculation with infinite sites/infinite alleles and discrete recombination models.
  5. Sampling algorithms for migration and recombination.
  6. Fine-scale recombinations, such as LDHat/LDHelmet.

More info:

http://coalescent.sourceforge.net/

http://pubmedcentralcanada.ca/pmcc/articles/PMC3575375/

Tuesday May 21, 2013

Health Manager on the NetBeans Platform

Vobium Health Manager, by Vobium Technologies, is software to store and organize your family's medical information securely on your computer.

Many more screenshots can be found here: http://www.vobium.com/health/screenshots

You can manage records across 25+ categories like diseases, allergies, doctor visits, tests & checkups, medicines, vaccinations, surgeries, therapies, diet & fitness, pregnancies, baby milestones, etc, and quickly search for any records whenever needed.

You can generate reports (in PDF or Microsoft Excel format) and carry your data on a USB pen drive, print them, bring them to your doctor visits, or email it to someone. You can print an emergency medical card and keep it in your wallet.

The first time I saw the screenshots, such as the one above, I didn't believe this was written in Java and based on the NetBeans Platform! However, Bhavin Khambhadia from Vobium tells me:

The majority of our end users are Windows based and hence Vobium Health Manager should look like a Windows application. To achieve this, we extended SynthLookAndFeel. We hired an in-house UI designer who created the application wireframe, icons/images, and color combinations for our application. We leveraged rich-client effects for Java Swing applications, as described in "Filthy Rich Clients" by Chet Haase and Romain Guy, together with inputs available from other sources, such as blogs, white papers, in-house POTs, and Google searches.

Here's a screenshot of the application open in NetBeans IDE, showing its modular structure on the NetBeans Platform:

Finally, some nice movies to watch on YouTube:

http://www.youtube.com/user/VobiumHealthManager?feature=watch

Monday May 20, 2013

Live Band Music Manager on the NetBeans Platform

Chord Maestro is an application on the NetBeans Platform that displays chord charts on a computer, TV, or large (confidence) monitor, without requiring a lot of unnecessary effort. Chord Maestro was made for live bands and church worship leaders tired of using music stands and having to deal with an ever expanding library of paper chord charts.

A comment from Mike Kelly, the developer behind Chord Maestro, as well as the recently highlighted US Navy chemical & biological modeling software:

I built this app in about three months in my free time (which ain't much with a two year old running around). We've been using it every Sunday at church for a while now and it has allowed us to do away with paper music and music stands. Everyone that sees it is shocked that it is not a commercially built tool.

(Much) more info:

http://chordmaestro.secondchancesoldier.com

Sunday May 19, 2013

Open Source Financial Platform on the NetBeans Platform

Gaia Transparence is a software vendor specialized in financial markets. It is a pioneer in the open source community for financial markets. The Gaia Transparence team is building an open source solution for the finance industry based on the NetBeans Platform.

The Gaia Transparence open source financial platform will address new regulatory requirements, including central counterparty (CCP) margining, credit value adjustment (CVA), Markets in Financial Instruments Directive revision (MIFID2), and Basle3.


On the open source motivations of the team, Benjamin Frerejean (Director of R&D) explains the following: 

A key benefit of open source is "transparency". As the source code is available, it can easily be audited by either users or auditors. Along with Gaia Transparence turnkey applications, we deliver "generic trades", "positions", and underlying objects. Users pilot the development and share all the specific instance types, while user group members can mutualize enhancement costs.

We, the Gaia Transparence team, believe that open source is the solution for financial institutions to cope with the challenges they are faced with since the 2008 crunch. On the one hand, the market needs to regain "trust", whilst on the other the new regulatory environment imposes new trading standards and reporting. IT budgets are tight in this time of crisis. Trust can only be gained with transparency and standardization. Open source is transparent by nature. Open source solutions become standards when the community is active. By enabling mutualization of development costs, open source solutions help contain IT budgets. The rapid acceptance of the open source CDS pricer published by ISDA in April 2009, as part of the "Big Bang" initiative, proves the market is ready.

Saturday May 18, 2013

Towards an Integrated WYSIWYG JavaFX WebView

Last week I blogged about the free and open source EPUB Open Toolbox which I am creating for publishers and authors. Officially, it is now known as Fosfor, since it is initially being developed for the Fosfor Uitgeverij, that is, an on-line e-book publisher based in Amsterdam, as a replacement for Sigil. And this is yet another example of how the web and mobile worlds need the desktop—just for fun you should ask a publisher or author some time: "Do you ever see yourself editing and managing books on your mobile phone?"

At the time, when I started working on this, I was using the SHEF framework as the basis of a WYSIWYG editor. That had its shortcomings and I couldn't help thinking that the JavaFX WebView would be a more natural fit.

So, here we are a week later, with the JavaFX WebView doing a superb job rendering the XHTML pages of EPUB projects:

It simply looks awesome. No credit whatsoever for me on that score, since I'm simply reusing the JavaFX WebView, the creation of which I had nothing to do with. Images are rendered, which wasn't the case with SHEF, the performance is great, and the whole thing just looks professional, like a commercial off the shelf product that took years to develop, rather than days. Aside from the rendering, there's a lot of functionality built into the JavaFX WebView, e.g., when you right-click on an image, you get popup menus for opening the image in a new view, when you right-click on a URL, you can open the URL in a new view, etc.

But, I don't want a web browser. I want a WYSIWYG editor. The start is clearly there, i.e., there's a JavaFX toolbar containing JavaFX buttons, each of which will be, once the prototyping phase is over, provided by different NetBeans modules. For example, here's the color chooser in action—select a piece of text, invoke the color chooser, select a color, and immediately the font of the selected text is changed to the selected color:

Still many things to do. Especially, synchronizing changes back into the source file. Once that's done, all the rest should be relatively painless. Not possible, right now, to type in the WebView, but I have a pretty good idea how to solve that. My insight on this is that there's no difference between adding characters and adding colors to selected text. And it's also possible to get hold of the cursor in the JavaFX WebView, so the basics for typing are already included in the app. With that solved, its all about adding more tools, e.g., a bold tool, italics tool, font size, and so on.

I've shared the above pics with Sean Phillips who works on NASA software (he's been mentioned in this blog several times, has a lot of JavaFX/NetBeans Platform articles on NetBeans Zone, and hopefully will be at JavaOne this year) and he responded pretty positively from his perspective at NASA:

Based on what you have said and the limited images I've seen, this could be used as a technical document markup tool. Several of the Ground System missions I am associated with have home brew tools that generate documentation. Office tools like MS Word and the like can't really be used because a significant portion of the documentation is based around data produced by custom mission specific software systems. As a result, someone ends up writing code that generates Latex or HTML as a custom one off. I wonder if there could be a future in a tool like what you are developing that could be used towards a goal like what I have just described.

Part of my reason for blogging about this is to ask—are there developers out there who have tools written in JavaFX (or who would like to start doing so) that are relevant to the above and could be contributed to the free and open source Fosfor project?

Friday May 17, 2013

Network QoS Simulator on the NetBeans Platform

qSim is a computer network simulator with emphasis on Quality of Service (QoS) mechanisms. It lets you observe how computer networks react to different QoS mechanisms, including network node usage (input/output queues, RX/TX buffers usage), data flow delay time, and packet drop statistics.

13 QoS mechanisms are supported, which can be divided in three groups: packet classification & marking, active queue management, and packet scheduling algorithms.

The network topology is fully customizable, including:

  • link bit rate and length (in meters)
  • link reliability
  • simulation of input/output queues
  • simulation of RX/TX buffers
  • size of all buffers/queues
  • different data flows (TCP/UDP/ICMP protocols supported, various packet sizes, realistic packet generation delays)

The simulations have been tested and compared with real CISCO devices, with positive results.

qSim was developed at the Faculty of Informatics and Information Technologies, Slovak University of Technology, in Bratislava.

Thursday May 16, 2013

Model Based Embedded Development on the NetBeans Platform

SimuQuest is a Michigan-based software development company that specializes in working with electronic hardware companies that produce electronic controls for such things as car engines or wind turbine generators.

UniPhi is one of SimuQuest's software tools. It is created on the NetBeans Platform. It is a model-based development tool for data management and dependency visualization, enabling consistent, version-controlled management of data (signals and parameters) and rapid visualization of object dependencies (modeled features, signals and parameters). UniPhi is deployed to develop embedded systems using model-based design within a variety of industries such as aerospace, automotive, consumer appliance, and alternative energy.

Further info:

http://www.simuquest.com/products/uniphi

Wednesday May 15, 2013

Brand Independent PLC Programming on the NetBeans Platform

Most modern automation installations, such as controlers of machinery on factory assembly lines, amusement rides, or light fixtures, are driven by Programmable Logic Controllers (PLCs). Low level programming languages that have been used for decades, such as Ladder Diagrams (LD), are still being used to develop new PLC software. Together with the ageing techniques inherent in such programming constructs, there are hidden  penalties, such as the fact that PLC software is brand dependent.

PLC-PROG is the first tool for PLC programming to enable a completely brand independent and user-friendly object oriented approach, resulting in a reduction of development cost and an increase in the reliability of developed programs. It is valid for all PLC brands which comply with the IEC 611131-3 standard, is based on graphical programming methodologies, requires no specific programming skills, and makes it possible to perform both monitoring and visualization from the tool.

PLC-PROG has been developed using the NetBeans Platform, to take advantage of the benefits that its libraries offer. Below you see the PLC-Prog Visual Editor with the rack concept, which is a base element on top of which fuctions and input/output modules can be dragged: 

Other tools, such as a Tree View for tracking programming flow, is shown below:

Further info:

http://www.plc-prog.eu/

Tuesday May 14, 2013

Corona SDK Lua IDE on the NetBeans Platform

The Corona SDK lets you build rich mobile apps for iOS, Android, Kindle, and Nook. The Corona SDK uses Lua as its programming language. Lua Glider has been created by M.Y. Developers LLC on the NetBeans Platform and NetBeans IDE as an advanced IDE for Corona SDK professionals and beginners alike. Lua Glider's latest release is 1.9, released 11 May 2013.

Its many features include an advanced debugger, variables explorer, call stack, adaptive auto-complete, built in documentation, real-time breakpoints, split screen support, asset preview, simulator remote, theme switcher, and much more.

YouTube has several videos on Lua Glider (previously known as Corona Cider), including this very inspiring introduction:

Further info:

http://www.coronalabs.com/products/corona-sdk/

http://www.mydevelopersgames.com/Glider/

http://forums.coronalabs.com/topic/34829-lua-glider-v-19-launch-discount-code-included/

http://www.holamariquita.com/?p=136

http://www.raywenderlich.com/22064/how-to-make-a-simple-game-with-corona

Monday May 13, 2013

WYSIWYG Editor for Java Desktop Applications

The EPUB Open Toolbox (introduced in the last two blog entries) includes a WYSIWYG editor based on the Swing HTML Editor Framework (SHEF), but extended in small ways. For example, keyboard shortcuts can be used for bold, italics, etc.

One of the holy grails of the Java desktop world, that is, WYSIWYG support, can thus be solved via SHEF. Here's the visual pane of SHEF embedded in a NetBeans TopComponent:

And, when you switch to the Source view, the above is shown as follows in the SHEF XML editor:

If I make a change to the source and switch to the view, the view is automatically updated, and vice versa.

Would be cool to replace the editor above with the NetBeans XML Editor. On the other hand, that could have disadvantages too. Not sure how that would figure on the juice/squeeze continuum. 

Sunday May 12, 2013

EPUB Open Toolbox (Part 2)

In the absence of a WYSIWYG editor in JavaFX WebView, the SHEF project provides a fine alternative. Click to enlarge the image below.

Aside from being to generate to/from EPUB, project templates are provided for creating new EPUB 3.0 and EPUB 2.0 books:


The structure of the app is modular and Mavenized:


One thing I will do is replace all Matisse GUI Builder forms with plain Java classes, so that anyone can work on this application, i.e., in any IDE. The point is that thanks to Maven, the app can be opened in any IDE that supports Maven, but the TopComponents have been generated in NetBeans IDE, hence they use the Matisse GUI Builder forms, which are not supported in other IDEs. It will be simple to replace those with plain Java classes, since in each case the TopComponent only contains one Swing component, i.e., either a BeanTreeView or the SHEF HTML Editor.

Return to part 1...

About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« May 2013 »
SunMonTueWedThuFriSat
   
 
       
Today