Revision 345 2.0/trunk/org.gvsig.gvsig3d.app/org.gvsig.gvsig3d.app.extension/src/main/java/org/gvsig/gvsig3d/app/gui/styling/Object3DSymbolTab.java

View differences:

Object3DSymbolTab.java
164 164
		gbl_panel_4.columnWidths = new int[] { 175 };
165 165
		gbl_panel_4.rowHeights = new int[] { 250, 45 };
166 166
		gbl_panel_4.columnWeights = new double[] { 1.0 };
167
		gbl_panel_4.rowWeights = new double[] { 1.0, 0.0};
167
		gbl_panel_4.rowWeights = new double[] { 1.0, 0.0 };
168 168
		panel_4.setLayout(gbl_panel_4);
169
		
169

  
170 170
		JPanel panel_1 = new JPanel();
171
		panel_1.setBorder(new TitledBorder(null, "Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null));
171
		panel_1.setBorder(new TitledBorder(null, "Preview",
172
				TitledBorder.LEADING, TitledBorder.TOP, null, null));
172 173
		GridBagConstraints gbc_panel_1 = new GridBagConstraints();
173 174
		gbc_panel_1.insets = new Insets(0, 0, 5, 0);
174 175
		gbc_panel_1.fill = GridBagConstraints.BOTH;
......
176 177
		gbc_panel_1.gridy = 0;
177 178
		panel_4.add(panel_1, gbc_panel_1);
178 179
		panel_1.setLayout(new BorderLayout(0, 0));
179
		
180

  
180 181
		panel_1.add(getAlternateOsgPanel());
181
		
182

  
182 183
		_comboBox = new JComboBox();
183 184
		_comboBox.addActionListener(new ActionListener() {
184 185
			public void actionPerformed(ActionEvent arg0) {
185
				
186
				switch(_comboBox.getSelectedIndex()){
187
				
188
				case 0:
189
					_nodeURL=Object3DSymbolTab.class.getResource("/particle/fire.osgb").getPath();
190
					break;
191
				case 1:
192
					_nodeURL=Object3DSymbolTab.class.getResource("/particle/radial.osgb").getPath();
193
					break;
194
				case 2:
195
					_nodeURL=Object3DSymbolTab.class.getResource("/particle/space.osgb").getPath();
196
					break;
197
				case 3:
198
					_nodeURL=Object3DSymbolTab.class.getResource("/particle/trisistema.osgb").getPath();
199
					break;
200
					
201
				default: 
202
					break;			
203
				
204
				}	
205
				
206
				try {
207
					Node node = osgDB.readNodeFile(_nodeURL);
208
					_alternateCanvas3d.getOSGViewer().setSceneData(node);
209
				} catch (LoadNodeException e) {
210
					// TODO Auto-generated catch block
211
					e.printStackTrace();
212
				} catch (FileNotFoundException e) {
213
					// TODO Auto-generated catch block
214
					e.printStackTrace();
186

  
187
				if (arg0.getSource() instanceof JComboBox) {
188
					switch (_comboBox.getSelectedIndex()) {
189

  
190
					case 0:
191
						_nodeURL = Object3DSymbolTab.class.getResource(
192
								"/particle/fire.osgb").getPath();
193
						break;
194
					case 1:
195
						_nodeURL = Object3DSymbolTab.class.getResource(
196
								"/particle/radial.osgb").getPath();
197
						break;
198
					case 2:
199
						_nodeURL = Object3DSymbolTab.class.getResource(
200
								"/particle/space.osgb").getPath();
201
						break;
202
					case 3:
203
						_nodeURL = Object3DSymbolTab.class.getResource(
204
								"/particle/trisistema.osgb").getPath();
205
						break;
206

  
207
					default:
208
						break;
209

  
210
					}
211

  
212
					try {
213
						Node node = osgDB.readNodeFile(_nodeURL);
214
						_alternateCanvas3d.getOSGViewer().setSceneData(node);
215
					} catch (LoadNodeException e) {
216
						// TODO Auto-generated catch block
217
						e.printStackTrace();
218
					} catch (FileNotFoundException e) {
219
						// TODO Auto-generated catch block
220
						e.printStackTrace();
221
					}
222

  
223
					Object3DSymbolTab.this.repaint();
224
					_alternateCanvas3d.getOSGViewer().getCameraManipulator()
225
							.computeHomePosition();
226

  
215 227
				}
216
				
217 228
			}
218 229
		});
219
		_comboBox.setModel(new DefaultComboBoxModel(new String[] {"Fire", "Radial", "Space", "Flare"}));
230
		_comboBox.setModel(new DefaultComboBoxModel(new String[] { "Fire",
231
				"Radial", "Space", "Flare" }));
220 232
		GridBagConstraints gbc_comboBox = new GridBagConstraints();
221 233
		gbc_comboBox.fill = GridBagConstraints.HORIZONTAL;
222 234
		gbc_comboBox.gridx = 0;

Also available in: Unified diff