/** * Adds a ome.model.annotations.ShapeAnnotationLink to annotationLinks, allowing for recursion -- whether * or not addShapeAnnotationLink will be called on the addition <b>if it is loaded</b> */ public void addShapeAnnotationLink (ome.model.annotations.ShapeAnnotationLink link, boolean bothSides) { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { throwNullCollectionException("AnnotationLinks"); } getAnnotationLinks().add( link ); }
/** * unlinks all ome.model.annotations.Annotation instances from this instance. */ public void unlinkAnnotation (ome.model.annotations.Annotation removal) { if (! _loaded ) errorIfUnloaded(); java.util.Set<ome.model.annotations.ShapeAnnotationLink> toRemove = findShapeAnnotationLink( removal ); java.util.Iterator<ome.model.annotations.ShapeAnnotationLink> it = toRemove.iterator(); while ( it.hasNext() ) { removeShapeAnnotationLink( it.next(), true ); } }
/** * clears the set. */ public void clearAnnotationLinks() { if (! _loaded ) errorIfUnloaded(); java.util.List<ome.model.annotations.ShapeAnnotationLink> list = new java.util.ArrayList<ome.model.annotations.ShapeAnnotationLink>( getAnnotationLinks() ); for (ome.model.annotations.ShapeAnnotationLink link : list) { removeShapeAnnotationLink( link, true ); } }
/** * Returns an unmodifiable collection-view */ public java.util.Collection<ome.model.annotations.ShapeAnnotationLink> unmodifiableAnnotationLinks() { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { return java.util.Collections.emptyList(); } return java.util.Collections.unmodifiableCollection( getAnnotationLinks() ); }
return null; } else if (field.equals(ID)) { return getId(); } else if (field.equals(VERSION)) { return getVersion(); } else if (field.equals(THEZ)) { return getTheZ(); } else if (field.equals(THET)) { return getTheT(); } else if (field.equals(THEC)) { return getTheC(); } else if (field.equals(ROI)) { return getRoi(); } else if (field.equals(LOCKED)) { return getLocked(); } else if (field.equals(TRANSFORM)) { return getTransform(); } else if (field.equals(FILLCOLOR)) { return getFillColor(); } else if (field.equals(FILLRULE)) { return getFillRule(); } else if (field.equals(STROKECOLOR)) { return getStrokeColor(); } else if (field.equals(STROKEDASHARRAY)) { return getStrokeDashArray(); } else if (field.equals(STROKEWIDTH)) { return getStrokeWidth(); } else if (field.equals(FONTFAMILY)) { return getFontFamily();
final ome.model.roi.Roi roi = shape.getRoi(); final ome.model.core.Image img = roi.getImage(); "Fallback value(s) for unattached z/t shapes are out of bounds"); final int theZ = shape.getTheZ() != null ? shape.getTheZ() : zForUnattached; final int theT = shape.getTheT() != null ? shape.getTheT() : tForUnattached; zt_lookup.put(theZ + "/" + theT, shape); final int size_stats = validChannels.size(); final ShapeStats stats = makeStats(size_stats); stats.shapeId = shape.getId(); final double[] sumOfSquares = new double[size_stats];
public void setLocked(java.lang.Boolean locked) { if (! _loaded ) errorIfUnloaded(); this.locked = (java.lang.Boolean) locked; } protected ome.model.roi.AffineTransform transform = null;
@Override public boolean acceptFilter(ome.util.Filter __filter){ try { this.points = (java.lang.String) __filter.filter(POINTS, this.points ); this.textValue = (java.lang.String) __filter.filter(TEXTVALUE, this.textValue ); return super.acceptFilter(__filter); } catch (RuntimeException re) { // ticket:1183 - Caused by Utils.trueClass(Annotation.class) if (re.getCause() instanceof InstantiationException) { this.unload(); return true; } else { throw re; } } }
/** * produces a {@link java.util.List}-copy of the underlying collection. Unlike, * {@link #linkedAnnotationIterator()}, while using the returned {@link java.util.List}, * modifications can be made to the underlying collection without throwing * {@link java.util.ConcurrentModificationException}. */ public java.util.List<ome.model.annotations.Annotation> linkedAnnotationList() { if (! _loaded ) errorIfUnloaded(); java.util.Iterator<ome.model.annotations.Annotation> it = linkedAnnotationIterator(); java.util.List<ome.model.annotations.Annotation> list = new java.util.ArrayList<ome.model.annotations.Annotation>(); while ( it.hasNext() ) { list.add( it.next() ); } return list; }
/** * find all ome.model.annotations.ShapeAnnotationLink which have the argument as their child. */ public java.util.Set<ome.model.annotations.ShapeAnnotationLink> findShapeAnnotationLink( ome.model.annotations.Annotation target ) { if (! _loaded ) errorIfUnloaded(); final java.util.Iterator<ome.model.annotations.ShapeAnnotationLink> it = iterateAnnotationLinks(); final java.util.Set<ome.model.annotations.ShapeAnnotationLink> result = new java.util.HashSet<ome.model.annotations.ShapeAnnotationLink>(); while ( it.hasNext() ) { ome.model.annotations.ShapeAnnotationLink link = it.next(); if ( link.child() == target ) { result.add( link ); } } return result; }
/** * Adds a ome.model.annotations.ShapeAnnotationLink to annotationLinks . This entails changing our annotationLinks Set, * creating a new ome.model.annotations.ShapeAnnotationLink and calling linkAnnotation on the ome.model.annotations.Annotation. */ public ome.model.annotations.ShapeAnnotationLink linkAnnotation (ome.model.annotations.Annotation addition) { if (! _loaded ) errorIfUnloaded(); // Setup link ome.model.annotations.ShapeAnnotationLink link = new ome.model.annotations.ShapeAnnotationLink(); link.link( this, addition ); // Add it to us and possibly the other side. addShapeAnnotationLink( link, true ); return link; }
private ShapeStats makeStats(Pixels pix, ome.model.roi.Shape shape) { // If the shape does not explicitly list any channels, then we will // need to take all the available channels from the pixels. Integer theC = shape.getTheC(); int sizeC = pix.sizeOfChannels(); if (theC != null) { sizeC = 1; } ShapeStats stats = makeStats(sizeC); for (int w = 0; w < sizeC; w++) { if (theC != null) { stats.channelIds[w] = pix.getChannel(theC).getLogicalChannel() .getId(); } else { stats.channelIds[w] = pix.getChannel(w).getLogicalChannel() .getId(); } } return stats; }
.map(shape); final ome.model.roi.Roi roi = shape.getRoi(); final ome.model.core.Image img = roi.getImage(); final ome.model.core.Pixels pix = img.getPrimaryPixels(); stats.shapeId = shape.getId(); final Integer theZ = shape.getTheZ(); // May be null final Integer theT = shape.getTheT(); // May be null
public void setStrokeColor(java.lang.Integer strokeColor) { if (! _loaded ) errorIfUnloaded(); this.strokeColor = (java.lang.Integer) strokeColor; } protected java.lang.String strokeDashArray = null;
/** * should be used rather than accessing the annotationLinks set directly. * This method will never return null, but rather will return an instance * of {@link ome.util.EmptyIterator}. To test for a null collection, * see of {@link #sizeOfAnnotationLinks()} is less than zero. */ public java.util.Iterator<ome.model.annotations.ShapeAnnotationLink> iterateAnnotationLinks() { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { return new ome.util.EmptyIterator<ome.model.annotations.ShapeAnnotationLink>(); } return getAnnotationLinks().iterator(); // TODO should this be direct access }
@Override public boolean acceptFilter(ome.util.Filter __filter){ try { this.d = (java.lang.String) __filter.filter(D, this.d ); this.textValue = (java.lang.String) __filter.filter(TEXTVALUE, this.textValue ); return super.acceptFilter(__filter); } catch (RuntimeException re) { // ticket:1183 - Caused by Utils.trueClass(Annotation.class) if (re.getCause() instanceof InstantiationException) { this.unload(); return true; } else { throw re; } } }
/** * takes a CBlock and calls the block once for each ome.model.annotations.Annotation while * collecting the results. If <code>block == null</code>, then the * iterator values themselves are collected. */ @SuppressWarnings("unchecked") public <E> java.util.List<E> eachLinkedAnnotation(ome.util.CBlock<E> block) { if (! _loaded ) errorIfUnloaded(); java.util.List<E> result = new java.util.ArrayList<E>(); java.util.Iterator<ome.model.annotations.Annotation> it = linkedAnnotationIterator(); while ( it.hasNext() ) { ome.model.annotations.Annotation obj = it.next(); if ( block != null ) { result.add( block.call( obj ) ); } else { result.add( (E) obj ); } } return result; }
/** * takes a CBlock and calls the block once for each ome.model.annotations.ShapeAnnotationLink while * collecting the results. If <code>block == null</code>, then the * iterator values themselves are collected. This method uses * {@link #iterateAnnotationLinks} internally and so will return a value * even if the underlying collection is null. */ @SuppressWarnings("unchecked") public <E> java.util.List<E> collectAnnotationLinks(ome.util.CBlock<E> block) { if (! _loaded ) errorIfUnloaded(); java.util.List<E> result = new java.util.ArrayList<E>(); java.util.Iterator<ome.model.annotations.ShapeAnnotationLink> it = iterateAnnotationLinks(); while ( it.hasNext() ) { IObject obj = (IObject) it.next(); if ( block != null ) { result.add( block.call( obj ) ); } else { result.add( (E) obj ); } } return result; }
/** * removes the given ShapeAnnotationLink from annotationLinks, allowing for recursion -- whether * or not the removal will call unlinkShape again <b>if loaded</b>. */ public void removeShapeAnnotationLink (ome.model.annotations.ShapeAnnotationLink link, boolean bothSides) { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { throwNullCollectionException("AnnotationLinks"); } getAnnotationLinks().remove( link ); }
public void setStrokeDashArray(java.lang.String strokeDashArray) { if (! _loaded ) errorIfUnloaded(); this.strokeDashArray = (java.lang.String) strokeDashArray; } protected ome.model.units.Length strokeWidth = null;