org.jfree.chart.axis.CategoryLabelWidthType Java Examples

The following examples show how to use org.jfree.chart.axis.CategoryLabelWidthType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CategoryLabelWidthTypeTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Confirm that the equals() method distinguishes the known values.
 */
public void testEquals() {
    assertEquals(CategoryLabelWidthType.CATEGORY,
            CategoryLabelWidthType.CATEGORY);
    assertEquals(CategoryLabelWidthType.RANGE,
            CategoryLabelWidthType.RANGE);
}
 
Example #2
Source File: CategoryLabelWidthTypeTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashCode() {
    CategoryLabelWidthType a1 = CategoryLabelWidthType.CATEGORY;
    CategoryLabelWidthType a2 = CategoryLabelWidthType.CATEGORY;
    assertTrue(a1.equals(a2));
    int h1 = a1.hashCode();
    int h2 = a2.hashCode();
    assertEquals(h1, h2);
}
 
Example #3
Source File: CategoryLabelWidthTypeTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Confirm that the equals() method distinguishes the known values.
 */
public void testEquals() {
    assertEquals(
        CategoryLabelWidthType.CATEGORY, CategoryLabelWidthType.CATEGORY
    );
    assertEquals(
        CategoryLabelWidthType.RANGE, CategoryLabelWidthType.RANGE
    );
}
 
Example #4
Source File: CategoryLabelWidthTypeTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashCode() {
    CategoryLabelWidthType a1 = CategoryLabelWidthType.CATEGORY;
    CategoryLabelWidthType a2 = CategoryLabelWidthType.CATEGORY;
    assertTrue(a1.equals(a2));
    int h1 = a1.hashCode();
    int h2 = a2.hashCode();
    assertEquals(h1, h2);
}
 
Example #5
Source File: CategoricalChartExpression.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Used instead of <code>org.jfree.chart.axis.CategoryLabelPosition.createUpRotationLabelPositions</code>.
 * <p>
 * It additionally takes into consideration the axis position.
 *
 * @param axisPosition
 * @param labelAngle
 * @return
 */
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 );
}