Ejemplo n.º 1
0
    def set_band_item_settings(
        self, altitude, rank, top_band_alt, bot_band_alt, leftmost_object_label, rightmost_object_label
    ):
        item = self._band_items[altitude]
        item.rank = rank
        item.top_band = self._band_items[top_band_alt] if top_band_alt is not None else None
        item.bot_band = self._band_items[bot_band_alt] if bot_band_alt is not None else None

        if leftmost_object_label == "":
            item.left_most_obj = self.bandStack
        else:
            if ("e" in leftmost_object_label) or ("c" in leftmost_object_label):
                item.left_most_obj = self._snap_items[str(leftmost_object_label)]
                left_index = snapkey.parse_snapkey(leftmost_object_label)[0]
            else:  # Not snap, but hook
                item.left_most_obj = self._hook_items[str(leftmost_object_label)]
                left_index = hooklabel.parse_hooklabel(leftmost_object_label)[2]

        if rightmost_object_label == "":
            item.right_most_obj = self.bandStack
        else:
            if ("e" in rightmost_object_label) or ("c" in rightmost_object_label):
                item.right_most_obj = self._snap_items[str(rightmost_object_label)]
                right_index = snapkey.parse_snapkey(rightmost_object_label)[0]
            else:  # Not snap, but hook
                item.right_most_obj = self._hook_items[str(rightmost_object_label)]
                right_index = hooklabel.parse_hooklabel(rightmost_object_label)[2]

        try:
            if right_index == left_index:
                # Make sure it won't stick weirdly out to the left
                if left_index > 0:
                    item.left_most_obj = self._block_items[left_index - 1]
                # Make sure it doesn't stick out weirdly to the right
                if right_index < max(self._block_items.keys()):
                    item.right_most_obj = self._block_items[right_index + 1]
        except:  # right_index and left_index don't exist
            pass
Ejemplo n.º 2
0
    def __init__(self, parent, snapkey):
        self.parent = parent
        self._snapkey = snapkey
        self.block_index, self.container_name, self.snap_order = parse_snapkey(snapkey)

        self.block_item = None
        self.left_snap = None
        self.right_snap = None
        self.posBandItem = None
        self.negBandItem = None

        # Layout properties
        self.col = None
        self.centerRow = None
        self.posBandRow = None
        self.negBandRow = None
Ejemplo n.º 3
0
    def __init__(self, parent, snapkey):
        self.parent = parent
        self._snapkey = snapkey
        self.block_index, self.container_name, self.snap_order = parse_snapkey(
            snapkey)

        self.block_item = None
        self.left_snap = None
        self.right_snap = None
        self.posBandItem = None
        self.negBandItem = None

        # Layout properties
        self.col = None
        self.centerRow = None
        self.posBandRow = None
        self.negBandRow = None