Revision 793
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/lib/gvsig/view.py | ||
---|---|---|
4 | 4 |
from project import currentView, currentProject |
5 | 5 |
from org.gvsig.app import ApplicationLocator |
6 | 6 |
from org.gvsig.app.project.documents.view import ViewManager |
7 |
from org.gvsig.andami.ui.mdiManager import MDIManager |
|
7 | 8 |
|
8 | 9 |
def __centerView(self, envelope): |
9 | 10 |
self.getMapContext().getViewPort().setEnvelope(envelope) |
10 | 11 |
|
11 |
def __showWindow(self, maximize=False): |
|
12 |
def __showWindow(self, maximize=False, align=None):
|
|
12 | 13 |
application = ApplicationLocator.getManager() # Manager app |
13 | 14 |
projectManager = application.getProjectManager() # Project manager |
14 | 15 |
|
15 | 16 |
viewManager = projectManager.getDocumentManager(ViewManager.TYPENAME) |
16 | 17 |
view = currentProject().getView(self.name) |
17 | 18 |
viewin = viewManager.getMainWindow(view, None) #got our view |
18 |
application.getUIManager().addWindow(viewin) #open into the project |
|
19 |
if align==None: |
|
20 |
application.getUIManager().addWindow(viewin) #open into the project |
|
21 |
elif isinstance(align, str): |
|
22 |
attr = getattr(MDIManager, align) |
|
23 |
application.getUIManager().addWindow(viewin, attr) |
|
24 |
elif isinstance(align, int): |
|
25 |
application.getUIManager().addWindow(viewin, align) |
|
19 | 26 |
if maximize: |
20 | 27 |
application.getUIManager().setMaximum(viewin, True) #all window size |
21 | 28 |
|
Also available in: Unified diff