Revision 42775 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.coreplugin.app/org.gvsig.coreplugin.app.mainplugin/src/main/java/org/gvsig/coreplugin/mdiManager/NewSkin.java
NewSkin.java | ||
---|---|---|
344 | 344 |
return window; |
345 | 345 |
} |
346 | 346 |
|
347 |
@Override |
|
348 |
public void move(final IWindow panel, final int x, final int y) { |
|
349 |
if (!SwingUtilities.isEventDispatchThread()) { |
|
350 |
SwingUtilities.invokeLater(new Runnable() { |
|
351 |
@Override |
|
352 |
public void run() { |
|
353 |
move(panel, x, y); |
|
354 |
} |
|
355 |
}); |
|
356 |
return; |
|
357 |
} |
|
358 |
Component window = fws.getFrame(panel); |
|
359 |
if (window == null) { |
|
360 |
return; |
|
361 |
} |
|
362 |
Point p = new Point(); |
|
363 |
p.setLocation(x, y); |
|
364 |
window.setLocation(p); |
|
365 |
} |
|
366 |
|
|
347 | 367 |
/** |
348 | 368 |
* Centres the Frame in the contentPane of the MainFrame. If the frame can't |
349 | 369 |
* be showed completely, it tries to show its top-left corner. |
... | ... | |
634 | 654 |
private void centerDialog(JDialog d) { |
635 | 655 |
int offSetX = d.getWidth() / 2; |
636 | 656 |
int offSetY = d.getHeight() / 2; |
637 |
|
|
638 |
d.setLocation((mainFrame.getWidth() / 2) - offSetX, (mainFrame |
|
639 |
.getHeight() / 2) |
|
640 |
- offSetY); |
|
657 |
Point o = mainFrame.getLocation(); |
|
658 |
int x = o.x + (mainFrame.getWidth() / 2) - offSetX; |
|
659 |
int y = o.y + (mainFrame.getHeight() / 2) - offSetY; |
|
660 |
if( x<0 ) { |
|
661 |
x = 0; |
|
662 |
} |
|
663 |
if( y<0 ) { |
|
664 |
y=0; |
|
665 |
} |
|
666 |
d.setLocation(x,y); |
|
641 | 667 |
} |
642 | 668 |
|
643 | 669 |
/** |
Also available in: Unified diff