@Test public void testGetTextAnchorDirectionOfAngle() { TestableCategoricalChartExpression e = new TestableCategoricalChartExpression(); Assert.assertEquals( PlaneDirection.RIGHT, e.getTextAnchorDirectionOfAngle( 0.0 ) ); Assert.assertEquals( PlaneDirection.RIGHT, e.getTextAnchorDirectionOfAngle( 45.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.RIGHT, e.getTextAnchorDirectionOfAngle( 56.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.TOP_RIGHT, e.getTextAnchorDirectionOfAngle( 57.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.TOP_RIGHT, e.getTextAnchorDirectionOfAngle( 78.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.TOP, e.getTextAnchorDirectionOfAngle( 79.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.TOP, e.getTextAnchorDirectionOfAngle( 90.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.TOP, e.getTextAnchorDirectionOfAngle( 101.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.TOP_LEFT, e.getTextAnchorDirectionOfAngle( 102.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.TOP_LEFT, e.getTextAnchorDirectionOfAngle( 123.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.LEFT, e.getTextAnchorDirectionOfAngle( 124.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.LEFT, e.getTextAnchorDirectionOfAngle( 180.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.LEFT, e.getTextAnchorDirectionOfAngle( 236.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.BOTTOM_LEFT, e.getTextAnchorDirectionOfAngle( 237.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.BOTTOM_LEFT, e.getTextAnchorDirectionOfAngle( 258.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.BOTTOM, e.getTextAnchorDirectionOfAngle( 259.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.BOTTOM, e.getTextAnchorDirectionOfAngle( 270.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.BOTTOM, e.getTextAnchorDirectionOfAngle( 281.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.BOTTOM_RIGHT, e.getTextAnchorDirectionOfAngle( 282.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.BOTTOM_RIGHT, e.getTextAnchorDirectionOfAngle( 303.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.RIGHT, e.getTextAnchorDirectionOfAngle( 304.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.RIGHT, e.getTextAnchorDirectionOfAngle( 315.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.RIGHT, e.getTextAnchorDirectionOfAngle( 360.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.BOTTOM, e.getTextAnchorDirectionOfAngle( -90.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.RIGHT, e.getTextAnchorDirectionOfAngle( -45.0 * Math.PI / 180.0 ) ); Assert.assertEquals( PlaneDirection.LEFT, e.getTextAnchorDirectionOfAngle( -135.0 * Math.PI / 180.0 ) ); }
protected PlaneDirection getTextAnchorDirectionOfAngle( double angle ) { int sectorIndex = ( (int) ( ( ( ( angle * 16 / Math.PI ) ) % 32 ) + 32 ) ) % 32; switch ( sectorIndex ) { case 5: case 6: return PlaneDirection.TOP_RIGHT; case 7: case 8: return PlaneDirection.TOP; case 9: case 10: return PlaneDirection.TOP_LEFT; case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: return PlaneDirection.LEFT; case 21: case 22: return PlaneDirection.BOTTOM_LEFT; case 23: case 24: return PlaneDirection.BOTTOM; case 25: case 26: return PlaneDirection.BOTTOM_RIGHT; case 27: case 28: case 29: case 30: case 31: case 0: case 1: case 2: case 3: case 4: default: return PlaneDirection.RIGHT; } }
CategoricalChartExpression extends AbstractChartExpression implements LegacyUpdateHandler { protected PlaneDirection getTextAnchorDirectionOfAngle( double angle ) { int sectorIndex = ( (int) ( ( ( ( angle * 16 / Math.PI ) ) % 32 ) + 32 ) ) % 32; switch ( sectorIndex ) { case 5: case 6: return PlaneDirection.TOP_RIGHT; case 7: case 8: return PlaneDirection.TOP; case 9: case 10: return PlaneDirection.TOP_LEFT; case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: return PlaneDirection.LEFT; case 21: case 22: return PlaneDirection.BOTTOM_LEFT; case 23: case 24: return PlaneDirection.BOTTOM; case 25: case 26: return PlaneDirection.BOTTOM_RIGHT; case 27: case 28: case 29: case 30: case 31: case 0: case 1: case 2: case 3: case 4: default: return PlaneDirection.RIGHT; } } }
CategoricalChartExpression extends AbstractChartExpression implements LegacyUpdateHandler { protected PlaneDirection getTextAnchorDirectionOfAngle( double angle ) { int sectorIndex = ( (int) ( ( ( ( angle * 16 / Math.PI ) ) % 32 ) + 32 ) ) % 32; switch ( sectorIndex ) { case 5: case 6: return PlaneDirection.TOP_RIGHT; case 7: case 8: return PlaneDirection.TOP; case 9: case 10: return PlaneDirection.TOP_LEFT; case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: return PlaneDirection.LEFT; case 21: case 22: return PlaneDirection.BOTTOM_LEFT; case 23: case 24: return PlaneDirection.BOTTOM; case 25: case 26: return PlaneDirection.BOTTOM_RIGHT; case 27: case 28: case 29: case 30: case 31: case 0: case 1: case 2: case 3: case 4: default: return PlaneDirection.RIGHT; } } protected  CategoricalChartExpression(); }
CategoricalChartExpression extends AbstractChartExpression implements LegacyUpdateHandler { protected PlaneDirection getTextAnchorDirectionOfAngle( double angle ) { int sectorIndex = ( (int) ( ( ( ( angle * 16 / Math.PI ) ) % 32 ) + 32 ) ) % 32; switch ( sectorIndex ) { case 5: case 6: return PlaneDirection.TOP_RIGHT; case 7: case 8: return PlaneDirection.TOP; case 9: case 10: return PlaneDirection.TOP_LEFT; case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: return PlaneDirection.LEFT; case 21: case 22: return PlaneDirection.BOTTOM_LEFT; case 23: case 24: return PlaneDirection.BOTTOM; case 25: case 26: return PlaneDirection.BOTTOM_RIGHT; case 27: case 28: case 29: case 30: case 31: case 0: case 1: case 2: case 3: case 4: default: return PlaneDirection.RIGHT; } } protected  CategoricalChartExpression(); Font getCategoryTitleFont(); void setCategoryTitleFont( final Font categoryTitleFont ); Font getCategoryTickFont(); void setCategoryTickFont( final Font categoryTickFont ); String getRangeTickFormatString(); void setRangeTickFormatString( final String rangeTickFormatString ); String getCategoricalAxisMessageFormat(); void setCategoricalAxisMessageFormat( final String categoricalAxisMessageFormat ); Font getRangeTickFont(); void setRangeTickFont( final Font rangeTickFont ); double getRangeMinimum(); void setRangeMinimum( final double rangeMinimum ); double getRangeMaximum(); void setRangeMaximum( final double rangeMaximum ); Font getRangeTitleFont(); void setRangeTitleFont( final Font rangeTitleFont ); NumberFormat getRangeTickFormat(); void setRangeTickFormat( final NumberFormat rangeTickFormat ); boolean isRangeIncludesZero(); void setRangeIncludesZero( final boolean rangeIncludesZero ); boolean isRangeStickyZero(); void setRangeStickyZero( final boolean rangeStickyZero ); boolean isLogarithmicAxis(); void setLogarithmicAxis( final boolean logarithmicAxis ); boolean isHumanReadableLogarithmicFormat(); void setHumanReadableLogarithmicFormat( final boolean humanReadableLogarithmicFormat ); Double getLowerMargin(); void setLowerMargin( final Double lowerMargin ); Double getUpperMargin(); void setUpperMargin( final Double upperMargin ); Double getCategoryMargin(); void setCategoryMargin( final Double categoryMargin ); Double getLabelRotationDeg(); void setLabelRotationDeg( final Double value ); Double getLabelRotation(); void setLabelRotation( final Double value ); Double getCategoricalItemLabelRotationDeg(); void setCategoricalItemLabelRotationDeg( final Double value ); Double getCategoricalItemLabelRotation(); void setCategoricalItemLabelRotation( final Double value ); void setMaxCategoryLabelWidthRatio( final Float value ); Float getMaxCategoryLabelWidthRatio(); boolean isShowGridlines(); void setShowGridlines( final boolean value ); boolean isHorizontal(); void setHorizontal( final boolean value ); String getValueAxisLabel(); void setValueAxisLabel( final String valueAxisLabel ); String getCategoryAxisLabel(); void setCategoryAxisLabel( final String categoryAxisLabel ); void setCategoricalLabelFormat( final String value ); String getCategoricalLabelFormat(); void setCategoricalLabelDecimalFormat( final String value ); String getCategoricalLabelDecimalFormat(); void setCategoricalLabelDateFormat( final String value ); String getCategoricalLabelDateFormat(); boolean isAutoRange(); void setAutoRange( final boolean autoRange ); double getScaleFactor(); void setScaleFactor( final double scaleFactor ); JFreeChart getChart( final CategoryDataset categoryDataset ); Class getRangeTimePeriod(); void setRangeTimePeriod( final Class rangeTimePeriod ); double getRangePeriodCount(); void setRangePeriodCount( final double rangePeriodCount ); Expression getInstance(); void reconfigureForCompatibility( final int versionTag ); }
CategoricalChartExpression extends AbstractChartExpression implements LegacyUpdateHandler { protected PlaneDirection getTextAnchorDirectionOfAngle( double angle ) { int sectorIndex = ( (int) ( ( ( ( angle * 16 / Math.PI ) ) % 32 ) + 32 ) ) % 32; switch ( sectorIndex ) { case 5: case 6: return PlaneDirection.TOP_RIGHT; case 7: case 8: return PlaneDirection.TOP; case 9: case 10: return PlaneDirection.TOP_LEFT; case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: return PlaneDirection.LEFT; case 21: case 22: return PlaneDirection.BOTTOM_LEFT; case 23: case 24: return PlaneDirection.BOTTOM; case 25: case 26: return PlaneDirection.BOTTOM_RIGHT; case 27: case 28: case 29: case 30: case 31: case 0: case 1: case 2: case 3: case 4: default: return PlaneDirection.RIGHT; } } protected  CategoricalChartExpression(); Font getCategoryTitleFont(); void setCategoryTitleFont( final Font categoryTitleFont ); Font getCategoryTickFont(); void setCategoryTickFont( final Font categoryTickFont ); String getRangeTickFormatString(); void setRangeTickFormatString( final String rangeTickFormatString ); String getCategoricalAxisMessageFormat(); void setCategoricalAxisMessageFormat( final String categoricalAxisMessageFormat ); Font getRangeTickFont(); void setRangeTickFont( final Font rangeTickFont ); double getRangeMinimum(); void setRangeMinimum( final double rangeMinimum ); double getRangeMaximum(); void setRangeMaximum( final double rangeMaximum ); Font getRangeTitleFont(); void setRangeTitleFont( final Font rangeTitleFont ); NumberFormat getRangeTickFormat(); void setRangeTickFormat( final NumberFormat rangeTickFormat ); boolean isRangeIncludesZero(); void setRangeIncludesZero( final boolean rangeIncludesZero ); boolean isRangeStickyZero(); void setRangeStickyZero( final boolean rangeStickyZero ); boolean isLogarithmicAxis(); void setLogarithmicAxis( final boolean logarithmicAxis ); boolean isHumanReadableLogarithmicFormat(); void setHumanReadableLogarithmicFormat( final boolean humanReadableLogarithmicFormat ); Double getLowerMargin(); void setLowerMargin( final Double lowerMargin ); Double getUpperMargin(); void setUpperMargin( final Double upperMargin ); Double getCategoryMargin(); void setCategoryMargin( final Double categoryMargin ); Double getLabelRotationDeg(); void setLabelRotationDeg( final Double value ); Double getLabelRotation(); void setLabelRotation( final Double value ); Double getCategoricalItemLabelRotationDeg(); void setCategoricalItemLabelRotationDeg( final Double value ); Double getCategoricalItemLabelRotation(); void setCategoricalItemLabelRotation( final Double value ); void setMaxCategoryLabelWidthRatio( final Float value ); Float getMaxCategoryLabelWidthRatio(); boolean isShowGridlines(); void setShowGridlines( final boolean value ); boolean isHorizontal(); void setHorizontal( final boolean value ); String getValueAxisLabel(); void setValueAxisLabel( final String valueAxisLabel ); String getCategoryAxisLabel(); void setCategoryAxisLabel( final String categoryAxisLabel ); void setCategoricalLabelFormat( final String value ); String getCategoricalLabelFormat(); void setCategoricalLabelDecimalFormat( final String value ); String getCategoricalLabelDecimalFormat(); void setCategoricalLabelDateFormat( final String value ); String getCategoricalLabelDateFormat(); boolean isAutoRange(); void setAutoRange( final boolean autoRange ); double getScaleFactor(); void setScaleFactor( final double scaleFactor ); JFreeChart getChart( final CategoryDataset categoryDataset ); Class getRangeTimePeriod(); void setRangeTimePeriod( final Class rangeTimePeriod ); double getRangePeriodCount(); void setRangePeriodCount( final double rangePeriodCount ); Expression getInstance(); void reconfigureForCompatibility( final int versionTag );  }