ini.trakem2.display
Class Dissector

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.Dissector
All Implemented Interfaces:
Paintable, VectorData

public class Dissector
extends ZDisplayable
implements VectorData

Implements the Double Dissector method with scale-invariant grouped labels. Each label is simply a cross marker with a number attached; labels are grouped; each member label of the group has the same number.


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
Dissector(Project project, long id, java.util.HashMap<java.lang.String,java.lang.String> ht, java.util.HashMap<Displayable,java.lang.String> ht_links)
          Reconstruct from XML.
Dissector(Project project, long id, java.lang.String title, float width, float height, float alpha, boolean visible, java.awt.Color color, boolean locked, java.awt.geom.AffineTransform at)
           
Dissector(Project project, java.lang.String title, double x, double y)
           
 
Method Summary
 void addItem(int tag, int radius, java.lang.String data)
          For reconstruction purposes from XML.
 boolean apply(Layer la, java.awt.geom.Area roi, mpicbg.models.CoordinateTransform ict)
          Applies the 2D transform @ict (which is expected to operate on the world coordinates version of the data contained here) only to the data that falls within the @param roi (in world coords), and then recomputes the bounding box and affine transform (to a translation or identity).
 boolean apply(VectorDataTransform vdt)
           
protected  boolean calculateBoundingBox(Layer la)
           
 Displayable clone(Project pr, boolean copy_id)
          Returns a deep copy.
 boolean contains(Layer layer, int x, int y)
          Calls contains(x_p, y_p) unless overriden -- in ZDisplayable objects, it tests whether the given point is contained in the part of the ZDisplayable that shows in the given layer.
 boolean crop(java.util.List<Layer> range)
          Retain the data within the layer range, and through out all the rest.
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)
          The oid is this objects' id, whereas the 'id' tag will be the id of the wrapper Thing object.
 java.awt.geom.Area getAreaAt(Layer layer)
          This area is meant to represent the entire area where a Displayable paints to in the @param layer.
 Layer getFirstLayer()
          Returns the layer of lowest Z coordinate where this ZDisplayable has a point in.
 java.lang.String getInfo()
          Returns: - first line: the title of this dissector - second line: the number of items included in this dissector and then a list of 5 tab-separated columns: item tag, radius, x, y, z
 java.util.Collection<java.lang.Long> getLayerIds()
          Get the list of Layer ids on which this ZDisplayable has data on.
 boolean intersects(java.awt.geom.Area area, double z_first, double z_last)
           
 boolean isDeletable()
           
protected  boolean layerRemoved(Layer la)
          Update internal datastructures to reflect the fact that @param layer has been removed from the containing LayerSet.
 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.
 ij.measure.ResultsTable measure(ij.measure.ResultsTable rt)
          Does nothing unless overriden.
 void mouseDragged(java.awt.event.MouseEvent me, Layer la, int x_p, int y_p, int x_d, int y_d, int x_d_old, int y_d_old)
           
 void mousePressed(java.awt.event.MouseEvent me, Layer la, int x_p, int y_p, double mag)
           
 void mouseReleased(java.awt.event.MouseEvent me, Layer la, int x_p, int y_p, int x_d, int y_d, int x_r, int y_r)
           
 void paint(java.awt.Graphics2D g, java.awt.Rectangle srcRect, double magnification, boolean active, int channels, Layer active_layer)
           
 void paintSnapshot(java.awt.Graphics2D g, Layer layer, java.util.List<Layer> layers, java.awt.Rectangle srcRect, double mag)
          Always paint as box.
 
Methods inherited from class ini.trakem2.display.ZDisplayable
exportDTD, getBucketable, getLayerSet, paintsAt, remove, remove2, 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, deselect, destroy, displacePoints, exportSVG, findById, findNearestPoint, findNearestPoint, getAffineTransform, getAffineTransformCopy, getAlpha, getAnnotation, getArea, getAreaForBucket, getBoundingBox, getBoundingBox, getBoundingBox, getBounds, getBounds, getColor, getComposite, getComposite, getCompositeMode, getHeight, getIntersection, getLayer, 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, keyPressed, link, link, makeAdjustPropertiesDialog, mouseWheelMoved, paint, paintAsBox, paintOffscreen, prePaint, preTransform, processAdjustPropertiesDialog, removeLinkedProperties, removeLinkedPropertiesFromOrigins, repaint, restXML, rotate, rotate, rotatePoints, scale, scale, scalePoints, setAffineTransform, 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, getProject, getUniqueIdentifier, removeFromDatabase, updateInDatabase
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dissector

public Dissector(Project project,
                 java.lang.String title,
                 double x,
                 double y)

Dissector

public Dissector(Project project,
                 long id,
                 java.lang.String title,
                 float width,
                 float height,
                 float alpha,
                 boolean visible,
                 java.awt.Color color,
                 boolean locked,
                 java.awt.geom.AffineTransform at)

Dissector

public Dissector(Project project,
                 long id,
                 java.util.HashMap<java.lang.String,java.lang.String> ht,
                 java.util.HashMap<Displayable,java.lang.String> ht_links)
Reconstruct from XML.

Method Detail

paint

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

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

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.

contains

public boolean contains(Layer layer,
                        int x,
                        int y)
Description copied from class: Displayable
Calls contains(x_p, y_p) unless overriden -- in ZDisplayable objects, it tests whether the given point is contained in the part of the ZDisplayable that shows in the given layer.

Overrides:
contains in class Displayable

clone

public Displayable clone(Project pr,
                         boolean copy_id)
Returns a deep copy.

Specified by:
clone in class Displayable

isDeletable

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent me,
                         Layer la,
                         int x_p,
                         int y_p,
                         double mag)
Overrides:
mousePressed in class Displayable

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me,
                         Layer la,
                         int x_p,
                         int y_p,
                         int x_d,
                         int y_d,
                         int x_d_old,
                         int y_d_old)
Overrides:
mouseDragged in class Displayable

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me,
                          Layer la,
                          int x_p,
                          int y_p,
                          int x_d,
                          int y_d,
                          int x_r,
                          int y_r)
Overrides:
mouseReleased in class Displayable

calculateBoundingBox

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

exportDTD

public static 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)
Description copied from class: Displayable
The oid is this objects' id, whereas the 'id' tag will be the id of the wrapper Thing object.

Overrides:
exportXML in class ZDisplayable

addItem

public void addItem(int tag,
                    int radius,
                    java.lang.String data)
For reconstruction purposes from XML.


getInfo

public java.lang.String getInfo()
Returns: - first line: the title of this dissector - second line: the number of items included in this dissector and then a list of 5 tab-separated columns: item tag, radius, x, y, z

Overrides:
getInfo in class DBObject

paintSnapshot

public void paintSnapshot(java.awt.Graphics2D g,
                          Layer layer,
                          java.util.List<Layer> layers,
                          java.awt.Rectangle srcRect,
                          double mag)
Always paint as box. TODO paint as the area of an associated ROI.

Overrides:
paintSnapshot in class Displayable

intersects

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

measure

public ij.measure.ResultsTable measure(ij.measure.ResultsTable rt)
Description copied from class: Displayable
Does nothing unless overriden.

Overrides:
measure in class Displayable

crop

public boolean crop(java.util.List<Layer> range)
Retain the data within the layer range, and through out all the rest.

Overrides:
crop in class ZDisplayable

layerRemoved

protected boolean layerRemoved(Layer la)
Description copied from class: ZDisplayable
Update internal datastructures to reflect the fact that @param layer has been removed from the containing LayerSet.

Overrides:
layerRemoved in class ZDisplayable

apply

public boolean apply(Layer la,
                     java.awt.geom.Area roi,
                     mpicbg.models.CoordinateTransform ict)
              throws java.lang.Exception
Description copied from interface: VectorData
Applies the 2D transform @ict (which is expected to operate on the world coordinates version of the data contained here) only to the data that falls within the @param roi (in world coords), and then recomputes the bounding box and affine transform (to a translation or identity). Does not consider links.

Specified by:
apply in interface VectorData
Parameters:
la - Only data at this Layer may be transformed.
roi - Only data inside this world-coordinates Area may be transformed.
ict - The transform to apply to the data that is in @param la and within @param roi.
Throws:
java.lang.Exception

apply

public boolean apply(VectorDataTransform vdt)
              throws java.lang.Exception
Specified by:
apply in interface VectorData
Throws:
java.lang.Exception

getLayerIds

public java.util.Collection<java.lang.Long> getLayerIds()
Description copied from class: ZDisplayable
Get the list of Layer ids on which this ZDisplayable has data on.

Overrides:
getLayerIds in class ZDisplayable

getAreaAt

public java.awt.geom.Area getAreaAt(Layer layer)
Description copied from class: Displayable
This area is meant to represent the entire area where a Displayable paints to in the @param layer. But for some this is reduced to areas with data, not with interpolated data. For example, a Polyine would show a list of little 1x1 rectangles for each point in the @param layer.

Overrides:
getAreaAt in class Displayable