extra.inpro.synthesis.visual
Class HotSpot<T>

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by java.awt.Point
          extended by extra.inpro.synthesis.visual.HotSpot<T>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
SegmentSelector.StringHotSpot

 class HotSpot<T>
extends java.awt.Point

A hotspot associates an item with a point on the screen. it can be checked whether a given Point matches this hotspot (that is, the point is within the hotspot; the hotspot size is given in the constructor) and can then return the item that is associated with the hotspot. Hotspots are used in SegmentSelector and also in SegmentPanel to allow easy access to PitchMarks

Author:
timo

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
 
Field Summary
(package private)  T item
           
(package private)  int squaredHotspotSize
           
 
Fields inherited from class java.awt.Point
x, y
 
Constructor Summary
HotSpot(int x, int y, T item, float hotspotSize)
           
HotSpot(java.awt.Point p, T item, float hotspotSize)
           
HotSpot(T item, int x, int y, float hotspotSize)
           
 
Method Summary
(package private)  T getItem()
           
(package private)  boolean matches(java.awt.Point p)
           
static int squaredDistance(java.awt.Point p1, java.awt.Point p2)
           
 
Methods inherited from class java.awt.Point
equals, getLocation, getX, getY, move, setLocation, setLocation, setLocation, toString, translate
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

item

final T item

squaredHotspotSize

final int squaredHotspotSize
Constructor Detail

HotSpot

HotSpot(java.awt.Point p,
        T item,
        float hotspotSize)

HotSpot

HotSpot(int x,
        int y,
        T item,
        float hotspotSize)

HotSpot

HotSpot(T item,
        int x,
        int y,
        float hotspotSize)
Method Detail

matches

boolean matches(java.awt.Point p)

getItem

T getItem()

squaredDistance

public static int squaredDistance(java.awt.Point p1,
                                  java.awt.Point p2)