Java Code Examples for org.jfree.text.TextBlockAnchor#BOTTOM_CENTER
The following examples show how to use
org.jfree.text.TextBlockAnchor#BOTTOM_CENTER .
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: CategoricalChartExpression.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 6 votes |
public TextBlockAnchor asTextBlockAnchor() { switch ( this ) { case RIGHT: return TextBlockAnchor.CENTER_RIGHT; case TOP_RIGHT: return TextBlockAnchor.TOP_RIGHT; case TOP: return TextBlockAnchor.TOP_CENTER; case TOP_LEFT: return TextBlockAnchor.TOP_LEFT; case LEFT: return TextBlockAnchor.CENTER_LEFT; case BOTTOM_LEFT: return TextBlockAnchor.BOTTOM_LEFT; case BOTTOM: return TextBlockAnchor.BOTTOM_CENTER; case BOTTOM_RIGHT: return TextBlockAnchor.BOTTOM_RIGHT; default: return null; } }
Example 2
Source File: TextTitle.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Draws a the title vertically within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawVertical(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float y = 0.0f; VerticalAlignment verticalAlignment = getVerticalAlignment(); if (verticalAlignment == VerticalAlignment.TOP) { y = (float) titleArea.getY(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { y = (float) titleArea.getMaxY(); anchor = TextBlockAnchor.TOP_LEFT; } else if (verticalAlignment == VerticalAlignment.CENTER) { y = (float) titleArea.getCenterY(); anchor = TextBlockAnchor.TOP_CENTER; } float x = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.LEFT) { x = (float) titleArea.getX(); } else if (position == RectangleEdge.RIGHT) { x = (float) titleArea.getMaxX(); if (verticalAlignment == VerticalAlignment.TOP) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } else if (verticalAlignment == VerticalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { anchor = TextBlockAnchor.BOTTOM_LEFT; } } this.content.draw(g2, x, y, anchor, x, y, -Math.PI / 2.0); }
Example 3
Source File: CategoryLabelPosition.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Creates a new position record with default settings. */ public CategoryLabelPosition() { this( RectangleAnchor.CENTER, TextBlockAnchor.BOTTOM_CENTER, TextAnchor.CENTER, 0.0, CategoryLabelWidthType.CATEGORY, 0.95f ); }
Example 4
Source File: TextTitle.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Draws a the title vertically within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawVertical(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float y = 0.0f; VerticalAlignment verticalAlignment = getVerticalAlignment(); if (verticalAlignment == VerticalAlignment.TOP) { y = (float) titleArea.getY(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { y = (float) titleArea.getMaxY(); anchor = TextBlockAnchor.TOP_LEFT; } else if (verticalAlignment == VerticalAlignment.CENTER) { y = (float) titleArea.getCenterY(); anchor = TextBlockAnchor.TOP_CENTER; } float x = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.LEFT) { x = (float) titleArea.getX(); } else if (position == RectangleEdge.RIGHT) { x = (float) titleArea.getMaxX(); if (verticalAlignment == VerticalAlignment.TOP) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } else if (verticalAlignment == VerticalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { anchor = TextBlockAnchor.BOTTOM_LEFT; } } this.content.draw(g2, x, y, anchor, x, y, -Math.PI / 2.0); }
Example 5
Source File: TextTitle.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Draws a the title horizontally within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawHorizontal(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float x = 0.0f; HorizontalAlignment horizontalAlignment = getHorizontalAlignment(); if (horizontalAlignment == HorizontalAlignment.LEFT) { x = (float) titleArea.getX(); anchor = TextBlockAnchor.TOP_LEFT; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { x = (float) titleArea.getMaxX(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { x = (float) titleArea.getCenterX(); anchor = TextBlockAnchor.TOP_CENTER; } float y = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.TOP) { y = (float) titleArea.getY(); } else if (position == RectangleEdge.BOTTOM) { y = (float) titleArea.getMaxY(); if (horizontalAlignment == HorizontalAlignment.LEFT) { anchor = TextBlockAnchor.BOTTOM_LEFT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } } this.content.draw(g2, x, y, anchor); }
Example 6
Source File: TextTitle.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Draws a the title horizontally within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawHorizontal(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float x = 0.0f; HorizontalAlignment horizontalAlignment = getHorizontalAlignment(); if (horizontalAlignment == HorizontalAlignment.LEFT) { x = (float) titleArea.getX(); anchor = TextBlockAnchor.TOP_LEFT; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { x = (float) titleArea.getMaxX(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { x = (float) titleArea.getCenterX(); anchor = TextBlockAnchor.TOP_CENTER; } float y = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.TOP) { y = (float) titleArea.getY(); } else if (position == RectangleEdge.BOTTOM) { y = (float) titleArea.getMaxY(); if (horizontalAlignment == HorizontalAlignment.LEFT) { anchor = TextBlockAnchor.BOTTOM_LEFT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } } this.content.draw(g2, x, y, anchor); }
Example 7
Source File: TextTitle.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * Draws a the title vertically within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawVertical(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float y = 0.0f; VerticalAlignment verticalAlignment = getVerticalAlignment(); if (verticalAlignment == VerticalAlignment.TOP) { y = (float) titleArea.getY(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { y = (float) titleArea.getMaxY(); anchor = TextBlockAnchor.TOP_LEFT; } else if (verticalAlignment == VerticalAlignment.CENTER) { y = (float) titleArea.getCenterY(); anchor = TextBlockAnchor.TOP_CENTER; } float x = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.LEFT) { x = (float) titleArea.getX(); } else if (position == RectangleEdge.RIGHT) { x = (float) titleArea.getMaxX(); if (verticalAlignment == VerticalAlignment.TOP) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } else if (verticalAlignment == VerticalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { anchor = TextBlockAnchor.BOTTOM_LEFT; } } this.content.draw(g2, x, y, anchor, x, y, -Math.PI / 2.0); }
Example 8
Source File: TextTitle.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Draws a the title vertically within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawVertical(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float y = 0.0f; VerticalAlignment verticalAlignment = getVerticalAlignment(); if (verticalAlignment == VerticalAlignment.TOP) { y = (float) titleArea.getY(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { y = (float) titleArea.getMaxY(); anchor = TextBlockAnchor.TOP_LEFT; } else if (verticalAlignment == VerticalAlignment.CENTER) { y = (float) titleArea.getCenterY(); anchor = TextBlockAnchor.TOP_CENTER; } float x = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.LEFT) { x = (float) titleArea.getX(); } else if (position == RectangleEdge.RIGHT) { x = (float) titleArea.getMaxX(); if (verticalAlignment == VerticalAlignment.TOP) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } else if (verticalAlignment == VerticalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { anchor = TextBlockAnchor.BOTTOM_LEFT; } } this.content.draw(g2, x, y, anchor, x, y, -Math.PI / 2.0); }
Example 9
Source File: TextTitle.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Draws a the title horizontally within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawHorizontal(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float x = 0.0f; HorizontalAlignment horizontalAlignment = getHorizontalAlignment(); if (horizontalAlignment == HorizontalAlignment.LEFT) { x = (float) titleArea.getX(); anchor = TextBlockAnchor.TOP_LEFT; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { x = (float) titleArea.getMaxX(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { x = (float) titleArea.getCenterX(); anchor = TextBlockAnchor.TOP_CENTER; } float y = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.TOP) { y = (float) titleArea.getY(); } else if (position == RectangleEdge.BOTTOM) { y = (float) titleArea.getMaxY(); if (horizontalAlignment == HorizontalAlignment.LEFT) { anchor = TextBlockAnchor.BOTTOM_LEFT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } } this.content.draw(g2, x, y, anchor); }
Example 10
Source File: TextTitle.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Draws a the title horizontally within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawHorizontal(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float x = 0.0f; HorizontalAlignment horizontalAlignment = getHorizontalAlignment(); if (horizontalAlignment == HorizontalAlignment.LEFT) { x = (float) titleArea.getX(); anchor = TextBlockAnchor.TOP_LEFT; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { x = (float) titleArea.getMaxX(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { x = (float) titleArea.getCenterX(); anchor = TextBlockAnchor.TOP_CENTER; } float y = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.TOP) { y = (float) titleArea.getY(); } else if (position == RectangleEdge.BOTTOM) { y = (float) titleArea.getMaxY(); if (horizontalAlignment == HorizontalAlignment.LEFT) { anchor = TextBlockAnchor.BOTTOM_LEFT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } } this.content.draw(g2, x, y, anchor); }
Example 11
Source File: TextTitle.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * Draws a the title vertically within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawVertical(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float y = 0.0f; VerticalAlignment verticalAlignment = getVerticalAlignment(); if (verticalAlignment == VerticalAlignment.TOP) { y = (float) titleArea.getY(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { y = (float) titleArea.getMaxY(); anchor = TextBlockAnchor.TOP_LEFT; } else if (verticalAlignment == VerticalAlignment.CENTER) { y = (float) titleArea.getCenterY(); anchor = TextBlockAnchor.TOP_CENTER; } float x = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.LEFT) { x = (float) titleArea.getX(); } else if (position == RectangleEdge.RIGHT) { x = (float) titleArea.getMaxX(); if (verticalAlignment == VerticalAlignment.TOP) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } else if (verticalAlignment == VerticalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (verticalAlignment == VerticalAlignment.BOTTOM) { anchor = TextBlockAnchor.BOTTOM_LEFT; } } this.content.draw(g2, x, y, anchor, x, y, -Math.PI / 2.0); }
Example 12
Source File: TextTitle.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * Draws a the title horizontally within the specified area. This method * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} * method. * * @param g2 the graphics device. * @param area the area for the title. */ protected void drawHorizontal(Graphics2D g2, Rectangle2D area) { Rectangle2D titleArea = (Rectangle2D) area.clone(); g2.setFont(this.font); g2.setPaint(this.paint); TextBlockAnchor anchor = null; float x = 0.0f; HorizontalAlignment horizontalAlignment = getHorizontalAlignment(); if (horizontalAlignment == HorizontalAlignment.LEFT) { x = (float) titleArea.getX(); anchor = TextBlockAnchor.TOP_LEFT; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { x = (float) titleArea.getMaxX(); anchor = TextBlockAnchor.TOP_RIGHT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { x = (float) titleArea.getCenterX(); anchor = TextBlockAnchor.TOP_CENTER; } float y = 0.0f; RectangleEdge position = getPosition(); if (position == RectangleEdge.TOP) { y = (float) titleArea.getY(); } else if (position == RectangleEdge.BOTTOM) { y = (float) titleArea.getMaxY(); if (horizontalAlignment == HorizontalAlignment.LEFT) { anchor = TextBlockAnchor.BOTTOM_LEFT; } else if (horizontalAlignment == HorizontalAlignment.CENTER) { anchor = TextBlockAnchor.BOTTOM_CENTER; } else if (horizontalAlignment == HorizontalAlignment.RIGHT) { anchor = TextBlockAnchor.BOTTOM_RIGHT; } } this.content.draw(g2, x, y, anchor); }
Example 13
Source File: CategoryTickTest.java From SIMVA-SoS with Apache License 2.0 | 4 votes |
/** * Confirm that the equals method can distinguish all the required fields. */ @Test public void testEquals() { Comparable c1 = "C1"; Comparable c2 = "C2"; TextBlock tb1 = new TextBlock(); tb1.addLine(new TextLine("Block 1")); TextBlock tb2 = new TextBlock(); tb1.addLine(new TextLine("Block 2")); TextBlockAnchor tba1 = TextBlockAnchor.CENTER; TextBlockAnchor tba2 = TextBlockAnchor.BOTTOM_CENTER; TextAnchor ta1 = TextAnchor.CENTER; TextAnchor ta2 = TextAnchor.BASELINE_LEFT; CategoryTick t1 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f); CategoryTick t2 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f); assertTrue(t1.equals(t2)); }
Example 14
Source File: CategoryTickTest.java From openstock with GNU General Public License v3.0 | 4 votes |
/** * Confirm that the equals method can distinguish all the required fields. */ @Test public void testEquals() { Comparable c1 = "C1"; Comparable c2 = "C2"; TextBlock tb1 = new TextBlock(); tb1.addLine(new TextLine("Block 1")); TextBlock tb2 = new TextBlock(); tb1.addLine(new TextLine("Block 2")); TextBlockAnchor tba1 = TextBlockAnchor.CENTER; TextBlockAnchor tba2 = TextBlockAnchor.BOTTOM_CENTER; TextAnchor ta1 = TextAnchor.CENTER; TextAnchor ta2 = TextAnchor.BASELINE_LEFT; CategoryTick t1 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f); CategoryTick t2 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f); assertTrue(t1.equals(t2)); }
Example 15
Source File: CategoryLabelPosition.java From SIMVA-SoS with Apache License 2.0 | 4 votes |
/** * Creates a new position record with default settings. */ public CategoryLabelPosition() { this(RectangleAnchor.CENTER, TextBlockAnchor.BOTTOM_CENTER, TextAnchor.CENTER, 0.0, CategoryLabelWidthType.CATEGORY, 0.95f); }
Example 16
Source File: CategoryTickTest.java From ECG-Viewer with GNU General Public License v2.0 | 4 votes |
/** * Confirm that the equals method can distinguish all the required fields. */ @Test public void testEquals() { Comparable c1 = "C1"; Comparable c2 = "C2"; TextBlock tb1 = new TextBlock(); tb1.addLine(new TextLine("Block 1")); TextBlock tb2 = new TextBlock(); tb1.addLine(new TextLine("Block 2")); TextBlockAnchor tba1 = TextBlockAnchor.CENTER; TextBlockAnchor tba2 = TextBlockAnchor.BOTTOM_CENTER; TextAnchor ta1 = TextAnchor.CENTER; TextAnchor ta2 = TextAnchor.BASELINE_LEFT; CategoryTick t1 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f); CategoryTick t2 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f); assertTrue(t1.equals(t2)); }
Example 17
Source File: CategoryLabelPosition.java From buffer_bci with GNU General Public License v3.0 | 4 votes |
/** * Creates a new position record with default settings. */ public CategoryLabelPosition() { this(RectangleAnchor.CENTER, TextBlockAnchor.BOTTOM_CENTER, TextAnchor.CENTER, 0.0, CategoryLabelWidthType.CATEGORY, 0.95f); }
Example 18
Source File: CategoryTickTest.java From ccu-historian with GNU General Public License v3.0 | 4 votes |
/** * Confirm that the equals method can distinguish all the required fields. */ @Test public void testEquals() { Comparable c1 = "C1"; Comparable c2 = "C2"; TextBlock tb1 = new TextBlock(); tb1.addLine(new TextLine("Block 1")); TextBlock tb2 = new TextBlock(); tb1.addLine(new TextLine("Block 2")); TextBlockAnchor tba1 = TextBlockAnchor.CENTER; TextBlockAnchor tba2 = TextBlockAnchor.BOTTOM_CENTER; TextAnchor ta1 = TextAnchor.CENTER; TextAnchor ta2 = TextAnchor.BASELINE_LEFT; CategoryTick t1 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f); CategoryTick t2 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f); assertTrue(t1.equals(t2)); t1 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f); assertFalse(t1.equals(t2)); t2 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f); assertTrue(t1.equals(t2)); }
Example 19
Source File: CategoryLabelPosition.java From openstock with GNU General Public License v3.0 | 4 votes |
/** * Creates a new position record with default settings. */ public CategoryLabelPosition() { this(RectangleAnchor.CENTER, TextBlockAnchor.BOTTOM_CENTER, TextAnchor.CENTER, 0.0, CategoryLabelWidthType.CATEGORY, 0.95f); }
Example 20
Source File: CategoryLabelPosition.java From buffer_bci with GNU General Public License v3.0 | 4 votes |
/** * Creates a new position record with default settings. */ public CategoryLabelPosition() { this(RectangleAnchor.CENTER, TextBlockAnchor.BOTTOM_CENTER, TextAnchor.CENTER, 0.0, CategoryLabelWidthType.CATEGORY, 0.95f); }