com.partnersoft.maps.model
Class JobRoverSet

java.lang.Object
  extended by com.partnersoft.maps.model.RoverSet
      extended by com.partnersoft.maps.model.JobRoverSet

public class JobRoverSet
extends RoverSet

A RoverSet based on Jobs. This class is made much more complicated than a read-only map set by the demands of an interactive GUI. We track not only the jobs in the set, but which one is the current focus for manipulation. We do the same for the current alternative, current chain, and so forth. This differs subtly from the immediate selection (which may be as specific as a location unit, or as general as the whole job). To distinguish it from the selection, we call it the "editing context". Rendering is based on the configurable legend for a job and its components. The editing context is indicated by an additional rendering of the "skeleton" of the current chain. The skeleton provides consistent graphical handles and feedback for interacting with and modifying a chain. For example, a chain may not render its locations (it forms a polyline or line mesh without icons), yet you need to be able to select and move the locations. The same holds true for chains whose spans are not configured to be visible.

Author:
Paul Reavis Copyright 2004

Field Summary
static int ALTERNATIVE
           
static int CHAIN
           
static int JOB
           
static int LOCATION
           
static int LOCATIONUNIT
           
static int SPAN
           
static int SPANUNIT
           
 
Fields inherited from class com.partnersoft.maps.model.RoverSet
areaToGroup, areaTypes, changeGadget, enabled, findItems, groups, legendAliases, lineToGroup, lineTypes, lookups, mapSet, pointToGroup, pointTypes, renderLegends, space, textToGroup, textTypes, viewSettings
 
Constructor Summary
JobRoverSet(MapSpace space, MapSet mapSet)
           
 
Method Summary
 void addJob(Job newJob)
           
 void addToJob(Job newJob)
          Adds data from one job into the current job.
 MapDataItem dataFor(int dataID)
          Subclasses must also provide this facility.
 JobDataComponent fetchJobDataComponent(int dataID)
           
 void fireChanged()
          We need update the rover before notifying anyone about the changes.
 int[] getContextIDs()
           
 Alternative getCurrentAlternative()
           
 Chain getCurrentChain()
           
 Job getCurrentJob()
           
 Location getCurrentLocation()
           
 Span getCurrentSpan()
           
 int getDataItemCount()
          This returns the number of data items.
 Naming getDataTypes()
           
 java.util.ArrayList getJobs()
           
 java.lang.String getName()
           
 JobDataComponent getSelection()
           
 RoverBytes graphicsFor(int dataID)
          All subclasses must provide this facility.
 RoverBytes[] graphicsInside(MapViewFrame frame)
          Currently returns all job data, whether visible or not.
 void reload()
           
 void removeJob(Job oldJob)
           
 void replaceJob(Job newJob)
          Replaces the current job.
 void select(int dataID)
          Selects the JobDataComponent with the given ID, and sets the context appropriately.
 void select(JobDataComponent what)
          Selects the given JobDataComponent, and sets the context appropriately.
 void setName(java.lang.String newName)
           
 void setSpinning(boolean tizit)
           
 void setStretching(boolean tizit)
           
 void stretchTo(double x, double y)
           
 
Methods inherited from class com.partnersoft.maps.model.RoverSet
addChangeListener, areaTypeCodeFor, findItemNamed, getAreaTypes, getFindItems, getGroupIDFor, getLineTypes, getMapSet, getPointTypes, getProfile, getTextTypes, isDrawable, isEnabled, lineTypeCodeFor, lookupNamed, pointTypeCodeFor, removeChangeListener, scaleRegionFor, setEnabled, setProfile, textTypeCodeFor, updateGroups
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JOB

public static final int JOB
See Also:
Constant Field Values

ALTERNATIVE

public static final int ALTERNATIVE
See Also:
Constant Field Values

CHAIN

public static final int CHAIN
See Also:
Constant Field Values

LOCATION

public static final int LOCATION
See Also:
Constant Field Values

SPAN

public static final int SPAN
See Also:
Constant Field Values

LOCATIONUNIT

public static final int LOCATIONUNIT
See Also:
Constant Field Values

SPANUNIT

public static final int SPANUNIT
See Also:
Constant Field Values
Constructor Detail

JobRoverSet

public JobRoverSet(MapSpace space,
                   MapSet mapSet)
Method Detail

replaceJob

public void replaceJob(Job newJob)
Replaces the current job.


addToJob

public void addToJob(Job newJob)
Adds data from one job into the current job. Assumes it can do as it wishes with the copy, so beware!


addJob

public void addJob(Job newJob)

removeJob

public void removeJob(Job oldJob)

getJobs

public java.util.ArrayList getJobs()

select

public void select(int dataID)
Selects the JobDataComponent with the given ID, and sets the context appropriately.


select

public void select(JobDataComponent what)
Selects the given JobDataComponent, and sets the context appropriately.


fireChanged

public void fireChanged()
We need update the rover before notifying anyone about the changes.

Overrides:
fireChanged in class RoverSet

fetchJobDataComponent

public JobDataComponent fetchJobDataComponent(int dataID)

setStretching

public void setStretching(boolean tizit)

setSpinning

public void setSpinning(boolean tizit)

stretchTo

public void stretchTo(double x,
                      double y)

graphicsInside

public RoverBytes[] graphicsInside(MapViewFrame frame)
Currently returns all job data, whether visible or not.

Specified by:
graphicsInside in class RoverSet

graphicsFor

public RoverBytes graphicsFor(int dataID)
All subclasses must provide this facility. It returns the hilite graphics for the given object ID.

Specified by:
graphicsFor in class RoverSet

dataFor

public MapDataItem dataFor(int dataID)
Subclasses must also provide this facility. It returns an appropriate RoverItem for the given ID.

Specified by:
dataFor in class RoverSet

getDataItemCount

public int getDataItemCount()
Description copied from class: RoverSet
This returns the number of data items.

Specified by:
getDataItemCount in class RoverSet

getDataTypes

public Naming getDataTypes()

reload

public void reload()
            throws java.io.IOException
Specified by:
reload in class RoverSet
Throws:
java.io.IOException

getContextIDs

public int[] getContextIDs()

getName

public java.lang.String getName()

setName

public void setName(java.lang.String newName)

getCurrentJob

public Job getCurrentJob()

getCurrentAlternative

public Alternative getCurrentAlternative()

getCurrentChain

public Chain getCurrentChain()

getCurrentLocation

public Location getCurrentLocation()

getCurrentSpan

public Span getCurrentSpan()

getSelection

public JobDataComponent getSelection()