I recently noticed that the PopOver control, which I committed to the ControlsFX project, does not properly clip its content. It became obvious when I was working on the accordion popover for the FlexCalendarFX framework. Whenever the last titled pane was expanded the bottom corners were no longer rounded but square. After placing a red rectangle as content to the titled pane it became clear to me that I forgot to add clipping. The following picture shows the problem. Normally clipping in JavaFX is quite easy. All it takes is an additional node and a call to setClip(node). However, normally [...]
I recently had to implement a layout for an application where the menu area and the status area could be hidden or shown with a slide-in / slide-out animation based on whether the user was logged in or not. The following video shows the the layout in action: [youtube=http://youtu.be/cKXFG4pAoys] Update: a new video shows even better how the panes slide in and out. [youtube=http://youtu.be/qdplhq1KJLs] In the past I probably would have implemented this kind of behavior with a custom control and custom layout code (as in "override layoutChildren() method in skin"). But this time my setup was different because I [...]
Writing custom controls in JavaFX is a simple and straight forward process. A control class is needed for controlling the state of the control (hence the name). A skin class is needed for the apperance of the control. And more often than not a CSS file for customizing the apperance. A common approach for controls is to hide the nodes they are using inside their skin class. The TextField control for example uses two instances of javafx.scene.text.Text. One for the regular text, one for the prompt text. These nodes are not accessible via the TextField API. If you want to get a [...]
When I initially started out working with the Canvas API I noticed that the results of my rendering code were somewhat blurry and even worse, inconsistent. Some lines were blurry, others sharp. Coming from Swing it took me some time to realize that this was caused by the coordinate system of JavaFX, which allows for double precision rendering. To solve this problem all that is needed is to use coordinates "in the middle". So in my code you now find a lot of methods called snapXYZ() (similar methods can be found in the JavaFX code itself), which first casts [...]
While working on FlexGanttFX I had to deal a lot with the JavaFX Canvas node. I am using it to render activities on a timeline. Each row in the Gantt chart is a Canvas node. The user has the option to resize each row individually. So I had to figure out the best way to resize a canvas, which out-of-the-box is not resizable. The listing below shows how this can be accomplished. The main steps needed are: Create a subclass of Canvas. Override the isResizable() method and return true. Override the prefWidth() and prefHeight() methods. Return the values of Canvas.getWidth() and Canvas.getHeight(). [...]
FlexGanttFX now has its own website at flexganttfx.com. It includes a download for the latest early access release, javadocs, videos, support, etc...
FlexGanttFX Newsgroup I have created a new Google group for FlexGanttFX discussions. Anyone interested in FlexGanttFX can become a member. The group is intended for news, technical support, and feature requests.
I finished another JavaFX control today, which I urgently needed for my FlexGanttFX control: a master details pane, which allows the user to show / hide a node with detailed information for a so-called "master" node. My use case is a dual Gantt chart control where a primary (master) Gantt chart is initially shown and then a secondary (details) Gantt chart can be added to the window (stage). By using the MasterDetailsPane the user can easily toggle the visibility of the second Gantt chart at the bottom. At the same time each Gantt chart also has a property sheet [...]
Today I had once again the pleasure to write a small and highly specialized control for JavaFX, which might be useful for others as well. I am calling it PlusMinusAdjuster and all it does is firing value events with values ranging from -1 to +1. The difference to a normal slider is that it continues to fire events even when the value has not changed. This kind of behavior is useful for implementing scrolling through large data sets. A normal scrollbar often causes big jumps even when the user only moves it a few pixels. For me this was [...]
PopOver JavaFX control released with ControlsFX 8.0.3 The PopOver control (formerly PopupEditor) has seen the light of day yesterday when it was released as part of ControlsFX 8.0.3. Go and check it out. Any input much appreciated.