Search in sources :

Example 1 with Line

use of ome.xml.model.Line in project bioformats by openmicroscopy.

the class PrintROIs method printShape.

/**
 * Print the given shape.
 */
public static void printShape(Shape shapeObject) {
    if (shapeObject instanceof Ellipse) {
        Ellipse ellipse = (Ellipse) shapeObject;
        System.out.println("    Ellipse:");
        System.out.println("      Text = " + ellipse.getText());
        System.out.println("      X = " + ellipse.getX());
        System.out.println("      Y = " + ellipse.getY());
        System.out.println("      Radius (X) = " + ellipse.getRadiusX());
        System.out.println("      Radius (Y) = " + ellipse.getRadiusY());
    } else if (shapeObject instanceof Line) {
        Line line = (Line) shapeObject;
        System.out.println("    Line:");
        System.out.println("      Text = " + line.getText());
        System.out.println("      X1 = " + line.getX1());
        System.out.println("      Y1 = " + line.getY1());
        System.out.println("      X2 = " + line.getX2());
        System.out.println("      Y2 = " + line.getY2());
    } else if (shapeObject instanceof Point) {
        Point point = (Point) shapeObject;
        System.out.println("    Point:");
        System.out.println("      Text = " + point.getText());
        System.out.println("      X = " + point.getX());
        System.out.println("      Y = " + point.getY());
    } else if (shapeObject instanceof Polyline) {
        Polyline polyline = (Polyline) shapeObject;
        System.out.println("    Polyline:");
        System.out.println("      Text = " + polyline.getText());
        System.out.println("      Points = " + polyline.getPoints());
    } else if (shapeObject instanceof Polygon) {
        Polygon polygon = (Polygon) shapeObject;
        System.out.println("    Polygon:");
        System.out.println("      Text = " + polygon.getText());
        System.out.println("      Points = " + polygon.getPoints());
    } else if (shapeObject instanceof Rectangle) {
        Rectangle rectangle = (Rectangle) shapeObject;
        System.out.println("    Rectangle:");
        System.out.println("      Text = " + rectangle.getText());
    } else if (shapeObject instanceof Mask) {
        Mask mask = (Mask) shapeObject;
        System.out.println("    Mask:");
        System.out.println("      Text = " + mask.getText());
        System.out.println("      X = " + mask.getX());
        System.out.println("      Y = " + mask.getY());
        System.out.println("      Width = " + mask.getWidth());
        System.out.println("      Height = " + mask.getHeight());
    } else if (shapeObject instanceof Label) {
        Label text = (Label) shapeObject;
        System.out.println("    Label:");
        System.out.println("      Text = " + text.getText());
        System.out.println("      X = " + text.getX());
        System.out.println("      Y = " + text.getY());
    }
}
Also used : Line(ome.xml.model.Line) Ellipse(ome.xml.model.Ellipse) Polyline(ome.xml.model.Polyline) Rectangle(ome.xml.model.Rectangle) Mask(ome.xml.model.Mask) Label(ome.xml.model.Label) Point(ome.xml.model.Point) Polygon(ome.xml.model.Polygon)

Example 2 with Line

use of ome.xml.model.Line in project bioformats by openmicroscopy.

the class Schema2011_06_File_Upgrade_Test method testShape9.

@Test(groups = { "11-06-u-roi" }, dependsOnMethods = { "testROI2AndUnion" })
public void testShape9() {
    Assert.assertNotNull(union2);
    shape9 = union2.getShape(3);
    Assert.assertEquals(Line.class.getName(), shape9.getClass().getName());
    Line line9 = (Line) shape9;
    Assert.assertEquals(ref.ROI2Shape9Stroke, line9.getStrokeColor());
    Assert.assertEquals(ref.ROI2Shape9StrokeWidth, line9.getStrokeWidth());
    Assert.assertEquals(ref.ROI2Shape9MarkerEnd, line9.getMarkerEnd());
    Assert.assertEquals(ref.ROI2Shape9LineX1, line9.getX1());
    Assert.assertEquals(ref.ROI2Shape9LineY1, line9.getY1());
    Assert.assertEquals(ref.ROI2Shape9LineX2, line9.getX2());
    Assert.assertEquals(ref.ROI2Shape9LineY2, line9.getY2());
}
Also used : Line(ome.xml.model.Line) Test(org.testng.annotations.Test)

Example 3 with Line

use of ome.xml.model.Line in project bioformats by openmicroscopy.

the class Schema2011_06_File_Upgrade_Test method testShape7.

@Test(groups = { "11-06-u-roi" }, dependsOnMethods = { "testROI2AndUnion" })
public void testShape7() {
    Assert.assertNotNull(union2);
    shape7 = union2.getShape(1);
    Assert.assertEquals(Line.class.getName(), shape7.getClass().getName());
    Line line7 = (Line) shape7;
    Assert.assertEquals(ref.ROI2Shape7Stroke, line7.getStrokeColor());
    Assert.assertEquals(ref.ROI2Shape7StrokeWidth, line7.getStrokeWidth());
    Assert.assertEquals(ref.ROI2Shape7MarkerStart, line7.getMarkerStart());
    Assert.assertEquals(ref.ROI2Shape7MarkerEnd, line7.getMarkerEnd());
    Assert.assertEquals(ref.ROI2Shape7LineX1, line7.getX1());
    Assert.assertEquals(ref.ROI2Shape7LineY1, line7.getY1());
    Assert.assertEquals(ref.ROI2Shape7LineX2, line7.getX2());
    Assert.assertEquals(ref.ROI2Shape7LineY2, line7.getY2());
}
Also used : Line(ome.xml.model.Line) Test(org.testng.annotations.Test)

Example 4 with Line

use of ome.xml.model.Line in project bioformats by openmicroscopy.

the class Schema2011_06_File_Upgrade_Test method testShape8.

@Test(groups = { "11-06-u-roi" }, dependsOnMethods = { "testROI2AndUnion" })
public void testShape8() {
    Assert.assertNotNull(union2);
    shape8 = union2.getShape(2);
    Assert.assertEquals(Line.class.getName(), shape8.getClass().getName());
    Line line8 = (Line) shape8;
    Assert.assertEquals(ref.ROI2Shape8Stroke, line8.getStrokeColor());
    Assert.assertEquals(ref.ROI2Shape8StrokeWidth, line8.getStrokeWidth());
    Assert.assertEquals(ref.ROI2Shape8MarkerEnd, line8.getMarkerEnd());
    Assert.assertEquals(ref.ROI2Shape8LineX1, line8.getX1());
    Assert.assertEquals(ref.ROI2Shape8LineY1, line8.getY1());
    Assert.assertEquals(ref.ROI2Shape8LineX2, line8.getX2());
    Assert.assertEquals(ref.ROI2Shape8LineY2, line8.getY2());
}
Also used : Line(ome.xml.model.Line) Test(org.testng.annotations.Test)

Aggregations

Line (ome.xml.model.Line)4 Test (org.testng.annotations.Test)3 Ellipse (ome.xml.model.Ellipse)1 Label (ome.xml.model.Label)1 Mask (ome.xml.model.Mask)1 Point (ome.xml.model.Point)1 Polygon (ome.xml.model.Polygon)1 Polyline (ome.xml.model.Polyline)1 Rectangle (ome.xml.model.Rectangle)1