Statistics
| Revision:

root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.gui / src / main / java / es / unex / sextante / gui / toolbox / ToolboxDialog.java @ 119

History | View | Annotate | Download (1.57 KB)

1

    
2

    
3
package es.unex.sextante.gui.toolbox;
4

    
5
import java.awt.Frame;
6
import java.net.URL;
7

    
8
import javax.swing.ImageIcon;
9
import javax.swing.JDialog;
10

    
11
import es.unex.sextante.core.Sextante;
12

    
13

    
14
/**
15
 * A dialog to show a toolbox
16
 *
17
 * @author volaya
18
 *
19
 */
20
public class ToolboxDialog
21
         extends
22
            JDialog
23
         implements
24
            IToolboxDialog {
25

    
26
   private ToolboxPanel m_Panel;
27

    
28

    
29
   /**
30
    * Constructor
31
    *
32
    * @param parent
33
    *                the parent frame
34
    */
35
   public ToolboxDialog(final Frame parent) {
36

    
37
      super(parent, Sextante.getText("Toolbox"), true);
38
      this.setLocationRelativeTo(null);
39

    
40
      initialize();
41

    
42
   }
43

    
44

    
45
   public void initialize() {
46

    
47
      ImageIcon img;
48
      final URL res = getClass().getClassLoader().getResource("images/sextante_toolbox.gif");
49
      if (res != null) {
50
         img = new ImageIcon(res);
51
      }
52
      else {
53
         img = null;
54
      }
55

    
56
      m_Panel = new ToolboxPanel(this, null, img);
57
      this.setContentPane(m_Panel);
58

    
59
      m_Panel.fillTreesWithAllAlgorithms();
60

    
61
   }
62

    
63

    
64
   /**
65
    * Returns the toolbox panel contained in this dialog
66
    *
67
    * @return the toolbox panel contained in this dialog
68
    */
69
   public ToolboxPanel getToolboxPanel() {
70

    
71
      return m_Panel;
72

    
73
   }
74

    
75

    
76
   public void setAlgorithmsCount(final int iCount) {
77

    
78
      setTitle(Sextante.getText("Toolbox")+ ". " +  Integer.toString(iCount) + " " + Sextante.getText("Algorithms"));
79

    
80
   }
81

    
82

    
83
   public JDialog getDialog() {
84

    
85
      return this;
86

    
87
   }
88

    
89

    
90
}