Class Task
- java.lang.Object
-
- com.vividsolutions.jump.workbench.model.Task
-
- All Implemented Interfaces:
LayerManagerProxy
public class Task extends Object implements LayerManagerProxy
Whatever the user needs to do a particular task. Currently a thin wrapper around a LayerManager.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTask.NameListenerInterface: NameListener must respond to task name changing.
-
Field Summary
Fields Modifier and Type Field Description static StringPROJECT_COMMENT_KEYProject Information property, Used to determine extra info as string textstatic StringPROJECT_FILE_KEYProject File property, Used to determine whether a project file has been moved away from its original locationstatic StringPROJECT_SRS_KEYProject SRS property, Used to determine spatial reference system of a project (saved as SRID: 32632, 4326, etc)static StringPROJECT_TIME_KEYProject Time property, Used to determine last modification time of a projectstatic StringPROJECT_UNIT_KEYProject Unit property, Used to determine project unit (extract from SRS: metre, foot, etc)
-
Constructor Summary
Constructors Constructor Description Task()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Task.NameListener nameListener)voidaddCategory(Category category)Called by Java2XMLCollection<Category>getCategories()LayerManagergetLayerManager()booleangetMaximized()StringgetName()FilegetProjectFile()Map<QName,Object>getProperties()Get all the task properties.<T> TgetProperty(QName name)Get the value for the named property casting it to the return value.<T> TgetProperty(QName name, Object defaultValue)convenience method forgetProperty(QName)that returns a default value in case the named property is not definedorg.locationtech.jts.geom.EnvelopegetSavedViewEnvelope()PointgetTaskWindowLocation()intgetTaskWindowLocationX()intgetTaskWindowLocationY()DimensiongetTaskWindowSize()intgetTaskWindowSizeHeight()intgetTaskWindowSizeWidth()doublegetTaskWindowZoomBottom()doublegetTaskWindowZoomLeft()doublegetTaskWindowZoomRight()doublegetTaskWindowZoomTop()voidsetMaximized(boolean isMaximized)voidsetName(String name)voidsetProjectFile(File projectFile)voidsetProperties(Map<QName,Object> properties)Set all the task properties.voidsetProperty(QName name, Object value)Set the value for the named property.voidsetSavedViewEnvelope(org.locationtech.jts.geom.Envelope savedViewEnvelope)voidsetTaskWindowLocation(Point taskWindowLocation)voidsetTaskWindowLocationX(String x)voidsetTaskWindowLocationY(String y)voidsetTaskWindowSize(Dimension taskWindowSize)voidsetTaskWindowSizeHeight(String height)voidsetTaskWindowSizeWidth(String width)voidsetTaskWindowZoomBottom(String bottom)voidsetTaskWindowZoomLeft(String left)voidsetTaskWindowZoomRight(String right)voidsetTaskWindowZoomTop(String top)This method must be called after all three previous have been done.StringtoString()
-
-
-
Field Detail
-
PROJECT_FILE_KEY
public static final String PROJECT_FILE_KEY
Project File property, Used to determine whether a project file has been moved away from its original location- See Also:
- Constant Field Values
-
PROJECT_UNIT_KEY
public static final String PROJECT_UNIT_KEY
Project Unit property, Used to determine project unit (extract from SRS: metre, foot, etc)- See Also:
- Constant Field Values
-
PROJECT_SRS_KEY
public static final String PROJECT_SRS_KEY
Project SRS property, Used to determine spatial reference system of a project (saved as SRID: 32632, 4326, etc)- See Also:
- Constant Field Values
-
PROJECT_COMMENT_KEY
public static final String PROJECT_COMMENT_KEY
Project Information property, Used to determine extra info as string text- See Also:
- Constant Field Values
-
PROJECT_TIME_KEY
public static final String PROJECT_TIME_KEY
Project Time property, Used to determine last modification time of a project- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
-
setName
public void setName(String name)
-
add
public void add(Task.NameListener nameListener)
-
getProjectFile
public File getProjectFile()
-
setProjectFile
public void setProjectFile(File projectFile)
-
getLayerManager
public LayerManager getLayerManager()
- Specified by:
getLayerManagerin interfaceLayerManagerProxy
-
getCategories
public Collection<Category> getCategories()
-
addCategory
public void addCategory(Category category)
Called by Java2XML
-
setProperty
public void setProperty(QName name, Object value)
Set the value for the named property.- Parameters:
name- The name of the property.value- The value for the property.
-
getProperty
public <T> T getProperty(QName name)
Get the value for the named property casting it to the return value.
Instead of:
Integer i = (Integer)task.getProperty(...)
You can use the following:
Integer i = task.getProperty(...)
- Parameters:
name- The name of the property.- Returns:
- value The value for the property.
-
getProperty
public <T> T getProperty(QName name, Object defaultValue)
convenience method forgetProperty(QName)that returns a default value in case the named property is not defined- Parameters:
name- qualified name of the Task propertydefaultValue- default value of the Task property- Returns:
- the property of type T having this name
-
getProperties
public Map<QName,Object> getProperties()
Get all the task properties.- Returns:
- The task properties.
-
setProperties
public void setProperties(Map<QName,Object> properties)
Set all the task properties.- Parameters:
properties- The task properties.
-
getTaskWindowLocation
public Point getTaskWindowLocation()
-
getTaskWindowLocationX
public int getTaskWindowLocationX()
-
getTaskWindowLocationY
public int getTaskWindowLocationY()
-
setTaskWindowLocation
public void setTaskWindowLocation(Point taskWindowLocation)
-
setTaskWindowLocationX
public void setTaskWindowLocationX(String x)
-
setTaskWindowLocationY
public void setTaskWindowLocationY(String y)
-
getTaskWindowSize
public Dimension getTaskWindowSize()
-
getTaskWindowSizeWidth
public int getTaskWindowSizeWidth()
-
getTaskWindowSizeHeight
public int getTaskWindowSizeHeight()
-
setTaskWindowSize
public void setTaskWindowSize(Dimension taskWindowSize)
-
setTaskWindowSizeWidth
public void setTaskWindowSizeWidth(String width)
-
setTaskWindowSizeHeight
public void setTaskWindowSizeHeight(String height)
-
getMaximized
public boolean getMaximized()
-
setMaximized
public void setMaximized(boolean isMaximized)
-
getSavedViewEnvelope
public org.locationtech.jts.geom.Envelope getSavedViewEnvelope()
-
getTaskWindowZoomLeft
public double getTaskWindowZoomLeft()
-
getTaskWindowZoomRight
public double getTaskWindowZoomRight()
-
getTaskWindowZoomBottom
public double getTaskWindowZoomBottom()
-
getTaskWindowZoomTop
public double getTaskWindowZoomTop()
-
setSavedViewEnvelope
public void setSavedViewEnvelope(org.locationtech.jts.geom.Envelope savedViewEnvelope)
-
setTaskWindowZoomLeft
public void setTaskWindowZoomLeft(String left)
-
setTaskWindowZoomRight
public void setTaskWindowZoomRight(String right)
-
setTaskWindowZoomBottom
public void setTaskWindowZoomBottom(String bottom)
-
setTaskWindowZoomTop
public void setTaskWindowZoomTop(String top)
This method must be called after all three previous have been done. Java2XML does this. This is necessary because all parameters must be known before an Envelope can be created (unlike Point and Dimension).- Parameters:
top-
-
-