def __init__(self, labelparam=None): super(AbstractLabelItem, self).__init__() self.selected = False self.anchor = None self.G = None self.C = None self.border_pen = None self.bg_brush = None if labelparam is None: self.labelparam = LabelParam(_("Label"), icon='label.png') else: self.labelparam = labelparam self.labelparam.update_label(self)
def info_label(self, anchor, comps, title=None): """ Make an info label `plot item` (:py:class:`guiqwt.label.DataInfoLabel` object) """ basename = _("Computation") param = LabelParam(basename, icon="label.png") param.read_config(CONF, "plot", "info_label") if title is not None: param.label = title else: global LABEL_COUNT LABEL_COUNT += 1 param.label = make_title(basename, LABEL_COUNT) param.abspos = True param.absg = anchor param.anchor = anchor c = ANCHOR_OFFSETS[anchor] param.xc, param.yc = c return DataInfoLabel(param, comps)
def deserialize(self, reader): """Deserialize object from HDF5 reader""" self.labelparam = LabelParam(_("Label"), icon='label.png') reader.read('labelparam', instance=self.labelparam) self.labelparam.update_label(self)
def create_label(self): """Return the label object associated to this annotated shape object""" label_param = LabelParam(_("Label"), icon='label.png') label_param.read_config(CONF, "plot", "shape/label") label_param.anchor = self.LABEL_ANCHOR return DataInfoLabel(label_param, [self])