com.partnersoft.v3x.apps.Staker.domain
Class Location

java.lang.Object
  extended by com.partnersoft.v3x.apps.MapBrowser.MapPoint
      extended by com.partnersoft.v3x.apps.MapBrowser.MapTreeNode
          extended by com.partnersoft.v3x.apps.Staker.domain.StakingNode
              extended by com.partnersoft.v3x.apps.Staker.domain.Location
All Implemented Interfaces:
java.io.Serializable

public class Location
extends StakingNode

This is a point on the electrical grid where assemblies and conductors may be placed.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.partnersoft.v3x.apps.Staker.domain.StakingNode
job
 
Fields inherited from class com.partnersoft.v3x.apps.MapBrowser.MapPoint
coords
 
Constructor Summary
Location()
          Create a new, blank Location.
Location(Job job)
          Create a new location with location defaults set according to data in job header
 
Method Summary
 void addGISLocationUnit(java.lang.String unitCode, int quantity)
          Useful for python scripting; add the named unit as existing.
 void addGISSpanUnit(java.lang.String unitCode, int length)
          Useful for python scripting; add the named unit as existing.
 void assignConstructionID()
          Assigns a location id from the job and increments the job's location id counter.
 void clearGuid()
          This clears both the location's guid and any unit guids.
 void contractPolylines()
          Part of the grand TOF depth-reduction kludge; this compacts the intermediate points into a simple list.
 java.lang.Object deepCopy()
           
 void expandPolylines()
          Part of the grand TOF depth-reduction kludge; this expands the intermediate points from a simple list.
 double getCalculatedSpan()
          The by-the-map distance in feet to the parent point.
 java.util.List<Location> getChildLocations()
           
 java.util.List<StakedUnitCombo> getCombos()
           
 java.util.List<StakedUnitComboState> getComboStates()
          This accessor is used to store the combos in TOF format.
 java.lang.String getComments()
          Comments or whatever.
 java.lang.String getConnectivityPosition()
          Returns a sorting key based on the locations' position in the job.
 java.lang.String getConstructionID()
          A unique ID assigned to the point in the job to facilitate references to diagrams.
 java.util.ArrayList getDescendentLocations()
           
 GPSPosition getGPSPosition()
           
 HexagonLabel getHexagonLabel()
           
 double getHexAngle()
          Angle in radians of the hexagon label.
 int getHexDistance()
          Distance in pixels of the hexagon label.
 LocationInfo getInfo()
           
 int getLocationID()
          A truly unique ID assigned to the point; no two in the job should be the same.
 byte[] getLocationShape()
           
 java.lang.String getMapLocation()
          Coordinate in nomenclature space.
 OverUnder getOverUnder()
          Overhead or underground? One lump or two?
 java.lang.String getSourceName()
           
 Span getSpan()
          This is the backspan, or imaginary line connecting this node with its parent.
 Coord3D getSpanLegendCoord()
           
 java.util.ArrayList getStations()
           
 StakeStatus getStatus()
          Existing, retired, or new.
 Coord3D getUnitLegendCoord()
           
 java.util.Set<UnitAtALocation> getUnits()
          Stuff on the point.
 java.util.Set getUnitSummary()
          An accumulated summary of all units (span or location) used in the job.
 ValidationErrorList getValidationErrors()
           
 boolean isShowLegend()
           
 boolean isShowSpanLegend()
           
 void paintOn(java.awt.Graphics g, java.awt.Point p, boolean inverse)
          Subclasses should override this.
 void paintOn(java.awt.Graphics g, RenderMold mold)
          Figures out where the centerpoint should be and calls paintOn(Graphics, Point);
 void refreshConnectivityPosition(java.lang.String prefix, int count)
           
 void setComboStates(java.util.List<StakedUnitComboState> newStates)
          This accessor is used to store the combos in TOF format.
 void setComments(java.lang.String newComments)
           
 void setConnectivityPosition(java.lang.String newPosition)
           
 void setConstructionID(java.lang.String newconstructionID)
           
 void setGPSPosition(GPSPosition newPosition)
           FIXME: take this out.
 void setHexAngle(double newHexAngle)
           
 void setHexDistance(int newHexDistance)
           
 void setInfo(LocationInfo newInfo)
           
 void setLocationID(int newlocationID)
           
 void setMapLocation(java.lang.String newMapLocation)
           
 void setOverUnder(OverUnder newOverUnder)
           
 void setShowLegend(boolean newShowLegend)
           
 void setShowSpanLegend(boolean newShowSpanLegend)
           
 void setSpan(Span newSpan)
           
 void setSpanLegendCoord(Coord3D newCoord)
           
 void setStations(java.util.ArrayList newStations)
           
 void setStatus(StakeStatus newStatus)
           
 void setUnitLegendCoord(Coord3D newCoord)
           
 void setUnits(java.util.Set newUnits)
           
 void setValidationErrors(ValidationErrorList newErrors)
           
 UnitAtALocation stakedUnitWithGuid(java.lang.String guid)
           
 java.lang.String toString()
           
 
Methods inherited from class com.partnersoft.v3x.apps.Staker.domain.StakingNode
getGpsID, getJob, getParentLocation, setGpsID
 
Methods inherited from class com.partnersoft.v3x.apps.MapBrowser.MapTreeNode
addChild, children, containsDescendent, descendents, formsLoop, getBackSpanDeflection, getBackSpanVector, getChildrenSet, getDistanceToParent, getFrontSpanDeflections, getFrontSpanVector, getNumberOfChildren, getParent, hasChildren, isLoopWith, listAllConnectedNodes, listChildren, remove, removeChild, setParent
 
Methods inherited from class com.partnersoft.v3x.apps.MapBrowser.MapPoint
copyFromExistingPoint, getCoords, getGuid, getPostprocessingPoint, getXyPoint, isSelected, setCoords, setGuid, setPostprocessingPoint, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Location

public Location()
Create a new, blank Location.


Location

public Location(Job job)
Create a new location with location defaults set according to data in job header

Method Detail

addGISLocationUnit

public void addGISLocationUnit(java.lang.String unitCode,
                               int quantity)
Useful for python scripting; add the named unit as existing.


addGISSpanUnit

public void addGISSpanUnit(java.lang.String unitCode,
                           int length)
Useful for python scripting; add the named unit as existing.


assignConstructionID

public void assignConstructionID()
Assigns a location id from the job and increments the job's location id counter.


contractPolylines

public void contractPolylines()
Part of the grand TOF depth-reduction kludge; this compacts the intermediate points into a simple list.


expandPolylines

public void expandPolylines()
Part of the grand TOF depth-reduction kludge; this expands the intermediate points from a simple list.


getCalculatedSpan

public double getCalculatedSpan()
The by-the-map distance in feet to the parent point.

Overrides:
getCalculatedSpan in class StakingNode

getSourceName

public java.lang.String getSourceName()

getLocationShape

public byte[] getLocationShape()

paintOn

public void paintOn(java.awt.Graphics g,
                    RenderMold mold)
Figures out where the centerpoint should be and calls paintOn(Graphics, Point);

Overrides:
paintOn in class MapPoint

paintOn

public void paintOn(java.awt.Graphics g,
                    java.awt.Point p,
                    boolean inverse)
Description copied from class: MapPoint
Subclasses should override this.

Specified by:
paintOn in class MapPoint

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getUnitSummary

public java.util.Set getUnitSummary()
An accumulated summary of all units (span or location) used in the job. Consists of a Set of StakedUnitSummary objects.


getConnectivityPosition

public java.lang.String getConnectivityPosition()
Returns a sorting key based on the locations' position in the job.


setConnectivityPosition

public void setConnectivityPosition(java.lang.String newPosition)

getDescendentLocations

public java.util.ArrayList getDescendentLocations()

getChildLocations

public java.util.List<Location> getChildLocations()

refreshConnectivityPosition

public void refreshConnectivityPosition(java.lang.String prefix,
                                        int count)

clearGuid

public void clearGuid()
This clears both the location's guid and any unit guids.

Overrides:
clearGuid in class MapPoint

getConstructionID

public java.lang.String getConstructionID()
A unique ID assigned to the point in the job to facilitate references to diagrams. Assigned sequentially; has no significance outside a job. Users can override the assigned ID to fit existing nomenclature, as long as the ID remains unique in the job.


setConstructionID

public void setConstructionID(java.lang.String newconstructionID)

getSpan

public Span getSpan()
This is the backspan, or imaginary line connecting this node with its parent. It is null if there is no parent.


setSpan

public void setSpan(Span newSpan)

getStatus

public StakeStatus getStatus()
Existing, retired, or new.


setStatus

public void setStatus(StakeStatus newStatus)

getHexAngle

public double getHexAngle()
Angle in radians of the hexagon label.


setHexAngle

public void setHexAngle(double newHexAngle)

getHexDistance

public int getHexDistance()
Distance in pixels of the hexagon label.


setHexDistance

public void setHexDistance(int newHexDistance)

getComments

public java.lang.String getComments()
Comments or whatever.


setComments

public void setComments(java.lang.String newComments)

getMapLocation

public java.lang.String getMapLocation()
Coordinate in nomenclature space.


setMapLocation

public void setMapLocation(java.lang.String newMapLocation)

getUnits

public java.util.Set<UnitAtALocation> getUnits()
Stuff on the point.


setUnits

public void setUnits(java.util.Set newUnits)

getOverUnder

public OverUnder getOverUnder()
Overhead or underground? One lump or two?


setOverUnder

public void setOverUnder(OverUnder newOverUnder)

getInfo

public LocationInfo getInfo()

setInfo

public void setInfo(LocationInfo newInfo)

getHexagonLabel

public HexagonLabel getHexagonLabel()

getStations

public java.util.ArrayList getStations()

setStations

public void setStations(java.util.ArrayList newStations)

getGPSPosition

public GPSPosition getGPSPosition()

setGPSPosition

public void setGPSPosition(GPSPosition newPosition)

FIXME: take this out. Don't use it because it isn't used anywhere else. I am not taking out because I can't test the consequences with old jobs.

Parameters:
newPosition -

getUnitLegendCoord

public Coord3D getUnitLegendCoord()

setUnitLegendCoord

public void setUnitLegendCoord(Coord3D newCoord)

getSpanLegendCoord

public Coord3D getSpanLegendCoord()

setSpanLegendCoord

public void setSpanLegendCoord(Coord3D newCoord)

getLocationID

public int getLocationID()
A truly unique ID assigned to the point; no two in the job should be the same.


setLocationID

public void setLocationID(int newlocationID)

isShowLegend

public boolean isShowLegend()

setShowLegend

public void setShowLegend(boolean newShowLegend)

isShowSpanLegend

public boolean isShowSpanLegend()

setShowSpanLegend

public void setShowSpanLegend(boolean newShowSpanLegend)

getCombos

public java.util.List<StakedUnitCombo> getCombos()

getComboStates

public java.util.List<StakedUnitComboState> getComboStates()
This accessor is used to store the combos in TOF format. It shouldn't be used for other purposes.

Returns:

setComboStates

public void setComboStates(java.util.List<StakedUnitComboState> newStates)
This accessor is used to store the combos in TOF format. It shouldn't be used for other purposes.


getValidationErrors

public ValidationErrorList getValidationErrors()

setValidationErrors

public void setValidationErrors(ValidationErrorList newErrors)

deepCopy

public java.lang.Object deepCopy()
Overrides:
deepCopy in class StakingNode

stakedUnitWithGuid

public UnitAtALocation stakedUnitWithGuid(java.lang.String guid)