About 2 months of coding has finally paid off. Mercury has been release earlier this week. This is the first stable version of the screen ruler OpenRule. It is a very basic version of the popular freeware program JRuler. One of my favorite features is the snap to zero functionality, which will snap the ruler to your cursor at pixel zero. More information can be found on the project page.
This is the overall roadmap for the OpenRule software. The current status version of OpenRule is marked below in orange-yellow. Hopefully, by the time we reach Mars status OpenRule can be marked as mature and will not need any more additional features. As always you can get the most up to date version on the project page.
- Must be always on top
- Have ruler ticks counting off the units
- Displays the number of pixels from the beginning of the ruler (pixel 0)
- Ruler should be easily re-sizable
- A fast key for flipping between horizontal and vertical modes.
- Close and minimize buttons
- Snap beginning of ruler to cursor
- The ruler is drag-able
- Add Program icon to replace the default Java Icon.
- Allow the ruler to be transparent
- Allow the ruler to be different colors.
- Nudge the whole ruler by a pixel using arrow keys (left, right, top and bottom)
- A leader hangs off of the ruler which easily shows where your cursor is on the ruler
- About menu item
- Help menu item
- Change the tick units (px, inch, cm, pica, custom)
- Add Default Preferences for: color and transparency, orientation, always on top, tick units,
- Reorganize code to be more efficient and faster
- Measure anywhere on the ruler
- Change the color of the tick leader
- Change the color of the ticks and measurements
- Default Preference for bar layout
- Bookmark option to mark points on the ruler
- Snap end of the ruler to cursor
- Snap ruler to cursor at pixel position X
- Snap cursor to end of ruler
- Snap cursor to beginning of ruler
- Snap cursor to nearest tick
- Snap cursor to nearest tick mode
- Click, click measure mode (The mouse click defines the beginning and ending positions)
- Swap the info bar and tick bar
- Rotate ruler
- Click, click measure at an angle (The mouse click defines the beginning and ending positions)
• Must be always on top — Make this optional but default to “always on top”
• Nudge by 5 pixels when using ctrl+arrow keys
• Does not work on Mac (Java 1.5.x)
Found a Bug? Report it!
• Code documentation
• Getting started and Help sections
• Streamlining code making it efficient
*A significant amount of minor revisions and bugs can count for a version or significant internal code revision.
This past week has seen lots of effort in getting the basic version of OpenRule up and running. Here are some highlights:
- Developed the vertical version of the ruler
- Added the RulerEvent and RulerListener claases to address
- flipping between the two Ruler modes
- form controls (minimizing, exiting)
- global keyboard commands
- Allow the ruler to resize
You can download the newest version of the ruler here and the code here. Have comments or questions about OpenRule? Email us at paul(at)leadiv(dot)com or post a comment on this post.
Always welcome other developers to help make OpenRule even better. If you are interested please contact me here paul(at)leadiv(dot)com
I ran into some trouble when I tried putting the popup menu on the ruler. It rendered the dragging functionality useless. I was unable to attach the menu to the frame which where the draggable functionality is implemented. The solution I found was to apply the draggable events to the main ruler panel which is where the popup menu resides as well. This way the popup menu listeners do not consume all of the mouse listening events.
Community is a very important aspect of any open source project. The community is what helps to shape the project, debug new code and write documentation. This is why open source projects can develop so much faster then traditional approaches to software development in such a robust way. Another investment the community makes is through monetary. An example of this is the Blender project. I have been reading a little about blender recently — an open source 3d modeling program. Blender had its humble beginnings as a shareware program until the company went bankrupted. A deal was made with the creditors to allow the blender code base to be publicly released for a one time payment of $102,000. Blender must have had a pretty good user community because in less then two months this was raised and blender became open source. I wish I could have done that for my college education, instead of taking out loans! More about Blender.