Beispiel #1
0
 def removeOverlay(self, overlay):
     if type(overlay) == int:
         try:
             OverlayViewer.removeOverlay(self, self.overlays[overlay])
             self.overlays.pop(overlay)
             self.update()
         except IndexError, e:
             print "No such overlay."
Beispiel #2
0
 def removeOverlay(self, overlay):
     if type(overlay) == int:
         try:
             OverlayViewer.removeOverlay(self, self.overlays[overlay])
             self.overlays.pop(overlay)
             self.update()
         except IndexError, e:
             print "No such overlay."
Beispiel #3
0
 def removeOverlay(self, overlay):
     if type(overlay) == int:
         try:
             OverlayViewer.removeOverlay(self, self.overlays[overlay])
             self.overlays.pop(overlay)
             self.update()
         except IndexError as e:
             print("No such overlay.")
     else:
         try:
             self.overlays.remove(overlay)
             OverlayViewer.removeOverlay(self, overlay)
             self.update()
         except ValueError as e:
             print("No such overlay.")
Beispiel #4
0
 def removeOverlay(self, overlay):
     if type(overlay) == int:
         try:
             OverlayViewer.removeOverlay(self, self.overlays[overlay])
             self.overlays.pop(overlay)
             self.update()
         except IndexError as e:
             print("No such overlay.")
     else:
         try:
             self.overlays.remove(overlay)
             OverlayViewer.removeOverlay(self, overlay)
             self.update()
         except ValueError as e:
             print("No such overlay.")
Beispiel #5
0
        OverlayViewer.addOverlay(self, overlay)
        self.update()
        return len(self.overlays) - 1

    def removeOverlay(self, overlay):
        if type(overlay) == int:
            try:
                OverlayViewer.removeOverlay(self, self.overlays[overlay])
                self.overlays.pop(overlay)
                self.update()
            except IndexError, e:
                print "No such overlay."
        else:
            try:
                self.overlays.remove(overlay)
                OverlayViewer.removeOverlay(self, overlay)
                self.update()
            except ValueError, e:
                print "No such overlay."

    def _slideAfterZoom(self, shift):
        if self.zoomLevel() > 0:
            shift *= 1 + self.zoomLevel()
        elif self.zoomLevel() < 0:
            shift /= 1 - self.zoomLevel()
        self.slideBy(shift)

    def zoomInPopup(self):
        beforePos = self.imageCoordinate(self.mousepos)
        self.zoomUp()
        afterPos = self.imageCoordinate(self.mousepos)
Beispiel #6
0
        OverlayViewer.addOverlay(self, overlay)
        self.update()
        return len(self.overlays) - 1

    def removeOverlay(self, overlay):
        if type(overlay) == int:
            try:
                OverlayViewer.removeOverlay(self, self.overlays[overlay])
                self.overlays.pop(overlay)
                self.update()
            except IndexError, e:
                print "No such overlay."
        else:
            try:
                self.overlays.remove(overlay)
                OverlayViewer.removeOverlay(self, overlay)
                self.update()
            except ValueError, e:
                print "No such overlay."

    def _slideAfterZoom(self, shift):
        if self.zoomLevel() > 0:
            shift *= 1 + self.zoomLevel()
        elif self.zoomLevel() < 0:
            shift /= 1 - self.zoomLevel()
        self.slideBy(shift)

    def zoomInPopup(self):
        beforePos = self.imageCoordinate(self.mousepos)
        self.zoomUp()
        afterPos = self.imageCoordinate(self.mousepos)