Revision 25007

View differences:

trunk/extensions/extDockingSkin/src/main/java/org/gvsig/mdiManager/DockingManager.java
80 80
	private JToggleButton projectButton;
81 81
	private DockWindow projectWindow;
82 82
	boolean showProjectWindow = true;
83
	
84 83

  
85 84
	private Dimension projectWindowSise;
86 85
	private JToggleButton hiddeButton;
......
91 90
	public void init(MDIFrame frame) {
92 91

  
93 92
		this.mainFrame = frame;
94
		
93

  
95 94
		dockWindowSupport = new DockWindowSupport(mainFrame, rootWindow);
96 95
		dialogStack = new DialogStack();
97 96
		singletonSupport = new SingletonSupport();
......
102 101

  
103 102
		singletonSupport.setDockInfoSupport(wis);
104 103
		singletonSupport.setDockWindowSupport(dockWindowSupport);
105
		
104

  
106 105
		singletonSupport.rootWindow = this.rootWindow;
107 106

  
108 107
		initDockingSystem();
......
181 180
		rootWindow = new RootWindow(true, null);// DockingUtil.createRootWindow(
182 181
		// new
183 182
		// StringViewMap(), true);
184
		
183

  
185 184
		singletonSupport.rootWindow = rootWindow;
186 185

  
187 186
		// Setting up the root window
......
274 273
			if (wi.isModal()) {
275 274
				addModalDialog(iWindow, wi);
276 275
			} else {
277
				if ((iWindow.getWindowProfile().equals(
278
						WindowInfo.PROJECT_PROFILE))&&(this.projectWindow!= null)) {
276
				if ((iWindow.getWindowProfile()
277
						.equals(WindowInfo.PROJECT_PROFILE))
278
						&& (this.projectWindow != null)) {
279 279
					setProjectWindowVisible(!showProjectWindow);
280 280
				} else {
281 281
					wss.add(iWindow, new ActionListener() {
282 282
						public void actionPerformed(ActionEvent e) {
283 283
							IWindow v = wis.getWindowById(Integer.parseInt(e
284 284
									.getActionCommand()));
285
							if (!(v.getWindowProfile().equals(
286
									WindowInfo.PROJECT_PROFILE))&&(projectWindow!= null)){
287
								DockWindow f = dockWindowSupport.getDockWindow(v);
285
							if (!(v.getWindowProfile()
286
									.equals(WindowInfo.PROJECT_PROFILE))
287
									&& (projectWindow != null)) {
288
								DockWindow f = dockWindowSupport
289
										.getDockWindow(v);
288 290
								f.getTopLevelAncestor().requestFocus();
289 291
								f.restoreFocus();
290
							}else{
292
							} else {
291 293
								setProjectWindowVisible(!showProjectWindow);
292 294
							}
293 295
							// activateJInternalFrame(f);
......
365 367
						ButtonGroup gButton = new ButtonGroup();
366 368
						tool.addButton(gButton, this.projectButton);
367 369
						gButton.add(this.hiddeButton);
368
//						tool.addButton(gButton, this.projectButton);
370
						// tool.addButton(gButton, this.projectButton);
369 371
					}
370
//					System.err.println("toolbar : " + toolBar[i].getName() + " visible " + toolBar[i].isEnabled());
372
					// System.err.println("toolbar : " + toolBar[i].getName() +
373
					// " visible " + toolBar[i].isEnabled());
371 374
				}
372 375

  
373 376
				projectWindow = wnd;
......
378 381
				DockingUtil.addWindow(wnd, rootWindow);
379 382
			}
380 383
			if (type.equals(WindowInfo.PROPERTIES_PROFILE)) {
381
//				DockingUtil.addWindow(wnd, rootWindow);
382
				
383
				int x = (wi.getX()<=0)? 100 : wi.getX();
384
				int y = (wi.getY()<=0)? 100 : wi.getY();
384
				// DockingUtil.addWindow(wnd, rootWindow);
385

  
386
				int x = (wi.getX() <= 0) ? 100 : wi.getX();
387
				int y = (wi.getY() <= 0) ? 100 : wi.getY();
385 388
				Point possition = new Point(x, y);
386 389
				final FloatingWindow floatingWindow = rootWindow
387
						.createFloatingWindow(possition,
388
								new Dimension(wi.getWidth(), wi.getHeight()),
389
								wnd);
390
						.createFloatingWindow(possition, new Dimension(wi
391
								.getWidth(), wi.getHeight()), wnd);
390 392
				// Show the window
391 393
				floatingWindow.getTopLevelAncestor().setVisible(true);
392 394
				((JDialog) floatingWindow.getTopLevelAncestor())
393 395
						.addWindowListener(new FloatingWindowContainerListener(
394 396
								floatingWindow));
395
				
397

  
396 398
			}
397 399
		} else {
398 400
			JOptionPane
......
444 446
		// }
445 447
		// DockingUtil.addWindow(wnd, rootWindow);
446 448
		updateDockWindowProperties(wnd, wi);
447
		// wnd.getTopLevelAncestor().requestFocus();
449
		if (wnd.getTopLevelAncestor() != null)
450
			wnd.getTopLevelAncestor().requestFocus();
448 451
		wnd.restoreFocus();
449 452
		lastFocusedWindow = wnd;
450 453
	}
......
867 870
		}
868 871

  
869 872
	}
870
	
871
	
872
	
873
	private void setProjectWindowVisible(boolean show){
873

  
874
	private void setProjectWindowVisible(boolean show) {
874 875
		showProjectWindow = show;
875 876
		if (showProjectWindow) {
876 877
			rootWindow.getWindowBar(Direction.LEFT).remove(projectWindow);
......
882 883
			this.projectButton.setSelected(true);
883 884
			rootWindow.validate();
884 885
		}
885
		
886

  
886 887
	}
887 888

  
888 889
	public void actionPerformed(ActionEvent e) {
......
893 894

  
894 895
	public boolean isShowProjectWindow() {
895 896
		return showProjectWindow;
896
	}	
897
	}
897 898

  
898 899
}

Also available in: Unified diff