public String getShapeType(int ROIIndex, int shapeIndex) { Shape o = (Shape) root.getROI(ROIIndex).getUnion().getShape(shapeIndex); String className = o.getClass().getName(); return className.substring( className.lastIndexOf('.') + 1, className.length()); }
public int getShapeCount(int ROIIndex) { // Parents: {u'Union': {u'ROI': {u'OME': None}}} // Shape is not a reference return root.getROI(ROIIndex).getUnion().sizeOfShapeList(); }
public Element asXMLElement(Document document) { return asXMLElement(document, null); }
public void setEllipseFillColor(Color fillColor, int ROIIndex, int shapeIndex) { // Parents: None // FillColor is not a reference OME o0 = root; if (o0.sizeOfROIList() == ROIIndex) { o0.addROI(new ROI()); } ROI o1 = o0.getROI(ROIIndex); if (o1.getUnion() == null) { o1.setUnion(new Union()); } Union o2 = o1.getUnion(); if (o2.sizeOfShapeList() == shapeIndex) { o2.addShape(new Ellipse()); } Ellipse o3 = (Ellipse) o2.getShape(shapeIndex); o3.setFillColor(fillColor); }
@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()); }
/** * Constructs Union recursively from an XML DOM tree. * @param element Root of the XML DOM tree to construct a model object * graph from. * @param model Handler for the OME model which keeps track of instances * and references seen during object population. * @throws EnumerationException If there is an error instantiating an * enumeration during model object creation. */ public Union(Element element, OMEModel model) throws EnumerationException { update(element, model); }
public void setEllipseFontStyle(FontStyle fontStyle, int ROIIndex, int shapeIndex) { // Parents: None // FontStyle is not a reference OME o0 = root; if (o0.sizeOfROIList() == ROIIndex) { o0.addROI(new ROI()); } ROI o1 = o0.getROI(ROIIndex); if (o1.getUnion() == null) { o1.setUnion(new Union()); } Union o2 = o1.getUnion(); if (o2.sizeOfShapeList() == shapeIndex) { o2.addShape(new Ellipse()); } Ellipse o3 = (Ellipse) o2.getShape(shapeIndex); o3.setFontStyle(fontStyle); }
@Test(dependsOnMethods={"testValidOMENode"}) public void testValidROINode() { ROI roi = ome.getROI(0); assertNotNull(roi); assertEquals(ROI_ID, roi.getID()); Union shapeUnion = roi.getUnion(); assertNotNull(shapeUnion); assertEquals(1, shapeUnion.sizeOfShapeList()); Shape s = shapeUnion.getShape(0); assertNotNull(s); assertEquals(SHAPE_ID, s.getID()); assertTrue(s instanceof Rectangle); Rectangle rect = (Rectangle) s; assertEquals(RECTANGLE_X, rect.getX()); assertEquals(RECTANGLE_Y, rect.getY()); assertEquals(RECTANGLE_WIDTH, rect.getWidth()); assertEquals(RECTANGLE_HEIGHT, rect.getHeight()); }
/** * Constructs Union recursively from an XML DOM tree. * @param element Root of the XML DOM tree to construct a model object * graph from. * @param model Handler for the OME model which keeps track of instances * and references seen during object population. * @throws EnumerationException If there is an error instantiating an * enumeration during model object creation. */ public Union(Element element, OMEModel model) throws EnumerationException { update(element, model); }
public void setEllipseStrokeColor(Color strokeColor, int ROIIndex, int shapeIndex) { // Parents: None // StrokeColor is not a reference OME o0 = root; if (o0.sizeOfROIList() == ROIIndex) { o0.addROI(new ROI()); } ROI o1 = o0.getROI(ROIIndex); if (o1.getUnion() == null) { o1.setUnion(new Union()); } Union o2 = o1.getUnion(); if (o2.sizeOfShapeList() == shapeIndex) { o2.addShape(new Ellipse()); } Ellipse o3 = (Ellipse) o2.getShape(shapeIndex); o3.setStrokeColor(strokeColor); }
public FontStyle getEllipseFontStyle(int ROIIndex, int shapeIndex) { // Parents: None // FontStyle is not a reference return ((Ellipse)root.getROI(ROIIndex).getUnion().getShape(shapeIndex)).getFontStyle(); }
public int getShapeCount(int ROIIndex) { // Parents: {u'Union': {u'ROI': {u'OME': None}}} // Shape is not a reference return root.getROI(ROIIndex).getUnion().sizeOfShapeList(); }
public Element asXMLElement(Document document) { return asXMLElement(document, null); }
public void setEllipseStrokeDashArray(String strokeDashArray, int ROIIndex, int shapeIndex) { // Parents: None // StrokeDashArray is not a reference OME o0 = root; if (o0.sizeOfROIList() == ROIIndex) { o0.addROI(new ROI()); } ROI o1 = o0.getROI(ROIIndex); if (o1.getUnion() == null) { o1.setUnion(new Union()); } Union o2 = o1.getUnion(); if (o2.sizeOfShapeList() == shapeIndex) { o2.addShape(new Ellipse()); } Ellipse o3 = (Ellipse) o2.getShape(shapeIndex); o3.setStrokeDashArray(strokeDashArray); }
public String getEllipseID(int ROIIndex, int shapeIndex) { // Parents: None // ID is not a reference return ((Ellipse)root.getROI(ROIIndex).getUnion().getShape(shapeIndex)).getID(); }
@Test (groups = {"11-06-u-roi"}, dependsOnMethods = {"testOmeNode"}) public void testROI2AndUnion() { Assert.assertNotNull(ome); roi2 = ome.getROI(2); Assert.assertNull(roi2.getDescription()); Assert.assertNull(roi2.getName()); union2 = roi2.getUnion(); Assert.assertNotNull(union2); Assert.assertEquals(8, union2.sizeOfShapeList()); }
public void setEllipseStrokeWidth(Length strokeWidth, int ROIIndex, int shapeIndex) { // Parents: None // StrokeWidth is not a reference OME o0 = root; if (o0.sizeOfROIList() == ROIIndex) { o0.addROI(new ROI()); } ROI o1 = o0.getROI(ROIIndex); if (o1.getUnion() == null) { o1.setUnion(new Union()); } Union o2 = o1.getUnion(); if (o2.sizeOfShapeList() == shapeIndex) { o2.addShape(new Ellipse()); } Ellipse o3 = (Ellipse) o2.getShape(shapeIndex); o3.setStrokeWidth(strokeWidth); }
public Boolean getEllipseLocked(int ROIIndex, int shapeIndex) { // Parents: None // Locked is not a reference return ((Ellipse)root.getROI(ROIIndex).getUnion().getShape(shapeIndex)).getLocked(); }
@Test (groups = {"11-06-u-roi"}, dependsOnMethods = {"testOmeNode"}) public void testROI1AndUnion() { Assert.assertNotNull(ome); roi1 = ome.getROI(1); Assert.assertEquals(ref.ROI1Description, roi1.getDescription()); Assert.assertNull(roi1.getName()); union1 = roi1.getUnion(); Assert.assertNotNull(union1); Assert.assertEquals(1, union1.sizeOfShapeList()); }
public void setEllipseTransform(AffineTransform transform, int ROIIndex, int shapeIndex) { // Parents: None // Transform is not a reference OME o0 = root; if (o0.sizeOfROIList() == ROIIndex) { o0.addROI(new ROI()); } ROI o1 = o0.getROI(ROIIndex); if (o1.getUnion() == null) { o1.setUnion(new Union()); } Union o2 = o1.getUnion(); if (o2.sizeOfShapeList() == shapeIndex) { o2.addShape(new Ellipse()); } Ellipse o3 = (Ellipse) o2.getShape(shapeIndex); o3.setTransform(transform); }