Mercurial > MadButterfly
comparison pyink/domview_ui.py @ 1323:ffbbd3aa218d
Make a component from a group.
User can translate a group into a component from context menu.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Sun, 30 Jan 2011 19:15:17 +0800 |
parents | 6090be010927 |
children | 407f321f0d7c |
comparison
equal
deleted
inserted
replaced
1322:7f25abbc1b61 | 1323:ffbbd3aa218d |
---|---|
453 r = self._dom.has_timeline(name) | 453 r = self._dom.has_timeline(name) |
454 return r | 454 return r |
455 | 455 |
456 def get_current_timeline(self): | 456 def get_current_timeline(self): |
457 return self._dom.get_current_timeline() | 457 return self._dom.get_current_timeline() |
458 | |
459 ## \brief Add a new component from a group node. | |
460 # | |
461 # The group node is reparented to the group of first layer of | |
462 # specified component. | |
463 # | |
464 def add_component_from_group(self, comp_name, group): | |
465 self.add_component(comp_name) | |
466 self._dom.mv_group_to_component(group, comp_name) | |
467 pass | |
458 pass | 468 pass |
459 | 469 |
460 | 470 |
461 ## \brief Bridge of DOM-tree to syncrhonize data-model and UI. | 471 ## \brief Bridge of DOM-tree to syncrhonize data-model and UI. |
462 # | 472 # |
755 src_group = self.get_key_group(layer_idx, src_frame_idx) | 765 src_group = self.get_key_group(layer_idx, src_frame_idx) |
756 dst_group = self.get_key_group(layer_idx, dst_frame_idx) | 766 dst_group = self.get_key_group(layer_idx, dst_frame_idx) |
757 self._dom.clone_group_children(src_group, dst_group) | 767 self._dom.clone_group_children(src_group, dst_group) |
758 pass | 768 pass |
759 | 769 |
770 ## \brief To test a graphic node. | |
771 # | |
772 # A graphic node is a SVG node that is not layer group, scene | |
773 # group, ... etc. It is only a normal node in a layer group or a | |
774 # scene group. | |
775 def is_graph_node(self, node): | |
776 return self._dom.is_graph_node(node) | |
777 | |
760 ## \brief Return widget showing frames and layers. | 778 ## \brief Return widget showing frames and layers. |
761 # | 779 # |
762 def get_frame_ui_widget(self): | 780 def get_frame_ui_widget(self): |
763 return self._fl_stack.frameline_box | 781 return self._fl_stack.frameline_box |
764 | 782 |
904 except: | 922 except: |
905 label = layer_group.getAttribute('id') | 923 label = layer_group.getAttribute('id') |
906 pass | 924 pass |
907 self._fl_stack.set_layer_label(layer_idx, label) | 925 self._fl_stack.set_layer_label(layer_idx, label) |
908 pass | 926 pass |
927 | |
928 ## \brief Get layer group. | |
929 # | |
930 def get_layer_group(self, layer_idx): | |
931 layer_group = self._dom.get_layer_group(layer_idx) | |
932 return layer_group | |
909 pass | 933 pass |
910 | 934 |
911 | 935 |
912 ## \brief Oven domview_ui and all mix-ins | 936 ## \brief Oven domview_ui and all mix-ins |
913 # | 937 # |