コード例 #1
0
ファイル: FeatureNode.py プロジェクト: jpurma/Kataja
 def __init__(self, label=None, forest=None):
     Node.__init__(self, forest=forest)
     self.repulsion = 0.25
     self._gravity = 3.0
     self.fshape = 2
     self.left_shape = 0
     self.right_shape = 0
     self.invert_colors = True
コード例 #2
0
 def __init__(self, label='', value='', family=''):
     Node.__init__(self)
     self.name = label
     self.value = value
     self.family = family
     self.repulsion = 0.25
     self._gravity = 2.5
     self.z_value = 60
     self.setZValue(self.z_value)
コード例 #3
0
 def __init__(self, label='', value='', family=''):
     Node.__init__(self)
     self.name = label
     self.value = value
     self.family = family
     self.repulsion = 0.25
     self._gravity = 2.5
     self.z_value = 60
     self.setZValue(self.z_value)
コード例 #4
0
ファイル: CommentNode.py プロジェクト: jpurma/Kataja
 def __init__(self, label='comment', forest=None):
     self.image_object = None
     Node.__init__(self, forest=forest)
     if not label:
         label = 'comment'
     self.label = label
     self.physics_x = False
     self.physics_y = False
     self.image_path = None
     self.image = None
     self.pos_relative_to_host = -50, -50
     self.preferred_host = None
コード例 #5
0
ファイル: CommentNode.py プロジェクト: osagha/Kataja
 def __init__(self, label='comment'):
     self.image_object = None
     Node.__init__(self)
     if not label:
         label = 'comment'
     self.resizable = True
     self.label = label
     self.physics_x = False
     self.physics_y = False
     self.image_path = None
     self.image = None
     self.pos_relative_to_host = -50, -50
     self.preferred_host = None
コード例 #6
0
ファイル: ConstituentNode.py プロジェクト: osagha/Kataja
    def __init__(self, label=''):
        """ Most of the initiation is inherited from Node """
        Node.__init__(self)
        self.heads = []

        # ### Projection -- see also preferences that govern if these are used
        self.can_project = True
        self.projecting_to = set()

        self.index = ''
        self.label = label
        self.autolabel = ''
        self.gloss = ''

        self.is_trace = False
        self.merge_order = 0
        self.select_order = 0
        self.in_projections = []
コード例 #7
0
    def __init__(self,
                 forest=None,
                 host=None,
                 attribute_id=None,
                 label='',
                 show_label=False,
                 restoring=False):
        """

        :param host: 
        :param attribute_id: 
        :param attribute_label: 
        :param show_label: 
        :param forest: 
        :param restoring: 
        :raise: 
        """
        self.help_text = ""
        Node.__init__(self)
        self.host = host
        self.attribute_label = label or attribute_id
        self.attribute_id = attribute_id
        self._show_label = show_label
        # if self.attribute_label in color_map:
        # self.color = colors.feature_palette[color_map[self.attribute_label]]
        # else:
        # self.color = colors.feature
        if not restoring:
            # compute start position -- similar to FeatureNode, but happens on init
            # because host is given
            x, y = self.host.current_position
            k = self.attribute_label
            if k in color_map:
                x += color_map[k]
                y += color_map[k]
            else:
                x += random.uniform(-4, 4)
                y += random.uniform(-4, 4)
            self.set_original_position((x, y))
            self.update_help_text()
            self.update_label()
            self.update_bounding_rect()
            self.update_visibility()
コード例 #8
0
    def __init__(self, label=''):
        """ Most of the initiation is inherited from Node """
        Node.__init__(self)
        self.heads = []

        # ### Projection -- see also preferences that govern if these are used
        self.can_project = True
        self.projecting_to = set()

        self.index = ''
        self.label = label
        self.gloss = ''

        self.is_trace = False
        self.merge_order = 0
        self.select_order = 0
        self.original_parent = None
        self.in_projections = []
        self.halo = False
コード例 #9
0
    def __init__(self, forest=None, host=None, attribute_id=None, label='',
                 show_label=False, restoring=False):
        """

        :param host: 
        :param attribute_id: 
        :param attribute_label: 
        :param show_label: 
        :param forest: 
        :param restoring: 
        :raise: 
        """
        self.help_text = ""
        Node.__init__(self)
        self.host = host
        self.attribute_label = label or attribute_id
        self.attribute_id = attribute_id
        self._show_label = show_label
        # if self.attribute_label in color_map:
        # self.color = colors.feature_palette[color_map[self.attribute_label]]
        # else:
        # self.color = colors.feature
        if not restoring:
            # compute start position -- similar to FeatureNode, but happens on init
            # because host is given
            x, y = self.host.current_position
            k = self.attribute_label
            if k in color_map:
                x += color_map[k]
                y += color_map[k]
            else:
                x += random.uniform(-4, 4)
                y += random.uniform(-4, 4)
            self.set_original_position((x, y))
            self.update_help_text()
            self.update_label()
            self.update_bounding_rect()
            self.update_visibility()
コード例 #10
0
 def __init__(self, label=''):
     Node.__init__(self)
     if not label:
         label = 'gloss'
     self.label = label
     self._gravity = 1.5
コード例 #11
0
ファイル: GlossNode.py プロジェクト: jpurma/Kataja
 def __init__(self, label='', forest=None):
     Node.__init__(self, forest=forest)
     if not label:
         label = 'gloss'
     self.label = label
     self._gravity = 1.5
コード例 #12
0
 def __init__(self, label=''):
     Node.__init__(self)
     if not label:
         label = 'gloss'
     self.label = label
     self._gravity = 1.5