/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/classgen.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/classgen.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1391 by jonathan, Thu Jul 10 14:54:02 2003 UTC revision 1526 by jonathan, Wed Jul 30 15:43:06 2003 UTC
# Line 24  import classifier, resource Line 24  import classifier, resource
24    
25  from Thuban.Model.classgen import \  from Thuban.Model.classgen import \
26      generate_uniform_distribution, generate_singletons, generate_quantiles, \      generate_uniform_distribution, generate_singletons, generate_quantiles, \
27      CustomRamp, GreyRamp, RedRamp, GreenRamp, BlueRamp, GreenToRedRamp, \      CustomRamp, grey_ramp, red_ramp, green_ramp, blue_ramp, green_to_red_ramp, \
28      HotToColdRamp      HotToColdRamp, FixedRamp
29    
30    
31  USEALL_BMP  = "group_use_all"  USEALL_BMP  = "group_use_all"
# Line 136  class ClassGenDialog(wxDialog): Line 136  class ClassGenDialog(wxDialog):
136          self.propPanel = None          self.propPanel = None
137          custom_ramp_panel = CustomRampPanel(self, layer.ShapeType())          custom_ramp_panel = CustomRampPanel(self, layer.ShapeType())
138    
139          self.propCombo.Append(PROPCOMBOSTR_GREY,  GreyRamp)          self.propCombo.Append(PROPCOMBOSTR_GREY,  grey_ramp)
140          self.propCombo.Append(PROPCOMBOSTR_RED,   RedRamp)          self.propCombo.Append(PROPCOMBOSTR_RED,   red_ramp)
141          self.propCombo.Append(PROPCOMBOSTR_GREEN, GreenRamp)          self.propCombo.Append(PROPCOMBOSTR_GREEN, green_ramp)
142          self.propCombo.Append(PROPCOMBOSTR_BLUE,  BlueRamp)          self.propCombo.Append(PROPCOMBOSTR_BLUE,  blue_ramp)
143          self.propCombo.Append(PROPCOMBOSTR_GREEN2RED, GreenToRedRamp)          self.propCombo.Append(PROPCOMBOSTR_GREEN2RED, green_to_red_ramp)
144          self.propCombo.Append(PROPCOMBOSTR_HOT2COLD,  HotToColdRamp())          self.propCombo.Append(PROPCOMBOSTR_HOT2COLD,  HotToColdRamp())
145          self.propCombo.Append(PROPCOMBOSTR_CUSTOM, custom_ramp_panel)          self.propCombo.Append(PROPCOMBOSTR_CUSTOM, custom_ramp_panel)
146    
# Line 225  class ClassGenDialog(wxDialog): Line 225  class ClassGenDialog(wxDialog):
225              ramp = propPanel.GetRamp()              ramp = propPanel.GetRamp()
226              if self.border_color and self.fix_border_check.IsChecked():              if self.border_color and self.fix_border_check.IsChecked():
227                  props = self.border_color.GetProperties()                  props = self.border_color.GetProperties()
228                  lineColor = props.GetLineColor()                  ramp = FixedRamp(ramp,
229                  lineWidth = props.GetLineWidth()                      (props.GetLineColor(), props.GetLineWidth(), None))
             else:  
                 lineColor = None  
                 lineWidth = None  
230    
231              if genSel == GENCOMBOSTR_UNIFORM:              if genSel == GENCOMBOSTR_UNIFORM:
232    
# Line 242  class ClassGenDialog(wxDialog): Line 239  class ClassGenDialog(wxDialog):
239    
240                      self.clazz = generate_uniform_distribution(                      self.clazz = generate_uniform_distribution(
241                                  min, max, numGroups, ramp,                                  min, max, numGroups, ramp,
242                                  self.type == FIELDTYPE_INT,                                  self.type == FIELDTYPE_INT)
                                 fixes = (lineColor, lineWidth, None))  
243    
244                      self.parent._SetClassification(self.clazz)                      self.parent._SetClassification(self.clazz)
245    
# Line 252  class ClassGenDialog(wxDialog): Line 248  class ClassGenDialog(wxDialog):
248                  list = genPanel.GetValueList()                  list = genPanel.GetValueList()
249    
250                  if len(list) > 0:                  if len(list) > 0:
251                      self.clazz = generate_singletons(list, ramp,                      self.clazz = generate_singletons(list, ramp)
                                      (lineColor, lineWidth, None))  
252                      self.parent._SetClassification(self.clazz)                      self.parent._SetClassification(self.clazz)
253    
254              elif genSel == GENCOMBOSTR_QUANTILES:              elif genSel == GENCOMBOSTR_QUANTILES:
# Line 265  class ClassGenDialog(wxDialog): Line 260  class ClassGenDialog(wxDialog):
260                  delta = 1 / float(numGroups)                  delta = 1 / float(numGroups)
261                  percents = [delta * i for i in range(1, numGroups + 1)]                  percents = [delta * i for i in range(1, numGroups + 1)]
262                  adjusted, self.clazz = \                  adjusted, self.clazz = \
263                      generate_quantiles(_list, percents, ramp, _range,                      generate_quantiles(_list, percents, ramp, _range)
                                        (lineColor, lineWidth, None))  
264    
265                  if adjusted:                  if adjusted:
266                      dlg = wxMessageDialog(self,                      dlg = wxMessageDialog(self,

Legend:
Removed from v.1391  
changed lines
  Added in v.1526

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26