afreechart/src/main/java/org/afree/chart/axis/Axis.java
/**
     * Created an entity for the axis.
     * 
     * @param cursor
     *            the initial cursor value.
     * @param state
     *            the axis state after completion of the drawing with a possibly
     *            updated cursor position.
     * @param dataArea
     *            the data area.
     * @param edge
     *            the edge.
     * @param plotState
     *            the PlotRenderingInfo from which a reference to the entity
     *            collection can be obtained.
     * 
     * @since JFreeChart 1.0.13
     */
Created an entity for the axis.

@param cursor
the initial cursor value.
@param state
the axis state after completion of the drawing with a possibly
updated cursor position.
@param dataArea
the data area.
@param edge
the edge.
@param plotState
the PlotRenderingInfo from which a reference to the entity
collection can be obtained.


Created an entity for the axis . @param cursor the initial cursor value . @param state the axis state after completion of the drawing with a possibly updated cursor position . @param dataArea the data area . @param edge the edge . @param plotState the PlotRenderingInfo from which a reference to the entity collection can be obtained .
protected void createAndAddEntity(double cursor, AxisState state,
            RectShape dataArea, RectangleEdge edge,
            PlotRenderingInfo plotState) {
        if (plotState == null || plotState.getOwner() == null) {
            return; 
        }
        RectShape hotspot = null;
        if (edge.equals(RectangleEdge.TOP)) {
            hotspot = new RectShape(dataArea.getX(),
                    state.getCursor(), dataArea.getWidth(), cursor
                            - state.getCursor());
        } else if (edge.equals(RectangleEdge.BOTTOM)) {
            hotspot = new RectShape(dataArea.getX(), cursor, dataArea
                    .getWidth(), state.getCursor() - cursor);
        } else if (edge.equals(RectangleEdge.LEFT)) {
            hotspot = new RectShape(state.getCursor(),
                    dataArea.getY(), cursor - state.getCursor(), dataArea
                            .getHeight());
        } else if (edge.equals(RectangleEdge.RIGHT)) {
            hotspot = new RectShape(cursor, dataArea.getY(), state
                    .getCursor()
                    - cursor, dataArea.getHeight());
        }
        EntityCollection e = plotState.getOwner().getEntityCollection();
        if (e != null) {
            e.add(new AxisEntity(hotspot, this));
        }
    }
protected void createAndAddEntity ( double cursor , AxisState state , RectShape dataArea , RectangleEdge edge , PlotRenderingInfo plotState ) { if ( plotState == null || plotState . getOwner ( ) == null ) { return ; } RectShape hotspot = null ; if ( edge . equals ( RectangleEdge . TOP ) ) { hotspot = new RectShape ( dataArea . getX ( ) , state . getCursor ( ) , dataArea . getWidth ( ) , cursor - state . getCursor ( ) ) ; } else if ( edge . equals ( RectangleEdge . BOTTOM ) ) { hotspot = new RectShape ( dataArea . getX ( ) , cursor , dataArea . getWidth ( ) , state . getCursor ( ) - cursor ) ; } else if ( edge . equals ( RectangleEdge . LEFT ) ) { hotspot = new RectShape ( state . getCursor ( ) , dataArea . getY ( ) , cursor - state . getCursor ( ) , dataArea . getHeight ( ) ) ; } else if ( edge . equals ( RectangleEdge . RIGHT ) ) { hotspot = new RectShape ( cursor , dataArea . getY ( ) , state . getCursor ( ) - cursor , dataArea . getHeight ( ) ) ; } EntityCollection e = plotState . getOwner ( ) . getEntityCollection ( ) ; if ( e != null ) { e . add ( new AxisEntity ( hotspot , this ) ) ; } }
Created an entity for the axis.
Created an entity for the axis .
// no need to create entity if we can't save it anyways...