at.tuwien.ifs.somtoolbox.visualization.thematicmap
Class SOMRegion

java.lang.Object
  extended by java.awt.Polygon
      extended by at.tuwien.ifs.somtoolbox.visualization.thematicmap.SOMRegion
All Implemented Interfaces:
edu.cornell.cs.voronoi.IPnt, Shape, Serializable

public class SOMRegion
extends Polygon
implements edu.cornell.cs.voronoi.IPnt

Version:
$Id: SOMRegion.java 3883 2010-11-02 17:13:23Z frank $
Author:
Taha Abdel Aziz
See Also:
Serialized Form

Field Summary
(package private)  double area
           
(package private)  Color borderColor
           
(package private)  edu.cornell.cs.voronoi.Pnt center
           
 ArrayList<SOMClass> classes
           
(package private)  SOMLibClassInformation classInfo
           
(package private)  Color fillcolor
           
(package private)  ArrayList<Grid> grids
           
(package private)  RndIndexGenerator indexGenerator
           
 SOMClass mainClass
           
(package private)  double min_visible_class
           
private  org.jfree.util.PaintList paintList
           
private  ArrayList<Polygon> polygons
           
(package private)  boolean resolved
           
(package private)  ArrayList<Segment> segments
           
private static long serialVersionUID
           
(package private)  Unit unit
           
(package private) static int x
           
 
Fields inherited from class java.awt.Polygon
bounds, npoints, xpoints, ypoints
 
Constructor Summary
SOMRegion(Unit unit, edu.cornell.cs.voronoi.IPnt pnt, int clssIndex, SOMLibClassInformation classInfo, org.jfree.util.PaintList paintList)
           
SOMRegion(Unit unit, SOMLibClassInformation classInfo, org.jfree.util.PaintList paintList, int zoom)
          Creates a new instance of SOMNode
 
Method Summary
 edu.cornell.cs.voronoi.Pnt add(edu.cornell.cs.voronoi.Pnt p)
           
 void addSegment(Segment seg)
           
 double angle(edu.cornell.cs.voronoi.Pnt p)
           
 void assignClassGrids()
           
 void assignClassGrids(SOMClass clss, Segment seg, double anteilVonAnteil, double weight1, double weight2)
           
 edu.cornell.cs.voronoi.Pnt bisector(edu.cornell.cs.voronoi.Pnt point)
           
 void calcGrids()
           
 void calcRelations()
           
 double calculateEntropy()
          Calculates the Entropy in the SOM Region
 double coord(int i)
           
 void cut(int width, int height)
           
 int dimCheck(edu.cornell.cs.voronoi.Pnt p)
           
 int dimension()
           
 double dot(edu.cornell.cs.voronoi.Pnt p)
           
 void drawRegion(Graphics2D g)
           
 boolean equals(Object other)
           
 boolean equals(Object other, boolean round)
           
 edu.cornell.cs.voronoi.Pnt extend(double[] coords)
           
 void fillRegion(Graphics2D g, boolean chessboard)
           
 SOMClass getClass(int index)
           
 String[][] getClasses()
          Returns the class names of the Region on [0] and its hits on [1]
 SOMClass getClassWithIndex(int index)
          Returns the SOMClass with the specified index or NULL otherwise
(package private)  int getRelationNumber(int index)
           
(package private)  double[] getRelationNumberAndWeights(int index)
           
 Unit getUnit()
           
 int hashCode()
           
 boolean isInside(edu.cornell.cs.voronoi.Pnt[] simplex)
           
 edu.cornell.cs.voronoi.Pnt isOn(edu.cornell.cs.voronoi.Pnt[] simplex)
           
 edu.cornell.cs.voronoi.Pnt isOutside(edu.cornell.cs.voronoi.Pnt[] simplex)
           
 double magnitude()
           
 void makeUniqe()
           
 int[] relation(edu.cornell.cs.voronoi.Pnt[] simplex)
           
private  Color repairColor(Color color)
           
 void resolve(double min_visible_class)
           
 int resolveMainClassIndex(int index)
          Resolves the Main Class Index from any given ClassIndex in the Region, or -1 if the ClassINdex is not part of the Region
 void setFillColor(Color col)
           
 void setRegionBorderColor(Color col)
           
 void sortSegments()
           
 edu.cornell.cs.voronoi.Pnt subtract(edu.cornell.cs.voronoi.Pnt p)
           
 String toString()
           
 int vsCircumcircle(edu.cornell.cs.voronoi.Pnt[] simplex)
           
 
Methods inherited from class java.awt.Polygon
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, invalidate, reset, translate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

center

edu.cornell.cs.voronoi.Pnt center

segments

ArrayList<Segment> segments

borderColor

Color borderColor

fillcolor

Color fillcolor

classes

public ArrayList<SOMClass> classes

mainClass

public SOMClass mainClass

unit

Unit unit

classInfo

SOMLibClassInformation classInfo

resolved

boolean resolved

area

double area

indexGenerator

RndIndexGenerator indexGenerator

grids

ArrayList<Grid> grids

polygons

private ArrayList<Polygon> polygons

min_visible_class

double min_visible_class

paintList

private org.jfree.util.PaintList paintList

x

static int x
Constructor Detail

SOMRegion

public SOMRegion(Unit unit,
                 SOMLibClassInformation classInfo,
                 org.jfree.util.PaintList paintList,
                 int zoom)
Creates a new instance of SOMNode


SOMRegion

public SOMRegion(Unit unit,
                 edu.cornell.cs.voronoi.IPnt pnt,
                 int clssIndex,
                 SOMLibClassInformation classInfo,
                 org.jfree.util.PaintList paintList)
Method Detail

addSegment

public void addSegment(Segment seg)

getUnit

public Unit getUnit()

sortSegments

public void sortSegments()

makeUniqe

public void makeUniqe()

drawRegion

public void drawRegion(Graphics2D g)

fillRegion

public void fillRegion(Graphics2D g,
                       boolean chessboard)

repairColor

private Color repairColor(Color color)

setRegionBorderColor

public void setRegionBorderColor(Color col)

setFillColor

public void setFillColor(Color col)

getClass

public SOMClass getClass(int index)

toString

public String toString()
Overrides:
toString in class Object

getRelationNumber

int getRelationNumber(int index)

getRelationNumberAndWeights

double[] getRelationNumberAndWeights(int index)

cut

public void cut(int width,
                int height)

calcRelations

public void calcRelations()

resolve

public void resolve(double min_visible_class)

calcGrids

public void calcGrids()

assignClassGrids

public void assignClassGrids()

assignClassGrids

public void assignClassGrids(SOMClass clss,
                             Segment seg,
                             double anteilVonAnteil,
                             double weight1,
                             double weight2)

add

public edu.cornell.cs.voronoi.Pnt add(edu.cornell.cs.voronoi.Pnt p)
Specified by:
add in interface edu.cornell.cs.voronoi.IPnt

angle

public double angle(edu.cornell.cs.voronoi.Pnt p)
Specified by:
angle in interface edu.cornell.cs.voronoi.IPnt

bisector

public edu.cornell.cs.voronoi.Pnt bisector(edu.cornell.cs.voronoi.Pnt point)
Specified by:
bisector in interface edu.cornell.cs.voronoi.IPnt

coord

public double coord(int i)
Specified by:
coord in interface edu.cornell.cs.voronoi.IPnt

dimCheck

public int dimCheck(edu.cornell.cs.voronoi.Pnt p)
Specified by:
dimCheck in interface edu.cornell.cs.voronoi.IPnt

dimension

public int dimension()
Specified by:
dimension in interface edu.cornell.cs.voronoi.IPnt

dot

public double dot(edu.cornell.cs.voronoi.Pnt p)
Specified by:
dot in interface edu.cornell.cs.voronoi.IPnt

equals

public boolean equals(Object other)
Overrides:
equals in class Object

equals

public boolean equals(Object other,
                      boolean round)
Specified by:
equals in interface edu.cornell.cs.voronoi.IPnt

extend

public edu.cornell.cs.voronoi.Pnt extend(double[] coords)
Specified by:
extend in interface edu.cornell.cs.voronoi.IPnt

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isInside

public boolean isInside(edu.cornell.cs.voronoi.Pnt[] simplex)
Specified by:
isInside in interface edu.cornell.cs.voronoi.IPnt

isOn

public edu.cornell.cs.voronoi.Pnt isOn(edu.cornell.cs.voronoi.Pnt[] simplex)
Specified by:
isOn in interface edu.cornell.cs.voronoi.IPnt

isOutside

public edu.cornell.cs.voronoi.Pnt isOutside(edu.cornell.cs.voronoi.Pnt[] simplex)
Specified by:
isOutside in interface edu.cornell.cs.voronoi.IPnt

magnitude

public double magnitude()
Specified by:
magnitude in interface edu.cornell.cs.voronoi.IPnt

relation

public int[] relation(edu.cornell.cs.voronoi.Pnt[] simplex)
Specified by:
relation in interface edu.cornell.cs.voronoi.IPnt

subtract

public edu.cornell.cs.voronoi.Pnt subtract(edu.cornell.cs.voronoi.Pnt p)
Specified by:
subtract in interface edu.cornell.cs.voronoi.IPnt

vsCircumcircle

public int vsCircumcircle(edu.cornell.cs.voronoi.Pnt[] simplex)
Specified by:
vsCircumcircle in interface edu.cornell.cs.voronoi.IPnt

resolveMainClassIndex

public int resolveMainClassIndex(int index)
Resolves the Main Class Index from any given ClassIndex in the Region, or -1 if the ClassINdex is not part of the Region


getClassWithIndex

public SOMClass getClassWithIndex(int index)
Returns the SOMClass with the specified index or NULL otherwise


calculateEntropy

public double calculateEntropy()
Calculates the Entropy in the SOM Region


getClasses

public String[][] getClasses()
Returns the class names of the Region on [0] and its hits on [1]