Writing POV-Ray Support for NetBeans X—Conclusion

This tutorial needs a review. You can edit it in GitHub following these contribution guidelines.

This is a continuation of the tutorial for building POV-Ray support for NetBeans. If you have not read the first, second, third, fourth, fifth, sixth, seventh, eighth, and ninth parts of this tutorial, you may want to start there.

At this stage, you have completed the application, which should look like this:

povray 71 ch7 pic2

Additional steps to take to improve and enhance the application:

  • Test your application. (See the Test Infrastructure Tutorial.)

  • Hide the menus and toolbar buttons that you don’t need in your application.

  • Add a Plugin Manager so that users can install new features at runtime.

  • Localize the application.

  • Customize the display text in the title bar.

  • Customize the splash screen, icons, and NetBeans Platform display texts.

  • Create an installer.

Key Points

We now have our POV-Ray rendering application working exactly as we want. During the course of this tutorial, many NetBeans Platform topics have been covered. Here they are listed, per part:

  • Part 1: Application Structure & File Support—Here you learn how to set up a NetBeans Platform application, how to create modules, and how the NetBeans Platform distinguishes between different types of files.

  • Part 2: Project Type Design—Before beginning to code, you spend some time examining the requirements of the application and how you will implement those requirements.

  • Part 3: Implementing a Project Type—Here you learn how the NetBeans Platform is able to recognize a set of folders and files on disk as being POV-Ray projects. By the end of this section, you’re able to open POV-Ray projects into your application.

  • Part 4: Providing Project Templates—You install your POV-Ray Project module into NetBeans IDE, so that the IDE is able to recognize POV-Ray projects. You then create some POV-Ray projects and create project template wizards, registering them in the module so that they’re available to your users via the New Project dialog.

  • Part 5: Creating an API—Here you create a provider of main files, a rendering service, and a viewing service. You are shown how to encapsulate these interfaces in a separate module, how to load that module on demand, and how to share it with the other two modules in the application. A first usage of one of the APIs is described—the Node of a POV-Ray file will be bold-faced if the main file provider indicates that the Node represents the main file of the project.

  • Part 6: Implementing the API—In this section, you learn how implement the APIs created in the previous part, you add Actions to the Node for setting the main file and for rendering POV-Ray files, and you add some plumbing code for locating the POV-Ray executable.

  • Part 7: Support For Running POV-Ray—For the first time, you actually begin working directly with the POV-Ray executable. By the end of this section, you’re able to actually render POV-Ray files and display the rendered images.

  • Part 8: Implementing ViewService and its Actions—An Action for opening images, and rendering them if they don’t already exist, is added. You’re also introduced to the topic of icon badging, which you use to distinguish between Nodes representing files that have been rendered and those that represent files that haven’t been rendered.

  • Part 9: Build Support—You now move away from working with the Node representing POV-Ray files. Instead, you work on the project node and add new project actions, for rendering the main file of the POV-Ray project, for setting the main file if it has not been set, and for closing the project.

Next Steps

Now that you have completed the POV-Ray tutorial, what should you do next?

  • With the concepts you’ve learned and applied in this tutorial, take another look at the * Introduction to NetBeans Idioms and Infrastructure*, which reinforces a lot of the concepts you have encountered in this tutorial.

  • Explore the NetBeans Developer FAQ, focusing on the specific topics you’re interested in.

  • Gain some more practical experiences by joining one of the many NetBeans Platform open source projects: http://java.net/projects/netbeans

  • Stay in tune with the latest NetBeans API changes, by looking through this page now and again: http://bits.netbeans.org/dev/javadoc/apichanges.html

  • As you learn more about the NetBeans Platform, blog about your experiences. You can publish or republish your blog entries, articles, tips, or any other thoughts here on NetBeans Zone: http://netbeans.dzone.com/

  • When you have an application ready, ask for it to be added to the NetBeans Platform Showcase, which is a great page to look through when beginning your project, since more than likely a similar project that you can learn from, possibly in the open source community, already exists.

  • Read and work through the NetBeans Platform Porting Tutorial and apply its principles to your own existing applications.

Appendix: Setting Up POV-Ray

Mac users may find DarwinPorts the easiest way—simply install DarwinPorts and then run sudo port install povray.

Linux and other Unix users should be fine with the downloads available from povray.org. Everything should work out of the box for these users, without any tweaks or post-install configurations. Make sure, however, that the POV-Ray launcher has the correct permissions, otherwise it will not execute. Run it from the command line to check that it executes.

Under Windows, life is slightly more complicated. Take the following steps to set up POV-Ray:

  1. Download the newest stable version of POV-Ray for Windows: http://povray.org/download

1. Run the downloaded file and install into "C:\POVRay" or some other directory, while making sure that the path has no spaces, even though the installer will prompt you to install in a directory with spaces. For example, change the suggested destination directory to "C:\POVRay", as shown here:

povray 71 ch10 pov windows 1
Do not let the installer install the application into the destination directory "C:\Program Files" or into any of that directory’s subfolders.
Read the above note again.
  1. Open the POV-Ray application. Do the following: * Disable I/O restrictions to avoid input and output warnings on each render: Options | Script I/O Restrictions | No Restrictions.

povray 71 ch10 pov windows 2
  • To facilitate smooth interoperability with the plugin that you will create, ensure that POV-Ray will exit when rendering completes: Render | On Completion | Exit POV-Ray for Windows.

povray 71 ch10 pov windows 3
POV-Ray for Windows cannot process paths with spaces. When you use the application that you will create to create POV-Ray projects, make sure that you create them in directories without spaces in their paths. The name of the project must not have any spaces either.