private double transEnd(double value, Rectangle2D area, RectangleEdge edge,
                            double length1, double length2) {
        double min = 0.0;
        double max = 0.0;
        if (RectangleEdge.isTopOrBottom(edge)) {
            max = area.getMaxX();
            min = area.getMaxX() - area.getWidth() * length2 
                  / (length1 + length2);
        }
        else if (RectangleEdge.isLeftOrRight(edge)) {
            max = area.getMinY();
            min = area.getMinY() + area.getHeight() * length2 
                  / (length1 + length2);
        }
        if (isInverted()) {
            return max - ((value - this.fixedRange.getLowerBound()) 
                    / (this.displayEnd - this.fixedRange.getLowerBound())) 
                    * (max - min);
        }
        else {
            return min + ((value - this.fixedRange.getLowerBound()) 
                    / (this.displayEnd - this.fixedRange.getLowerBound())) 
                    * (max - min);