Geertjan's Blog

  • December 6, 2010

Paint Application on Maven via IntelliJ IDEA

Geertjan Wielenga
Product Manager
I recreated the NetBeans Paint Application (see here and here) on top of Maven in IntelliJ IDEA:

My run configurations in IntelliJ IDEA:

Run: nbm:run-platform (working directory: /foo/bar/Paint/application)

Build: clean reactor:make -Dmake.folders=application (working directory: /foo/bar/Paint)

Test: test (working directory: /foo/bar/Paint)

As you can see, I haven't looked at debugging yet. For testing, I have set up functional tests for the Maven-based NetBeans Paint Application (see here and here).

And to give you a flavor of how things will be in 7.0, here's the start of the definition of the PaintTopComponent class:

@TopComponent.Description(preferredID = "PaintTopComponent", persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "editor", openAtStartup = true)
@ActionID(category = "Window", id = "com.paint.PaintTopComponent")
@ActionReference(path = "Menu/Window", position = 100)
@TopComponent.OpenActionRegistration(displayName = "Open Paint Component", preferredID = "PaintTopComponent")
public class PaintTopComponent extends TopComponent implements ActionListener, ChangeListener {
private PaintCanvas canvas = new PaintCanvas(); //The component the user draws on
private JComponent preview; //A component in the toolbar that shows the paintbrush size
private static int ct = 0; //A counter you use to provide names for new images
private InstanceContent content;
private Saver saver;
public PaintTopComponent() {

Next is to look at how/if debugging and profiling will work in this scenario. For profiling, one approach would be to include the profiling modules in the Paint Application itself, so that the application will end up profiling itself. That would avoid the need to start up NetBeans IDE.

Join the discussion

Comments ( 1 )
  • Martin Neumann Monday, December 6, 2010

    It's almost looking like Hibernate: Annotation overload.

    I often shy away from Annotations because more often than not they make decorator magic instead of readable, debuggable code.

    This example looks quite good, though.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha

Integrated Cloud Applications & Platform Services