org.jfree.util.ShapeUtilities Java Examples
The following examples show how to use
org.jfree.util.ShapeUtilities.
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: SamplingXYLineRenderer.java From SIMVA-SoS with Apache License 2.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return <code>true</code> or <code>false</code>. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SamplingXYLineRenderer)) { return false; } if (!super.equals(obj)) { return false; } SamplingXYLineRenderer that = (SamplingXYLineRenderer) obj; if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } return true; }
Example #2
Source File: XYDotRenderer.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. This method * returns <code>true</code> if and only if: * * <ul> * <li><code>obj</code> is not <code>null</code>;</li> * <li><code>obj</code> is an instance of <code>XYDotRenderer</code>;</li> * <li>both renderers have the same attribute values. * </ul> * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDotRenderer)) { return false; } XYDotRenderer that = (XYDotRenderer) obj; if (this.dotWidth != that.dotWidth) { return false; } if (this.dotHeight != that.dotHeight) { return false; } if (!ShapeUtilities.equal(this.legendShape, that.legendShape)) { return false; } return super.equals(obj); }
Example #3
Source File: DefaultDrawingSupplier.java From opensim-gui with Apache License 2.0 | 6 votes |
/** * A utility method for testing the equality of two arrays of shapes. * * @param s1 the first array (<code>null</code> permitted). * @param s2 the second array (<code>null</code> permitted). * * @return A boolean. */ private boolean equalShapes(Shape[] s1, Shape[] s2) { if (s1 == null) { return s2 == null; } if (s2 == null) { return false; } if (s1.length != s2.length) { return false; } for (int i = 0; i < s1.length; i++) { if (!ShapeUtilities.equal(s1[i], s2[i])) { return false; } } return true; }
Example #4
Source File: SamplingXYLineRenderer.java From ccu-historian with GNU General Public License v3.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return <code>true</code> or <code>false</code>. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SamplingXYLineRenderer)) { return false; } if (!super.equals(obj)) { return false; } SamplingXYLineRenderer that = (SamplingXYLineRenderer) obj; if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } return true; }
Example #5
Source File: XYAreaRenderer2.java From SIMVA-SoS with Apache License 2.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> not permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYAreaRenderer2)) { return false; } XYAreaRenderer2 that = (XYAreaRenderer2) obj; if (this.showOutline != that.showOutline) { return false; } if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) { return false; } return super.equals(obj); }
Example #6
Source File: SamplingXYLineRenderer.java From ECG-Viewer with GNU General Public License v2.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return <code>true</code> or <code>false</code>. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SamplingXYLineRenderer)) { return false; } if (!super.equals(obj)) { return false; } SamplingXYLineRenderer that = (SamplingXYLineRenderer) obj; if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } return true; }
Example #7
Source File: DefaultDrawingSupplier.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * A utility method for testing the equality of two arrays of shapes. * * @param s1 the first array (<code>null</code> permitted). * @param s2 the second array (<code>null</code> permitted). * * @return A boolean. */ private boolean equalShapes(Shape[] s1, Shape[] s2) { if (s1 == null) { return s2 == null; } if (s2 == null) { return false; } if (s1.length != s2.length) { return false; } for (int i = 0; i < s1.length; i++) { if (!ShapeUtilities.equal(s1[i], s2[i])) { return false; } } return true; }
Example #8
Source File: DefaultDrawingSupplier.java From openstock with GNU General Public License v3.0 | 6 votes |
/** * A utility method for testing the equality of two arrays of shapes. * * @param s1 the first array (<code>null</code> permitted). * @param s2 the second array (<code>null</code> permitted). * * @return A boolean. */ private boolean equalShapes(Shape[] s1, Shape[] s2) { if (s1 == null) { return s2 == null; } if (s2 == null) { return false; } if (s1.length != s2.length) { return false; } for (int i = 0; i < s1.length; i++) { if (!ShapeUtilities.equal(s1[i], s2[i])) { return false; } } return true; }
Example #9
Source File: XYDotRenderer.java From SIMVA-SoS with Apache License 2.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. This method * returns <code>true</code> if and only if: * * <ul> * <li><code>obj</code> is not <code>null</code>;</li> * <li><code>obj</code> is an instance of <code>XYDotRenderer</code>;</li> * <li>both renderers have the same attribute values. * </ul> * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDotRenderer)) { return false; } XYDotRenderer that = (XYDotRenderer) obj; if (this.dotWidth != that.dotWidth) { return false; } if (this.dotHeight != that.dotHeight) { return false; } if (!ShapeUtilities.equal(this.legendShape, that.legendShape)) { return false; } return super.equals(obj); }
Example #10
Source File: XYAreaRenderer2.java From openstock with GNU General Public License v3.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> not permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYAreaRenderer2)) { return false; } XYAreaRenderer2 that = (XYAreaRenderer2) obj; if (this.showOutline != that.showOutline) { return false; } if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) { return false; } return super.equals(obj); }
Example #11
Source File: DefaultDrawingSupplier.java From ccu-historian with GNU General Public License v3.0 | 6 votes |
/** * A utility method for testing the equality of two arrays of shapes. * * @param s1 the first array (<code>null</code> permitted). * @param s2 the second array (<code>null</code> permitted). * * @return A boolean. */ private boolean equalShapes(Shape[] s1, Shape[] s2) { if (s1 == null) { return s2 == null; } if (s2 == null) { return false; } if (s1.length != s2.length) { return false; } for (int i = 0; i < s1.length; i++) { if (!ShapeUtilities.equal(s1[i], s2[i])) { return false; } } return true; }
Example #12
Source File: XYAreaRenderer2.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> not permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYAreaRenderer2)) { return false; } XYAreaRenderer2 that = (XYAreaRenderer2) obj; if (this.showOutline != that.showOutline) { return false; } if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) { return false; } return super.equals(obj); }
Example #13
Source File: XYAreaRenderer.java From opensim-gui with Apache License 2.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYAreaRenderer)) { return false; } XYAreaRenderer that = (XYAreaRenderer) obj; if (this.plotArea != that.plotArea) { return false; } if (this.plotLines != that.plotLines) { return false; } if (this.plotShapes != that.plotShapes) { return false; } if (this.showOutline != that.showOutline) { return false; } if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) { return false; } return true; }
Example #14
Source File: XYDotRenderer.java From openstock with GNU General Public License v3.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. This method * returns <code>true</code> if and only if: * * <ul> * <li><code>obj</code> is not <code>null</code>;</li> * <li><code>obj</code> is an instance of <code>XYDotRenderer</code>;</li> * <li>both renderers have the same attribute values. * </ul> * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDotRenderer)) { return false; } XYDotRenderer that = (XYDotRenderer) obj; if (this.dotWidth != that.dotWidth) { return false; } if (this.dotHeight != that.dotHeight) { return false; } if (!ShapeUtilities.equal(this.legendShape, that.legendShape)) { return false; } return super.equals(obj); }
Example #15
Source File: SamplingXYLineRenderer.java From openstock with GNU General Public License v3.0 | 6 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return <code>true</code> or <code>false</code>. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SamplingXYLineRenderer)) { return false; } if (!super.equals(obj)) { return false; } SamplingXYLineRenderer that = (SamplingXYLineRenderer) obj; if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } return true; }
Example #16
Source File: DefaultDrawingSupplier.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * A utility method for testing the equality of two arrays of shapes. * * @param s1 the first array (<code>null</code> permitted). * @param s2 the second array (<code>null</code> permitted). * * @return A boolean. */ private boolean equalShapes(Shape[] s1, Shape[] s2) { if (s1 == null) { return s2 == null; } if (s2 == null) { return false; } if (s1.length != s2.length) { return false; } for (int i = 0; i < s1.length; i++) { if (!ShapeUtilities.equal(s1[i], s2[i])) { return false; } } return true; }
Example #17
Source File: DefaultDrawingSupplier.java From ECG-Viewer with GNU General Public License v2.0 | 6 votes |
/** * A utility method for testing the equality of two arrays of shapes. * * @param s1 the first array (<code>null</code> permitted). * @param s2 the second array (<code>null</code> permitted). * * @return A boolean. */ private boolean equalShapes(Shape[] s1, Shape[] s2) { if (s1 == null) { return s2 == null; } if (s2 == null) { return false; } if (s1.length != s2.length) { return false; } for (int i = 0; i < s1.length; i++) { if (!ShapeUtilities.equal(s1[i], s2[i])) { return false; } } return true; }
Example #18
Source File: XYBarRenderer.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Returns a clone of the renderer. * * @return A clone. * * @throws CloneNotSupportedException if the renderer cannot be cloned. */ @Override public Object clone() throws CloneNotSupportedException { XYBarRenderer result = (XYBarRenderer) super.clone(); if (this.gradientPaintTransformer != null) { result.gradientPaintTransformer = (GradientPaintTransformer) ObjectUtilities.clone(this.gradientPaintTransformer); } result.legendBar = ShapeUtilities.clone(this.legendBar); return result; }
Example #19
Source File: CategoryAxis.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * A utility method for determining the height of a text block. * * @param block the text block. * @param position the label position. * @param g2 the graphics device. * * @return The height. */ protected double calculateTextBlockHeight(TextBlock block, CategoryLabelPosition position, Graphics2D g2) { RectangleInsets insets = getTickLabelInsets(); Size2D size = block.calculateDimensions(g2); Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight()); Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(), 0.0f, 0.0f); double h = rotatedBox.getBounds2D().getHeight() + insets.getTop() + insets.getBottom(); return h; }
Example #20
Source File: XYDifferenceRenderer.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { return false; } return true; }
Example #21
Source File: MultiplePiePlot.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Tests this plot for equality with an arbitrary object. Note that the * plot's dataset is not considered in the equality test. * * @param obj the object (<code>null</code> permitted). * * @return <code>true</code> if this plot is equal to <code>obj</code>, and * <code>false</code> otherwise. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof MultiplePiePlot)) { return false; } MultiplePiePlot that = (MultiplePiePlot) obj; if (this.dataExtractOrder != that.dataExtractOrder) { return false; } if (this.limit != that.limit) { return false; } if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) { return false; } if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint)) { return false; } if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) { return false; } if (!ShapeUtilities.equal(this.legendItemShape, that.legendItemShape)) { return false; } if (!super.equals(obj)) { return false; } return true; }
Example #22
Source File: CategoryAxis.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * A utility method for determining the width of a text block. * * @param block the text block. * @param position the position. * @param g2 the graphics device. * * @return The width. */ protected double calculateTextBlockWidth(TextBlock block, CategoryLabelPosition position, Graphics2D g2) { RectangleInsets insets = getTickLabelInsets(); Size2D size = block.calculateDimensions(g2); Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight()); Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(), 0.0f, 0.0f); double w = rotatedBox.getBounds2D().getWidth() + insets.getLeft() + insets.getRight(); return w; }
Example #23
Source File: CategoryAxis.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * A utility method for determining the width of a text block. * * @param block the text block. * @param position the position. * @param g2 the graphics device. * * @return The width. */ protected double calculateTextBlockWidth(TextBlock block, CategoryLabelPosition position, Graphics2D g2) { RectangleInsets insets = getTickLabelInsets(); Size2D size = block.calculateDimensions(g2); Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight()); Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(), 0.0f, 0.0f); double w = rotatedBox.getBounds2D().getWidth() + insets.getLeft() + insets.getRight(); return w; }
Example #24
Source File: XYBarRenderer.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * Returns a clone of the renderer. * * @return A clone. * * @throws CloneNotSupportedException if the renderer cannot be cloned. */ @Override public Object clone() throws CloneNotSupportedException { XYBarRenderer result = (XYBarRenderer) super.clone(); if (this.gradientPaintTransformer != null) { result.gradientPaintTransformer = (GradientPaintTransformer) ObjectUtilities.clone(this.gradientPaintTransformer); } result.legendBar = ShapeUtilities.clone(this.legendBar); return result; }
Example #25
Source File: ZoomHandlerFX.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * Handles a mouse pressed event by recording the initial mouse pointer * location. * * @param canvas the JavaFX canvas (<code>null</code> not permitted). * @param e the mouse event (<code>null</code> not permitted). */ @Override public void handleMousePressed(ChartCanvas canvas, MouseEvent e) { Point2D pt = new Point2D.Double(e.getX(), e.getY()); Rectangle2D dataArea = canvas.findDataArea(pt); if (dataArea != null) { this.startPoint = ShapeUtilities.getPointInRectangle(e.getX(), e.getY(), dataArea); } else { this.startPoint = null; canvas.clearLiveHandler(); } }
Example #26
Source File: XYDifferenceRenderer.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { return false; } return true; }
Example #27
Source File: XYBarRenderer.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * Returns a clone of the renderer. * * @return A clone. * * @throws CloneNotSupportedException if the renderer cannot be cloned. */ @Override public Object clone() throws CloneNotSupportedException { XYBarRenderer result = (XYBarRenderer) super.clone(); if (this.gradientPaintTransformer != null) { result.gradientPaintTransformer = (GradientPaintTransformer) ObjectUtilities.clone(this.gradientPaintTransformer); } result.legendBar = ShapeUtilities.clone(this.legendBar); return result; }
Example #28
Source File: CategoryAxis.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * A utility method for determining the height of a text block. * * @param block the text block. * @param position the label position. * @param g2 the graphics device. * * @return The height. */ protected double calculateTextBlockHeight(TextBlock block, CategoryLabelPosition position, Graphics2D g2) { RectangleInsets insets = getTickLabelInsets(); Size2D size = block.calculateDimensions(g2); Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight()); Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(), 0.0f, 0.0f); double h = rotatedBox.getBounds2D().getHeight() + insets.getTop() + insets.getBottom(); return h; }
Example #29
Source File: StandardXYItemRenderer.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Tests this renderer for equality with another object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof StandardXYItemRenderer)) { return false; } if (!super.equals(obj)) { return false; } StandardXYItemRenderer that = (StandardXYItemRenderer) obj; if (this.baseShapesVisible != that.baseShapesVisible) { return false; } if (this.plotLines != that.plotLines) { return false; } if (this.plotImages != that.plotImages) { return false; } if (this.plotDiscontinuous != that.plotDiscontinuous) { return false; } if (this.gapThresholdType != that.gapThresholdType) { return false; } if (this.gapThreshold != that.gapThreshold) { return false; } if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } return true; }
Example #30
Source File: ZoomHandlerFX.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Handles a mouse pressed event by recording the initial mouse pointer * location. * * @param canvas the JavaFX canvas (<code>null</code> not permitted). * @param e the mouse event (<code>null</code> not permitted). */ @Override public void handleMousePressed(ChartCanvas canvas, MouseEvent e) { Point2D pt = new Point2D.Double(e.getX(), e.getY()); Rectangle2D dataArea = canvas.findDataArea(pt); if (dataArea != null) { this.startPoint = ShapeUtilities.getPointInRectangle(e.getX(), e.getY(), dataArea); } else { this.startPoint = null; canvas.clearLiveHandler(); } }