16 |
from Thuban.Model.table import FIELDTYPE_INT, FIELDTYPE_DOUBLE, \ |
from Thuban.Model.table import FIELDTYPE_INT, FIELDTYPE_DOUBLE, \ |
17 |
FIELDTYPE_STRING |
FIELDTYPE_STRING |
18 |
|
|
19 |
|
from Thuban.Model.layer import SHAPETYPE_ARC |
20 |
from Thuban.Model.range import Range |
from Thuban.Model.range import Range |
21 |
from Thuban.UI.common import ThubanBeginBusyCursor, ThubanEndBusyCursor |
from Thuban.UI.common import ThubanBeginBusyCursor, ThubanEndBusyCursor |
22 |
|
|
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, GreyRamp, RedRamp, GreenRamp, BlueRamp, GreenToRedRamp, \ |
28 |
HotToColdRamp |
HotToColdRamp, FixedRamp |
29 |
|
|
30 |
|
|
31 |
USEALL_BMP = "group_use_all" |
USEALL_BMP = "group_use_all" |
32 |
USE_BMP = "group_use" |
USE_BMP = "group_use" |
48 |
ID_CLASSGEN_GENCOMBO = 4007 |
ID_CLASSGEN_GENCOMBO = 4007 |
49 |
ID_CLASSGEN_PROPCOMBO = 4008 |
ID_CLASSGEN_PROPCOMBO = 4008 |
50 |
|
|
51 |
|
ID_BORDER_COLOR = 4009 |
52 |
|
ID_BORDER_COLOR_CHANGE = 4010 |
53 |
|
|
54 |
class ClassGenDialog(wxDialog): |
class ClassGenDialog(wxDialog): |
55 |
|
|
56 |
def __init__(self, parent, layer, fieldName): |
def __init__(self, parent, layer, fieldName): |
149 |
psizer.Add(self.propCombo, 1, wxALL | wxGROW, 4) |
psizer.Add(self.propCombo, 1, wxALL | wxGROW, 4) |
150 |
sizer.Add(psizer, 0, wxALL | wxGROW, 4) |
sizer.Add(psizer, 0, wxALL | wxGROW, 4) |
151 |
|
|
152 |
|
if layer.ShapeType() != SHAPETYPE_ARC: |
153 |
|
psizer = wxBoxSizer(wxHORIZONTAL) |
154 |
|
self.fix_border_check = wxCheckBox(self, -1, _("Fix Border Color")) |
155 |
|
psizer.Add(self.fix_border_check, 0, wxALL | wxGROW, 4) |
156 |
|
self.border_color = classifier.ClassGroupPropertiesCtrl( |
157 |
|
self, ID_BORDER_COLOR, |
158 |
|
ClassGroupProperties(), SHAPETYPE_ARC, |
159 |
|
style=wxSIMPLE_BORDER, size=(40, 20)) |
160 |
|
psizer.Add(self.border_color, 0, wxALL | wxGROW, 4) |
161 |
|
psizer.Add(wxButton(self, ID_BORDER_COLOR_CHANGE, _("Change")), |
162 |
|
0, wxALL, 4) |
163 |
|
sizer.Add(psizer, 0, wxALL | wxGROW, 4) |
164 |
|
EVT_BUTTON(self, ID_BORDER_COLOR_CHANGE, self.OnBorderColorChange) |
165 |
|
else: |
166 |
|
self.border_color = None |
167 |
|
|
168 |
sizer.Add(custom_ramp_panel, 1, wxGROW | wxALL, 4) |
sizer.Add(custom_ramp_panel, 1, wxGROW | wxALL, 4) |
169 |
sizer.Show(custom_ramp_panel, False) |
sizer.Show(custom_ramp_panel, False) |
170 |
|
|
223 |
propPanel = self.propCombo.GetClientData(index) |
propPanel = self.propCombo.GetClientData(index) |
224 |
|
|
225 |
ramp = propPanel.GetRamp() |
ramp = propPanel.GetRamp() |
226 |
|
if self.border_color and self.fix_border_check.IsChecked(): |
227 |
|
props = self.border_color.GetProperties() |
228 |
|
ramp = FixedRamp(ramp, |
229 |
|
(props.GetLineColor(), props.GetLineWidth(), None)) |
230 |
|
|
231 |
if genSel == GENCOMBOSTR_UNIFORM: |
if genSel == GENCOMBOSTR_UNIFORM: |
232 |
|
|
278 |
def OnCancel(self, event): |
def OnCancel(self, event): |
279 |
self.Close() |
self.Close() |
280 |
|
|
281 |
|
def OnBorderColorChange(self, event): |
282 |
|
self.border_color.DoEdit() |
283 |
|
|
284 |
def _OnGenTypeSelect(self, event): |
def _OnGenTypeSelect(self, event): |
285 |
self.__DoOnGenTypeSelect() |
self.__DoOnGenTypeSelect() |
286 |
return |
return |