Revision 4827

View differences:

trunk/extensions/extGPS/src/org/gvsig/gps/panel/GPSConfigPanel.java
43 43
 *
44 44
 * $Id$
45 45
 * $Log$
46
 * Revision 1.7  2006-04-11 13:19:51  jaume
46
 * Revision 1.8  2006-04-12 06:49:47  jaume
47 47
 * *** empty log message ***
48 48
 *
49
 * Revision 1.7  2006/04/11 13:19:51  jaume
50
 * *** empty log message ***
51
 *
49 52
 * Revision 1.6  2006/04/10 17:13:28  jaume
50 53
 * *** empty log message ***
51 54
 *
......
71 74
import gnu.io.CommPortIdentifier;
72 75

  
73 76
import java.awt.Component;
74
import java.util.ArrayList;
75 77
import java.util.Enumeration;
76 78

  
77 79
import javax.swing.JButton;
......
85 87
import org.gvsig.gps.tools.PointCalibrate;
86 88

  
87 89
import com.iver.andami.PluginServices;
90
import com.iver.andami.ui.mdiManager.SingletonView;
88 91
import com.iver.andami.ui.mdiManager.View;
89 92
import com.iver.andami.ui.mdiManager.ViewInfo;
90 93
import com.iver.cit.gvsig.fmap.MapControl;
91 94
import com.iver.cit.gvsig.fmap.tools.Behavior.PointBehavior;
92 95
import com.iver.utiles.XMLEntity;
93 96

  
94
public class GPSConfigPanel extends JPanel implements View{
97
public class GPSConfigPanel extends JPanel implements SingletonView{
98
	public static String viewModel = "GPSConfigPanel";
95 99
	private JComboBox cmbPorts = null;
96 100
	private JPanel pnlPortConfig = null;
97 101
	private JTextField txtSampleRate;
......
312 316
		return btnCancel;
313 317
	}
314 318

  
315
	protected void cancel() {
319
	private void cancel() {
316 320
		PluginServices.getMDIManager().closeView(this);		
317 321
	}
318 322
	
319
	protected void ok() {
323
	private void ok() {
320 324
		try {
321 325
			control.setSampleRate(Integer.parseInt(txtSampleRate.getText()));
322 326
			control.setPortSpeed(Integer.parseInt((String) cmbPortSpeed.getSelectedItem()));
......
449 453
					PointCalibrate calibrator = new PointCalibrate(v, currentTool);
450 454
					mc.addMapTool(toolName, new PointBehavior(calibrator));
451 455
					mc.setTool(toolName);
456
					PluginServices.getMDIManager().addView(v);
452 457
					return;
453 458
				}
454 459
			}
......
478 483
		btnCalibrate.setEnabled(cmbViews.isEnabled());
479 484
		return cmbViews;
480 485
	}
486

  
487
	public Object getViewModel() {
488
		return viewModel;
489
	}
481 490
}
trunk/extensions/extGPS/src/org/gvsig/gps/panel/GPSControlPanel.java
43 43
 *
44 44
 * $Id$
45 45
 * $Log$
46
 * Revision 1.15  2006-04-11 20:01:18  jaume
46
 * Revision 1.16  2006-04-12 06:51:56  jaume
47 47
 * *** empty log message ***
48 48
 *
49 49
 * Revision 1.14  2006/04/11 13:19:51  jaume
......
396 396
						model.putValue(kPos, Math.abs(lat)+""+cLat+", "+Math.abs(lon)+cLon);
397 397
						tblStatus.tableChanged(e);	
398 398
						// esto igual ho hauria de canviar.
399
						((GPSExtension) thisExtension).drawSymbol(null, null, p, true);
399
						((GPSExtension) thisExtension).drawSymbol(null, null, p, false);
400 400
					}
401 401
					
402 402
					public void signalQualityChanged(float level, int satellites, String qualityStatus) {
trunk/extensions/extGPS/src/org/gvsig/gps/tools/PointCalibrate.java
43 43
*
44 44
* $Id$
45 45
* $Log$
46
* Revision 1.6  2006-04-11 20:01:18  jaume
46
* Revision 1.7  2006-04-12 06:51:35  jaume
47 47
* *** empty log message ***
48 48
*
49 49
* Revision 1.5  2006/04/11 13:27:30  jaume
......
77 77
import org.cresques.cts.gt2.CoordSys;
78 78
import org.cresques.cts.gt2.CoordTrans;
79 79
import org.gvsig.gps.GPSDriver;
80
import org.gvsig.gps.exceptions.GPSReceiverException;
80
import org.gvsig.gps.panel.GPSConfigPanel;
81 81

  
82 82
import com.iver.andami.PluginServices;
83
import com.iver.andami.ui.mdiManager.SingletonView;
83 84
import com.iver.cit.gvsig.fmap.tools.BehaviorException;
84 85
import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
85 86
import com.iver.cit.gvsig.fmap.tools.Listeners.PointListener;
86 87
import com.iver.cit.gvsig.gui.View;
87
import com.iver.utiles.XMLEntity;
88 88

  
89 89
public class PointCalibrate implements PointListener {
90 90
	
......
117 117
			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "gps_not_ready") );
118 118

  
119 119
		view.getMapControl().setTool(previousToolName);
120
		com.iver.andami.ui.mdiManager.View views[] = PluginServices.getMDIManager().getAllViews();
121
		for (int i = 0; i < views.length; i++) {
122
			if (views[i] instanceof SingletonView) {
123
				SingletonView s = (SingletonView) views[i];
124
				if (s.getViewModel().equals(GPSConfigPanel.viewModel))
125
					PluginServices.getMDIManager().addView(s);
126
			}
127
		}
128
		
120 129
	}
121 130

  
122 131
	public void pointDoubleClick(PointEvent event) throws BehaviorException {}

Also available in: Unified diff