def getUpperLeftX(self, width, x, xPrev, xNext, xMin, xMax, xMid, xMouse):
        if AnnotationLocation.AT_THE_MOUSE == self.location:
            if (GChartConsts.NAI == xMouse):
                result = Double.NaN
            else:
                result = xMouse

        elif AnnotationLocation.AT_THE_MOUSE_SNAP_TO_X == self.location:
            if (GChartConsts.NAI == xMouse):
                result = Double.NaN
            else:
                result = x

        elif AnnotationLocation.AT_THE_MOUSE_SNAP_TO_Y == self.location:
            if (GChartConsts.NAI == xMouse):
                result = Double.NaN
            else:
                result = xMouse

        elif AnnotationLocation.NORTHWEST == self.location  or  AnnotationLocation.WEST == self.location  or  AnnotationLocation.SOUTHWEST == self.location:
            result = xMin

        elif AnnotationLocation.NORTHEAST == self.location  or  AnnotationLocation.EAST == self.location  or  AnnotationLocation.SOUTHEAST == self.location:
            result = xMax

        else:
            # NORTH, CENTER, or SOUTH
            result = (xMin + xMax)/2


        return result
dataset/ETHPy150Open anandology/pyjamas/library/gwt/chart/SymbolType.py/AnnotationAnchor.getUpperLeftX/original