double dUnitSize = getUnitSize();
    final void computeAxisStartEndShifts(IDisplayServer xs, Label la, int iOrientation, int iLocation, AllAxes aax)        throws GenerationException    {        final double dMaxSS = (aax != null && iOrientation == aax.getOrientation()) ? aax.getMaxStartShift() : 0;        final double dMaxES = (aax != null && iOrientation == aax.getOrientation()) ? aax.getMaxEndShift() : 0;        if (!la.isVisible())        {            dStartShift = dMaxSS;            dEndShift = dMaxES;            return;        }        if (getType() == TEXT || bCategoryScale)        {            // COMPUTE THE BOUNDING BOXES FOR FIRST AND LAST LABEL TO ADJUST            // START/END OF X-AXIS            final double dUnitSize = getUnitSize();            final DataSetIterator dsi = getData();            final int iDateTimeUnit = (getType() == IConstants.DATE_TIME) ? CDateTime.computeUnit(dsi)                : IConstants.UNDEFINED;            // ADJUST THE START POSITION            la.getCaption().setValue(formatCategoryValue(getType(), dsi.first(), iDateTimeUnit));            BoundingBox bb = null;            try            {                bb = computeBox(xs, iLocation, la, 0, 0);            }            catch (UnexpectedInputException uiex )            {                throw new GenerationException(uiex);            }            if (iOrientation == VERTICAL) // VERTICAL AXIS            {                dStartShift = Math.max(dMaxSS, (dUnitSize > bb.getHeight()) ? 0 : (bb.getHeight() - dUnitSize) / 2);            }            else if (iOrientation == HORIZONTAL) // HORIZONTAL AXIS            {                dStartShift = Math.max(dMaxSS, (dUnitSize > bb.getWidth()) ? 0 : (bb.getWidth() - dUnitSize) / 2);            }            // ADJUST THE END POSITION            la.getCaption().setValue(formatCategoryValue(getType(), dsi.last(), iDateTimeUnit));            try            {                bb = computeBox(xs, iLocation, la, 0, dEnd);            }            catch (UnexpectedInputException uiex )            {                throw new GenerationException(uiex);            }            if (iOrientation == VERTICAL) // VERTICAL AXIS            {                dEndShift = Math.max(dMaxES, (dUnitSize > bb.getHeight()) ? 0 : (bb.getHeight() - dUnitSize) / 2);            }            else if (iOrientation == HORIZONTAL) // HORIZONTAL AXIS            {                dEndShift = Math.max(dMaxES, (dUnitSize > bb.getWidth()) ? 0 : (bb.getWidth() - dUnitSize) / 2);            }        }        else if ((iType & NUMERICAL) == NUMERICAL)        {            if ((iType & LINEAR) == LINEAR)            {                // ADJUST THE START POSITION                DecimalFormat df = null;                if (fs == null) // ONLY COMPUTE INTERNALLY IF FORMAT SPECIFIER ISN'T DEFINED                {                    df = new DecimalFormat(getNumericPattern());                }                String sValue = null;                try                {                    sValue = ValueFormatter.format(getMinimum(), fs, lcl, df);                }                catch (DataFormatException dfex )                {                    DefaultLoggerImpl.instance().log(dfex);                    sValue = IConstants.NULL_STRING;                }                la.getCaption().setValue(sValue);                BoundingBox bb = null;                try                {                    bb = computeBox(xs, iLocation, la, 0, 0);                }                catch (UnexpectedInputException uiex )                {                    throw new GenerationException(uiex);                }                if (iOrientation == VERTICAL) // VERTICAL AXIS                {                    dStartShift = Math.max(dMaxSS, (bb.getHeight() - bb.getHotPoint()));                }                else if (iOrientation == HORIZONTAL)                {                    dStartShift = Math.max(dMaxSS, bb.getHotPoint());                }                // ADJUST THE END POSITION                try                {                    sValue = ValueFormatter.format(getMaximum(), fs, lcl, df);                }                catch (DataFormatException dfex )                {                    DefaultLoggerImpl.instance().log(dfex);                    sValue = IConstants.NULL_STRING;                }                la.getCaption().setValue(sValue);                try                {                    bb = computeBox(xs, iLocation, la, 0, 0);                }                catch (UnexpectedInputException uiex )                {                    throw new GenerationException(uiex);                }                if (iOrientation == VERTICAL) // VERTICAL AXIS                {                    dEndShift = Math.max(dMaxES, bb.getHotPoint());                }                else if (iOrientation == HORIZONTAL)                {                    dEndShift = Math.max(dMaxES, (bb.getWidth() - bb.getHotPoint()));                }            }            else if ((iType & LOGARITHMIC) == LOGARITHMIC)            {                // ADJUST THE START POSITION                final double dMinimum = asDouble(getMinimum()).doubleValue();                DecimalFormat df = null;                if (fs == null) // ONLY COMPUTE INTERNALLY IF FORMAT SPECIFIER ISN'T DEFINED                {                    df = new DecimalFormat(getNumericPattern(dMinimum));                }                String sValue = null;                try                {                    sValue = ValueFormatter.format(getMinimum(), fs, lcl, df);                }                catch (DataFormatException dfex )                {                    DefaultLoggerImpl.instance().log(dfex);                    sValue = IConstants.NULL_STRING;                }                la.getCaption().setValue(sValue);                BoundingBox bb = null;                try                {                    bb = computeBox(xs, iLocation, la, 0, 0);                }                catch (UnexpectedInputException uiex )                {                    throw new GenerationException(uiex);                }                if (iOrientation == VERTICAL) // VERTICAL AXIS                {                    dStartShift = Math.max(dMaxSS, (bb.getHeight() - bb.getHotPoint()));                }                else if (iOrientation == HORIZONTAL)                {                    dStartShift = Math.max(dMaxSS, bb.getHotPoint());                }                // ADJUST THE END POSITION                final double dMaximum = asDouble(getMaximum()).doubleValue();                if (fs == null) // ONLY COMPUTE INTERNALLY (DIFFERENT FROM MINIMUM) IF FORMAT SPECIFIER ISN'T DEFINED                {                    df = new DecimalFormat(getNumericPattern(dMaximum));                }                try                {                    sValue = ValueFormatter.format(getMaximum(), fs, lcl, df);                }                catch (DataFormatException dfex )                {                    DefaultLoggerImpl.instance().log(dfex);                    sValue = IConstants.NULL_STRING;                }                la.getCaption().setValue(sValue);                try                {                    bb = computeBox(xs, iLocation, la, 0, 0);                }                catch (UnexpectedInputException uiex )                {                    throw new GenerationException(uiex);                }                if (iOrientation == VERTICAL) // VERTICAL AXIS                {                    dEndShift = Math.max(dMaxES, bb.getHotPoint());                }                else if (iOrientation == HORIZONTAL)                {                    dEndShift = Math.max(dMaxES, (bb.getWidth() - bb.getHotPoint()));                }            }        }        else if (getType() == DATE_TIME)        {            // COMPUTE THE BOUNDING BOXES FOR FIRST AND LAST LABEL TO ADJUST            // START/END OF X-AXIS            double dUnitSize = getUnitSize();            CDateTime cdt = asDateTime(getMinimum());            final int iUnit = asInteger(oUnit);            SimpleDateFormat sdf = null;            String sText = null;            if (fs != null) // ONLY COMPUTE INTERNALLY IF FORMAT SPECIFIER ISN'T DEFINED            {                sdf = new SimpleDateFormat(CDateTime.getPreferredFormat(iUnit));            }            // ADJUST THE START POSITION            try            {                sText = ValueFormatter.format(cdt, fs, lcl, sdf);            }            catch (DataFormatException dfex )            {                DefaultLoggerImpl.instance().log(dfex);                sText = IConstants.NULL_STRING;            }            la.getCaption().setValue(sText);            BoundingBox bb = null;            try            {                bb = computeBox(xs, iLocation, la, 0, 0);            }            catch (UnexpectedInputException uiex )            {                throw new GenerationException(uiex);            }            if (iOrientation == VERTICAL) // VERTICAL AXIS            {                dStartShift = Math.max(dMaxSS, (bb.getHeight() - bb.getHotPoint()));            }            else if (iOrientation == HORIZONTAL)            {                dStartShift = Math.max(dMaxSS, bb.getHotPoint());            }            // ADJUST THE END POSITION            cdt = asDateTime(getMaximum());            try            {                sText = ValueFormatter.format(cdt, fs, lcl, sdf);            }            catch (DataFormatException dfex )            {                DefaultLoggerImpl.instance().log(dfex);                sText = IConstants.NULL_STRING;            }            la.getCaption().setValue(sText);            try            {                bb = computeBox(xs, iLocation, la, 0, dEnd);            }            catch (UnexpectedInputException uiex )            {                throw new GenerationException(uiex);            }            if (iOrientation == VERTICAL) // VERTICAL AXIS            {                dEndShift = Math.max(dMaxES, bb.getHotPoint());            }            else if (iOrientation == HORIZONTAL)            {                dEndShift = Math.max(dMaxES, (bb.getWidth() - bb.getHotPoint()));            }        }    }