[GRASS-SVN] r49363 - in grass/trunk/gui/wxpython: . lmgr mapdisp wxplot

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 26 08:36:35 EST 2011


Author: martinl
Date: 2011-11-26 05:36:34 -0800 (Sat, 26 Nov 2011)
New Revision: 49363

Modified:
   grass/trunk/gui/wxpython/lmgr/layertree.py
   grass/trunk/gui/wxpython/mapdisp/frame.py
   grass/trunk/gui/wxpython/wxgui.py
   grass/trunk/gui/wxpython/wxplot/base.py
   grass/trunk/gui/wxpython/wxplot/dialogs.py
   grass/trunk/gui/wxpython/wxplot/histogram.py
   grass/trunk/gui/wxpython/wxplot/profile.py
   grass/trunk/gui/wxpython/wxplot/scatter.py
Log:
wxGUI major code reorganization (more fixes) 


Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2011-11-25 21:32:28 UTC (rev 49362)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2011-11-26 13:36:34 UTC (rev 49363)
@@ -545,8 +545,8 @@
             self.histogramFrame = self.mapdisplay.histogram
 
         if not self.histogramFrame:
-            self.histogramFrame = HistFrame(self, size = globalvar.HIST_WINDOW_SIZE,
-                                            style = wx.DEFAULT_FRAME_STYLE)
+            self.histogramFrame = HistogramFrame(self, size = globalvar.HIST_WINDOW_SIZE,
+                                                 style = wx.DEFAULT_FRAME_STYLE)
             self.histogramFrame.CentreOnScreen()
             # show new display
             self.histogramFrame.Show()

Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py	2011-11-25 21:32:28 UTC (rev 49362)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py	2011-11-26 13:36:34 UTC (rev 49363)
@@ -965,7 +965,7 @@
         self.MapWindow.SetCursor(self.cursors["pencil"])
         
         # initiating output
-        style = self._layerManager.goutput.cmd_output.StyleWarning
+        style = self._layerManager.goutput.cmdOutput.StyleWarning
         self._layerManager.goutput.WriteLog(_('Click and drag with left mouse button '
                                               'to measure.%s'
                                               'Double click with left button to clear.') % \
@@ -1035,10 +1035,8 @@
                 self.tree.GetPyData(self.tree.layer_selected)[0]['type'] == 'raster':
             raster.append(self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].name)
 
-        self.profile = ProfileFrame(self,
-                                            id = wx.ID_ANY, pos = wx.DefaultPosition, size = (700,300),
-                                            style = wx.DEFAULT_FRAME_STYLE, 
-                                            rasterList = raster)
+        self.profile = ProfileFrame(self, size = wx.Size(700, 300),
+                                    rasterList = raster)
         self.profile.Show()
         # Open raster select dialog to make sure that a raster (and the desired raster)
         # is selected to be profiled
@@ -1136,8 +1134,8 @@
     def OnHistogram(self, event):
         """!Init histogram display canvas and tools
         """
-        self.histogram = HistFrame(parent = self, id = wx.ID_ANY, size = globalvar.HIST_WINDOW_SIZE,
-                                   style = wx.DEFAULT_FRAME_STYLE)
+        self.histogram = HistogramFrame(parent = self, id = wx.ID_ANY, size = globalvar.HIST_WINDOW_SIZE,
+                                        style = wx.DEFAULT_FRAME_STYLE)
         
         # show new display
         self.histogram.Show()

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2011-11-25 21:32:28 UTC (rev 49362)
+++ grass/trunk/gui/wxpython/wxgui.py	2011-11-26 13:36:34 UTC (rev 49363)
@@ -1060,9 +1060,9 @@
         cmd = self.GetMenuCmd(event)
         
         if cmd[0] == 'r.colors':
-            ctable = colorrules.RasterColorTable(self)
+            ctable = RasterColorTable(self)
         else:
-            ctable = colorrules.VectorColorTable(self, attributeType = 'color')
+            ctable = VectorColorTable(self, attributeType = 'color')
         ctable.CentreOnScreen()
         ctable.Show()
         

Modified: grass/trunk/gui/wxpython/wxplot/base.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/base.py	2011-11-25 21:32:28 UTC (rev 49362)
+++ grass/trunk/gui/wxpython/wxplot/base.py	2011-11-26 13:36:34 UTC (rev 49363)
@@ -23,6 +23,7 @@
 from core.globalvar import ETCICONDIR
 from core.settings  import UserSettings
 from wxplot.dialogs import TextDialog, OptDialog
+from core.render    import Map
 
 import grass.script as grass
 

Modified: grass/trunk/gui/wxpython/wxplot/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/dialogs.py	2011-11-25 21:32:28 UTC (rev 49362)
+++ grass/trunk/gui/wxpython/wxplot/dialogs.py	2011-11-26 13:36:34 UTC (rev 49363)
@@ -23,8 +23,9 @@
 import wx.lib.colourselect  as csel
 import wx.lib.scrolledpanel as scrolled
 
-from core          import globalvar
-from core.settings import UserSettings
+from core             import globalvar
+from core.settings    import UserSettings
+from gui_core.gselect import Select
 
 from grass.script import core  as grass
 

Modified: grass/trunk/gui/wxpython/wxplot/histogram.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/histogram.py	2011-11-25 21:32:28 UTC (rev 49362)
+++ grass/trunk/gui/wxpython/wxplot/histogram.py	2011-11-26 13:36:34 UTC (rev 49363)
@@ -23,6 +23,8 @@
 
 from gui_core.toolbars import BaseToolbar
 from wxplot.base       import BasePlotFrame
+from icons.icon        import Icons
+from wxplot.dialogs    import HistRasterDialog, PlotStatsFrame
 
 class Histogram2Frame(BasePlotFrame):
     def __init__(self, parent, id, pos, style, size, rasterList = []):
@@ -74,7 +76,7 @@
     def OnSelectRaster(self, event):
         """!Select raster map(s) to profile
         """
-        dlg = dialogs.HistRasterDialog(parent = self)
+        dlg = HistRasterDialog(parent = self)
 
         if dlg.ShowModal() == wx.ID_OK:
             self.rasterList = dlg.rasterList
@@ -211,8 +213,8 @@
             stats = _('Statistics for %s\n\n%s\n') % (rast, ret)
             message.append(stats)
             
-        stats = dialogs.PlotStatsFrame(self, id = wx.ID_ANY, message = message, 
-                                      title = title)
+        stats = PlotStatsFrame(self, id = wx.ID_ANY, message = message, 
+                               title = title)
 
         if stats.Show() == wx.ID_CLOSE:
             stats.Destroy()       
@@ -221,7 +223,7 @@
     """!Toolbar for histogramming raster map
     """ 
     def __init__(self, parent):
-        AbstractToolbar.__init__(self, parent)
+        BaseToolbar.__init__(self, parent)
         
         self.InitToolbar(self._toolbarData())
         

Modified: grass/trunk/gui/wxpython/wxplot/profile.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/profile.py	2011-11-25 21:32:28 UTC (rev 49362)
+++ grass/trunk/gui/wxpython/wxplot/profile.py	2011-11-26 13:36:34 UTC (rev 49363)
@@ -36,14 +36,16 @@
 
 from wxplot.base       import BasePlotFrame
 from gui_core.toolbars import BaseToolbar
+from icons.icon        import Icons
+from wxplot.dialogs    import ProfileRasterDialog, PlotStatsFrame
 
 class ProfileFrame(BasePlotFrame):
     """!Mainframe for displaying profile of one or more raster maps. Uses wx.lib.plot.
     """
-    def __init__(self, parent, id, pos, style, size, rasterList = []):
+    def __init__(self, parent, id = wx.ID_ANY, style = wx.DEFAULT_FRAME_STYLE, 
+                 rasterList = [], **kwargs):
+        BasePlotFrame.__init__(self, parent, **kwargs)
 
-        BasePlotFrame.__init__(self, parent)
-
         self.toolbar = ProfileToolbar(parent = self)
         self.SetToolBar(self.toolbar)
         self.SetLabel(_("GRASS Profile Analysis Tool"))
@@ -102,7 +104,7 @@
     def OnSelectRaster(self, event):
         """!Select raster map(s) to profile
         """
-        dlg = dialogs.ProfileRasterDialog(parent = self)
+        dlg = ProfileRasterDialog(parent = self)
 
         if dlg.ShowModal() == wx.ID_OK:
             self.rasterList = dlg.rasterList
@@ -374,8 +376,8 @@
             except:
                 pass
             
-        stats = dialogs.PlotStatsFrame(self, id = wx.ID_ANY, message = message, 
-                                      title = title)
+        stats = PlotStatsFrame(self, id = wx.ID_ANY, message = message, 
+                               title = title)
 
         if stats.Show() == wx.ID_CLOSE:
             stats.Destroy()       

Modified: grass/trunk/gui/wxpython/wxplot/scatter.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/scatter.py	2011-11-25 21:32:28 UTC (rev 49362)
+++ grass/trunk/gui/wxpython/wxplot/scatter.py	2011-11-26 13:36:34 UTC (rev 49363)
@@ -23,6 +23,8 @@
 
 from wxplot.base       import BasePlotFrame
 from gui_core.toolbars import BaseToolbar
+from icons.icon        import Icons
+from wxplot.dialogs    import ScatterRasterDialog, PlotStatsFrame
 
 class ScatterFrame(BasePlotFrame):
     """!Mainframe for displaying bivariate scatter plot of two raster maps. Uses wx.lib.plot.
@@ -74,7 +76,7 @@
     def OnSelectRaster(self, event):
         """!Select raster map(s) to profile
         """
-        dlg = dialogs.ScatterRasterDialog(parent = self)
+        dlg = ScatterRasterDialog(parent = self)
 
         if dlg.ShowModal() == wx.ID_OK:
             rlist = dlg.rasterList
@@ -250,17 +252,17 @@
             str = eqtitle + eq + num + rval + rsq + ftest
             message.append(str)
             
-        stats = dialogs.PlotStatsFrame(self, id = wx.ID_ANY, message = message, 
+        stats = PlotStatsFrame(self, id = wx.ID_ANY, message = message, 
                                       title = title)
 
         if stats.Show() == wx.ID_CLOSE:
             stats.Destroy()       
 
-class ScatterplotToolbar(BaseToolbar):
+class ScatterToolbar(BaseToolbar):
     """!Toolbar for bivariate scatterplots of raster map pairs
     """ 
     def __init__(self, parent):
-        AbstractToolbar.__init__(self, parent)
+        BaseToolbar.__init__(self, parent)
         
         self.InitToolbar(self._toolbarData())
         
@@ -270,7 +272,6 @@
     def _toolbarData(self):
         """!Toolbar data"""
         icons = Icons['plot']
-#        icons2 = Icons['modeler']
         return self._getToolbarData((('addraster', Icons['layerManager']["addRast"],
                                       self.parent.OnSelectRaster),
                                      (None, ),



More information about the grass-commit mailing list