use of ome.xml.model.Label 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());
}
}
use of ome.xml.model.Label in project bioformats by openmicroscopy.
the class Upgrade201106Test method validateUpgrade.
@Test
public void validateUpgrade() throws ServiceException {
assertEquals(1, ome.sizeOfImageList());
Image image = ome.getImage(0);
assertNotNull(image.getAcquisitionDate());
assertEquals(1, ome.sizeOfROIList());
ROI roi = ome.getROI(0);
Union union = roi.getUnion();
assertEquals(1, union.sizeOfShapeList());
Shape shape = union.getShape(0);
assertTrue(shape instanceof Label);
assertNotNull(shape.getText());
}
use of ome.xml.model.Label in project bioformats by openmicroscopy.
the class Schema2011_06_File_Upgrade_Test method testShape3.
@Test(groups = { "11-06-u-roi" }, dependsOnMethods = { "testROI2AndUnion" })
public void testShape3() {
Assert.assertNotNull(union2);
shape3 = union2.getShape(0);
Assert.assertEquals(Label.class.getName(), shape3.getClass().getName());
Label label3 = (Label) shape3;
Assert.assertEquals(ref.ROI2Shape3FillRule, label3.getFillRule());
Assert.assertEquals(ref.ROI2Shape3FontFamily, label3.getFontFamily());
Assert.assertEquals(ref.ROI2Shape3FontStyle, label3.getFontStyle());
Assert.assertEquals(ref.ROI2Shape3TextX, label3.getX());
Assert.assertEquals(ref.ROI2Shape3TextY, label3.getY());
Assert.assertEquals(ref.ROI2Shape3TextValue, label3.getText());
}
use of ome.xml.model.Label in project bioformats by openmicroscopy.
the class Schema2011_06_File_Upgrade_Test method testShape13.
@Test(groups = { "11-06-u-roi" }, dependsOnMethods = { "testROI4AndUnion" })
public void testShape13() {
Assert.assertNotNull(union4);
shape13 = union4.getShape(1);
Assert.assertEquals(Label.class.getName(), shape13.getClass().getName());
Label label13 = (Label) shape13;
Assert.assertEquals(MESSAGE_REMOVED_PATH, label13.getText());
Assert.assertEquals(Double.valueOf(0), label13.getX());
Assert.assertEquals(Double.valueOf(0), label13.getY());
}
use of ome.xml.model.Label in project bioformats by openmicroscopy.
the class Schema2011_06_File_Upgrade_Test method testShape11.
@Test(groups = { "11-06-u-roi" }, dependsOnMethods = { "testROI3AndUnion" })
public void testShape11() {
Assert.assertNotNull(union3);
shape11 = union3.getShape(0);
Assert.assertEquals(Label.class.getName(), shape11.getClass().getName());
Label label11 = (Label) shape11;
Assert.assertEquals(MESSAGE_REMOVED_PATH, label11.getText());
Assert.assertEquals(Double.valueOf(0), label11.getX());
Assert.assertEquals(Double.valueOf(0), label11.getY());
}
Aggregations