ini.trakem2.display
Class LayerSet

java.lang.Object
  extended by ini.trakem2.persistence.DBObject
      extended by ini.trakem2.display.Displayable
          extended by ini.trakem2.display.LayerSet
All Implemented Interfaces:
Bucketable, Paintable

public final class LayerSet
extends Displayable
implements Bucketable

A LayerSet is a container for a list of Layer. LayerSet methods are NOT synchronized. It is your reponsibility to synchronize access to a LayerSet instance methods. Failure to do so may result in corrupted internal data structures and overall misbehavior.


Nested Class Summary
protected static class LayerSet.DoChangeTrees
          Records the state of the LayerSet.al_layers, each Layer.al_displayables and all the trees and unique types of Project.
protected  class LayerSet.LayerBucket
          A Bucket for the ZDisplayable parts that show in every Layer.
 
Nested classes/interfaces inherited from class ini.trakem2.display.Displayable
Displayable.DataPackage, Displayable.DoEdit, Displayable.DoEdits, Displayable.DoTransforms, Displayable.SliderListener
 
Field Summary
static java.lang.String[] ANCHORS
           
protected  boolean area_color_cues
           
static int BOTTOM
           
static int CENTER
           
protected  boolean color_cues
           
static int DOWN
           
static int EAST
           
static int FLIP_HORIZONTAL
           
static int FLIP_VERTICAL
           
protected  java.util.HashMap<Layer,LayerSet.LayerBucket> lbucks
          For fast search.
protected  int n_layers_color_cue
           
static int NORTH
           
static int NORTHEAST
           
static int NORTHWEST
           
protected  boolean paint_arrows
           
protected  boolean paint_edge_confidence_boxes
           
protected  boolean prepaint
           
static int R270
           
static int R90
           
static java.lang.String[] ROTATIONS
           
static java.lang.String[] snapshot_modes
           
static int SOUTH
           
static int SOUTHEAST
           
static int SOUTHWEST
           
protected  java.util.Map<java.lang.Integer,java.util.HashMap<java.lang.String,Tag>> tags
          A set of unique tags, retrievable by their own identity.
static int TOP
           
static int UP
           
protected  boolean use_color_cue_colors
           
static int WEST
           
 
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
protected LayerSet(Project project, long id)
          Dummy.
  LayerSet(Project project, long id, java.util.HashMap<java.lang.String,java.lang.String> ht_attributes, java.util.HashMap<Displayable,java.lang.String> ht_links)
          Reconstruct from an XML entry.
  LayerSet(Project project, long id, java.lang.String title, float width, float height, double rot_x, double rot_y, double rot_z, float layer_width, float layer_height, boolean locked, int snapshots_mode, java.awt.geom.AffineTransform at)
          Reconstruct from the database.
  LayerSet(Project project, java.lang.String title, double x, double y, Layer parent, float layer_width, float layer_height)
          Create a new LayerSet with a 0,0,0 rotation vector and default 20,20 px Displayable width,height.
 
Method Summary
 void add(Layer layer)
          Add a new Layer, inserted according to its Z.
 void add(ZDisplayable zdispl)
          Add a Displayable to be painted in all Layers, such as a Pipe.
 void addAll(java.util.Collection<? extends ZDisplayable> coll)
           
 LayerSet.DoChangeTrees addChangeTreesStep()
          Add a step to undo the addition or deletion of one or more objects in this project and LayerSet.
 LayerSet.DoChangeTrees addChangeTreesStep(java.util.Set<DoStep> dependents)
          Add a step to undo the addition or deletion of one or more objects in this project and LayerSet, along with an arbitrary set of steps that may alter, for example the data.
 void addLayerContentStep(Layer la)
          For the Displayable contained in a Layer: their number, and their stack order.
 void addLayerEditedStep(Layer layer)
          For the Z and thickness of a layer.
 void addLayerEditedStep(java.util.List<Layer> al)
          For the Z and thickness of a list of layers.
 void addSilently(Layer layer)
          Add a new Layer silently, ordering by z as well.
 void addSilently(ZDisplayable zdispl)
          Used for reconstruction purposes, avoids repainting or updating.
 void addTransformStep()
          Add an undo step for the transformations of all Displayable in all layers.
 void addTransformStep(java.util.Collection<? extends Displayable> col)
          Add an undo step for the transformations of all Displayable in hs.
 void addTransformStep(Layer layer)
          Add an undo step for the transformations of all Displayable in the layer.
 void addTransformStep(java.util.List<Layer> layers)
           
 Displayable.DoEdits addTransformStepWithData(java.util.Collection<? extends Displayable> col)
          Add an undo step for the transformations of all Displayable in col, with data as well (for Patch, data includes the CoordinateTransform).
 java.util.Collection<Displayable> addTransformStepWithDataForAll(java.util.Collection<Layer> layers)
          Includes all ZDisplayable that paint at any of the given layers.
 void addUndoStep(DoStep step)
           
static void applyTransforms(java.util.Map<Displayable,java.awt.geom.AffineTransform> m)
           
protected  Tag askForNewTag(int keyCode)
           
protected  boolean askToRemoveTag(int keyCode)
          Returns false if the dialog was canceled or there wasn't any tag to remove.
 boolean canRedo()
           
 boolean canUndo()
           
 void checkBuckets()
          Checks only buckets for ZDisplayable, not any related to any layer.
 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.
 Displayable clone(Project pr, Layer first, Layer last, java.awt.Rectangle roi, boolean add_to_tree, boolean copy_id)
          Clone the contents of this LayerSet, from first to last given layers, and cropping for the given rectangle; does NOT copy the ZDisplayable, which may be copied using the LayerSet.cloneInto method.
static void cloneInto(LayerSet src, Layer src_first, Layer src_last, Project pr, LayerSet copy, java.awt.Rectangle roi, boolean copy_id)
           
 boolean contains(java.lang.Class<?> c)
          Returns true if any of the ZDisplayable objects are of the given class.
 boolean contains(Displayable zdispl)
           
 boolean contains(Layer layer)
           
 boolean containsDisplayable(java.lang.Class<?> c)
          Check in all layers.
 LayerSet create(Layer parent_layer)
          Create a new LayerSet in the middle of the parent Layer.
 LayerStack createLayerStack(java.lang.Class<?> clazz, int type, int c_alphas)
          Create a virtual layer stack that acts as a virtual ij.ImageStack, in RGB and set to a scale of max_dimension / Math.max(layer_width, layer_height).
 void destroy()
          Release resources.
 void enlargeToFit(java.util.Collection<? extends Displayable> ds)
          Enlarge the 2D universe so that all Displayable in the collection fit in it; that is, that no Displayable has a negative x,y position or lays beyond bounds.
 boolean enlargeToFit(Displayable d, int anchor)
          Enlarges the display in the given direction; the anchor is the point to keep still, and can be any of LayerSet.NORTHWEST (top-left), etc.
static void exportDTD(java.lang.StringBuilder sb_header, java.util.HashSet<java.lang.String> hs, java.lang.String indent)
          Includes the !ELEMENT
 java.lang.String exportTags()
           
 void exportXML(java.io.Writer writer, java.lang.String indent, java.lang.Object any)
           
 java.util.ArrayList<Displayable> find(java.lang.Class<?> c, Layer layer, java.awt.geom.Area aroi, boolean visible_only)
          Find any Displayable or ZDisplayable objects of class C which intersect with the Area @param aroi.
 java.util.ArrayList<Displayable> find(java.lang.Class<?> c, Layer layer, java.awt.geom.Area aroi, boolean visible_only, boolean instance_of)
          Find any Displayable or ZDisplayable objects of class C which intersect with the Area @param aroi.
 java.util.ArrayList<Displayable> find(java.lang.Class<?> c, Layer layer, int x, int y, boolean visible_only)
           
 java.util.ArrayList<ZDisplayable> find(Layer first, Layer last, java.awt.geom.Area area)
          Find the ZDisplayable objects that intersect with the 3D roi defined by the first and last layers, and the area -all in world coordinates.
protected  java.util.Map<Displayable,java.util.List<java.awt.geom.Area>> findAreas(Layer layer, java.awt.Rectangle box, boolean visible)
          Find all java.awt.geom.Area in layer that intersect with box, if visible.
 DBObject findById(long id)
          Searches in all ZDisplayables and in all layers, recursively into nested LayerSets.
 Displayable findDisplayable(long id)
          Searches in all layers.
 java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c, Layer layer, java.awt.geom.Area aroi, boolean visible_only, boolean instance_of)
          Find ZDisplayable objects of the given class that intersect the given area in the given layer.
 java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c, Layer layer, int x, int y, boolean visible_only)
          Find ZDisplayable objects of Class c that contain the point x,y in the given layer.
 java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c, Layer layer, int x, int y, boolean visible_only, boolean instance_of)
          Find ZDisplayable objects of Class c that contain the point x,y in the given layer.
 java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c, Layer layer, java.awt.Rectangle r, boolean visible_only)
           
 java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c, Layer layer, java.awt.Rectangle r, boolean visible_only, boolean instance_of)
          Find ZDisplayable objects of the given class that intersect the given rectangle in the given layer.
 java.util.Collection<Displayable> findZDisplayables(Layer layer, int x, int y, boolean visible_only)
          Find ZDisplayable objects that contain the point x,y in the given layer.
 java.util.Collection<Displayable> findZDisplayables(Layer layer, java.awt.Rectangle r, boolean visible_only)
          Find ZDisplayable objects that intersect the given rectangle in the given layer.
 java.util.ArrayList<Displayable> get(java.util.ArrayList<Displayable> all, java.lang.Class<?> c)
          Find, in this LayerSet and contained layers and their nested LayerSets if any, all Displayable instances of Class c, which are stored in the given ArrayList; returns the same ArrayList, or a new one if its null.
 java.util.ArrayList<Displayable> get(java.lang.Class<?> c)
          Find, in this LayerSet and contained layers and their nested LayerSets if any, all Displayable instances of Class c.
 java.awt.Rectangle get2DBounds()
          Returns a new Rectangle of 0, 0, layer_width, layer_height.
<T extends Displayable>
java.util.List<T>
getAll(java.lang.Class<T> c)
          Get all Displayable or ZDisplayable of the given class.
 java.util.HashMap<Displayable,java.util.HashSet<Bucket>> getBucketMap(Layer la)
           
 ij.measure.Calibration getCalibration()
           
 ij.measure.Calibration getCalibrationCopy()
           
 java.util.List<Layer> getColorCueLayerRange(Layer active_layer)
          Returns the list of layers to paint by considering the range of n_layers_color_cue around the active layer index.
 double getDepth()
          Returns the distance from the first layer's Z to the last layer's Z.
 java.util.ArrayList<ZDisplayable> getDisplayableList()
          Returns the real list of displayables, not a copy.
 java.util.ArrayList<Displayable> getDisplayables()
          Return all the Displayable objects from all the layers of this LayerSet.
 java.util.ArrayList<Displayable> getDisplayables(java.lang.Class<?> c)
          Return all the Displayable objects from all the layers of this LayerSet of the given class.
 java.util.ArrayList<Displayable> getDisplayables(java.lang.Class<?> c, java.awt.geom.Area aroi, boolean visible_only)
          Return all the Displayable objects from all the layers of this LayerSet of the given class that intersect the given area.
 Layer getLayer(double z)
          Returns the first layer found with the given Z coordinate, rounded to seventh decimal precision, or null if none found.
 Layer getLayer(double z, double thickness, boolean create)
          Returns null if none has the given z and thickness.
 Layer getLayer(int i)
          Find a layer by index, or null if none.
 Layer getLayer(long id)
          Find a layer with the given id, or null if none.
 Layer getLayer(java.lang.Long id)
          Same as getLayer(long) but without box/unbox.
 float getLayerHeight()
           
 int getLayerIndex(long id)
           
 java.util.ArrayList<Layer> getLayers()
          Returns a copy of the layer list.
 java.util.List<Layer> getLayers(int first, int last)
          Returns a sublist of layers from first to last, both inclusive.
 java.util.List<Layer> getLayers(Layer first, Layer last)
          Returns the layer range from first to last, both included.
 float getLayerWidth()
           
 java.awt.Rectangle getMinimalBoundingBox(java.lang.Class<?> c)
          Returns the minimal 2D bounding box for Displayables of class @param c in all layers.
 Layer getNearestLayer(double z)
           
 java.util.ArrayList<Layer> getNeighborLayers(Layer layer, int n)
          Get up to 'n' layers before and after the given layers.
 Overlay getOverlay()
          Return the current Overlay or a new one if none yet.
 Layer getParent()
           
 int getPixelsMaxDimension()
           
 double getRotX()
           
 double getRotY()
           
 double getRotZ()
           
 int getSnapshotsMode()
           
 java.util.TreeSet<Tag> getTags(int keyCode)
          If there aren't any tags for keyCode, returns an empty TreeSet.
 double getVirtualizationScale()
          From 0.000...
 java.util.ArrayList<ZDisplayable> getZDisplayables()
          Returns a copy of the list of ZDisplayable objects.
 java.util.ArrayList<ZDisplayable> getZDisplayables(java.lang.Class<?> c)
           
 java.util.ArrayList<ZDisplayable> getZDisplayables(java.lang.Class<?> c, boolean instance_of)
          Returns a list of ZDisplayable of class c only.
 java.util.ArrayList<ZDisplayable> getZDisplayables(java.lang.Class<?> c, Layer layer, java.awt.geom.Area aroi, boolean visible_only)
          Deprecated. 
 java.util.ArrayList<ZDisplayable> getZDisplayables(java.lang.Class<?> c, Layer layer, java.awt.geom.Area aroi, boolean visible_only, boolean instance_of)
          Deprecated. 
 java.lang.Object grab(int first, int last, java.awt.Rectangle r, double scale, java.lang.Class<?> c, int c_alphas, int format, int type)
          Returns the region defined by the rectangle as an image in the type and format specified.
 java.util.HashSet<Displayable> hideExcept(java.util.ArrayList<java.lang.Class<?>> type, boolean repaint)
          Hide all except those whose type is in 'type' list, whose visibility flag is left unchanged.
 void importTags(java.lang.String path, boolean replace)
           
 int indexOf(Layer layer)
          From zero to size-1.
 int indexOf(ZDisplayable zd)
          Returns the reverse index of ZDisplayable zd, which is the actual index as seen in the screen.
protected  boolean isBottom(Displayable d)
          Hub method: ZDisplayable or into the Displayable's Layer.
 boolean isBottom(ZDisplayable zd)
           
 boolean isCalibrated()
           
 boolean isDeletable()
           
 boolean isEmptyAt(Layer layer)
           
 boolean isPixelsVirtualizationEnabled()
           
protected  boolean isTop(Displayable d)
          Hub method: ZDisplayable or into the Displayable's Layer.
 boolean isTop(ZDisplayable zd)
           
 void keyPressed(java.awt.event.KeyEvent ke)
           
 void mouseDragged(java.awt.event.MouseEvent me, int x_p, int y_p, int x_d, int y_d, int x_d_old, int y_d_old, java.awt.Rectangle srcRect, double mag)
           
 void mousePressed(java.awt.event.MouseEvent me, int x_p, int y_p, java.awt.Rectangle srcRect, double mag)
           
 void mouseReleased(java.awt.event.MouseEvent me, int x_p, int y_p, int x_d, int y_d, int x_r, int y_r, java.awt.Rectangle srcRect, double mag)
           
protected  void move(int place, Displayable d)
          Change z position in the layered stack, which defines the painting order.
 void move(java.util.Set<Displayable> hs_d, Layer source, Layer target)
          Move all Displayable objects in the HashSet to the given target layer.
 void moveDown(Layer layer, Displayable d)
          Move the given Displayable to the next layer if possible.
 void moveUp(Layer layer, Displayable d)
          Move the given Displayable to the previous layer if possible.
 Layer next(Layer layer)
           
 Layer nextNonEmpty(Layer layer)
           
 void paint(java.awt.Graphics2D g, java.awt.Rectangle srcRect, double magnification, boolean active, int channels, Layer active_layer)
           
 Layer previous(Layer layer)
           
 Layer previousNonEmpty(Layer layer)
           
 void printDebugInfo()
           
 Tag putTag(java.lang.String tag, int keyCode)
          Returns an existing immutable Tag instance if already there, or stores a new one and returns it.
 void recreateBuckets(boolean layer_buckets)
          Recreate the ZDisplayable buckets, and also the Layer Displayable buckets if desired.
 void recreateBuckets(java.util.Collection<Layer> layers, boolean layer_buckets)
          Regenerate the quad-tree bucket system for the ZDisplayable instances that have data at each of the given layers, and optionally regenerate the buckets as well for the 2D Displayable instances of that layer as well.
 void recreateBuckets(Layer layer, boolean layer_buckets)
           
 boolean redoOneStep()
          Redoes one step of the ongoing transformation history, otherwise of the overall LayerSet history.
 boolean remove(boolean check)
          Remove from both the database and any Display that shows the Layer in which this Displayable is shown.
 void remove(Layer layer)
          Remove a child.
 boolean remove(ZDisplayable zdispl)
          Remove a child.
protected  boolean remove2(boolean check)
          Remove also from the trees if present; does nothing more than remove(boolean) unless overriden.
 boolean removeAll(java.util.Set<ZDisplayable> zds)
          Remove a child.
 void removeAllTags()
           
 void removeFromOffscreens(Layer la)
           
protected  boolean removeLastUndoStep()
           
 void removeTag(java.lang.String tag, int keyCode)
          Removes the tag from the list of possible tags, and then from wherever it has been assigned.
 void removeTag(Tag t)
           
protected  void reposition(Layer layer)
          Used by the Layer.setZ method.
 void restoreCalibration(java.util.HashMap<java.lang.String,java.lang.String> ht_attributes)
          Restore calibration from the given XML attributes table.
 java.util.Collection<Displayable> roughlyFindZDisplayables(Layer layer, java.awt.Rectangle r, boolean visible_only)
          Find ZDisplayable objects that intersect the given rectangle in the given layer.
 java.util.Collection<Displayable> setAllVisible(boolean repaint)
          Returns the collection of Displayable whose visibility state has changed.
 void setAlpha(float alpha)
          Overiding.
 void setCalibration(ij.measure.Calibration cal)
          Set the calibration to a clone of the given calibration.
 void setDimensions(float x, float y, float layer_width, float layer_height)
          May leave objects beyond the visible window.
 boolean setDimensions(float layer_width, float layer_height, int anchor)
          Returns false if any Displayables are being partially or totally cropped away.
 void setLayer(Layer layer, boolean update)
          'update' in database or not.
 boolean setMinimumDimensions()
          Used by the Loader after loading blindly a lot of Patches.
 Overlay setOverlay(Overlay o)
          Set to null to remove the Overlay.
 void setParent(Layer layer)
           
 void setPixelsMaxDimension(int d)
           
 void setPixelsVirtualizationEnabled(boolean b)
           
 void setRotVector(double rot_x, double rot_y, double rot_z)
           
 void setSnapshotsMode(int mode)
           
 void setSnapshotsQuality(boolean b)
           
 void setup()
          For reconstruction purposes: set the active layer to the ZDisplayable objects.
 java.util.HashSet<Displayable> setVisible(java.lang.String type, boolean visible, boolean repaint)
          Returns the hash set of objects whose visibility has changed.
 int size()
          The number of Layers in this LayerSet.
 boolean snapshotsQuality()
          For creating snapshots, using a very slow but much better scaling algorithm (the Image.SCALE_AREA_AVERAGING method).
 java.lang.String toString()
          Minimal info that identifies this object as unique, for display on a JTree node.
 boolean undoOneStep()
          Undoes one step of the ongoing transformation history, otherwise of the overall LayerSet history.
 void updateBucket(Displayable d, Layer layer)
           
 void updateLayerTree()
          Recursive into nested LayerSet objects.
 
Methods inherited from class ini.trakem2.display.Displayable
adjustProperties, areThereLayerCrossLinks, canSendTo, clone, clone, commonDTDChildren, contains, contains, deselect, displacePoints, exportDTD, exportSVG, exportXML, findNearestPoint, findNearestPoint, getAffineTransform, getAffineTransformCopy, getAlpha, getAnnotation, getArea, getAreaAt, getAreaForBucket, getBoundingBox, getBoundingBox, getBoundingBox, getBounds, getBounds, getBucketable, getColor, getComposite, getComposite, getCompositeMode, getHeight, getIntersection, getLayer, getLayerIds, getLayerSet, getLayersWithData, getLinked, getLinked, getLinkedBox, getLinkedGroup, getLinkedProperties, getLinkedProperties, getLinkedProperty, getLinkedProperty, getMinimalBoundingBox, getNameId, getPerimeter, 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, link, link, linkPatches, makeAdjustPropertiesDialog, measure, mouseDragged, mousePressed, mouseReleased, mouseWheelMoved, paint, paintAsBox, paintOffscreen, paintSnapshot, prePaint, preTransform, processAdjustPropertiesDialog, removeLinkedProperties, removeLinkedPropertiesFromOrigins, repaint, restXML, rotate, rotate, rotatePoints, scale, scale, scalePoints, setAffineTransform, setAlpha, setAnnotation, setColor, setCompositeMode, setDimensions, setDimensions, setLayer, setLinkedProperties, setLinkedProperty, setLocation, setLocked, setProperty, setTitle, setVisible, setVisible, snapTo, softRemove, transform, transformPoint, transformPoint, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformRectangle, translate, translate, unlink, unlink, unlinkAll, updateBucket, 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
 
Methods inherited from interface ini.trakem2.display.Bucketable
getProject
 

Field Detail

NORTH

public static final int NORTH
See Also:
Constant Field Values

NORTHEAST

public static final int NORTHEAST
See Also:
Constant Field Values

EAST

public static final int EAST
See Also:
Constant Field Values

SOUTHEAST

public static final int SOUTHEAST
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
See Also:
Constant Field Values

SOUTHWEST

public static final int SOUTHWEST
See Also:
Constant Field Values

WEST

public static final int WEST
See Also:
Constant Field Values

NORTHWEST

public static final int NORTHWEST
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values

R90

public static final int R90
See Also:
Constant Field Values

R270

public static final int R270
See Also:
Constant Field Values

FLIP_HORIZONTAL

public static final int FLIP_HORIZONTAL
See Also:
Constant Field Values

FLIP_VERTICAL

public static final int FLIP_VERTICAL
See Also:
Constant Field Values

TOP

public static final int TOP
See Also:
Constant Field Values

UP

public static final int UP
See Also:
Constant Field Values

DOWN

public static final int DOWN
See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
See Also:
Constant Field Values

snapshot_modes

public static final java.lang.String[] snapshot_modes

ANCHORS

public static final java.lang.String[] ANCHORS

ROTATIONS

public static final java.lang.String[] ROTATIONS

color_cues

protected boolean color_cues

area_color_cues

protected boolean area_color_cues

use_color_cue_colors

protected boolean use_color_cue_colors

paint_arrows

protected boolean paint_arrows

paint_edge_confidence_boxes

protected boolean paint_edge_confidence_boxes

n_layers_color_cue

protected int n_layers_color_cue

prepaint

protected boolean prepaint

lbucks

protected java.util.HashMap<Layer,LayerSet.LayerBucket> lbucks
For fast search.


tags

protected final java.util.Map<java.lang.Integer,java.util.HashMap<java.lang.String,Tag>> tags
A set of unique tags, retrievable by their own identity.

Constructor Detail

LayerSet

protected LayerSet(Project project,
                   long id)
Dummy.


LayerSet

public LayerSet(Project project,
                java.lang.String title,
                double x,
                double y,
                Layer parent,
                float layer_width,
                float layer_height)
Create a new LayerSet with a 0,0,0 rotation vector and default 20,20 px Displayable width,height.


LayerSet

public LayerSet(Project project,
                long id,
                java.lang.String title,
                float width,
                float height,
                double rot_x,
                double rot_y,
                double rot_z,
                float layer_width,
                float layer_height,
                boolean locked,
                int snapshots_mode,
                java.awt.geom.AffineTransform at)
Reconstruct from the database.


LayerSet

public LayerSet(Project project,
                long id,
                java.util.HashMap<java.lang.String,java.lang.String> ht_attributes,
                java.util.HashMap<Displayable,java.lang.String> ht_links)
Reconstruct from an XML entry.

Method Detail

setup

public void setup()
For reconstruction purposes: set the active layer to the ZDisplayable objects. Recurses through LayerSets in the children layers.


create

public LayerSet create(Layer parent_layer)
Create a new LayerSet in the middle of the parent Layer.


addSilently

public void addSilently(Layer layer)
Add a new Layer silently, ordering by z as well.


add

public void add(Layer layer)
Add a new Layer, inserted according to its Z.


printDebugInfo

public void printDebugInfo()

getParent

public Layer getParent()

setLayer

public void setLayer(Layer layer,
                     boolean update)
'update' in database or not.

Overrides:
setLayer in class Displayable

setParent

public void setParent(Layer layer)

mousePressed

public void mousePressed(java.awt.event.MouseEvent me,
                         int x_p,
                         int y_p,
                         java.awt.Rectangle srcRect,
                         double mag)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me,
                         int x_p,
                         int y_p,
                         int x_d,
                         int y_d,
                         int x_d_old,
                         int y_d_old,
                         java.awt.Rectangle srcRect,
                         double mag)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me,
                          int x_p,
                          int y_p,
                          int x_d,
                          int y_d,
                          int x_r,
                          int y_r,
                          java.awt.Rectangle srcRect,
                          double mag)

keyPressed

public void keyPressed(java.awt.event.KeyEvent ke)
Overrides:
keyPressed in class Displayable

toString

public java.lang.String toString()
Description copied from class: Displayable
Minimal info that identifies this object as unique, for display on a JTree node.

Overrides:
toString in class Displayable

paint

public void paint(java.awt.Graphics2D g,
                  java.awt.Rectangle srcRect,
                  double magnification,
                  boolean active,
                  int channels,
                  Layer active_layer)

getLayerWidth

public float getLayerWidth()
Specified by:
getLayerWidth in interface Bucketable

getLayerHeight

public float getLayerHeight()
Specified by:
getLayerHeight in interface Bucketable

getRotX

public double getRotX()

getRotY

public double getRotY()

getRotZ

public double getRotZ()

size

public int size()
The number of Layers in this LayerSet.


setRotVector

public void setRotVector(double rot_x,
                         double rot_y,
                         double rot_z)

setMinimumDimensions

public boolean setMinimumDimensions()
Used by the Loader after loading blindly a lot of Patches. Will crop the canvas to the minimum size possible.


enlargeToFit

public void enlargeToFit(java.util.Collection<? extends Displayable> ds)
Enlarge the 2D universe so that all Displayable in the collection fit in it; that is, that no Displayable has a negative x,y position or lays beyond bounds.


enlargeToFit

public boolean enlargeToFit(Displayable d,
                            int anchor)
Enlarges the display in the given direction; the anchor is the point to keep still, and can be any of LayerSet.NORTHWEST (top-left), etc.


setDimensions

public void setDimensions(float x,
                          float y,
                          float layer_width,
                          float layer_height)
May leave objects beyond the visible window.


setDimensions

public boolean setDimensions(float layer_width,
                             float layer_height,
                             int anchor)
Returns false if any Displayables are being partially or totally cropped away.


remove2

protected boolean remove2(boolean check)
Description copied from class: Displayable
Remove also from the trees if present; does nothing more than remove(boolean) unless overriden.

Overrides:
remove2 in class Displayable

remove

public boolean remove(boolean check)
Description copied from class: Displayable
Remove from both the database and any Display that shows the Layer in which this Displayable is shown.

Overrides:
remove in class Displayable

remove

public void remove(Layer layer)
Remove a child. Does not destroy it or delete it from the database.


next

public Layer next(Layer layer)

previous

public Layer previous(Layer layer)

nextNonEmpty

public Layer nextNonEmpty(Layer layer)

previousNonEmpty

public Layer previousNonEmpty(Layer layer)

getLayerIndex

public int getLayerIndex(long id)

getLayer

public Layer getLayer(int i)
Find a layer by index, or null if none.


getLayer

public Layer getLayer(long id)
Find a layer with the given id, or null if none.


getLayer

public Layer getLayer(java.lang.Long id)
Same as getLayer(long) but without box/unbox.


getLayer

public Layer getLayer(double z)
Returns the first layer found with the given Z coordinate, rounded to seventh decimal precision, or null if none found.


getNearestLayer

public Layer getNearestLayer(double z)

getLayer

public Layer getLayer(double z,
                      double thickness,
                      boolean create)
Returns null if none has the given z and thickness. If 'create' is true and no layer is found, a new one with the given Z is created and added to the LayerTree.


add

public void add(ZDisplayable zdispl)
Add a Displayable to be painted in all Layers, such as a Pipe. Also updates open displays of the fact.


addAll

public void addAll(java.util.Collection<? extends ZDisplayable> coll)

addSilently

public void addSilently(ZDisplayable zdispl)
Used for reconstruction purposes, avoids repainting or updating.


remove

public boolean remove(ZDisplayable zdispl)
Remove a child. Does not destroy the child nor remove it from the database, only from the LayerSet and the Display.


removeAll

public boolean removeAll(java.util.Set<ZDisplayable> zds)
Remove a child. Does not destroy the child nor remove it from the database, only from the LayerSet and the Display. Returns false if at least one failed to be removed.


contains

public boolean contains(Layer layer)

contains

public boolean contains(Displayable zdispl)

getLayers

public java.util.ArrayList<Layer> getLayers()
Returns a copy of the layer list.


getLayers

public java.util.List<Layer> getLayers(int first,
                                       int last)
Returns a sublist of layers from first to last, both inclusive. If last is larger than first, the order is reversed.


getLayers

public java.util.List<Layer> getLayers(Layer first,
                                       Layer last)
Returns the layer range from first to last, both included. If last.getZ() < first.getZ(), the order is reversed.


getColorCueLayerRange

public java.util.List<Layer> getColorCueLayerRange(Layer active_layer)
Returns the list of layers to paint by considering the range of n_layers_color_cue around the active layer index.


isDeletable

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

setAlpha

public void setAlpha(float alpha)
Overiding. The alpha is used to show whether the LayerSet object is selected or not.

Overrides:
setAlpha in class Displayable

moveDown

public void moveDown(Layer layer,
                     Displayable d)
Move the given Displayable to the next layer if possible.


moveUp

public void moveUp(Layer layer,
                   Displayable d)
Move the given Displayable to the previous layer if possible.


move

public void move(java.util.Set<Displayable> hs_d,
                 Layer source,
                 Layer target)
Move all Displayable objects in the HashSet to the given target layer.


setVisible

public java.util.HashSet<Displayable> setVisible(java.lang.String type,
                                                 boolean visible,
                                                 boolean repaint)
Returns the hash set of objects whose visibility has changed.


hideExcept

public java.util.HashSet<Displayable> hideExcept(java.util.ArrayList<java.lang.Class<?>> type,
                                                 boolean repaint)
Hide all except those whose type is in 'type' list, whose visibility flag is left unchanged. Returns the list of displayables made hidden.


setAllVisible

public java.util.Collection<Displayable> setAllVisible(boolean repaint)
Returns the collection of Displayable whose visibility state has changed.


contains

public boolean contains(java.lang.Class<?> c)
Returns true if any of the ZDisplayable objects are of the given class.


containsDisplayable

public boolean containsDisplayable(java.lang.Class<?> c)
Check in all layers.


getDepth

public double getDepth()
Returns the distance from the first layer's Z to the last layer's Z.


getDisplayables

public java.util.ArrayList<Displayable> getDisplayables()
Return all the Displayable objects from all the layers of this LayerSet. Does not include the ZDisplayables.


getDisplayables

public java.util.ArrayList<Displayable> getDisplayables(java.lang.Class<?> c)
Return all the Displayable objects from all the layers of this LayerSet of the given class. Does not include the ZDisplayables.


getDisplayables

public java.util.ArrayList<Displayable> getDisplayables(java.lang.Class<?> c,
                                                        java.awt.geom.Area aroi,
                                                        boolean visible_only)
Return all the Displayable objects from all the layers of this LayerSet of the given class that intersect the given area. Does not include the ZDisplayables.


indexOf

public int indexOf(Layer layer)
From zero to size-1.


exportXML

public void exportXML(java.io.Writer writer,
                      java.lang.String indent,
                      java.lang.Object any)
               throws java.lang.Exception
Throws:
java.lang.Exception

exportDTD

public static void exportDTD(java.lang.StringBuilder sb_header,
                             java.util.HashSet<java.lang.String> hs,
                             java.lang.String indent)
Includes the !ELEMENT


setSnapshotsMode

public void setSnapshotsMode(int mode)

getSnapshotsMode

public int getSnapshotsMode()

destroy

public void destroy()
Description copied from class: Displayable
Release resources.

Overrides:
destroy in class Displayable

reposition

protected void reposition(Layer layer)
Used by the Layer.setZ method.


getNeighborLayers

public java.util.ArrayList<Layer> getNeighborLayers(Layer layer,
                                                    int n)
Get up to 'n' layers before and after the given layers.


isTop

public boolean isTop(ZDisplayable zd)

isBottom

public boolean isBottom(ZDisplayable zd)

isTop

protected boolean isTop(Displayable d)
Hub method: ZDisplayable or into the Displayable's Layer.


isBottom

protected boolean isBottom(Displayable d)
Hub method: ZDisplayable or into the Displayable's Layer.


move

protected void move(int place,
                    Displayable d)
Change z position in the layered stack, which defines the painting order.


indexOf

public int indexOf(ZDisplayable zd)
Returns the reverse index of ZDisplayable zd, which is the actual index as seen in the screen.


isEmptyAt

public boolean isEmptyAt(Layer layer)

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

clone

public Displayable clone(Project pr,
                         Layer first,
                         Layer last,
                         java.awt.Rectangle roi,
                         boolean add_to_tree,
                         boolean copy_id)
Clone the contents of this LayerSet, from first to last given layers, and cropping for the given rectangle; does NOT copy the ZDisplayable, which may be copied using the LayerSet.cloneInto method.


cloneInto

public static void cloneInto(LayerSet src,
                             Layer src_first,
                             Layer src_last,
                             Project pr,
                             LayerSet copy,
                             java.awt.Rectangle roi,
                             boolean copy_id)
                      throws java.lang.Exception
Throws:
java.lang.Exception

createLayerStack

public LayerStack createLayerStack(java.lang.Class<?> clazz,
                                   int type,
                                   int c_alphas)
Create a virtual layer stack that acts as a virtual ij.ImageStack, in RGB and set to a scale of max_dimension / Math.max(layer_width, layer_height).


getPixelsMaxDimension

public int getPixelsMaxDimension()

getVirtualizationScale

public double getVirtualizationScale()
From 0.000... to 1.


setPixelsMaxDimension

public void setPixelsMaxDimension(int d)

setPixelsVirtualizationEnabled

public void setPixelsVirtualizationEnabled(boolean b)

isPixelsVirtualizationEnabled

public boolean isPixelsVirtualizationEnabled()

get2DBounds

public java.awt.Rectangle get2DBounds()
Returns a new Rectangle of 0, 0, layer_width, layer_height.


setCalibration

public void setCalibration(ij.measure.Calibration cal)
Set the calibration to a clone of the given calibration.


getCalibration

public ij.measure.Calibration getCalibration()

getCalibrationCopy

public ij.measure.Calibration getCalibrationCopy()

isCalibrated

public boolean isCalibrated()

restoreCalibration

public void restoreCalibration(java.util.HashMap<java.lang.String,java.lang.String> ht_attributes)
Restore calibration from the given XML attributes table.


snapshotsQuality

public boolean snapshotsQuality()
For creating snapshots, using a very slow but much better scaling algorithm (the Image.SCALE_AREA_AVERAGING method).


setSnapshotsQuality

public void setSnapshotsQuality(boolean b)

get

public java.util.ArrayList<Displayable> get(java.lang.Class<?> c)
Find, in this LayerSet and contained layers and their nested LayerSets if any, all Displayable instances of Class c. Includes the ZDisplayables.


get

public java.util.ArrayList<Displayable> get(java.util.ArrayList<Displayable> all,
                                            java.lang.Class<?> c)
Find, in this LayerSet and contained layers and their nested LayerSets if any, all Displayable instances of Class c, which are stored in the given ArrayList; returns the same ArrayList, or a new one if its null. Includes the ZDisplayables.


grab

public java.lang.Object grab(int first,
                             int last,
                             java.awt.Rectangle r,
                             double scale,
                             java.lang.Class<?> c,
                             int c_alphas,
                             int format,
                             int type)
Returns the region defined by the rectangle as an image in the type and format specified. The type is either ImagePlus.GRAY8 or ImagePlus.COLOR_RGB. The format is either Layer.IMAGE (an array) or Layer.ImagePlus (it returns an ImagePlus containing an ImageStack), from which any ImageProcessor or pixel arrays can be retrieved trivially.


findDisplayable

public Displayable findDisplayable(long id)
Searches in all layers. Ignores the ZDisplaybles.


findById

public DBObject findById(long id)
Searches in all ZDisplayables and in all layers, recursively into nested LayerSets.

Overrides:
findById in class Displayable

updateLayerTree

public void updateLayerTree()
Recursive into nested LayerSet objects.


find

public java.util.ArrayList<ZDisplayable> find(Layer first,
                                              Layer last,
                                              java.awt.geom.Area area)
Find the ZDisplayable objects that intersect with the 3D roi defined by the first and last layers, and the area -all in world coordinates.


getZDisplayables

public java.util.ArrayList<ZDisplayable> getZDisplayables()
Returns a copy of the list of ZDisplayable objects.


getDisplayableList

public java.util.ArrayList<ZDisplayable> getDisplayableList()
Returns the real list of displayables, not a copy. If you modify this list, Thor may ground you with His lightning.

Specified by:
getDisplayableList in interface Bucketable

getBucketMap

public java.util.HashMap<Displayable,java.util.HashSet<Bucket>> getBucketMap(Layer la)
Specified by:
getBucketMap in interface Bucketable

updateBucket

public void updateBucket(Displayable d,
                         Layer layer)
Specified by:
updateBucket in interface Bucketable

recreateBuckets

public void recreateBuckets(boolean layer_buckets)
Recreate the ZDisplayable buckets, and also the Layer Displayable buckets if desired.


recreateBuckets

public void recreateBuckets(Layer layer,
                            boolean layer_buckets)

recreateBuckets

public void recreateBuckets(java.util.Collection<Layer> layers,
                            boolean layer_buckets)
Regenerate the quad-tree bucket system for the ZDisplayable instances that have data at each of the given layers, and optionally regenerate the buckets as well for the 2D Displayable instances of that layer as well.


checkBuckets

public void checkBuckets()
Checks only buckets for ZDisplayable, not any related to any layer.


getMinimalBoundingBox

public java.awt.Rectangle getMinimalBoundingBox(java.lang.Class<?> c)
Returns the minimal 2D bounding box for Displayables of class @param c in all layers.


addTransformStep

public void addTransformStep(Layer layer)
Add an undo step for the transformations of all Displayable in the layer.


addTransformStep

public void addTransformStep(java.util.List<Layer> layers)

addTransformStep

public void addTransformStep(java.util.Collection<? extends Displayable> col)
Add an undo step for the transformations of all Displayable in hs.


addTransformStepWithData

public Displayable.DoEdits addTransformStepWithData(java.util.Collection<? extends Displayable> col)
Add an undo step for the transformations of all Displayable in col, with data as well (for Patch, data includes the CoordinateTransform).


addTransformStepWithDataForAll

public java.util.Collection<Displayable> addTransformStepWithDataForAll(java.util.Collection<Layer> layers)
Includes all ZDisplayable that paint at any of the given layers.


addTransformStep

public void addTransformStep()
Add an undo step for the transformations of all Displayable in all layers.


addChangeTreesStep

public LayerSet.DoChangeTrees addChangeTreesStep()
Add a step to undo the addition or deletion of one or more objects in this project and LayerSet.


addChangeTreesStep

public LayerSet.DoChangeTrees addChangeTreesStep(java.util.Set<DoStep> dependents)
Add a step to undo the addition or deletion of one or more objects in this project and LayerSet, along with an arbitrary set of steps that may alter, for example the data.


addLayerContentStep

public void addLayerContentStep(Layer la)
For the Displayable contained in a Layer: their number, and their stack order.


addLayerEditedStep

public void addLayerEditedStep(Layer layer)
For the Z and thickness of a layer.


addLayerEditedStep

public void addLayerEditedStep(java.util.List<Layer> al)
For the Z and thickness of a list of layers.


addUndoStep

public void addUndoStep(DoStep step)

canUndo

public boolean canUndo()

canRedo

public boolean canRedo()

undoOneStep

public boolean undoOneStep()
Undoes one step of the ongoing transformation history, otherwise of the overall LayerSet history.


removeLastUndoStep

protected boolean removeLastUndoStep()

redoOneStep

public boolean redoOneStep()
Redoes one step of the ongoing transformation history, otherwise of the overall LayerSet history.


applyTransforms

public static void applyTransforms(java.util.Map<Displayable,java.awt.geom.AffineTransform> m)

getOverlay

public Overlay getOverlay()
Return the current Overlay or a new one if none yet.


setOverlay

public Overlay setOverlay(Overlay o)
Set to null to remove the Overlay.

Returns:
the previous Overlay, if any.

removeFromOffscreens

public final void removeFromOffscreens(Layer la)

findAreas

protected java.util.Map<Displayable,java.util.List<java.awt.geom.Area>> findAreas(Layer layer,
                                                                                  java.awt.Rectangle box,
                                                                                  boolean visible)
Find all java.awt.geom.Area in layer that intersect with box, if visible. Areas are returned as they are, with coords local to the Displayable they come from. Modifying the Area instances will modify the actual data in the AreaContainer Displayable.


putTag

public Tag putTag(java.lang.String tag,
                  int keyCode)
Returns an existing immutable Tag instance if already there, or stores a new one and returns it.


getTags

public java.util.TreeSet<Tag> getTags(int keyCode)
If there aren't any tags for keyCode, returns an empty TreeSet.


askForNewTag

protected Tag askForNewTag(int keyCode)

askToRemoveTag

protected boolean askToRemoveTag(int keyCode)
Returns false if the dialog was canceled or there wasn't any tag to remove.


removeTag

public void removeTag(java.lang.String tag,
                      int keyCode)
Removes the tag from the list of possible tags, and then from wherever it has been assigned. The @param tag is duck-typed.


removeTag

public void removeTag(Tag t)

removeAllTags

public void removeAllTags()

exportTags

public java.lang.String exportTags()

importTags

public void importTags(java.lang.String path,
                       boolean replace)

getZDisplayables

public java.util.ArrayList<ZDisplayable> getZDisplayables(java.lang.Class<?> c)

getZDisplayables

public java.util.ArrayList<ZDisplayable> getZDisplayables(java.lang.Class<?> c,
                                                          boolean instance_of)
Returns a list of ZDisplayable of class c only. If @param instance_of, use c.isInstance(...) instead of class equality.


getZDisplayables

@Deprecated
public java.util.ArrayList<ZDisplayable> getZDisplayables(java.lang.Class<?> c,
                                                                     Layer layer,
                                                                     java.awt.geom.Area aroi,
                                                                     boolean visible_only)
Deprecated. 

Use method findZDisplayables(...) instead.


getZDisplayables

@Deprecated
public java.util.ArrayList<ZDisplayable> getZDisplayables(java.lang.Class<?> c,
                                                                     Layer layer,
                                                                     java.awt.geom.Area aroi,
                                                                     boolean visible_only,
                                                                     boolean instance_of)
Deprecated. 

Use method findZDisplayables(...) instead.


find

public java.util.ArrayList<Displayable> find(java.lang.Class<?> c,
                                             Layer layer,
                                             java.awt.geom.Area aroi,
                                             boolean visible_only)
Find any Displayable or ZDisplayable objects of class C which intersect with the Area @param aroi. If @param visible_only, then only those that are not hidden.


find

public java.util.ArrayList<Displayable> find(java.lang.Class<?> c,
                                             Layer layer,
                                             java.awt.geom.Area aroi,
                                             boolean visible_only,
                                             boolean instance_of)
Find any Displayable or ZDisplayable objects of class C which intersect with the Area @param aroi. If @param visible_only, then only those that are not hidden. If @param instance_of is true, then classes are not check by equality but by instanceof.


find

public java.util.ArrayList<Displayable> find(java.lang.Class<?> c,
                                             Layer layer,
                                             int x,
                                             int y,
                                             boolean visible_only)

findZDisplayables

public java.util.Collection<Displayable> findZDisplayables(Layer layer,
                                                           int x,
                                                           int y,
                                                           boolean visible_only)
Find ZDisplayable objects that contain the point x,y in the given layer.


findZDisplayables

public java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c,
                                                           Layer layer,
                                                           int x,
                                                           int y,
                                                           boolean visible_only)
Find ZDisplayable objects of Class c that contain the point x,y in the given layer.


findZDisplayables

public java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c,
                                                           Layer layer,
                                                           int x,
                                                           int y,
                                                           boolean visible_only,
                                                           boolean instance_of)
Find ZDisplayable objects of Class c that contain the point x,y in the given layer.


findZDisplayables

public java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c,
                                                           Layer layer,
                                                           java.awt.Rectangle r,
                                                           boolean visible_only)

findZDisplayables

public java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c,
                                                           Layer layer,
                                                           java.awt.Rectangle r,
                                                           boolean visible_only,
                                                           boolean instance_of)
Find ZDisplayable objects of the given class that intersect the given rectangle in the given layer.


findZDisplayables

public java.util.Collection<Displayable> findZDisplayables(java.lang.Class<?> c,
                                                           Layer layer,
                                                           java.awt.geom.Area aroi,
                                                           boolean visible_only,
                                                           boolean instance_of)
Find ZDisplayable objects of the given class that intersect the given area in the given layer. If @param instance_of is true, use c.isAssignableFrom instead of class equality.


findZDisplayables

public java.util.Collection<Displayable> findZDisplayables(Layer layer,
                                                           java.awt.Rectangle r,
                                                           boolean visible_only)
Find ZDisplayable objects that intersect the given rectangle in the given layer.


roughlyFindZDisplayables

public java.util.Collection<Displayable> roughlyFindZDisplayables(Layer layer,
                                                                  java.awt.Rectangle r,
                                                                  boolean visible_only)
Find ZDisplayable objects that intersect the given rectangle in the given layer. May return false positives but never false negatives.


getAll

public <T extends Displayable> java.util.List<T> getAll(java.lang.Class<T> c)
Get all Displayable or ZDisplayable of the given class. Classes are tested by equality, except for ZDisplayable.class. Will also consider Displayable.class and subclasses in a similar fashion, by calling Layer.getAll(c).