ini.trakem2.display
Class Stack

java.lang.Object
  extended by ini.trakem2.persistence.DBObject
      extended by ini.trakem2.display.Displayable
          extended by ini.trakem2.display.ZDisplayable
              extended by ini.trakem2.display.Stack
All Implemented Interfaces:
ImageData, Paintable

public class Stack
extends ZDisplayable
implements ImageData


Nested Class Summary
 
Nested classes/interfaces inherited from class ini.trakem2.display.Displayable
Displayable.DataPackage, Displayable.DoEdit, Displayable.DoEdits, Displayable.DoTransforms, Displayable.SliderListener
 
Field Summary
 
Fields inherited from class ini.trakem2.display.ZDisplayable
layer_set
 
Fields inherited from class ini.trakem2.display.Displayable
alpha, annotation, at, color, COMPOSITE_ADD, COMPOSITE_COLOR_YCBCR, COMPOSITE_DIFFERENCE, COMPOSITE_MULTIPLY, COMPOSITE_NORMAL, COMPOSITE_SUBTRACT, compositeModes, height, hs_linked, last_color, layer, linked_props, linked_props_origins, locked, props, TAG_ATTR1, TAG_ATTR2, title, visible, width
 
Fields inherited from class ini.trakem2.persistence.DBObject
id, project
 
Constructor Summary
Stack(Project project, long id, java.util.HashMap<java.lang.String,java.lang.String> ht, java.util.HashMap<Displayable,java.lang.String> ht_links)
          Construct a Stack from an XML entry.
Stack(Project project, java.lang.String title, double x, double y, Layer initial_layer, java.lang.String file_path)
           
 
Method Summary
protected  boolean calculateBoundingBox(Layer la)
           
 Displayable clone(Project pr, boolean copy_id)
          Performs a deep copy of this object, obtaining its unique id either from the given project or the exact same as this object's id.
 long estimateImageFileSize()
           
static void exportDTD(java.lang.StringBuilder sb_header, java.util.HashSet<java.lang.String> hs, java.lang.String indent)
           
 void exportXML(java.lang.StringBuilder sb_body, java.lang.String indent, java.lang.Object any)
          Opens and closes the tag and exports data.
protected  java.awt.Rectangle getBounds(java.awt.Rectangle rect)
          Bounding box of the transformed data (or 0,0,0,0 when no data).
 java.lang.String getFilePath()
           
 Layer getFirstLayer()
          Returns the layer of lowest Z coordinate where this ZDisplayable has a point in.
 InvertibleCoordinateTransform getInvertibleCoordinateTransform()
           
 java.awt.Polygon getPerimeter()
          For now, just returns the bounding box---we can refine this later
 boolean intersects(java.awt.geom.Area area, double z_first, double z_last)
           
 boolean isDeletable()
           
 boolean linkPatches()
          Link the Patch objects that lay underneath the part of the bounding box of this profile that shows in the current layer, so that they cannot be dragged independently.
 void paint(java.awt.Graphics2D g, java.awt.Rectangle srcRect, double magnification, boolean active, int channels, Layer active_layer, java.util.List<Layer> layers)
          Slow paint: will wait until the image is generated and cached, then paint it.
 void prePaint(java.awt.Graphics2D g, java.awt.Rectangle srcRect, double magnification, boolean active, int channels, Layer active_layer, java.util.List<Layer> _ignored)
          Will not paint but fork a task to create an image to paint later, when not already cached.
 boolean remove2(boolean check)
          Avoid calling the trees: the stack exists only in the LayerSet ZDisplayable's list.
 void setAffineTransform(java.awt.geom.AffineTransform at)
          Sets the matrix values of this Displayable's AffineTransform to those of the given AffineTransform.
 void setFilePath(java.lang.String path)
          Will decache the ImagePlus if loaded.
 void setInvertibleCoordinateTransform(InvertibleCoordinateTransform ict)
           
 void setInvertibleCoordinateTransformSilently(InvertibleCoordinateTransform ict)
          For reconstruction purposes, overwrites the present InvertibleCoordinateTransform, if any, with the given one.
 
Methods inherited from class ini.trakem2.display.ZDisplayable
crop, exportDTD, getBucketable, getLayerIds, getLayerSet, layerRemoved, paintsAt, remove, setColor, setLayer, setLayerSet, setLayerSet, setPosition, setVisible, softRemove, transformPoints, updateBucket, updateBucket
 
Methods inherited from class ini.trakem2.display.Displayable
adjustProperties, areThereLayerCrossLinks, canSendTo, clone, clone, commonDTDChildren, contains, contains, deselect, destroy, displacePoints, exportSVG, findById, findNearestPoint, findNearestPoint, getAffineTransform, getAffineTransformCopy, getAlpha, getAnnotation, getArea, getAreaAt, getAreaForBucket, getBoundingBox, getBoundingBox, getBoundingBox, getBounds, getColor, getComposite, getComposite, getCompositeMode, getHeight, getIntersection, getLayer, getLayersWithData, getLinked, getLinked, getLinkedBox, getLinkedGroup, getLinkedProperties, getLinkedProperties, getLinkedProperty, getLinkedProperty, getMinimalBoundingBox, getNameId, getPerimeter, getProperties, getProperty, getProperty, getShortTitle, getTitle, getWidth, getX, getXMLSafeValue, getXMLSafeValue, getY, hasLinkedGroupWithinLayer, hasProperties, intersects, intersects, intersects, intersects, inverseTransformPoint, isLinked, isLinked, isLinked, isLocked, isLocked2, isOnlyLinkedTo, isOnlyLinkedTo, isOutOfRepaintingClip, isOutOfRepaintingClip, isRoughlyInside, isVisible, keyPressed, link, link, makeAdjustPropertiesDialog, measure, mouseDragged, mousePressed, mouseReleased, mouseWheelMoved, paintAsBox, paintOffscreen, paintSnapshot, preTransform, processAdjustPropertiesDialog, removeLinkedProperties, removeLinkedPropertiesFromOrigins, repaint, restXML, rotate, rotate, rotatePoints, scale, scale, scalePoints, setAlpha, setAlpha, setAnnotation, setCompositeMode, setDimensions, setDimensions, setLayer, setLinkedProperties, setLinkedProperty, setLocation, setLocked, setProperty, setTitle, setVisible, snapTo, toString, transform, transformPoint, transformPoint, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformRectangle, translate, translate, unlink, unlink, unlinkAll, updateInDatabase, xmlError, xmlError
 
Methods inherited from class ini.trakem2.persistence.DBObject
addToDatabase, getId, getInfo, getProject, getUniqueIdentifier, removeFromDatabase, updateInDatabase
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Stack

public Stack(Project project,
             java.lang.String title,
             double x,
             double y,
             Layer initial_layer,
             java.lang.String file_path)

Stack

public Stack(Project project,
             long id,
             java.util.HashMap<java.lang.String,java.lang.String> ht,
             java.util.HashMap<Displayable,java.lang.String> ht_links)
Construct a Stack from an XML entry.

Method Detail

getInvertibleCoordinateTransform

public InvertibleCoordinateTransform getInvertibleCoordinateTransform()

getFirstLayer

public Layer getFirstLayer()
Description copied from class: ZDisplayable
Returns the layer of lowest Z coordinate where this ZDisplayable has a point in.

Specified by:
getFirstLayer in class ZDisplayable

intersects

public boolean intersects(java.awt.geom.Area area,
                          double z_first,
                          double z_last)
Specified by:
intersects in class ZDisplayable

linkPatches

public boolean linkPatches()
Description copied from class: ZDisplayable
Link the Patch objects that lay underneath the part of the bounding box of this profile that shows in the current layer, so that they cannot be dragged independently.

Specified by:
linkPatches in class ZDisplayable
Returns:
whether the locking state changed.

clone

public Displayable clone(Project pr,
                         boolean copy_id)
Description copied from class: Displayable
Performs a deep copy of this object, obtaining its unique id either from the given project or the exact same as this object's id. The visibility, though, is set to true at all times.

Specified by:
clone in class Displayable

isDeletable

public boolean isDeletable()
Specified by:
isDeletable in class Displayable

getFilePath

public java.lang.String getFilePath()

setFilePath

public void setFilePath(java.lang.String path)
Will decache the ImagePlus if loaded.


estimateImageFileSize

public long estimateImageFileSize()

paint

public void paint(java.awt.Graphics2D g,
                  java.awt.Rectangle srcRect,
                  double magnification,
                  boolean active,
                  int channels,
                  Layer active_layer,
                  java.util.List<Layer> layers)
Slow paint: will wait until the image is generated and cached, then paint it.

Specified by:
paint in interface Paintable
Overrides:
paint in class Displayable

prePaint

public void prePaint(java.awt.Graphics2D g,
                     java.awt.Rectangle srcRect,
                     double magnification,
                     boolean active,
                     int channels,
                     Layer active_layer,
                     java.util.List<Layer> _ignored)
Will not paint but fork a task to create an image to paint later, when not already cached.

Specified by:
prePaint in interface Paintable
Overrides:
prePaint in class Displayable

exportDTD

public static final void exportDTD(java.lang.StringBuilder sb_header,
                                   java.util.HashSet<java.lang.String> hs,
                                   java.lang.String indent)

exportXML

public void exportXML(java.lang.StringBuilder sb_body,
                      java.lang.String indent,
                      java.lang.Object any)
Opens and closes the tag and exports data. The image is saved in the directory provided in @param any as a String.

Overrides:
exportXML in class ZDisplayable

getBounds

protected java.awt.Rectangle getBounds(java.awt.Rectangle rect)
Description copied from class: Displayable
Bounding box of the transformed data (or 0,0,0,0 when no data). Returns the same Rectangle, modified.

Overrides:
getBounds in class Displayable

getPerimeter

public java.awt.Polygon getPerimeter()
For now, just returns the bounding box---we can refine this later

Overrides:
getPerimeter in class Displayable

setInvertibleCoordinateTransformSilently

public void setInvertibleCoordinateTransformSilently(InvertibleCoordinateTransform ict)
For reconstruction purposes, overwrites the present InvertibleCoordinateTransform, if any, with the given one.


setInvertibleCoordinateTransform

public void setInvertibleCoordinateTransform(InvertibleCoordinateTransform ict)

setAffineTransform

public void setAffineTransform(java.awt.geom.AffineTransform at)
Description copied from class: Displayable
Sets the matrix values of this Displayable's AffineTransform to those of the given AffineTransform.

Overrides:
setAffineTransform in class Displayable

remove2

public boolean remove2(boolean check)
Avoid calling the trees: the stack exists only in the LayerSet ZDisplayable's list.

Overrides:
remove2 in class ZDisplayable

calculateBoundingBox

protected boolean calculateBoundingBox(Layer la)
Specified by:
calculateBoundingBox in class ZDisplayable