Revision 539 org.gvsig.toolbox/trunk/org.gvsig.toolbox/org.gvsig.toolbox.gui/src/main/java/es/unex/sextante/gui/algorithm/AlgorithmDialog.java

View differences:

AlgorithmDialog.java
36 36
import es.unex.sextante.outputs.OutputTable;
37 37
import es.unex.sextante.outputs.OutputVectorLayer;
38 38
import es.unex.sextante.parameters.Parameter;
39
import java.awt.BorderLayout;
40 39

  
41 40

  
42 41
/**
......
68 67
   private JButton                         jButtonPrevious;
69 68
   private JButton                         jButtonNext;
70 69
   private int                             m_iPreviousCommandIndex;
71
   private ArrayList<DateAndCommand> m_sCommand;
70
   private final ArrayList<DateAndCommand> m_sCommand;
72 71

  
73 72

  
74 73
   /**
......
92 91
                          final ArrayList<DateAndCommand> commands) {
93 92

  
94 93
      super(parent, algorithm.getName(), true);
95
      init(algorithm, panel, commands);
94

  
95
      setResizable(true);
96

  
97
      m_Algorithm = algorithm;
98
      m_sCommand = commands;
99

  
100
      jPanelParametersMain = panel;
101
      jPanelParametersMain.init(m_Algorithm);
102

  
103
      initGUI();
104
      setLocationRelativeTo(null);
105

  
96 106
   }
97 107

  
98 108

  
......
112 122
   public AlgorithmDialog(final GeoAlgorithm algorithm,
113 123
                          final GeoAlgorithmParametersPanel panel,
114 124
                          final ArrayList<DateAndCommand> commands) {
115
       
125

  
116 126
      super(SextanteGUI.getMainFrame(), algorithm.getName(), true);
117
      init(algorithm, panel, commands);
118
   }
119 127

  
120
    private void init(final GeoAlgorithm algorithm,
121
            final GeoAlgorithmParametersPanel panel,
122
            final ArrayList<DateAndCommand> commands) {
128
      setResizable(false);
123 129

  
124
        if(panel instanceof DefaultParametersPanel){
125
            setResizable(false);
126
        } else {
127
            setResizable(true);
128
        }
130
      m_sCommand = commands;
131
      m_Algorithm = algorithm;
129 132

  
130
        m_Algorithm = algorithm;
131
        m_sCommand = commands;
133
      jPanelParametersMain = panel;
134
      jPanelParametersMain.init(m_Algorithm);
132 135

  
133
        jPanelParametersMain = panel;
134
        jPanelParametersMain.init(m_Algorithm);
136
      initGUI();
137
      setLocationRelativeTo(null);
135 138

  
136
        initGUI();
137
        setLocationRelativeTo(null);
139
   }
138 140

  
139
    }
140 141

  
141

  
142 142
   private void initGUI() {
143 143

  
144 144

  
145
//      jMainPanel = new JPanel();
146
//
147
//      this.add(jMainPanel);
148
//
149
//      final TableLayout thisLayout = new TableLayout(new double[][] { { 10.0, TableLayoutConstants.FILL, 10. },
150
//               { 1.0, 338.0, 37.0 } });
151
//      jMainPanel.setLayout(thisLayout);
145
      jMainPanel = new JPanel();
146

  
147
      this.add(jMainPanel);
148

  
149
      final TableLayout thisLayout = new TableLayout(new double[][] { { 10.0, TableLayoutConstants.FILL, 10. },
150
               { 1.0, 338.0, 37.0 } });
151
      jMainPanel.setLayout(thisLayout);
152 152
      this.setSize(696, 446);
153 153
      {
154 154
         jTabbedPane1 = new JTabbedPane();
155
//         jMainPanel.add(jTabbedPane1, "1, 1");
155
         jMainPanel.add(jTabbedPane1, "1, 1");
156 156
         {
157 157
            jTabbedPane1.addTab(Sextante.getText("Parameters"), null, jPanelParametersMain, null);
158 158
         }
......
170 170
         jPanelButtonsLayout.setHGap(5);
171 171
         jPanelButtonsLayout.setVGap(5);
172 172
         jPanelButtons.setLayout(jPanelButtonsLayout);
173
//         jMainPanel.add(jPanelButtons, "1, 2");
173
         jMainPanel.add(jPanelButtons, "1, 2");
174 174
         jPanelButtons.setFocusable(false);
175 175
         {
176 176
            jButtonOK = new JButton();
......
245 245
            // do nothing
246 246
         }
247 247
      }
248
      jMainPanel = new JPanel();
249
      jMainPanel.setLayout(new BorderLayout());
250
      jMainPanel.add(jTabbedPane1, BorderLayout.CENTER);
251
      jMainPanel.add(jPanelButtons, BorderLayout.SOUTH);
248

  
252 249
   }
253 250

  
254 251

  

Also available in: Unified diff