1
2 package org.catacomb.druid.swing.ui;
3
4 import java.awt.Color;
5 import java.awt.Graphics;
6
7 import javax.swing.Icon;
8 import javax.swing.JComponent;
9 import javax.swing.plaf.ComponentUI;
10 import javax.swing.plaf.basic.BasicTreeUI;
11
12 import org.catacomb.icon.IconLoader;
13
14
15 public final class DruidTreeUI extends BasicTreeUI {
16
17 Icon colIcon;
18 Icon expIcon;
19
20
21
22
23 public DruidTreeUI() {
24 super();
25
26 colIcon = IconLoader.createImageIcon("collapsed.gif");
27 expIcon = IconLoader.createImageIcon("expanded.gif");
28
29 setCollapsedIcon(colIcon);
30 }
31
32
33 public Icon getCollapsedIcon() {
34 return colIcon;
35 }
36
37 public Icon getExpandedIcon() {
38 return expIcon;
39 }
40
41
42 public static ComponentUI createUI(JComponent jcomponent) {
43 return (new DruidTreeUI());
44 }
45
46
47 public void installUI(JComponent jcomponent) {
48 super.installUI(jcomponent);
49 }
50
51
52 public void uninstallUI(JComponent jcomponent) {
53 super.uninstallUI(jcomponent);
54 }
55
56
57 protected void paintVerticalLine(Graphics g, JComponent jcomponent,
58 int i, int j ,int k) {
59 g.setColor(Color.gray);
60 drawDashedVerticalLine(g, i , j , k);
61 }
62
63
64 protected void paintHorizontalLine(Graphics g, JComponent jcomponent,
65 int i, int j, int k) {
66 g.setColor(Color.gray);
67 drawDashedHorizontalLine(g, i , j , k);
68 }
69
70
71
72 }