br.usp.ime.klava.segmentit.structures
Class HierarchyLeaf

java.lang.Object
  extended by br.usp.ime.klava.segmentit.structures.HierarchyNode
      extended by br.usp.ime.klava.segmentit.structures.HierarchyLeaf

public class HierarchyLeaf
extends HierarchyNode

Leaf node of a hierarchy of nested partitions.

Author:
Bruno Klava

Constructor Summary
HierarchyLeaf(TreeOfCriticalLakes TCL, PrimitiveCatchmentBasin basin)
          Constructs a HierarchyLeaf that encapsulates basin in a hierarchy of partitions.
 
Method Summary
 javax.swing.tree.MutableTreeNode buildSubTree()
          Returns a MutableTreeNode representation of this HierarchyNode for visualization in a tree view.
 void deactivateSubTree()
          Sets active to false to all the basins under this HierarchyNode in the hierarchy.
 java.lang.String description(int level)
          Returns a String representation of the subtree of the hierarchy rooted by this HierarchyNode.
 java.util.Collection<HierarchyNode> getChildren()
          Returns the HierarchyNodes from which this HierarchyNode was constructed.
 int getNumPixels()
          Returns the number of pixels in this HierarchyNode.
 PrimitiveCatchmentBasin getPrimitiveCatchmentBasin()
          Returns the PrimitiveCatchmentBasin encapsulated in the HierarchyLeaf.
 void paint(java.awt.image.BufferedImage image, java.awt.Color color)
          Paints this HierarchyNode with the given color .
 void paintHierarchy(java.awt.image.BufferedImage image)
          Paints the partition selected on the hierarchy (according to the active values) limited to the region that this HierarchyNode represents.
 void setThreshold(int threshold)
          Selects a partition on the hierarchy according to a threshold value.
 
Methods inherited from class br.usp.ime.klava.segmentit.structures.HierarchyNode
description, getColor, getLabel, getMaximumBasin, getMetric, getParent, getValue, isActive, merge, paint, randomizeColor, refine, resetHierarchy, setActive, setParent, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HierarchyLeaf

public HierarchyLeaf(TreeOfCriticalLakes TCL,
                     PrimitiveCatchmentBasin basin)
Constructs a HierarchyLeaf that encapsulates basin in a hierarchy of partitions.

Parameters:
TCL - the TreeOfCriticalLakes where this HierarchyLeaf belongs
basin - the PrimitiveCatchmentBasin encapsulated in the HierarchyLeaf
Method Detail

getPrimitiveCatchmentBasin

public PrimitiveCatchmentBasin getPrimitiveCatchmentBasin()
Returns the PrimitiveCatchmentBasin encapsulated in the HierarchyLeaf.

Returns:
the PrimitiveCatchmentBasin encapsulated in the HierarchyLeaf

getChildren

public java.util.Collection<HierarchyNode> getChildren()
Description copied from class: HierarchyNode
Returns the HierarchyNodes from which this HierarchyNode was constructed.

Specified by:
getChildren in class HierarchyNode
Returns:
the HierarchyNodes from which this HierarchyNode was constructed

buildSubTree

public javax.swing.tree.MutableTreeNode buildSubTree()
Description copied from class: HierarchyNode
Returns a MutableTreeNode representation of this HierarchyNode for visualization in a tree view.

Specified by:
buildSubTree in class HierarchyNode
Returns:
a tree view representation of this HierarchyNode and all HierarchyNodes below it in the hierarchy

paint

public void paint(java.awt.image.BufferedImage image,
                  java.awt.Color color)
Description copied from class: HierarchyNode
Paints this HierarchyNode with the given color .

Specified by:
paint in class HierarchyNode
Parameters:
image - the image where this HierarchyNode will be painted
color - the Color to be used to paint this HierarchyNode

paintHierarchy

public void paintHierarchy(java.awt.image.BufferedImage image)
Description copied from class: HierarchyNode
Paints the partition selected on the hierarchy (according to the active values) limited to the region that this HierarchyNode represents.

Specified by:
paintHierarchy in class HierarchyNode
Parameters:
image - the image where the partition will be painted

setThreshold

public void setThreshold(int threshold)
Description copied from class: HierarchyNode
Selects a partition on the hierarchy according to a threshold value.

Specified by:
setThreshold in class HierarchyNode
Parameters:
threshold - the threshold value to select a partition in the hierarchy

deactivateSubTree

public void deactivateSubTree()
Description copied from class: HierarchyNode
Sets active to false to all the basins under this HierarchyNode in the hierarchy.

Specified by:
deactivateSubTree in class HierarchyNode

description

public java.lang.String description(int level)
Description copied from class: HierarchyNode
Returns a String representation of the subtree of the hierarchy rooted by this HierarchyNode.

Specified by:
description in class HierarchyNode
Parameters:
level - the indentation level to be used in the description
Returns:
a String representation of the hierarchy under this HierarchyNode

getNumPixels

public int getNumPixels()
Description copied from class: HierarchyNode
Returns the number of pixels in this HierarchyNode.

Specified by:
getNumPixels in class HierarchyNode
Returns:
the number of pixels in this HierarchyNode