[Thinlet-development] thinlet/src/java/thinlet Thinlet.java,1.7,1.8
Brought to you by:
bajzat
From: Andrzej B. <ab...@us...> - 2004-04-19 22:05:38
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23442 Modified Files: Thinlet.java Log Message: Improve visibility and LnF of tree lines if angle="true". Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Thinlet.java 19 Apr 2004 17:42:29 -0000 1.7 +++ Thinlet.java 19 Apr 2004 22:05:22 -0000 1.8 @@ -44,6 +44,8 @@ private transient Color c_ctrl = null; private transient int block; private transient Image hgradient, vgradient; + private transient Stroke dash = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 1.0f, new float[]{0.5f, 1.5f}, 0.0f); + private transient Stroke solid = new BasicStroke(1.0f); private transient Thread timer; private transient long watchdelay; @@ -2163,8 +2165,12 @@ if (angle) { Object nodebelow = get(item, ":next"); if (nodebelow != null) { // and the next node is bellow clipy - g.setColor(c_bg); int x = r.x - block / 2; - g.drawLine(x, r.y, x, getRectangle(nodebelow, "bounds").y); + ((Graphics2D)g).setStroke(dash); + Rectangle nbr = getRectangle(nodebelow, "bounds"); + if (nbr == null) nbr = new Rectangle(r.x, r.y + block, r.width, r.height); + g.setColor(c_text); int x = r.x - block / 2; + g.drawLine(x, r.y, x, nbr.y); + ((Graphics2D)g).setStroke(solid); } } continue; // clip rectangle is bellow @@ -2187,12 +2193,14 @@ if ("tree" == classname) { int x = r.x - block / 2; int y = r.y + (r.height - 1) / 2; if (angle) { - g.setColor(c_bg); + g.setColor(c_text); + ((Graphics2D)g).setStroke(dash); g.drawLine(x, r.y, x, y); g.drawLine(x, y, r.x - 1, y); Object nodebelow = get(item, ":next"); if (nodebelow != null) { g.drawLine(x, y, x, getRectangle(nodebelow, "bounds").y); } + ((Graphics2D)g).setStroke(solid); } if (subnode) { paintRect(g, x - 4, y - 4, 9, 9, itemenabled ? c_border : c_disable, @@ -6649,4 +6657,4 @@ { "bean", "bean", null, null } } }; } -} \ No newline at end of file +} |