ini.trakem2.display
Class ZDisplayable

java.lang.Object
  extended by ini.trakem2.persistence.DBObject
      extended by ini.trakem2.display.Displayable
          extended by ini.trakem2.display.ZDisplayable
All Implemented Interfaces:
Paintable
Direct Known Subclasses:
AreaList, Ball, Dissector, Pipe, Polyline, Stack, Tree

public abstract class ZDisplayable
extends Displayable

For Pipes and other objects that must be shown in all Layers of a LayerSet.


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
protected  LayerSet 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
ZDisplayable(Project project, long id, java.util.HashMap<java.lang.String,java.lang.String> ht, java.util.HashMap<Displayable,java.lang.String> ht_links)
          For reconstruction from an XML file.
ZDisplayable(Project project, long id, java.lang.String title, boolean locked, java.awt.geom.AffineTransform at, float width, float height)
          For reconstruction from the database.
ZDisplayable(Project project, java.lang.String title, double x, double y)
           
 
Method Summary
protected abstract  boolean calculateBoundingBox(Layer la)
           
 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.String type, 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.
 Bucketable getBucketable()
           
abstract  Layer getFirstLayer()
          Returns the layer of lowest Z coordinate where this ZDisplayable has a point in.
 java.util.Collection<java.lang.Long> getLayerIds()
          Get the list of Layer ids on which this ZDisplayable has data on.
 LayerSet getLayerSet()
           
abstract  boolean intersects(java.awt.geom.Area area, double z_first, double z_last)
           
protected  boolean layerRemoved(Layer la)
          Update internal datastructures to reflect the fact that @param layer has been removed from the containing LayerSet.
abstract  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.
 boolean paintsAt(Layer layer)
          Check if this instance will paint anything at the level of the given Layer.
 boolean remove(boolean check)
          Remove from both the database and any Display that shows the Layer in which this Displayable is shown.
protected  boolean remove2(boolean check)
          Remove also from the trees if present; does nothing more than remove(boolean) unless overriden.
 void setColor(java.awt.Color color)
           
 void setLayer(Layer layer)
           
 void setLayerSet(LayerSet layer_set)
           
 void setLayerSet(LayerSet layer_set, boolean update_db)
           
 void setPosition(FallLine fl)
           
 void setVisible(boolean visible, boolean repaint)
           
 boolean softRemove()
          Does not remove from the LayerSet.
 void transformPoints(Layer layer, double dx, double dy, double rot, double xo, double yo)
          Deprecated. 
 void updateBucket()
          Update buckets for all Layers.
 void updateBucket(Layer la)
           
 
Methods inherited from class ini.trakem2.display.Displayable
adjustProperties, areThereLayerCrossLinks, canSendTo, clone, clone, clone, commonDTDChildren, contains, contains, deselect, destroy, displacePoints, exportDTD, exportSVG, findById, findNearestPoint, findNearestPoint, getAffineTransform, getAffineTransformCopy, getAlpha, getAnnotation, getArea, getAreaAt, 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, isDeletable, isLinked, isLinked, isLinked, isLocked, isLocked2, isOnlyLinkedTo, isOnlyLinkedTo, isOutOfRepaintingClip, isOutOfRepaintingClip, isRoughlyInside, isVisible, keyPressed, link, link, 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, 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
 

Field Detail

layer_set

protected LayerSet layer_set
Constructor Detail

ZDisplayable

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

ZDisplayable

public ZDisplayable(Project project,
                    long id,
                    java.lang.String title,
                    boolean locked,
                    java.awt.geom.AffineTransform at,
                    float width,
                    float height)
For reconstruction from the database.


ZDisplayable

public ZDisplayable(Project project,
                    long id,
                    java.util.HashMap<java.lang.String,java.lang.String> ht,
                    java.util.HashMap<Displayable,java.lang.String> ht_links)
For reconstruction from an XML file.

Method Detail

setLayerSet

public void setLayerSet(LayerSet layer_set)

setLayerSet

public void setLayerSet(LayerSet layer_set,
                        boolean update_db)

getLayerSet

public LayerSet getLayerSet()
Overrides:
getLayerSet in class Displayable

setLayer

public void setLayer(Layer layer)
Overrides:
setLayer in class Displayable

linkPatches

public abstract 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.

Overrides:
linkPatches in class Displayable
Returns:
whether the locking state changed.

getFirstLayer

public abstract Layer getFirstLayer()
Returns the layer of lowest Z coordinate where this ZDisplayable has a point in.


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 Displayable

exportDTD

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

transformPoints

@Deprecated
public void transformPoints(Layer layer,
                                       double dx,
                                       double dy,
                                       double rot,
                                       double xo,
                                       double yo)
Deprecated. 

Transform points falling within the given layer; translate by dx,dy and rotate by rot relative to origin xo,yo


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

softRemove

public boolean softRemove()
Does not remove from the LayerSet.

Overrides:
softRemove in class Displayable

paintsAt

public boolean paintsAt(Layer layer)
Check if this instance will paint anything at the level of the given Layer.


getLayerIds

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

Overrides:
getLayerIds in class Displayable

setColor

public void setColor(java.awt.Color color)
Overrides:
setColor in class Displayable

intersects

public abstract boolean intersects(java.awt.geom.Area area,
                                   double z_first,
                                   double z_last)

setVisible

public void setVisible(boolean visible,
                       boolean repaint)
Overrides:
setVisible in class Displayable

getBucketable

public Bucketable getBucketable()
Overrides:
getBucketable in class Displayable

setPosition

public void setPosition(FallLine fl)

crop

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


layerRemoved

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


updateBucket

public void updateBucket(Layer la)

updateBucket

public void updateBucket()
Update buckets for all Layers.

Overrides:
updateBucket in class Displayable

calculateBoundingBox

protected abstract boolean calculateBoundingBox(Layer la)