17 |
FIELDTYPE_STRING |
FIELDTYPE_STRING |
18 |
|
|
19 |
from Thuban.Model.range import Range |
from Thuban.Model.range import Range |
20 |
|
from Thuban.UI.common import ThubanBeginBusyCursor, ThubanEndBusyCursor |
21 |
|
|
22 |
import classifier, resource |
import classifier, resource |
23 |
|
|
76 |
# panels they will call AllowGenerate() which uses genButton. |
# panels they will call AllowGenerate() which uses genButton. |
77 |
# |
# |
78 |
self.genButton = wxButton(self, wxID_OK, _("Generate")) |
self.genButton = wxButton(self, wxID_OK, _("Generate")) |
|
self.genButton.SetDefault() |
|
79 |
self.cancelButton = wxButton(self, wxID_CANCEL, _("Close")) |
self.cancelButton = wxButton(self, wxID_CANCEL, _("Close")) |
80 |
|
self.genButton.SetDefault() |
81 |
|
|
82 |
self.genChoice = wxChoice(self, ID_CLASSGEN_GENCOMBO) |
self.genChoice = wxChoice(self, ID_CLASSGEN_GENCOMBO) |
83 |
|
|
131 |
self.propPanel = None |
self.propPanel = None |
132 |
custom_ramp_panel = CustomRampPanel(self, layer.ShapeType()) |
custom_ramp_panel = CustomRampPanel(self, layer.ShapeType()) |
133 |
|
|
134 |
self.propCombo.Append(PROPCOMBOSTR_GREY, GreyRamp()) |
self.propCombo.Append(PROPCOMBOSTR_GREY, GreyRamp) |
135 |
self.propCombo.Append(PROPCOMBOSTR_RED, RedRamp()) |
self.propCombo.Append(PROPCOMBOSTR_RED, RedRamp) |
136 |
self.propCombo.Append(PROPCOMBOSTR_GREEN, GreenRamp()) |
self.propCombo.Append(PROPCOMBOSTR_GREEN, GreenRamp) |
137 |
self.propCombo.Append(PROPCOMBOSTR_BLUE, BlueRamp()) |
self.propCombo.Append(PROPCOMBOSTR_BLUE, BlueRamp) |
138 |
self.propCombo.Append(PROPCOMBOSTR_GREEN2RED, GreenToRedRamp()) |
self.propCombo.Append(PROPCOMBOSTR_GREEN2RED, GreenToRedRamp) |
139 |
self.propCombo.Append(PROPCOMBOSTR_HOT2COLD, HotToColdRamp()) |
self.propCombo.Append(PROPCOMBOSTR_HOT2COLD, HotToColdRamp()) |
140 |
self.propCombo.Append(PROPCOMBOSTR_CUSTOM, custom_ramp_panel) |
self.propCombo.Append(PROPCOMBOSTR_CUSTOM, custom_ramp_panel) |
141 |
|
|
222 |
|
|
223 |
list = genPanel.GetValueList() |
list = genPanel.GetValueList() |
224 |
|
|
225 |
if len(list) > 0 \ |
if len(list) > 0: |
226 |
and numGroups is not None: |
self.clazz = generate_singletons(list, ramp) |
|
|
|
|
self.clazz = generate_singletons( |
|
|
list, numGroups, ramp) |
|
|
|
|
227 |
self.parent._SetClassification(self.clazz) |
self.parent._SetClassification(self.clazz) |
228 |
|
|
229 |
elif genSel == GENCOMBOSTR_QUANTILES: |
elif genSel == GENCOMBOSTR_QUANTILES: |
503 |
def _OnRetrieve(self, event): |
def _OnRetrieve(self, event): |
504 |
table = self.layer.ShapeStore().Table() |
table = self.layer.ShapeStore().Table() |
505 |
if table is not None: |
if table is not None: |
506 |
wxBeginBusyCursor() |
ThubanBeginBusyCursor() |
507 |
try: |
try: |
508 |
min, max = table.ValueRange(self.fieldName) |
min, max = table.ValueRange(self.fieldName) |
509 |
self.minCtrl.SetValue(str(min)) |
self.minCtrl.SetValue(str(min)) |
510 |
self.maxCtrl.SetValue(str(max)) |
self.maxCtrl.SetValue(str(max)) |
511 |
finally: |
finally: |
512 |
wxEndBusyCursor() |
ThubanEndBusyCursor() |
513 |
|
|
514 |
def __GetValidatedTypeEntry(self, win, value, type, badValue = None): |
def __GetValidatedTypeEntry(self, win, value, type, badValue = None): |
515 |
|
|
717 |
self.list_avail.DeleteAllItems() |
self.list_avail.DeleteAllItems() |
718 |
self.list_avail_data = [] |
self.list_avail_data = [] |
719 |
|
|
720 |
list = self.layer.ShapeStore().Table().UniqueValues(self.fieldName) |
ThubanBeginBusyCursor() |
721 |
index = 0 |
try: |
722 |
for v in list: |
list = self.layer.ShapeStore().Table().UniqueValues(self.fieldName) |
723 |
self.dataList.append(v) |
index = 0 |
724 |
i = self.list_avail.InsertStringItem(index, str(v)) |
for v in list: |
725 |
self.list_avail.SetItemData(index, i) |
self.dataList.append(v) |
726 |
|
i = self.list_avail.InsertStringItem(index, str(v)) |
727 |
self.list_avail_data.append(v) |
self.list_avail.SetItemData(index, i) |
728 |
index += 1 |
|
729 |
|
self.list_avail_data.append(v) |
730 |
|
index += 1 |
731 |
|
finally: |
732 |
|
ThubanEndBusyCursor() |
733 |
|
|
734 |
def _OnUseAll(self, event): |
def _OnUseAll(self, event): |
735 |
for i in range(self.list_avail.GetItemCount()): |
for i in range(self.list_avail.GetItemCount()): |
836 |
_list = [] |
_list = [] |
837 |
table = self.layer.ShapeStore().Table() |
table = self.layer.ShapeStore().Table() |
838 |
if table is not None: |
if table is not None: |
839 |
wxBeginBusyCursor() |
ThubanBeginBusyCursor() |
840 |
try: |
try: |
841 |
# |
# |
842 |
# FIXME: Replace with a call to table when the method |
# FIXME: Replace with a call to table when the method |
845 |
for i in range(table.NumRows()): |
for i in range(table.NumRows()): |
846 |
_list.append(table.ReadValue(i, self.fieldName)) |
_list.append(table.ReadValue(i, self.fieldName)) |
847 |
finally: |
finally: |
848 |
wxEndBusyCursor() |
ThubanEndBusyCursor() |
849 |
|
|
850 |
return _list |
return _list |
851 |
|
|
864 |
def OnRetrieve(self, event): |
def OnRetrieve(self, event): |
865 |
table = self.layer.ShapeStore().Table() |
table = self.layer.ShapeStore().Table() |
866 |
if table is not None: |
if table is not None: |
867 |
wxBeginBusyCursor() |
ThubanBeginBusyCursor() |
868 |
try: |
try: |
869 |
min, max = table.ValueRange(self.fieldName) |
min, max = table.ValueRange(self.fieldName) |
870 |
self.text_range.SetValue("[" + str(min) + ";" + str(max) + "]") |
self.text_range.SetValue("[" + str(min) + ";" + str(max) + "]") |
871 |
finally: |
finally: |
872 |
wxEndBusyCursor() |
ThubanEndBusyCursor() |
873 |
|
|
874 |
ID_CUSTOMRAMP_COPYSTART = 4001 |
ID_CUSTOMRAMP_COPYSTART = 4001 |
875 |
ID_CUSTOMRAMP_COPYEND = 4002 |
ID_CUSTOMRAMP_COPYEND = 4002 |