205 |
|
|
206 |
def MoveCurrentItemUp(self): |
def MoveCurrentItemUp(self): |
207 |
cur_id = self.GetSelection() |
cur_id = self.GetSelection() |
208 |
assert(cur_id.IsOk()) |
assert cur_id.IsOk() |
209 |
|
|
210 |
cur_data = self.GetPyData(cur_id) |
cur_data = self.GetPyData(cur_id) |
211 |
|
|
221 |
elif isinstance(cur_data, ClassGroup): |
elif isinstance(cur_data, ClassGroup): |
222 |
pass |
pass |
223 |
else: |
else: |
224 |
assert(False, "Shouldn't be here.") |
assert False, "Shouldn't be here." |
225 |
pass |
pass |
226 |
|
|
227 |
def MoveCurrentItemDown(self): |
def MoveCurrentItemDown(self): |
228 |
cur_id = self.GetSelection() |
cur_id = self.GetSelection() |
229 |
assert(cur_id.IsOk()) |
assert cur_id.IsOk() |
230 |
|
|
231 |
cur_data = self.GetPyData(cur_id) |
cur_data = self.GetPyData(cur_id) |
232 |
|
|
235 |
elif isinstance(cur_data, ClassGroup): |
elif isinstance(cur_data, ClassGroup): |
236 |
pass |
pass |
237 |
else: |
else: |
238 |
assert(False, "Shouldn't be here.") |
assert False, "Shouldn't be here." |
239 |
pass |
pass |
240 |
|
|
241 |
|
|
263 |
|
|
264 |
# def DoOnClassify(self): |
# def DoOnClassify(self): |
265 |
# id = self.GetSelection() |
# id = self.GetSelection() |
266 |
# assert(id.IsOk()) |
# assert id.IsOk() |
267 |
|
|
268 |
# item = self.GetPyData(id) |
# item = self.GetPyData(id) |
269 |
# if isinstance(item, ClassGroup): |
# if isinstance(item, ClassGroup): |
270 |
# id = self.GetItemParent(id) |
# id = self.GetItemParent(id) |
271 |
# assert(id.IsOk()) |
# assert id.IsOk() |
272 |
# item = self.GetPyData(id) |
# item = self.GetPyData(id) |
273 |
|
|
274 |
# # XXX: THIS IS SUCH AWFUL STYLE! YUCK! |
# # XXX: THIS IS SUCH AWFUL STYLE! YUCK! |
275 |
# self.parent.mainWindow.OpenClassifier(item) |
# self.parent.mainWindow.OpenClassifier(item) |
276 |
# #assert(False, "XXX: FIXME HERE") |
# #assert False, "XXX: FIXME HERE" |
277 |
|
|
278 |
def Sort(self): |
def Sort(self): |
279 |
self.SortChildren(self.GetRootItem()) |
self.SortChildren(self.GetRootItem()) |
292 |
self.parent.DoOnClassify() |
self.parent.DoOnClassify() |
293 |
|
|
294 |
def _OnMsgLayerChanged(self, layer): |
def _OnMsgLayerChanged(self, layer): |
295 |
assert(isinstance(layer, Layer)) |
assert isinstance(layer, Layer) |
296 |
|
|
297 |
id = self.layer2id[layer] |
id = self.layer2id[layer] |
298 |
assert(id.IsOk()) |
assert id.IsOk() |
299 |
|
|
300 |
# XXX: yikes! this is so bad, we should be doing what is |
# XXX: yikes! this is so bad, we should be doing what is |
301 |
# commented out, but there is a problem with keeping |
# commented out, but there is a problem with keeping |
312 |
self.EnsureVisible(id) |
self.EnsureVisible(id) |
313 |
|
|
314 |
def _OnMsgMapLayersAddedRemoved(self, map): |
def _OnMsgMapLayersAddedRemoved(self, map): |
315 |
assert(map is self.map) |
assert map is self.map |
316 |
|
|
317 |
self.__FillTree(self.map) |
self.__FillTree(self.map) |
318 |
|
|
319 |
def _OnMsgLayerVisibilityChanged(self, layer): |
def _OnMsgLayerVisibilityChanged(self, layer): |
320 |
assert(isinstance(layer, Layer)) |
assert isinstance(layer, Layer) |
321 |
|
|
322 |
self.__ShowHideLayer(layer) |
self.__ShowHideLayer(layer) |
323 |
|
|
324 |
def GetSelectedHierarchy(self): |
def GetSelectedHierarchy(self): |
325 |
id = self.GetSelection() |
id = self.GetSelection() |
326 |
assert(id.IsOk()) |
assert id.IsOk() |
327 |
|
|
328 |
layer = self.GetPyData(id) |
layer = self.GetPyData(id) |
329 |
group = None |
group = None |
330 |
|
|
331 |
if isinstance(layer, ClassGroup): |
if isinstance(layer, ClassGroup): |
332 |
id = self.GetItemParent(id) |
id = self.GetItemParent(id) |
333 |
assert(id.IsOk()) |
assert id.IsOk() |
334 |
group = layer |
group = layer |
335 |
layer = self.GetPyData(id) |
layer = self.GetPyData(id) |
336 |
|
|
338 |
|
|
339 |
def __FillTree(self, map): |
def __FillTree(self, map): |
340 |
|
|
341 |
assert(isinstance(map, Map)) |
assert isinstance(map, Map) |
342 |
|
|
343 |
self.Freeze() |
self.Freeze() |
344 |
|
|
406 |
self.Thaw() |
self.Thaw() |
407 |
|
|
408 |
def __BuildGroupImage(self, group, shapeType): |
def __BuildGroupImage(self, group, shapeType): |
409 |
assert(isinstance(group, ClassGroup)) |
assert isinstance(group, ClassGroup) |
410 |
|
|
411 |
bmp = wxEmptyBitmap(BMP_SIZE_W, BMP_SIZE_H) |
bmp = wxEmptyBitmap(BMP_SIZE_W, BMP_SIZE_H) |
412 |
#brush = wxBrush(Color2wxColour(item[1]), wxSOLID) |
#brush = wxBrush(Color2wxColour(item[1]), wxSOLID) |
444 |
|
|
445 |
def __ShowHideLayer(self, layer): |
def __ShowHideLayer(self, layer): |
446 |
parent = self.layer2id[layer] |
parent = self.layer2id[layer] |
447 |
assert(parent.IsOk()) |
assert parent.IsOk() |
448 |
|
|
449 |
show = layer.Visible() |
show = layer.Visible() |
450 |
|
|