1 |
/* BasicFileChooserUI.java -- |
/* BasicFileChooserUI.java -- |
2 |
Copyright (C) 2005 Free Software Foundation, Inc. |
Copyright (C) 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
|
|
|
|
GNU Classpath is free software; you can redistribute it and/or modify |
|
|
it under the terms of the GNU General Public License as published by |
|
|
the Free Software Foundation; either version 2, or (at your option) |
|
|
any later version. |
|
|
|
|
|
GNU Classpath is distributed in the hope that it will be useful, but |
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
General Public License for more details. |
|
|
|
|
|
You should have received a copy of the GNU General Public License |
|
|
along with GNU Classpath; see the file COPYING. If not, write to the |
|
|
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
|
02110-1301 USA. |
|
|
|
|
|
Linking this library statically or dynamically with other modules is |
|
|
making a combined work based on this library. Thus, the terms and |
|
|
conditions of the GNU General Public License cover the whole |
|
|
combination. |
|
|
|
|
|
As a special exception, the copyright holders of this library give you |
|
|
permission to link this library with independent modules to produce an |
|
|
executable, regardless of the license terms of these independent |
|
|
modules, and to copy and distribute the resulting executable under |
|
|
terms of your choice, provided that you also meet, for each linked |
|
|
independent module, the terms and conditions of the license of that |
|
|
module. An independent module is a module which is not derived from |
|
|
or based on this library. If you modify this library, you may extend |
|
|
this exception to your version of the library, but you are not |
|
|
obligated to do so. If you do not wish to do so, delete this |
|
|
exception statement from your version. */ |
|
5 |
|
|
6 |
|
GNU Classpath is free software; you can redistribute it and/or modify |
7 |
|
it under the terms of the GNU General Public License as published by |
8 |
|
the Free Software Foundation; either version 2, or (at your option) |
9 |
|
any later version. |
10 |
|
|
11 |
|
GNU Classpath is distributed in the hope that it will be useful, but |
12 |
|
WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
|
General Public License for more details. |
15 |
|
|
16 |
|
You should have received a copy of the GNU General Public License |
17 |
|
along with GNU Classpath; see the file COPYING. If not, write to the |
18 |
|
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
19 |
|
02110-1301 USA. |
20 |
|
|
21 |
|
Linking this library statically or dynamically with other modules is |
22 |
|
making a combined work based on this library. Thus, the terms and |
23 |
|
conditions of the GNU General Public License cover the whole |
24 |
|
combination. |
25 |
|
|
26 |
|
As a special exception, the copyright holders of this library give you |
27 |
|
permission to link this library with independent modules to produce an |
28 |
|
executable, regardless of the license terms of these independent |
29 |
|
modules, and to copy and distribute the resulting executable under |
30 |
|
terms of your choice, provided that you also meet, for each linked |
31 |
|
independent module, the terms and conditions of the license of that |
32 |
|
module. An independent module is a module which is not derived from |
33 |
|
or based on this library. If you modify this library, you may extend |
34 |
|
this exception to your version of the library, but you are not |
35 |
|
obligated to do so. If you do not wish to do so, delete this |
36 |
|
exception statement from your version. */ |
37 |
|
|
38 |
package javax.swing.plaf.basic; |
package javax.swing.plaf.basic; |
39 |
|
|
48 |
import java.awt.Polygon; |
import java.awt.Polygon; |
49 |
import java.awt.Window; |
import java.awt.Window; |
50 |
import java.awt.event.ActionEvent; |
import java.awt.event.ActionEvent; |
51 |
|
import java.awt.event.ActionListener; |
52 |
import java.awt.event.ItemEvent; |
import java.awt.event.ItemEvent; |
53 |
import java.awt.event.ItemListener; |
import java.awt.event.ItemListener; |
54 |
import java.awt.event.MouseAdapter; |
import java.awt.event.MouseAdapter; |
62 |
import java.util.Hashtable; |
import java.util.Hashtable; |
63 |
import javax.swing.AbstractAction; |
import javax.swing.AbstractAction; |
64 |
import javax.swing.Action; |
import javax.swing.Action; |
65 |
|
import javax.swing.BoxLayout; |
66 |
import javax.swing.ButtonGroup; |
import javax.swing.ButtonGroup; |
67 |
import javax.swing.Icon; |
import javax.swing.Icon; |
68 |
import javax.swing.JButton; |
import javax.swing.JButton; |
90 |
import javax.swing.plaf.ComponentUI; |
import javax.swing.plaf.ComponentUI; |
91 |
import javax.swing.plaf.FileChooserUI; |
import javax.swing.plaf.FileChooserUI; |
92 |
|
|
93 |
|
|
94 |
/** |
/** |
95 |
* DOCUMENT ME! |
* DOCUMENT ME! |
96 |
*/ |
*/ |
104 |
public AcceptAllFileFilter() |
public AcceptAllFileFilter() |
105 |
{ |
{ |
106 |
} |
} |
107 |
|
|
108 |
/** |
/** |
109 |
* DOCUMENT ME! |
* DOCUMENT ME! |
110 |
* |
* |
111 |
* @param f |
* @param f DOCUMENT ME! |
112 |
* DOCUMENT ME! |
* |
113 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
114 |
*/ |
*/ |
115 |
public boolean accept(File f) |
public boolean accept(File f) |
119 |
|
|
120 |
/** |
/** |
121 |
* DOCUMENT ME! |
* DOCUMENT ME! |
122 |
* |
* |
123 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
124 |
*/ |
*/ |
125 |
public String getDescription() |
public String getDescription() |
148 |
*/ |
*/ |
149 |
public void actionPerformed(ActionEvent e) |
public void actionPerformed(ActionEvent e) |
150 |
{ |
{ |
151 |
Object obj = filelist.getSelectedValue(); |
Object obj = new String(parentPath + entry.getText()); |
152 |
if (obj != null) |
if (obj != null) |
153 |
{ |
{ |
154 |
File f = filechooser.getFileSystemView().createFileObject( |
File f = filechooser.getFileSystemView().createFileObject( |
155 |
obj.toString()); |
obj.toString()); |
156 |
if (filechooser.isTraversable(f) |
if (filechooser.isTraversable(f) |
157 |
&& filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY) |
&& filechooser.isDirectorySelectionEnabled()) |
158 |
filechooser.setCurrentDirectory(f); |
filechooser.setCurrentDirectory(f); |
159 |
else |
else |
160 |
{ |
{ |
180 |
|
|
181 |
/** |
/** |
182 |
* DOCUMENT ME! |
* DOCUMENT ME! |
183 |
* |
* |
184 |
* @param f |
* @param f DOCUMENT ME! |
185 |
* DOCUMENT ME! |
* @param i DOCUMENT ME! |
|
* @param i |
|
|
* DOCUMENT ME! |
|
186 |
*/ |
*/ |
187 |
public void cacheIcon(File f, Icon i) |
public void cacheIcon(File f, Icon i) |
188 |
{ |
{ |
199 |
|
|
200 |
/** |
/** |
201 |
* DOCUMENT ME! |
* DOCUMENT ME! |
202 |
* |
* |
203 |
* @param f |
* @param f DOCUMENT ME! |
204 |
* DOCUMENT ME! |
* |
205 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
206 |
*/ |
*/ |
207 |
public Icon getCachedIcon(File f) |
public Icon getCachedIcon(File f) |
211 |
|
|
212 |
/** |
/** |
213 |
* DOCUMENT ME! |
* DOCUMENT ME! |
214 |
* |
* |
215 |
* @param f |
* @param f DOCUMENT ME! |
216 |
* DOCUMENT ME! |
* |
217 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
218 |
*/ |
*/ |
219 |
public String getDescription(File f) |
public String getDescription(File f) |
223 |
|
|
224 |
/** |
/** |
225 |
* DOCUMENT ME! |
* DOCUMENT ME! |
226 |
* |
* |
227 |
* @param f |
* @param f DOCUMENT ME! |
228 |
* DOCUMENT ME! |
* |
229 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
230 |
*/ |
*/ |
231 |
public Icon getIcon(File f) |
public Icon getIcon(File f) |
232 |
{ |
{ |
233 |
Icon val = getCachedIcon(f); |
Icon val = getCachedIcon(f); |
234 |
if (val != null) |
if (val != null) |
235 |
return val; |
return val; |
236 |
if (filechooser.isTraversable(f)) |
if (filechooser.isTraversable(f)) |
237 |
val = directoryIcon; |
val = directoryIcon; |
238 |
else |
else |
239 |
val = fileIcon; |
val = fileIcon; |
240 |
cacheIcon(f, val); |
cacheIcon(f, val); |
241 |
return val; |
return val; |
242 |
} |
} |
243 |
|
|
244 |
/** |
/** |
245 |
* DOCUMENT ME! |
* DOCUMENT ME! |
246 |
* |
* |
247 |
* @param f |
* @param f DOCUMENT ME! |
248 |
* DOCUMENT ME! |
* |
249 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
250 |
*/ |
*/ |
251 |
public String getName(File f) |
public String getName(File f) |
255 |
|
|
256 |
/** |
/** |
257 |
* DOCUMENT ME! |
* DOCUMENT ME! |
258 |
* |
* |
259 |
* @param f |
* @param f DOCUMENT ME! |
260 |
* DOCUMENT ME! |
* |
261 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
262 |
*/ |
*/ |
263 |
public String getTypeDescription(File f) |
public String getTypeDescription(File f) |
264 |
{ |
{ |
265 |
if (filechooser.isTraversable(f)) |
if (filechooser.isTraversable(f)) |
266 |
return dirDescText; |
return dirDescText; |
267 |
else |
else |
268 |
return fileDescText; |
return fileDescText; |
269 |
} |
} |
270 |
|
|
271 |
/** |
/** |
272 |
* DOCUMENT ME! |
* DOCUMENT ME! |
273 |
* |
* |
274 |
* @param f |
* @param f DOCUMENT ME! |
275 |
* DOCUMENT ME! |
* |
276 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
277 |
*/ |
*/ |
278 |
public Boolean isHidden(File f) |
public Boolean isHidden(File f) |
295 |
|
|
296 |
/** |
/** |
297 |
* DOCUMENT ME! |
* DOCUMENT ME! |
298 |
* |
* |
299 |
* @param e |
* @param e DOCUMENT ME! |
|
* DOCUMENT ME! |
|
300 |
*/ |
*/ |
301 |
public void actionPerformed(ActionEvent e) |
public void actionPerformed(ActionEvent e) |
302 |
{ |
{ |
319 |
|
|
320 |
/** |
/** |
321 |
* DOCUMENT ME! |
* DOCUMENT ME! |
322 |
* |
* |
323 |
* @param e |
* @param e DOCUMENT ME! |
|
* DOCUMENT ME! |
|
324 |
*/ |
*/ |
325 |
public void actionPerformed(ActionEvent e) |
public void actionPerformed(ActionEvent e) |
326 |
{ |
{ |
346 |
|
|
347 |
/** |
/** |
348 |
* Creates a new DoubleClickListener object. |
* Creates a new DoubleClickListener object. |
349 |
* |
* |
350 |
* @param list |
* @param list DOCUMENT ME! |
|
* DOCUMENT ME! |
|
351 |
*/ |
*/ |
352 |
public DoubleClickListener(JList list) |
public DoubleClickListener(JList list) |
353 |
{ |
{ |
388 |
} |
} |
389 |
else |
else |
390 |
{ |
{ |
391 |
File f = fsv.createFileObject(list.getSelectedValue().toString()); |
String path = list.getSelectedValue().toString(); |
392 |
|
File f = fsv.createFileObject(path); |
393 |
if (filechooser.isTraversable(f)) |
if (filechooser.isTraversable(f)) |
394 |
{ |
{ |
395 |
setDirectorySelected(true); |
setDirectorySelected(true); |
400 |
setDirectorySelected(false); |
setDirectorySelected(false); |
401 |
setDirectory(null); |
setDirectory(null); |
402 |
} |
} |
403 |
lastSelected = list.getSelectedValue().toString(); |
lastSelected = path; |
404 |
|
parentPath = path.substring(0, path.lastIndexOf("/") + 1); |
405 |
|
entry.setText(path.substring(path.lastIndexOf("/") + 1)); |
406 |
timer.restart(); |
timer.restart(); |
407 |
} |
} |
408 |
} |
} |
433 |
|
|
434 |
/** |
/** |
435 |
* DOCUMENT ME! |
* DOCUMENT ME! |
436 |
* |
* |
437 |
* @param e |
* @param e DOCUMENT ME! |
|
* DOCUMENT ME! |
|
438 |
*/ |
*/ |
439 |
public void actionPerformed(ActionEvent e) |
public void actionPerformed(ActionEvent e) |
440 |
{ |
{ |
441 |
filechooser.setCurrentDirectory(filechooser.getFileSystemView().getHomeDirectory()); |
filechooser.setCurrentDirectory(filechooser.getFileSystemView() |
442 |
|
.getHomeDirectory()); |
443 |
filechooser.revalidate(); |
filechooser.revalidate(); |
444 |
filechooser.repaint(); |
filechooser.repaint(); |
445 |
} |
} |
459 |
|
|
460 |
/** |
/** |
461 |
* DOCUMENT ME! |
* DOCUMENT ME! |
462 |
* |
* |
463 |
* @param e |
* @param e DOCUMENT ME! |
|
* DOCUMENT ME! |
|
464 |
*/ |
*/ |
465 |
public void actionPerformed(ActionEvent e) |
public void actionPerformed(ActionEvent e) |
466 |
{ |
{ |
467 |
try |
try |
468 |
{ |
{ |
469 |
filechooser.getFileSystemView().createNewFolder( |
filechooser.getFileSystemView().createNewFolder(filechooser |
470 |
filechooser.getCurrentDirectory()); |
.getCurrentDirectory()); |
471 |
} |
} |
472 |
catch (IOException ioe) |
catch (IOException ioe) |
473 |
{ |
{ |
474 |
return; |
return; |
475 |
} |
} |
476 |
filechooser.rescanCurrentDirectory(); |
filechooser.rescanCurrentDirectory(); |
477 |
filechooser.repaint(); |
filechooser.repaint(); |
492 |
|
|
493 |
/** |
/** |
494 |
* DOCUMENT ME! |
* DOCUMENT ME! |
495 |
* |
* |
496 |
* @param e |
* @param e DOCUMENT ME! |
|
* DOCUMENT ME! |
|
497 |
*/ |
*/ |
498 |
public void valueChanged(ListSelectionEvent e) |
public void valueChanged(ListSelectionEvent e) |
499 |
{ |
{ |
500 |
Object f = filelist.getSelectedValue(); |
Object f = filelist.getSelectedValue(); |
501 |
if (f == null) |
if (f == null) |
502 |
return; |
return; |
503 |
File file = filechooser.getFileSystemView().createFileObject(f.toString()); |
File file = filechooser.getFileSystemView().createFileObject(f.toString()); |
504 |
if (!filechooser.isTraversable(file)) |
if (! filechooser.isTraversable(file)) |
505 |
filechooser.setSelectedFile(file); |
filechooser.setSelectedFile(file); |
506 |
else |
else |
507 |
filechooser.setSelectedFile(null); |
filechooser.setSelectedFile(null); |
508 |
} |
} |
509 |
} |
} |
510 |
|
|
522 |
|
|
523 |
/** |
/** |
524 |
* DOCUMENT ME! |
* DOCUMENT ME! |
525 |
* |
* |
526 |
* @param e |
* @param e DOCUMENT ME! |
|
* DOCUMENT ME! |
|
527 |
*/ |
*/ |
528 |
public void actionPerformed(ActionEvent e) |
public void actionPerformed(ActionEvent e) |
529 |
{ |
{ |
541 |
|
|
542 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
543 |
protected Icon computerIcon = new Icon() |
protected Icon computerIcon = new Icon() |
|
{ |
|
|
public int getIconHeight() |
|
544 |
{ |
{ |
545 |
return ICON_SIZE; |
public int getIconHeight() |
546 |
} |
{ |
547 |
|
return ICON_SIZE; |
548 |
|
} |
549 |
|
|
550 |
public int getIconWidth() |
public int getIconWidth() |
551 |
{ |
{ |
552 |
return ICON_SIZE; |
return ICON_SIZE; |
553 |
} |
} |
554 |
|
|
555 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
556 |
{ |
{ |
557 |
} |
} |
558 |
}; |
}; |
559 |
|
|
560 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
561 |
protected Icon detailsViewIcon = new Icon() |
protected Icon detailsViewIcon = new Icon() |
|
{ |
|
|
public int getIconHeight() |
|
562 |
{ |
{ |
563 |
return ICON_SIZE; |
public int getIconHeight() |
564 |
} |
{ |
565 |
|
return ICON_SIZE; |
566 |
|
} |
567 |
|
|
568 |
public int getIconWidth() |
public int getIconWidth() |
569 |
{ |
{ |
570 |
return ICON_SIZE; |
return ICON_SIZE; |
571 |
} |
} |
572 |
|
|
573 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
574 |
{ |
{ |
575 |
Color saved = g.getColor(); |
Color saved = g.getColor(); |
576 |
g.translate(x, y); |
g.translate(x, y); |
577 |
|
|
578 |
g.setColor(Color.GRAY); |
g.setColor(Color.GRAY); |
579 |
g.drawRect(1, 1, 15, 20); |
g.drawRect(1, 1, 15, 20); |
580 |
g.drawLine(17, 6, 23, 6); |
g.drawLine(17, 6, 23, 6); |
581 |
g.drawLine(17, 12, 23, 12); |
g.drawLine(17, 12, 23, 12); |
582 |
g.drawLine(17, 18, 23, 18); |
g.drawLine(17, 18, 23, 18); |
583 |
|
|
584 |
g.setColor(saved); |
g.setColor(saved); |
585 |
g.translate(-x, -y); |
g.translate(-x, -y); |
586 |
} |
} |
587 |
}; |
}; |
588 |
|
|
589 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
590 |
protected Icon directoryIcon = new Icon() |
protected Icon directoryIcon = new Icon() |
|
{ |
|
|
public int getIconHeight() |
|
591 |
{ |
{ |
592 |
return ICON_SIZE; |
public int getIconHeight() |
593 |
} |
{ |
594 |
|
return ICON_SIZE; |
595 |
public int getIconWidth() |
} |
|
{ |
|
|
return ICON_SIZE; |
|
|
} |
|
|
|
|
|
public void paintIcon(Component c, Graphics g, int x, int y) |
|
|
{ |
|
|
Color saved = g.getColor(); |
|
|
g.translate(x, y); |
|
596 |
|
|
597 |
Point ap = new Point(3, 7); |
public int getIconWidth() |
598 |
Point bp = new Point(3, 21); |
{ |
599 |
Point cp = new Point(21, 21); |
return ICON_SIZE; |
600 |
Point dp = new Point(21, 12); |
} |
|
Point ep = new Point(16, 12); |
|
|
Point fp = new Point(13, 7); |
|
601 |
|
|
602 |
Polygon dir = new Polygon( |
public void paintIcon(Component c, Graphics g, int x, int y) |
603 |
new int[] { ap.x, bp.x, cp.x, dp.x, ep.x, fp.x }, |
{ |
604 |
new int[] { ap.y, bp.y, cp.y, dp.y, ep.y, fp.y }, |
Color saved = g.getColor(); |
605 |
6); |
g.translate(x, y); |
606 |
|
|
607 |
g.setColor(new Color(153, 204, 255)); |
Point ap = new Point(3, 7); |
608 |
g.fillPolygon(dir); |
Point bp = new Point(3, 21); |
609 |
g.setColor(Color.BLACK); |
Point cp = new Point(21, 21); |
610 |
g.drawPolygon(dir); |
Point dp = new Point(21, 12); |
611 |
|
Point ep = new Point(16, 12); |
612 |
|
Point fp = new Point(13, 7); |
613 |
|
|
614 |
|
Polygon dir = new Polygon(new int[] { ap.x, bp.x, cp.x, dp.x, ep.x, fp.x }, |
615 |
|
new int[] { ap.y, bp.y, cp.y, dp.y, ep.y, fp.y }, |
616 |
|
6); |
617 |
|
|
618 |
|
g.setColor(new Color(153, 204, 255)); |
619 |
|
g.fillPolygon(dir); |
620 |
|
g.setColor(Color.BLACK); |
621 |
|
g.drawPolygon(dir); |
622 |
|
|
623 |
g.translate(-x, -y); |
g.translate(-x, -y); |
624 |
g.setColor(saved); |
g.setColor(saved); |
625 |
} |
} |
626 |
}; |
}; |
627 |
|
|
628 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
629 |
protected int directoryOpenButtonMnemonic; |
protected int directoryOpenButtonMnemonic; |
636 |
|
|
637 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
638 |
protected Icon fileIcon = new Icon() |
protected Icon fileIcon = new Icon() |
|
{ |
|
|
public int getIconHeight() |
|
|
{ |
|
|
return ICON_SIZE; |
|
|
} |
|
|
|
|
|
public int getIconWidth() |
|
|
{ |
|
|
return ICON_SIZE; |
|
|
} |
|
|
|
|
|
public void paintIcon(Component c, Graphics g, int x, int y) |
|
639 |
{ |
{ |
640 |
Color saved = g.getColor(); |
public int getIconHeight() |
641 |
g.translate(x, y); |
{ |
642 |
|
return ICON_SIZE; |
643 |
|
} |
644 |
|
|
645 |
Point a = new Point(5, 4); |
public int getIconWidth() |
646 |
Point b = new Point(5, 20); |
{ |
647 |
Point d = new Point(19, 20); |
return ICON_SIZE; |
648 |
Point e = new Point(19, 7); |
} |
|
Point f = new Point(16, 4); |
|
649 |
|
|
650 |
Polygon p = new Polygon(new int[] { a.x, b.x, d.x, e.x, f.x, }, |
public void paintIcon(Component c, Graphics g, int x, int y) |
651 |
new int[] { a.y, b.y, d.y, e.y, f.y }, 5); |
{ |
652 |
|
Color saved = g.getColor(); |
653 |
|
g.translate(x, y); |
654 |
|
|
655 |
g.setColor(Color.WHITE); |
Point a = new Point(5, 4); |
656 |
g.fillPolygon(p); |
Point b = new Point(5, 20); |
657 |
g.setColor(Color.BLACK); |
Point d = new Point(19, 20); |
658 |
g.drawPolygon(p); |
Point e = new Point(19, 7); |
659 |
|
Point f = new Point(16, 4); |
660 |
|
|
661 |
|
Polygon p = new Polygon(new int[] { a.x, b.x, d.x, e.x, f.x, }, |
662 |
|
new int[] { a.y, b.y, d.y, e.y, f.y }, 5); |
663 |
|
|
664 |
|
g.setColor(Color.WHITE); |
665 |
|
g.fillPolygon(p); |
666 |
|
g.setColor(Color.BLACK); |
667 |
|
g.drawPolygon(p); |
668 |
|
|
669 |
g.drawLine(16, 4, 14, 6); |
g.drawLine(16, 4, 14, 6); |
670 |
g.drawLine(14, 6, 19, 7); |
g.drawLine(14, 6, 19, 7); |
671 |
|
|
672 |
g.setColor(saved); |
g.setColor(saved); |
673 |
g.translate(-x, -y); |
g.translate(-x, -y); |
674 |
} |
} |
675 |
}; |
}; |
676 |
|
|
677 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
678 |
protected Icon floppyDriveIcon = new Icon() |
protected Icon floppyDriveIcon = new Icon() |
|
{ |
|
|
public int getIconHeight() |
|
679 |
{ |
{ |
680 |
return ICON_SIZE; |
public int getIconHeight() |
681 |
} |
{ |
682 |
|
return ICON_SIZE; |
683 |
|
} |
684 |
|
|
685 |
public int getIconWidth() |
public int getIconWidth() |
686 |
{ |
{ |
687 |
return ICON_SIZE; |
return ICON_SIZE; |
688 |
} |
} |
689 |
|
|
690 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
691 |
{ |
{ |
692 |
} |
} |
693 |
}; |
}; |
694 |
|
|
695 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
696 |
protected Icon hardDriveIcon = new Icon() |
protected Icon hardDriveIcon = new Icon() |
|
{ |
|
|
public int getIconHeight() |
|
697 |
{ |
{ |
698 |
return ICON_SIZE; |
public int getIconHeight() |
699 |
} |
{ |
700 |
|
return ICON_SIZE; |
701 |
|
} |
702 |
|
|
703 |
public int getIconWidth() |
public int getIconWidth() |
704 |
{ |
{ |
705 |
return ICON_SIZE; |
return ICON_SIZE; |
706 |
} |
} |
707 |
|
|
708 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
709 |
{ |
{ |
710 |
} |
} |
711 |
}; |
}; |
712 |
|
|
713 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
714 |
protected int helpButtonMnemonic; |
protected int helpButtonMnemonic; |
721 |
|
|
722 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
723 |
protected Icon homeFolderIcon = new Icon() |
protected Icon homeFolderIcon = new Icon() |
|
{ |
|
|
public int getIconHeight() |
|
|
{ |
|
|
return ICON_SIZE; |
|
|
} |
|
|
|
|
|
public int getIconWidth() |
|
|
{ |
|
|
return ICON_SIZE; |
|
|
} |
|
|
|
|
|
public void paintIcon(Component c, Graphics g, int x, int y) |
|
724 |
{ |
{ |
725 |
Color saved = g.getColor(); |
public int getIconHeight() |
726 |
g.translate(x, y); |
{ |
727 |
|
return ICON_SIZE; |
728 |
Point a = new Point(12, 3); |
} |
|
Point b = new Point(4, 10); |
|
|
Point d = new Point(20, 10); |
|
729 |
|
|
730 |
Polygon p = new Polygon(new int[] { a.x, b.x, d.x }, |
public int getIconWidth() |
731 |
new int[] { a.y, b.y, d.y }, 3); |
{ |
732 |
|
return ICON_SIZE; |
733 |
|
} |
734 |
|
|
735 |
g.setColor(new Color(104, 51, 0)); |
public void paintIcon(Component c, Graphics g, int x, int y) |
736 |
g.fillPolygon(p); |
{ |
737 |
g.setColor(Color.BLACK); |
Color saved = g.getColor(); |
738 |
g.drawPolygon(p); |
g.translate(x, y); |
739 |
|
|
740 |
g.setColor(Color.WHITE); |
Point a = new Point(12, 3); |
741 |
g.fillRect(8, 10, 8, 10); |
Point b = new Point(4, 10); |
742 |
g.setColor(Color.BLACK); |
Point d = new Point(20, 10); |
743 |
g.drawRect(8, 10, 8, 10); |
|
744 |
|
Polygon p = new Polygon(new int[] { a.x, b.x, d.x }, |
745 |
|
new int[] { a.y, b.y, d.y }, 3); |
746 |
|
|
747 |
|
g.setColor(new Color(104, 51, 0)); |
748 |
|
g.fillPolygon(p); |
749 |
|
g.setColor(Color.BLACK); |
750 |
|
g.drawPolygon(p); |
751 |
|
|
752 |
|
g.setColor(Color.WHITE); |
753 |
|
g.fillRect(8, 10, 8, 10); |
754 |
|
g.setColor(Color.BLACK); |
755 |
|
g.drawRect(8, 10, 8, 10); |
756 |
|
|
757 |
g.setColor(saved); |
g.setColor(saved); |
758 |
g.translate(-x, -y); |
g.translate(-x, -y); |
759 |
} |
} |
760 |
}; |
}; |
761 |
|
|
762 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
763 |
protected Icon listViewIcon = new Icon() |
protected Icon listViewIcon = new Icon() |
|
{ |
|
|
public int getIconHeight() |
|
764 |
{ |
{ |
765 |
return ICON_SIZE; |
public int getIconHeight() |
766 |
} |
{ |
767 |
|
return ICON_SIZE; |
768 |
|
} |
769 |
|
|
770 |
public int getIconWidth() |
public int getIconWidth() |
771 |
{ |
{ |
772 |
return ICON_SIZE; |
return ICON_SIZE; |
773 |
} |
} |
774 |
|
|
775 |
// Not needed. Only simplifies things until we get real icons. |
// Not needed. Only simplifies things until we get real icons. |
776 |
private void paintPartial(Graphics g, int x, int y) |
private void paintPartial(Graphics g, int x, int y) |
777 |
{ |
{ |
778 |
Color saved = g.getColor(); |
Color saved = g.getColor(); |
779 |
g.translate(x, y); |
g.translate(x, y); |
780 |
|
|
781 |
g.setColor(Color.GRAY); |
g.setColor(Color.GRAY); |
782 |
g.drawRect(1, 1, 7, 10); |
g.drawRect(1, 1, 7, 10); |
783 |
g.drawLine(8, 6, 11, 6); |
g.drawLine(8, 6, 11, 6); |
784 |
|
|
785 |
g.setColor(saved); |
g.setColor(saved); |
786 |
g.translate(-x, -y); |
g.translate(-x, -y); |
787 |
} |
} |
788 |
|
|
789 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
790 |
{ |
{ |
791 |
Color saved = g.getColor(); |
Color saved = g.getColor(); |
792 |
g.translate(x, y); |
g.translate(x, y); |
793 |
|
|
794 |
paintPartial(g, 0, 0); |
paintPartial(g, 0, 0); |
795 |
paintPartial(g, 12, 0); |
paintPartial(g, 12, 0); |
796 |
paintPartial(g, 0, 12); |
paintPartial(g, 0, 12); |
797 |
paintPartial(g, 12, 12); |
paintPartial(g, 12, 12); |
798 |
|
|
799 |
g.setColor(saved); |
g.setColor(saved); |
800 |
g.translate(-x, -y); |
g.translate(-x, -y); |
801 |
} |
} |
802 |
}; |
}; |
803 |
|
|
804 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
805 |
protected Icon newFolderIcon = directoryIcon; |
protected Icon newFolderIcon = directoryIcon; |
833 |
|
|
834 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
835 |
protected Icon upFolderIcon = new Icon() |
protected Icon upFolderIcon = new Icon() |
|
{ |
|
|
public int getIconHeight() |
|
836 |
{ |
{ |
837 |
return ICON_SIZE; |
public int getIconHeight() |
838 |
} |
{ |
839 |
|
return ICON_SIZE; |
840 |
|
} |
841 |
|
|
842 |
public int getIconWidth() |
public int getIconWidth() |
843 |
{ |
{ |
844 |
return ICON_SIZE; |
return ICON_SIZE; |
845 |
} |
} |
846 |
|
|
847 |
public void paintIcon(Component comp, Graphics g, int x, int y) |
public void paintIcon(Component comp, Graphics g, int x, int y) |
848 |
{ |
{ |
849 |
Color saved = g.getColor(); |
Color saved = g.getColor(); |
850 |
g.translate(x, y); |
g.translate(x, y); |
851 |
|
|
852 |
Point a = new Point(3, 7); |
Point a = new Point(3, 7); |
853 |
Point b = new Point(3, 21); |
Point b = new Point(3, 21); |
854 |
Point c = new Point(21, 21); |
Point c = new Point(21, 21); |
855 |
Point d = new Point(21, 12); |
Point d = new Point(21, 12); |
856 |
Point e = new Point(16, 12); |
Point e = new Point(16, 12); |
857 |
Point f = new Point(13, 7); |
Point f = new Point(13, 7); |
858 |
|
|
859 |
Polygon dir = new Polygon(new int[] { a.x, b.x, c.x, d.x, e.x, f.x }, |
Polygon dir = new Polygon(new int[] { a.x, b.x, c.x, d.x, e.x, f.x }, |
860 |
new int[] { a.y, b.y, c.y, d.y, e.y, f.y }, 6); |
new int[] { a.y, b.y, c.y, d.y, e.y, f.y }, 6); |
861 |
|
|
862 |
g.setColor(new Color(153, 204, 255)); |
g.setColor(new Color(153, 204, 255)); |
863 |
g.fillPolygon(dir); |
g.fillPolygon(dir); |
864 |
g.setColor(Color.BLACK); |
g.setColor(Color.BLACK); |
865 |
g.drawPolygon(dir); |
g.drawPolygon(dir); |
866 |
|
|
867 |
a = new Point(12, 15); |
a = new Point(12, 15); |
868 |
b = new Point(9, 18); |
b = new Point(9, 18); |
869 |
c = new Point(15, 18); |
c = new Point(15, 18); |
870 |
|
|
871 |
Polygon arrow = new Polygon(new int[] { a.x, b.x, c.x }, |
Polygon arrow = new Polygon(new int[] { a.x, b.x, c.x }, |
872 |
new int[] { a.y, b.y, c.y }, 3); |
new int[] { a.y, b.y, c.y }, 3); |
873 |
|
|
874 |
g.fillPolygon(arrow); |
g.fillPolygon(arrow); |
875 |
|
|
876 |
g.drawLine(12, 15, 12, 22); |
g.drawLine(12, 15, 12, 22); |
877 |
|
|
878 |
g.translate(-x, -y); |
g.translate(-x, -y); |
879 |
g.setColor(saved); |
g.setColor(saved); |
880 |
} |
} |
881 |
}; |
}; |
882 |
|
|
883 |
// -- begin private, but package local since used in inner classes -- |
// -- begin private, but package local since used in inner classes -- |
884 |
|
|
949 |
/** DOCUMENT ME! */ |
/** DOCUMENT ME! */ |
950 |
JPanel closePanel; |
JPanel closePanel; |
951 |
|
|
952 |
|
/** Text box that displays file name */ |
953 |
|
JTextField entry; |
954 |
|
|
955 |
|
/** Current parent path */ |
956 |
|
String parentPath; |
957 |
|
|
958 |
// -- end private -- |
// -- end private -- |
959 |
private class ListLabelRenderer extends JLabel implements ListCellRenderer |
private class ListLabelRenderer extends JLabel implements ListCellRenderer |
960 |
{ |
{ |
972 |
|
|
973 |
/** |
/** |
974 |
* DOCUMENT ME! |
* DOCUMENT ME! |
975 |
* |
* |
976 |
* @param list |
* @param list DOCUMENT ME! |
977 |
* DOCUMENT ME! |
* @param value DOCUMENT ME! |
978 |
* @param value |
* @param index DOCUMENT ME! |
979 |
* DOCUMENT ME! |
* @param isSelected DOCUMENT ME! |
980 |
* @param index |
* @param cellHasFocus DOCUMENT ME! |
981 |
* DOCUMENT ME! |
* |
|
* @param isSelected |
|
|
* DOCUMENT ME! |
|
|
* @param cellHasFocus |
|
|
* DOCUMENT ME! |
|
982 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
983 |
*/ |
*/ |
984 |
public Component getListCellRendererComponent(JList list, Object value, |
public Component getListCellRendererComponent(JList list, Object value, |
1013 |
|
|
1014 |
/** |
/** |
1015 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1016 |
* |
* |
1017 |
* @param list |
* @param list DOCUMENT ME! |
1018 |
* DOCUMENT ME! |
* @param value DOCUMENT ME! |
1019 |
* @param value |
* @param index DOCUMENT ME! |
1020 |
* DOCUMENT ME! |
* @param isSelected DOCUMENT ME! |
1021 |
* @param index |
* @param cellHasFocus DOCUMENT ME! |
1022 |
* DOCUMENT ME! |
* |
|
* @param isSelected |
|
|
* DOCUMENT ME! |
|
|
* @param cellHasFocus |
|
|
* DOCUMENT ME! |
|
1023 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1024 |
*/ |
*/ |
1025 |
public Component getListCellRendererComponent(JList list, Object value, |
public Component getListCellRendererComponent(JList list, Object value, |
1046 |
|
|
1047 |
/** |
/** |
1048 |
* Creates a new BasicFileChooserUI object. |
* Creates a new BasicFileChooserUI object. |
1049 |
* |
* |
1050 |
* @param b |
* @param b DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1051 |
*/ |
*/ |
1052 |
public BasicFileChooserUI(JFileChooser b) |
public BasicFileChooserUI(JFileChooser b) |
1053 |
{ |
{ |
1056 |
|
|
1057 |
/** |
/** |
1058 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1059 |
* |
* |
1060 |
* @param c |
* @param c DOCUMENT ME! |
1061 |
* DOCUMENT ME! |
* |
1062 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1063 |
*/ |
*/ |
1064 |
public static ComponentUI createUI(JComponent c) |
public static ComponentUI createUI(JComponent c) |
1083 |
installDefaults(fc); |
installDefaults(fc); |
1084 |
installComponents(fc); |
installComponents(fc); |
1085 |
installListeners(fc); |
installListeners(fc); |
1086 |
|
|
1087 |
|
Object path = filechooser.getCurrentDirectory(); |
1088 |
|
if (path != null) |
1089 |
|
parentPath = path.toString().substring(path.toString().lastIndexOf("/")); |
1090 |
} |
} |
1091 |
} |
} |
1092 |
|
|
1138 |
|
|
1139 |
/** |
/** |
1140 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1141 |
* |
* |
1142 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1143 |
*/ |
*/ |
1144 |
private ItemListener createBoxListener() |
private ItemListener createBoxListener() |
1145 |
{ |
{ |
1146 |
return new ItemListener() |
return new ItemListener() |
|
{ |
|
|
public void itemStateChanged(ItemEvent e) |
|
1147 |
{ |
{ |
1148 |
if (parents.getItemCount() - 1 == parents.getSelectedIndex()) |
public void itemStateChanged(ItemEvent e) |
1149 |
return; |
{ |
1150 |
StringBuffer dir = new StringBuffer(); |
if (parents.getItemCount() - 1 == parents.getSelectedIndex()) |
1151 |
for (int i = 0; i <= parents.getSelectedIndex(); i++) |
return; |
1152 |
{ |
StringBuffer dir = new StringBuffer(); |
1153 |
dir.append(parents.getItemAt(i)); |
for (int i = 0; i <= parents.getSelectedIndex(); i++) |
1154 |
dir.append(File.separatorChar); |
{ |
1155 |
} |
dir.append(parents.getItemAt(i)); |
1156 |
filechooser.setCurrentDirectory(filechooser.getFileSystemView().createFileObject( |
dir.append(File.separatorChar); |
1157 |
dir.toString())); |
} |
1158 |
} |
filechooser.setCurrentDirectory(filechooser.getFileSystemView() |
1159 |
}; |
.createFileObject(dir |
1160 |
|
.toString())); |
1161 |
|
} |
1162 |
|
}; |
1163 |
} |
} |
1164 |
|
|
1165 |
/** |
/** |
1166 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1167 |
* |
* |
1168 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1169 |
*/ |
*/ |
1170 |
private ItemListener createFilterListener() |
private ItemListener createFilterListener() |
1171 |
{ |
{ |
1172 |
return new ItemListener() |
return new ItemListener() |
|
{ |
|
|
public void itemStateChanged(ItemEvent e) |
|
1173 |
{ |
{ |
1174 |
int index = filters.getSelectedIndex(); |
public void itemStateChanged(ItemEvent e) |
1175 |
if (index == -1) |
{ |
1176 |
return; |
int index = filters.getSelectedIndex(); |
1177 |
filechooser.setFileFilter(filechooser.getChoosableFileFilters()[index]); |
if (index == -1) |
1178 |
} |
return; |
1179 |
}; |
filechooser.setFileFilter(filechooser.getChoosableFileFilters()[index]); |
1180 |
|
} |
1181 |
|
}; |
1182 |
} |
} |
1183 |
|
|
1184 |
void filterEntries() |
void filterEntries() |
1191 |
String selected = filechooser.getFileFilter().getDescription(); |
String selected = filechooser.getFileFilter().getDescription(); |
1192 |
for (int i = 0; i < list.length; i++) |
for (int i = 0; i < list.length; i++) |
1193 |
{ |
{ |
1194 |
if (selected.equals(list[i].getDescription())) |
if (selected.equals(list[i].getDescription())) |
1195 |
index = i; |
index = i; |
1196 |
filters.addItem(list[i].getDescription()); |
filters.addItem(list[i].getDescription()); |
1197 |
} |
} |
1198 |
filters.setSelectedIndex(index); |
filters.setSelectedIndex(index); |
1199 |
filters.revalidate(); |
filters.revalidate(); |
1202 |
|
|
1203 |
/** |
/** |
1204 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1205 |
* |
* |
1206 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1207 |
*/ |
*/ |
1208 |
public void installComponents(JFileChooser fc) |
public void installComponents(JFileChooser fc) |
1209 |
{ |
{ |
1276 |
JLabel fileNameLabel = new JLabel("File Name:"); |
JLabel fileNameLabel = new JLabel("File Name:"); |
1277 |
JLabel fileTypesLabel = new JLabel("Files of Type:"); |
JLabel fileTypesLabel = new JLabel("Files of Type:"); |
1278 |
|
|
1279 |
JTextField entry = new JTextField(); |
entry = new JTextField(); |
1280 |
filters = new JComboBox(); |
filters = new JComboBox(); |
1281 |
filterEntries(); |
filterEntries(); |
1282 |
|
|
1326 |
|
|
1327 |
/** |
/** |
1328 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1329 |
* |
* |
1330 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1331 |
*/ |
*/ |
1332 |
public void uninstallComponents(JFileChooser fc) |
public void uninstallComponents(JFileChooser fc) |
1333 |
{ |
{ |
1344 |
|
|
1345 |
/** |
/** |
1346 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1347 |
* |
* |
1348 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1349 |
*/ |
*/ |
1350 |
protected void installListeners(JFileChooser fc) |
protected void installListeners(JFileChooser fc) |
1351 |
{ |
{ |
1352 |
propertyChangeListener = createPropertyChangeListener(filechooser); |
propertyChangeListener = createPropertyChangeListener(filechooser); |
1353 |
filechooser.addPropertyChangeListener(propertyChangeListener); |
filechooser.addPropertyChangeListener(propertyChangeListener); |
1354 |
|
|
1355 |
// parents.addItemListener(createBoxListener()); |
//parents.addItemListener(createBoxListener()); |
1356 |
accept.addActionListener(getApproveSelectionAction()); |
accept.addActionListener(getApproveSelectionAction()); |
1357 |
cancel.addActionListener(getCancelSelectionAction()); |
cancel.addActionListener(getCancelSelectionAction()); |
1358 |
upFolderButton.addActionListener(getChangeToParentDirectoryAction()); |
upFolderButton.addActionListener(getChangeToParentDirectoryAction()); |
1366 |
|
|
1367 |
/** |
/** |
1368 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1369 |
* |
* |
1370 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1371 |
*/ |
*/ |
1372 |
protected void uninstallListeners(JFileChooser fc) |
protected void uninstallListeners(JFileChooser fc) |
1373 |
{ |
{ |
1377 |
|
|
1378 |
/** |
/** |
1379 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1380 |
* |
* |
1381 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1382 |
*/ |
*/ |
1383 |
protected void installDefaults(JFileChooser fc) |
protected void installDefaults(JFileChooser fc) |
1384 |
{ |
{ |
1388 |
|
|
1389 |
/** |
/** |
1390 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1391 |
* |
* |
1392 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1393 |
*/ |
*/ |
1394 |
protected void uninstallDefaults(JFileChooser fc) |
protected void uninstallDefaults(JFileChooser fc) |
1395 |
{ |
{ |
1399 |
|
|
1400 |
/** |
/** |
1401 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1402 |
* |
* |
1403 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1404 |
*/ |
*/ |
1405 |
protected void installIcons(JFileChooser fc) |
protected void installIcons(JFileChooser fc) |
1406 |
{ |
{ |
1409 |
|
|
1410 |
/** |
/** |
1411 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1412 |
* |
* |
1413 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1414 |
*/ |
*/ |
1415 |
protected void uninstallIcons(JFileChooser fc) |
protected void uninstallIcons(JFileChooser fc) |
1416 |
{ |
{ |
1419 |
|
|
1420 |
/** |
/** |
1421 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1422 |
* |
* |
1423 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1424 |
*/ |
*/ |
1425 |
protected void installStrings(JFileChooser fc) |
protected void installStrings(JFileChooser fc) |
1426 |
{ |
{ |
1449 |
|
|
1450 |
/** |
/** |
1451 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1452 |
* |
* |
1453 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1454 |
*/ |
*/ |
1455 |
protected void uninstallStrings(JFileChooser fc) |
protected void uninstallStrings(JFileChooser fc) |
1456 |
{ |
{ |
1485 |
|
|
1486 |
/** |
/** |
1487 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1488 |
* |
* |
1489 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1490 |
*/ |
*/ |
1491 |
public BasicDirectoryModel getModel() |
public BasicDirectoryModel getModel() |
1626 |
|
|
1627 |
/** |
/** |
1628 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1629 |
* |
* |
1630 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1631 |
*/ |
*/ |
1632 |
public String getDirectoryName() |
public String getDirectoryName() |
1637 |
|
|
1638 |
/** |
/** |
1639 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1640 |
* |
* |
1641 |
* @param filename |
* @param filename DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1642 |
*/ |
*/ |
1643 |
public void setFileName(String filename) |
public void setFileName(String filename) |
1644 |
{ |
{ |
1647 |
|
|
1648 |
/** |
/** |
1649 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1650 |
* |
* |
1651 |
* @param dirname |
* @param dirname DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1652 |
*/ |
*/ |
1653 |
public void setDirectoryName(String dirname) |
public void setDirectoryName(String dirname) |
1654 |
{ |
{ |
1657 |
|
|
1658 |
/** |
/** |
1659 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1660 |
* |
* |
1661 |
* @param fc |
* @param fc DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1662 |
*/ |
*/ |
1663 |
public void rescanCurrentDirectory(JFileChooser fc) |
public void rescanCurrentDirectory(JFileChooser fc) |
1664 |
{ |
{ |
1668 |
|
|
1669 |
/** |
/** |
1670 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1671 |
* |
* |
1672 |
* @param fc |
* @param fc DOCUMENT ME! |
1673 |
* DOCUMENT ME! |
* @param f DOCUMENT ME! |
|
* @param f |
|
|
* DOCUMENT ME! |
|
1674 |
*/ |
*/ |
1675 |
public void ensureFileIsVisible(JFileChooser fc, File f) |
public void ensureFileIsVisible(JFileChooser fc, File f) |
1676 |
{ |
{ |
1679 |
|
|
1680 |
/** |
/** |
1681 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1682 |
* |
* |
1683 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1684 |
*/ |
*/ |
1685 |
public JFileChooser getFileChooser() |
public JFileChooser getFileChooser() |
1689 |
|
|
1690 |
/** |
/** |
1691 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1692 |
* |
* |
1693 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1694 |
*/ |
*/ |
1695 |
public JPanel getAccessoryPanel() |
public JPanel getAccessoryPanel() |
1699 |
|
|
1700 |
/** |
/** |
1701 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1702 |
* |
* |
1703 |
* @param fc |
* @param fc DOCUMENT ME! |
1704 |
* DOCUMENT ME! |
* |
1705 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1706 |
*/ |
*/ |
1707 |
public JButton getApproveButton(JFileChooser fc) |
public JButton getApproveButton(JFileChooser fc) |
1714 |
|
|
1715 |
/** |
/** |
1716 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1717 |
* |
* |
1718 |
* @param fc |
* @param fc DOCUMENT ME! |
1719 |
* DOCUMENT ME! |
* |
1720 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1721 |
*/ |
*/ |
1722 |
public String getApproveButtonToolTipText(JFileChooser fc) |
public String getApproveButtonToolTipText(JFileChooser fc) |
1740 |
|
|
1741 |
/** |
/** |
1742 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1743 |
* |
* |
1744 |
* @param fc |
* @param fc DOCUMENT ME! |
1745 |
* DOCUMENT ME! |
* |
1746 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1747 |
*/ |
*/ |
1748 |
public ListSelectionListener createListSelectionListener(JFileChooser fc) |
public ListSelectionListener createListSelectionListener(JFileChooser fc) |
1752 |
|
|
1753 |
/** |
/** |
1754 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1755 |
* |
* |
1756 |
* @param fc |
* @param fc DOCUMENT ME! |
1757 |
* DOCUMENT ME! |
* @param list DOCUMENT ME! |
1758 |
* @param list |
* |
|
* DOCUMENT ME! |
|
1759 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1760 |
*/ |
*/ |
1761 |
protected MouseListener createDoubleClickListener(JFileChooser fc, JList list) |
protected MouseListener createDoubleClickListener(JFileChooser fc, JList list) |
1765 |
|
|
1766 |
/** |
/** |
1767 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1768 |
* |
* |
1769 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1770 |
*/ |
*/ |
1771 |
protected boolean isDirectorySelected() |
protected boolean isDirectorySelected() |
1775 |
|
|
1776 |
/** |
/** |
1777 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1778 |
* |
* |
1779 |
* @param selected |
* @param selected DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1780 |
*/ |
*/ |
1781 |
protected void setDirectorySelected(boolean selected) |
protected void setDirectorySelected(boolean selected) |
1782 |
{ |
{ |
1785 |
|
|
1786 |
/** |
/** |
1787 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1788 |
* |
* |
1789 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1790 |
*/ |
*/ |
1791 |
protected File getDirectory() |
protected File getDirectory() |
1795 |
|
|
1796 |
/** |
/** |
1797 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1798 |
* |
* |
1799 |
* @param f |
* @param f DOCUMENT ME! |
|
* DOCUMENT ME! |
|
1800 |
*/ |
*/ |
1801 |
protected void setDirectory(File f) |
protected void setDirectory(File f) |
1802 |
{ |
{ |
1805 |
|
|
1806 |
/** |
/** |
1807 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1808 |
* |
* |
1809 |
* @param fc |
* @param fc DOCUMENT ME! |
1810 |
* DOCUMENT ME! |
* |
1811 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1812 |
*/ |
*/ |
1813 |
public FileFilter getAcceptAllFileFilter(JFileChooser fc) |
public FileFilter getAcceptAllFileFilter(JFileChooser fc) |
1817 |
|
|
1818 |
/** |
/** |
1819 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1820 |
* |
* |
1821 |
* @param fc |
* @param fc DOCUMENT ME! |
1822 |
* DOCUMENT ME! |
* |
1823 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1824 |
*/ |
*/ |
1825 |
public FileView getFileView(JFileChooser fc) |
public FileView getFileView(JFileChooser fc) |
1831 |
|
|
1832 |
/** |
/** |
1833 |
* DOCUMENT ME! |
* DOCUMENT ME! |
1834 |
* |
* |
1835 |
* @param fc |
* @param fc DOCUMENT ME! |
1836 |
* DOCUMENT ME! |
* |
1837 |
* @return DOCUMENT ME! |
* @return DOCUMENT ME! |
1838 |
*/ |
*/ |
1839 |
public String getDialogTitle(JFileChooser fc) |
public String getDialogTitle(JFileChooser fc) |
1844 |
switch (fc.getDialogType()) |
switch (fc.getDialogType()) |
1845 |
{ |
{ |
1846 |
case JFileChooser.OPEN_DIALOG: |
case JFileChooser.OPEN_DIALOG: |
1847 |
ret = openButtonText; |
ret = openButtonText; |
1848 |
break; |
break; |
1849 |
case JFileChooser.SAVE_DIALOG: |
case JFileChooser.SAVE_DIALOG: |
1850 |
ret = saveButtonText; |
ret = saveButtonText; |
1851 |
break; |
break; |
1852 |
default: |
default: |
1853 |
ret = fc.getApproveButtonText(); |
ret = fc.getApproveButtonText(); |
1854 |
break; |
break; |
1855 |
} |
} |
1856 |
if (ret == null) |
if (ret == null) |
1857 |
ret = openButtonText; |
ret = openButtonText; |