Revision 655

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FPanelLocConfig.java
73 73
	{
74 74
		DefaultListModel lstModel = (DefaultListModel) getJList().getModel();
75 75
		lstModel.clear();
76
		for (int i=0; i < mapCtrl.getMapContext().getLayers().getLayersCount(); i++)
76
		for (int i=mapCtrl.getMapContext().getLayers().getLayersCount()-1; i >=0; i--)
77 77
		{
78 78
			FLayer lyr = mapCtrl.getMapContext().getLayers().getLayer(i);
79 79
			lstModel.addElement(lyr.getName());
......
299 299
		FLayers theLayers = mapCtrl.getMapContext().getLayers();
300 300
		// TODO LWS Esto debe venir de fuera (proyeccion del fichero, o de la vista)
301 301
		IProjection proj = ProjectionPool.get("ed50utm30");
302
		
303
		int numLayers = theLayers.getLayersCount()-1;
302 304

  
303 305
		if (e.getActionCommand() == "CANCEL")
304 306
		{
......
407 409
    				}
408 410
        		} // for
409 411
           //  lstModel.addElement(lyr.getName());
412
            }
410 413
            refreshList();
411 414
            updateControls(null);
412 415
            mapCtrl.getMapContext().fireInvalidEvent();
413
            }
414 416
	            
415 417
 		}
416 418
		if (e.getActionCommand() == "REMOVE_LAYER")
......
432 434
				if (lyr instanceof Classifiable)
433 435
				{
434 436
					try {
437
						theLayers.setActive(false);
438
						lyr.setActive(true);
435 439
						m_LegendEditor.setMapContext(mapCtrl.getMapContext());
436 440
					} catch (DriverException e1) {
437 441
						// TODO Auto-generated catch block
438 442
						e1.printStackTrace();
439 443
					}
440
					PluginServices.getMDIManager().addView(m_LegendEditor);
444
					if (PluginServices.getMainFrame() == null) {
445
						JDialog dlg = new JDialog();
446
						    							
447
						m_LegendEditor.setPreferredSize(m_LegendEditor.getSize());
448
						dlg.getContentPane().add(m_LegendEditor);
449
						dlg.setModal(true);			
450
						dlg.pack();
451
						dlg.show();
452
						
453
					} else
454
						PluginServices.getMDIManager().addView(m_LegendEditor);					
441 455
				}
442 456
				else
443 457
				{
......
452 466
			int idSelec = jList.getSelectedIndex();
453 467
		    int fromIndex = idSelec;
454 468
		    int toIndex = idSelec-1;
455
		        FLayer aux = theLayers.getLayer(fromIndex);
469
		        FLayer aux = theLayers.getLayer((String) lstModel.get(fromIndex));
456 470
		        try {
457
					theLayers.moveTo(fromIndex, toIndex);
471
					theLayers.moveTo(numLayers-fromIndex, numLayers-toIndex);
458 472
				} catch (CancelationException e1) {
459
					// TODO Auto-generated catch block
460 473
					e1.printStackTrace();
461 474
				}
462 475
		        
......
472 485
			int idSelec = jList.getSelectedIndex();
473 486
		    int fromIndex = idSelec;
474 487
		    int toIndex = idSelec+1;
475
		        FLayer aux = theLayers.getLayer(fromIndex);
488
		        FLayer aux = theLayers.getLayer((String) lstModel.get(fromIndex));
476 489
		        try {
477
					theLayers.moveTo(fromIndex, toIndex);
490
		        	theLayers.moveTo(numLayers-fromIndex, numLayers-toIndex);
478 491
				} catch (CancelationException e1) {
479
					// TODO Auto-generated catch block
480 492
					e1.printStackTrace();
481 493
				}
482 494
		        
......
495 507
	 */
496 508
	public ViewInfo getViewInfo() {
497 509
		if (m_viewinfo==null){
498
    		m_viewinfo=new ViewInfo(ViewInfo.RESIZABLE);
510
    		m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
499 511
			m_viewinfo.setTitle(PluginServices.getText(this,"Configurar_localizador"));
500 512
		}
501 513
			return m_viewinfo;
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/View.java
46 46

  
47 47
    /** DOCUMENT ME! */
48 48
    private NewMapControl m_MapControl;
49
    private NewMapControl m_MapLoc;
49
    private MapOverview m_MapLoc;
50 50

  
51 51
    /** DOCUMENT ME! */
52 52
    public FProjection m_Projection;
......
354 354
     *
355 355
     * @return DOCUMENT ME!
356 356
     */
357
    public NewMapControl getMapOverview() {
357
    public MapOverview getMapOverview() {
358 358
        return m_MapLoc;
359 359
    }
360 360

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SingleView.java
39 39
import org.apache.log4j.PropertyConfigurator;
40 40

  
41 41
import com.iver.andami.messages.Messages;
42
import com.iver.cit.gvsig.fmap.MapOverview;
42 43
import com.iver.cit.gvsig.fmap.NewMapControl;
43 44
import com.iver.cit.gvsig.fmap.ViewPort;
44 45
import com.iver.cit.gvsig.fmap.layers.FLayer;
......
79 80
// 	public FProjection m_Projection;
80 81
	private JScrollPane jscrollTOC;
81 82
	private TOC m_TOC;
82
	private NewMapControl m_MapLoc;
83
	private MapOverview m_MapLoc;
83 84
	private String m_Name = null;
84 85
	// private com.iver.cit.opensig.project.View modelo;
85 86
	
......
484 485
			});
485 486
		m_TOC = new TOC();
486 487
		m_TOC.setMapContext(m_MapControl.getMapContext());
487
		m_MapLoc = new NewMapControl();
488
		m_MapLoc = new MapOverview(m_MapControl);
488 489
		m_MapLoc.setPreferredSize(new Dimension(150,200));
489 490
		JSplitPane tempMainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
490 491
		tempMainSplit.setPreferredSize(new Dimension(500, 300));
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/MapOverview.java
20 20
import java.awt.geom.Point2D;
21 21
import java.awt.geom.Rectangle2D;
22 22

  
23
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
24 23

  
25

  
26 24
/**
27 25
 * @author FJP
28 26
 *
......
188 186
	        g2.fill(vpOrig.getExtent());
189 187
	        
190 188
	        // dibujamos las l?neas vertical y horizontal
189
	        Point2D pRightUp = vp.toMapPoint(getWidth(),0);
191 190
	        Line2D.Double linVert = new Line2D.Double(vpOrig.getExtent().getCenterX(), 
192
	        		vp.getExtent().getMinY(), vpOrig.getExtent().getCenterX(),vp.getExtent().getMaxY());
191
	        		vp.getExtent().getMinY(), vpOrig.getExtent().getCenterX(),pRightUp.getY());
193 192
	        Line2D.Double linHoriz = new Line2D.Double(vp.getExtent().getMinX(), 
194
	        		vpOrig.getExtent().getCenterY(), vp.getExtent().getMaxX(),
193
	        		vpOrig.getExtent().getCenterY(), pRightUp.getX(),
195 194
	        		vpOrig.getExtent().getCenterY());
196 195
	        
197 196
	        g2.draw(linVert);
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/ExtentEvent.java
5 5
import java.awt.geom.Rectangle2D;
6 6

  
7 7
public class ExtentEvent extends FMapEvent{
8
    private Rectangle2D newExtent;
9
    
10
    public ExtentEvent(Rectangle2D r)
11
    {
12
    	newExtent = r;
13
    }
8 14
    public Rectangle2D getNewExtent() {
9
    	//TODO implementar bien
10
    	return null;
15
    	return newExtent;
11 16
    }
17
    
12 18

  
13
    public Rectangle2D getOldExtent() {
14
    	//TODO implementar bien
15
    	return null;
16
    }
17

  
18
    private FMap mapa;
19 19
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/ViewPort.java
180 180
		this.imageSize = imageSize;
181 181
		calculateAffineTransform();
182 182
	}
183
	
184
    private void callExtentListeners(Rectangle2D newRect) {
185
    	ExtentEvent ev = new ExtentEvent(newRect);
186
        for (int i = 0; i < extentListeners.size(); i++) {
187
            ExtentListener listener = (ExtentListener) extentListeners.get(i);
188
            listener.extentChanged(ev);
189
        }
190
    }
183 191

  
192

  
184 193
	/**
185 194
	 * 
186 195
	 */
......
217 226
        trans.concatenate(escalado);
218 227

  
219 228
        trans.concatenate(translacion);
229
        
230
        // Lanzamos los eventos de extent cambiado
231
        callExtentListeners(adjustedExtent);
220 232

  
221 233
        
222 234
        // Calculamos las distancias de 1 pixel y 3 pixel con esa transformaci?n 

Also available in: Unified diff