protected void paintTick ( Graphics g , ValueDimension dim , Number tickValue , int tickLength ) { String str = String . format ( getTickInfo ( dim ) . getFormat ( ) , tickValue . doubleValue ( ) ) ; int xPosition ; int yPosition ; Point descPos ; switch ( dim ) { case X : xPosition = getXFor ( tickValue ) ; yPosition = getPaintingRegion ( ) . getBottomLeft ( ) . y ; g . drawLine ( xPosition , yPosition , xPosition , yPosition + tickLength ) ; descPos = getPaintingRegion ( ) . getDescriptionPos ( dim , str , xPosition ) ; g . drawString ( str , descPos . x , descPos . y + tickLength ) ; break ; case Y : xPosition = getPaintingRegion ( ) . getBottomLeft ( ) . x ; yPosition = getYFor ( tickValue ) ; g . drawLine ( xPosition , yPosition , xPosition - tickLength , yPosition ) ; descPos = getPaintingRegion ( ) . getDescriptionPos ( dim , str , yPosition ) ; g . drawString ( str , descPos . x - tickLength , descPos . y + tickLength ) ; break ; } }
Paints a tick with the specified length and value with respect to the given dimension .