@Test public void testCreateUpRotationCategoryLabelPosition() { TestableCategoricalChartExpression e = new TestableCategoricalChartExpression(); { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.BOTTOM, 0.0 ); Assert.assertEquals( RectangleAnchor.TOP, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.TOP_CENTER, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.TOP_CENTER, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.BOTTOM, 90.0 * Math.PI / 180.0 ); Assert.assertEquals( RectangleAnchor.TOP, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.CENTER_RIGHT, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.CENTER_RIGHT, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.BOTTOM, -90.0 * Math.PI / 180.0 ); Assert.assertEquals( RectangleAnchor.TOP, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.CENTER_LEFT, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.CENTER_LEFT, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.BOTTOM, 180.0 * Math.PI / 180.0 ); Assert.assertEquals( RectangleAnchor.TOP, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.BOTTOM_CENTER, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.BOTTOM_CENTER, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.LEFT, 0.0 ); Assert.assertEquals( RectangleAnchor.RIGHT, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.CENTER_RIGHT, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.CENTER_RIGHT, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.LEFT, 90.0 * Math.PI / 180.0 ); Assert.assertEquals( RectangleAnchor.RIGHT, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.BOTTOM_CENTER, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.BOTTOM_CENTER, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.LEFT, -90.0 * Math.PI / 180.0 ); Assert.assertEquals( RectangleAnchor.RIGHT, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.TOP_CENTER, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.TOP_CENTER, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.LEFT, 180.0 * Math.PI / 180.0 ); Assert.assertEquals( RectangleAnchor.RIGHT, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.CENTER_LEFT, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.CENTER_LEFT, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.TOP, 0.0 ); Assert.assertEquals( RectangleAnchor.BOTTOM, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.BOTTOM_CENTER, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.BOTTOM_CENTER, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.TOP, 90.0 * Math.PI / 180.0 ); Assert.assertEquals( RectangleAnchor.BOTTOM, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.CENTER_LEFT, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.CENTER_LEFT, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.RIGHT, 0.0 ); Assert.assertEquals( RectangleAnchor.LEFT, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.CENTER_LEFT, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.CENTER_LEFT, c.getRotationAnchor() ); } { CategoryLabelPosition c = e.createUpRotationCategoryLabelPosition( PlaneDirection.RIGHT, 90.0 * Math.PI / 180.0 ); Assert.assertEquals( RectangleAnchor.LEFT, c.getCategoryAnchor() ); Assert.assertEquals( TextBlockAnchor.TOP_CENTER, c.getLabelAnchor() ); Assert.assertEquals( TextAnchor.TOP_CENTER, c.getRotationAnchor() ); } }
protected CategoryLabelPosition createUpRotationCategoryLabelPosition( PlaneDirection axisPosition, double labelAngle ) { RectangleAnchor categoryAnchor = axisPosition.opposite().asRectangleAnchor(); double labelAnchorDirectionAngle = axisPosition.opposite().asAngle() - labelAngle; PlaneDirection labelAnchorDirection = getTextAnchorDirectionOfAngle( labelAnchorDirectionAngle ); TextBlockAnchor labelAnchor = labelAnchorDirection.asTextBlockAnchor(); TextAnchor rotationAnchor = labelAnchorDirection.asTextAnchor(); return new CategoryLabelPosition( categoryAnchor, labelAnchor, rotationAnchor, -labelAngle, CategoryLabelWidthType.RANGE, 0.50f ); }
CategoricalChartExpression extends AbstractChartExpression implements LegacyUpdateHandler { protected CategoryLabelPosition createUpRotationCategoryLabelPosition( PlaneDirection axisPosition, double labelAngle ) { RectangleAnchor categoryAnchor = axisPosition.opposite().asRectangleAnchor(); double labelAnchorDirectionAngle = axisPosition.opposite().asAngle() - labelAngle; PlaneDirection labelAnchorDirection = getTextAnchorDirectionOfAngle( labelAnchorDirectionAngle ); TextBlockAnchor labelAnchor = labelAnchorDirection.asTextBlockAnchor(); TextAnchor rotationAnchor = labelAnchorDirection.asTextAnchor(); return new CategoryLabelPosition( categoryAnchor, labelAnchor, rotationAnchor, -labelAngle, CategoryLabelWidthType.RANGE, 0.50f ); } }
CategoricalChartExpression extends AbstractChartExpression implements LegacyUpdateHandler { protected CategoryLabelPosition createUpRotationCategoryLabelPosition( PlaneDirection axisPosition, double labelAngle ) { RectangleAnchor categoryAnchor = axisPosition.opposite().asRectangleAnchor(); double labelAnchorDirectionAngle = axisPosition.opposite().asAngle() - labelAngle; PlaneDirection labelAnchorDirection = getTextAnchorDirectionOfAngle( labelAnchorDirectionAngle ); TextBlockAnchor labelAnchor = labelAnchorDirection.asTextBlockAnchor(); TextAnchor rotationAnchor = labelAnchorDirection.asTextAnchor(); return new CategoryLabelPosition( categoryAnchor, labelAnchor, rotationAnchor, -labelAngle, CategoryLabelWidthType.RANGE, 0.50f ); } protected  CategoricalChartExpression(); }
CategoricalChartExpression extends AbstractChartExpression implements LegacyUpdateHandler { protected CategoryLabelPosition createUpRotationCategoryLabelPosition( PlaneDirection axisPosition, double labelAngle ) { RectangleAnchor categoryAnchor = axisPosition.opposite().asRectangleAnchor(); double labelAnchorDirectionAngle = axisPosition.opposite().asAngle() - labelAngle; PlaneDirection labelAnchorDirection = getTextAnchorDirectionOfAngle( labelAnchorDirectionAngle ); TextBlockAnchor labelAnchor = labelAnchorDirection.asTextBlockAnchor(); TextAnchor rotationAnchor = labelAnchorDirection.asTextAnchor(); return new CategoryLabelPosition( categoryAnchor, labelAnchor, rotationAnchor, -labelAngle, CategoryLabelWidthType.RANGE, 0.50f ); } 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 CategoryLabelPosition createUpRotationCategoryLabelPosition( PlaneDirection axisPosition, double labelAngle ) { RectangleAnchor categoryAnchor = axisPosition.opposite().asRectangleAnchor(); double labelAnchorDirectionAngle = axisPosition.opposite().asAngle() - labelAngle; PlaneDirection labelAnchorDirection = getTextAnchorDirectionOfAngle( labelAnchorDirectionAngle ); TextBlockAnchor labelAnchor = labelAnchorDirection.asTextBlockAnchor(); TextAnchor rotationAnchor = labelAnchorDirection.asTextAnchor(); return new CategoryLabelPosition( categoryAnchor, labelAnchor, rotationAnchor, -labelAngle, CategoryLabelWidthType.RANGE, 0.50f ); } 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 );  }