.. | .. |
---|
110 | 110 | hasFocus); |
---|
111 | 111 | |
---|
112 | 112 | String valueString = value.toString(); |
---|
| 113 | + String lcString = valueString.toLowerCase(); |
---|
113 | 114 | |
---|
114 | | - if (valueString.toLowerCase().endsWith(".gfd") || valueString.toLowerCase().endsWith(".obj") || valueString.toLowerCase().endsWith(".3ds")) |
---|
| 115 | + if (lcString.endsWith(".gfd") || lcString.endsWith(".obj") || lcString.endsWith(".3ds")) |
---|
115 | 116 | { |
---|
116 | | - String valueTruncated = valueString.substring(0, valueString.length()-4); |
---|
117 | | - |
---|
118 | | - System.out.println(valueTruncated); |
---|
119 | | - |
---|
120 | | - javax.swing.ImageIcon rendererIcon = icons.get(valueTruncated); |
---|
121 | | - |
---|
122 | | - if (rendererIcon == null) |
---|
| 117 | + if (true) |
---|
123 | 118 | { |
---|
124 | | - if (new File(valueTruncated + ".jpg").exists()) |
---|
125 | | - { |
---|
126 | | - rendererIcon = new javax.swing.ImageIcon(valueTruncated + ".jpg"); |
---|
127 | | - } |
---|
128 | | - else |
---|
129 | | - { |
---|
130 | | - if (new File(valueTruncated + ".png").exists()) |
---|
131 | | - { |
---|
132 | | - rendererIcon = new javax.swing.ImageIcon(valueTruncated + ".png"); |
---|
133 | | - } |
---|
134 | | - } |
---|
135 | | - |
---|
| 119 | + // Small icons |
---|
| 120 | + String valueTruncated = valueString.substring(0, valueString.length()-4); |
---|
| 121 | + |
---|
| 122 | + //System.out.println("valueTruncated = " + valueTruncated); |
---|
| 123 | + |
---|
| 124 | + javax.swing.ImageIcon rendererIcon = icons.get(valueTruncated); |
---|
| 125 | + |
---|
136 | 126 | if (rendererIcon == null) |
---|
137 | 127 | { |
---|
138 | | - rendererIcon = new javax.swing.ImageIcon(); |
---|
| 128 | + if (new File(valueTruncated + ".jpg").exists()) |
---|
| 129 | + { |
---|
| 130 | + rendererIcon = new javax.swing.ImageIcon(valueTruncated + ".jpg"); |
---|
| 131 | + } |
---|
| 132 | + else |
---|
| 133 | + { |
---|
| 134 | + if (new File(valueTruncated + ".png").exists()) |
---|
| 135 | + { |
---|
| 136 | + rendererIcon = new javax.swing.ImageIcon(valueTruncated + ".png"); |
---|
| 137 | + } |
---|
| 138 | + } |
---|
| 139 | + |
---|
| 140 | + if (rendererIcon == null) |
---|
| 141 | + { |
---|
| 142 | + rendererIcon = ObjEditor.GetIcon("icons/primitives.png"); |
---|
| 143 | + } |
---|
| 144 | + |
---|
| 145 | + icons.put(valueTruncated, rendererIcon); |
---|
| 146 | + } |
---|
| 147 | + |
---|
| 148 | + setIcon(rendererIcon); |
---|
| 149 | + } |
---|
| 150 | + else |
---|
| 151 | + { |
---|
| 152 | + // Large icons |
---|
| 153 | + String[] split = valueString.split("/"); |
---|
| 154 | + |
---|
| 155 | + String valueTruncated = ""; |
---|
| 156 | + |
---|
| 157 | + for (int i=1; i<split.length-1; i++) |
---|
| 158 | + { |
---|
| 159 | + valueTruncated += "/" + split[i]; |
---|
139 | 160 | } |
---|
140 | 161 | |
---|
141 | | - icons.put(valueTruncated, rendererIcon); |
---|
| 162 | + valueTruncated += "/icon.jpg"; |
---|
| 163 | + |
---|
| 164 | + System.out.println(valueTruncated); |
---|
| 165 | + |
---|
| 166 | + javax.swing.ImageIcon rendererIcon = icons.get(valueTruncated); |
---|
| 167 | + |
---|
| 168 | + if (rendererIcon == null) |
---|
| 169 | + { |
---|
| 170 | + if (new File(valueTruncated).exists()) |
---|
| 171 | + { |
---|
| 172 | + rendererIcon = new javax.swing.ImageIcon(valueTruncated); |
---|
| 173 | + } |
---|
| 174 | + |
---|
| 175 | + if (rendererIcon == null) |
---|
| 176 | + { |
---|
| 177 | + rendererIcon = new javax.swing.ImageIcon(); |
---|
| 178 | + } |
---|
| 179 | + |
---|
| 180 | + icons.put(valueTruncated, rendererIcon); |
---|
| 181 | + } |
---|
| 182 | + |
---|
| 183 | + setIcon(rendererIcon); |
---|
142 | 184 | } |
---|
143 | | - |
---|
144 | | - setIcon(rendererIcon); |
---|
145 | 185 | } |
---|
146 | 186 | else |
---|
147 | 187 | { |
---|