Search |
||
Synth Week, Custom Lines StylePosted by gfx on September 21, 2005 at 11:41 PM PDT
Every Swing look and feel relies on properties to customize the rendering. One of these properties allows you, With
UIManager.put("Tree.lineTypeDashed", Boolean.TRUE);
The following screenshot shows the difference between dashed tree lines on the left and regular solid tree lines on the right. ![]() Fig. 1. Regular and dashed lines style in a JTree. Although not vital, this feature was used from time to time and was unfortunately unsupported by Synth. Actually, bug #6258272 reporting this problem had even 3 votes. As part of Mustang b53, this bug is now fixed but instead of just supporting dashed lines we went a step further and added an opportunity for later enhancements. The following snippets enables dashed tree lines in Synth: <style id="treeStyle"> <property key="Tree.linesStyle" type="string" value="dashed" /> </style> As you can see, the property used in Synth is more generic than <style id="myStyle"> <object class="MyGraphicsUtils" id="graphics" /> <graphicsUtils idref="graphics" /> </style> The specified class, in this case
void drawLine(SynthContext context, Object paintKey, Graphics g,
int x1, int y1, int x2, int y2)
The
void drawLine(SynthContext context, Object paintKey, Graphics g,
int x1, int y1, int x2, int y2, Objet styleKey)
A new parameter called ![]() Fig. 2. Curved lines style. Happy styling! »
Related Topics >>
Java Desktop Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|