org.eclipse.ohf.stem.ui.views.map
Class StemPolygonsList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<StemPolygon>
                  extended by org.eclipse.ohf.stem.ui.views.map.StemPolygonsList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<StemPolygon>, java.util.Collection<StemPolygon>, java.util.List<StemPolygon>, java.util.Queue<StemPolygon>

public class StemPolygonsList
extends java.util.LinkedList<StemPolygon>

A class that extends the LinkedList class. It has some fields that help in managing the polygons list of a map, such as the offset needed to be made in order to centralize the map, the optimum values of the map coordinates, etc.

See Also:
Serialized Form

Constructor Summary
StemPolygonsList()
          Empty Constructor
StemPolygonsList(LatLong latLongData, double relativeValueOfPolygon, java.lang.String title)
          Constructor which gets a LatLong object and constructs a list of polygons
 
Method Summary
 void centralizePolygons()
          This method will add the centralizationFactor value to the polygons' coordinates in order to make it be at the center of the view
 org.eclipse.swt.graphics.Point getCentralizationFactor()
          Gets the offset needed to be made in order to centralize the map.
 StemPolygon getPolygonContainingThisCoordinate(java.awt.geom.Point2D mousePoint, java.awt.geom.Point2D scalingFactorPoint, java.awt.geom.AffineTransform mapAffineTransform)
          Returns the polygon that contains the desired coordinates (x,y)
 java.lang.String getWhichProjection()
           
 double getXmax()
          Gets the maximum X coordinate value (double number format) of the polygons list.
 double getXmin()
          Gets the minimum X coordinate value (double number format) of the polygons list.
 double getYmax()
          Gets the maximum Y coordinate value (double number format) of the polygons list.
 double getYmin()
          Gets the minimum Y coordinate value (double number format) of the polygons list.
 void produceIntCoordinates()
          Produces integer coordinates out of the long/lat values given in degrees.
 void setCentralizationFactor()
          This method will determine the offset needed in order to make the map be drawn in (0,0)
 void setPolygonsBorders()
          Sets the minimum and maximum values of the coordinates saved in the polygons list.
 void setWhichProjection(java.lang.String whichProjection)
          Set whichProjection
 void setXmax()
          Saves the maximum X coordinate value (double number format) of the polygons list in a member of the class.
 void setXmin()
          Saves the minimum X coordinate value (double number format) in the polygons list in a member of the class.
 void setYmax()
          Saves the maximum Y coordinate value (double number format) of the polygons list in a member of the class.
 void setYmin()
          Saves the minimum Y coordinate value (double number format) of the polygons list in a member of the class.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

StemPolygonsList

public StemPolygonsList()
Empty Constructor


StemPolygonsList

public StemPolygonsList(LatLong latLongData,
                        double relativeValueOfPolygon,
                        java.lang.String title)
Constructor which gets a LatLong object and constructs a list of polygons

Parameters:
latLongData -
relativeValueOfPolygon -
title -
Method Detail

setPolygonsBorders

public void setPolygonsBorders()
Sets the minimum and maximum values of the coordinates saved in the polygons list. This method will call four helper methods, and will save the optimum values in members of the class.


setXmin

public void setXmin()
Saves the minimum X coordinate value (double number format) in the polygons list in a member of the class.


getXmin

public double getXmin()
Gets the minimum X coordinate value (double number format) of the polygons list.

Returns:
double

setXmax

public void setXmax()
Saves the maximum X coordinate value (double number format) of the polygons list in a member of the class.


getXmax

public double getXmax()
Gets the maximum X coordinate value (double number format) of the polygons list.

Returns:
double

setYmin

public void setYmin()
Saves the minimum Y coordinate value (double number format) of the polygons list in a member of the class.


getYmin

public double getYmin()
Gets the minimum Y coordinate value (double number format) of the polygons list.

Returns:
double

setYmax

public void setYmax()
Saves the maximum Y coordinate value (double number format) of the polygons list in a member of the class.


getYmax

public double getYmax()
Gets the maximum Y coordinate value (double number format) of the polygons list.

Returns:
double

setCentralizationFactor

public void setCentralizationFactor()
This method will determine the offset needed in order to make the map be drawn in (0,0)


getCentralizationFactor

public org.eclipse.swt.graphics.Point getCentralizationFactor()
Gets the offset needed to be made in order to centralize the map.

Returns:
Point

centralizePolygons

public void centralizePolygons()
This method will add the centralizationFactor value to the polygons' coordinates in order to make it be at the center of the view


produceIntCoordinates

public void produceIntCoordinates()
Produces integer coordinates out of the long/lat values given in degrees. It does so by calling a similar method on each one of the StemPolygon's in the list.


getPolygonContainingThisCoordinate

public StemPolygon getPolygonContainingThisCoordinate(java.awt.geom.Point2D mousePoint,
                                                      java.awt.geom.Point2D scalingFactorPoint,
                                                      java.awt.geom.AffineTransform mapAffineTransform)
Returns the polygon that contains the desired coordinates (x,y)

Parameters:
mousePoint -
scalingFactorPoint -
mapAffineTransform -
Returns:
the polygon

getWhichProjection

public java.lang.String getWhichProjection()
Returns:
whichProjection

setWhichProjection

public void setWhichProjection(java.lang.String whichProjection)
Set whichProjection

Parameters:
whichProjection -