Revision 9044 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/gui/View.java

View differences:

View.java
135 135
	protected boolean isShowConsole=false;
136 136
	private ViewPortListener viewPortListener;
137 137
	/**
138
     * Creates a new View object.
138
     * Creates a new View object. Before being used, the object must be
139
     * initialized.
140
     * 
141
     * @see initialize()
139 142
     */
140 143
    public View() {
144
    	super();
141 145
    	this.setName("View");
142
        //this.setName(Utilities.getMessage(this, "Vista")+ " : "+modelo.getName());
143
        // this.setPreferredSize(new Dimension(500, 300));
144
        initComponents();
145
        hideConsole();
146
    }
147
    
148
    /**
149
     * Create the internal componentes and populate the window with them.
150
     * If the layout properties were set using the
151
     * <code>setWindowData(WindowData)</code>
152
     * method, the window will be populated according to this
153
     * properties.
154
     */
155
    public void initialize() {
156
    	super.initialize();
157
    	initComponents();
158
    	hideConsole();
146 159
        getConsolePanel().addResponseListener(consoleResponseAdapter);
147
        /* getConsolePanel().addContainerListener(new ContainerAdapter() {
148
        	public void componentAdded(ContainerEvent e) {
149
        			// Mostramos consola
150
        			SwingUtilities.invokeLater(new Runnable() {
151
        				 public void run() {
152

  
153
        					 getMapControl().doLayout(); // drawMap(false);
154
        					 getConsolePanel().invalidate();
155
        					 getConsolePanel().repaint();
156
        					 getMapControl().repaint();
157
        					 getConsolePanel().getTxt().doLayout();
158
        			     }
159
        			});
160
        	    }
161

  
162
        	    public void componentRemoved(ContainerEvent e) {
163
        	    	// Ocultamos consola
164
        			SwingUtilities.invokeLater(new Runnable() {
165
       				 public void run() {
166
       					 getMapControl().repaint();
167
       			     }
168
       			});
169

  
170
        	    }
171

  
172
        }); */
173 160
    }
174 161

  
175 162
    /**
......
386 373
        m_MapControl = new MapControl(); // Default is paintEnabled = false.
387 374
											// Remember to activate it
388 375
        m_MapControl.addExceptionListener(mapControlExceptionListener);
389
        // modelo.setMapContext(m_MapControl.getMapContext());
390

  
391
        // m_MapControl.setAcceptEvents(true); Lo comento porque ya se hace en el setModel
392 376
        m_TOC = new TOC();
393 377

  
394

  
395 378
        // Ponemos el localizador
396
        m_MapLoc = new MapOverview(m_MapControl);
397
        m_MapLoc.setPreferredSize(new Dimension(150, 200));
379
        m_MapLoc = new MapOverview(m_MapControl);        
398 380
		removeAll();
399
		//JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
400 381
		tempMainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
401
		tempMainSplit.setPreferredSize(new Dimension(500, 300));
382

  
383
    	if (windowData==null) {
384
    		m_MapLoc.setPreferredSize(new Dimension(150, 200));
385
    		tempMainSplit.setPreferredSize(new Dimension(500, 300));
386
    	}
387
		
402 388
		if (!isPalette()){
403
			JSplitPane tempSplitToc = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
389
			tempSplitToc = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
404 390
			tempSplitToc.setTopComponent(m_TOC);
405 391
			tempSplitToc.setBottomComponent(m_MapLoc);
406 392
			tempSplitToc.setResizeWeight(0.7);
......
416 402
		this.setLayout(new BorderLayout());
417 403
		this.add(tempMainSplit, BorderLayout.CENTER);
418 404

  
419
        // hideConsole();
420

  
421

  
422

  
423

  
405
		
406
		if (windowData!=null) {
407
			try {
408
				tempMainSplit.setDividerLocation(Integer.valueOf(windowData.get("MainDivider.Location")).intValue());
409
				if (windowData.get("TOCDivider.Location")!=null) {
410
					tempSplitToc.setDividerLocation(Integer.valueOf(windowData.get("TOCDivider.Location")).intValue());
411
				}
412
			}
413
			catch (NumberFormatException ex) {
414
				PluginServices.getLogger().error("Error restoring View properties");
415
			}
416
		}
417
		
424 418
        //Listener de eventos de movimiento que pone las coordenadas del rat?n en la barra de estado
425 419
        StatusBarListener sbl = new StatusBarListener(m_MapControl);
426 420

  
......
514 508
		getMapControl().getViewPort().removeViewPortListener(viewPortListener);
515 509
		if (getMapOverview()!=null)
516 510
		getMapOverview().getViewPort().removeViewPortListener(getMapOverview());
511
		
517 512
	}
518 513
	public void toPalette() {
519 514
		isPalette=true;
......
601 596
	public static void setDefaultBackColor(Color color) {
602 597
		defaultViewBackColor = color;
603 598
	}
599
	
604 600

  
605 601
}

Also available in: Unified diff