Package com.kheops.jmap.metadata
Class Project
java.lang.Object
com.kheops.jmap.metadata.LocalizedObject
com.kheops.jmap.metadata.Project
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,Comparable<Project>
public class Project
extends LocalizedObject
implements Serializable, Cloneable, Comparable<Project>, ObjectInputValidation
This class encapsulates the information about a project on JMapServer.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doublestatic final double -
Constructor Summary
ConstructorsConstructorDescriptionProject(int id) Constructs a new Project object with the specified parameters.Project(int id, String name, String desc, JMapUnit mapUnit, JMapUnit distanceUnit, OrientedRectangle viewBounds) Constructs a new Project object with the specified parameters.Project(int id, String name, String desc, JMapUnit mapUnit, JMapUnit distanceUnit, OrientedRectangle viewBounds, JMapUnit displayUnit) Constructs a new Project object with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionclone()Overrides clone to return a new instance of Project that is the exact copy of the callerintImplementation of the interface ComparableGets a ViewSetting instance containing the default view settings.Gets the description.getDescription(Locale locale) Gets the description of this project for a specific locale.Retrieves the unit used in the projectintgetId()Gets the project id.Retrieves the default background color of the projectRetrieves the bounding area of the projectDeprecated.use getInitialExtent() instead.Retrieves the unit used in the projectRetrieves the defined maximum area of the project.doubleRetrieves the maximum scale of the project.doubleRetrieves the minimum scale of the project.getName()Gets the name of this project.Gets the name of this project for a specific locale.booleanReturns the value of the preventLabelsOverlapping flag.booleanChecks if the project is named (including available translations, case insensitive) as the specified value.voidremoveTranslationsOtherThan(Locale[] locales) Removes anyLocalefrom this object that are not in the specifiedlocales.voidsetDescription(String description) Sets the DescriptionvoidsetDescription(String description, Locale locale) Sets the description of this project for the specified Locale.voidsetDistanceUnit(JMapUnit unit) Sets the unit used in the projectvoidsetId(int id) Sets the project id.voidsetInitialBGColor(Color color) Sets the default background color of the projectvoidsetInitialExtent(OrientedRectangle extent) Sets the bounding area of the projectvoidDeprecated.use setInitialExtent(OrientedRectangle extent) instead.voidsetMapUnit(JMapUnit unit) Sets the unit used in the projectvoidsetMaximumExtent(OrientedRectangle extent) Sets the defined maximum area of the project.voidsetMaximumScale(double maximumScale) Sets the maximum scale of the project.voidsetMinimumScale(double minimumScale) Sets the minimum scale of the project.voidSets the name of this project.voidSets the name of this project for the specified Locale.voidsetPreventLabelsOverlapping(boolean flag) Sets the value of the preventLabelsOverlapping flag.toString()voidThis method update the project by setting the appropriate instance variable.voidMethods inherited from class com.kheops.jmap.metadata.LocalizedObject
getAvailableLocales, getTranslation, isTranslationExists, setTranslation, updateTranslations
-
Field Details
-
DEFAULT_MINIMUM_SCALE
public static final double DEFAULT_MINIMUM_SCALE- See Also:
-
DEFAULT_MAXIMUM_SCALE
public static final double DEFAULT_MAXIMUM_SCALE- See Also:
-
-
Constructor Details
-
Project
public Project(int id, String name, String desc, JMapUnit mapUnit, JMapUnit distanceUnit, OrientedRectangle viewBounds, JMapUnit displayUnit) Constructs a new Project object with the specified parameters.- Parameters:
id- the unique id of the projectname- the name of the projectdesc- the description of the projectmapUnit- the unit of the projectdistanceUnit- the distance unit of the projectviewBounds- the bounding area of the data in the projectdisplayUnit- the display unit for the view
-
Project
public Project(int id, String name, String desc, JMapUnit mapUnit, JMapUnit distanceUnit, OrientedRectangle viewBounds) Constructs a new Project object with the specified parameters.- Parameters:
id- the unique id of the projectname- the name of the projectdesc- the description of the projectmapUnit- the unit of the projectviewBounds- the bounding area of the data in the project
-
Project
public Project(int id) Constructs a new Project object with the specified parameters.- Parameters:
id- the unique id of the project
-
-
Method Details
-
getInitialExtent
Retrieves the bounding area of the project- Returns:
- the bounding area of the project
-
getInitialViewBounds
Deprecated.use getInitialExtent() instead. -
setInitialExtent
Sets the bounding area of the project- Parameters:
extent- the new bounding area of the project- See Also:
-
setInitialViewBounds
Deprecated.use setInitialExtent(OrientedRectangle extent) instead. -
getMaximumExtent
Retrieves the defined maximum area of the project.- Returns:
- the defined maximum area of the project
-
setMaximumExtent
Sets the defined maximum area of the project.- Parameters:
extent- the new defined maximum area of the project- See Also:
-
getMapUnit
Retrieves the unit used in the project- Returns:
- the unit used in the project
- See Also:
-
setMapUnit
Sets the unit used in the project- Parameters:
unit- the new unit used in the project- See Also:
-
getDistanceUnit
Retrieves the unit used in the project- Returns:
- the unit used in the project
- See Also:
-
setDistanceUnit
Sets the unit used in the project- Parameters:
unit- the new unit used in the project- See Also:
-
getInitialBGColor
Retrieves the default background color of the project- Returns:
- the background color of the directory
-
setInitialBGColor
Sets the default background color of the project- Parameters:
color- background color of the directory
-
getMaximumScale
public double getMaximumScale()Retrieves the maximum scale of the project. Zoom operations beyond that value should not be allowed.- Returns:
- the maximum scale of the project.
-
setMaximumScale
public void setMaximumScale(double maximumScale) Sets the maximum scale of the project. Zoom operations beyond that value should not be allowed.- Parameters:
maximumScale- the maximum scale to set.
-
getMinimumScale
public double getMinimumScale()Retrieves the minimum scale of the project. Zoom operations beyond that value should not be allowed.- Returns:
- the minimum scale of the project.
-
setMinimumScale
public void setMinimumScale(double minimumScale) Sets the minimum scale of the project. Zoom operations beyond that value should not be allowed.- Parameters:
minimumScale- the minimum scale to set.
-
getId
public int getId()Gets the project id.- Returns:
- the project id.
-
setId
public void setId(int id) Sets the project id.- Parameters:
id- the new project id.
-
getName
Gets the name of this project.- Returns:
- name
-
getName
Gets the name of this project for a specific locale.- Parameters:
locale-- Returns:
- name.
-
setName
Sets the name of this project.- Parameters:
name- the new given name.
-
setName
Sets the name of this project for the specified Locale.- Parameters:
name- the new given name.locale- the locale for this name
-
getDescription
Gets the description.- Returns:
- the description string
-
getDescription
Gets the description of this project for a specific locale.- Parameters:
locale-- Returns:
- name.
-
setDescription
Sets the Description- Parameters:
description- the associated description string.
-
setDescription
Sets the description of this project for the specified Locale.- Parameters:
description- the new given description.locale- the locale for this description
-
update
This method update the project by setting the appropriate instance variable.- Parameters:
project- the project instance containing the data that needs to be updated.
-
getDefaultViewSettings
Gets a ViewSetting instance containing the default view settings.- Returns:
- the corresponding ViewSettings instance.
- See Also:
-
clone
Overrides clone to return a new instance of Project that is the exact copy of the caller -
setPreventLabelsOverlapping
public void setPreventLabelsOverlapping(boolean flag) Sets the value of the preventLabelsOverlapping flag. If preventOverlapping is active, labels will not overlap each others. -
getPreventLabelsOverlapping
public boolean getPreventLabelsOverlapping()Returns the value of the preventLabelsOverlapping flag. If preventLabelsOverlapping is active, labels will not overlap each others. -
toString
-
compareTo
Implementation of the interface Comparable- Specified by:
compareToin interfaceComparable<Project>- Parameters:
o- the object to compare with- Returns:
- An integer. See Comparable for more details.
-
validateObject
public void validateObject()- Specified by:
validateObjectin interfaceObjectInputValidation
-
getDefaultLanguage
-
getAvailableLanguages
-
isNamed
Checks if the project is named (including available translations, case insensitive) as the specified value.- Parameters:
value-- Returns:
-
removeTranslationsOtherThan
Description copied from class:LocalizedObjectRemoves anyLocalefrom this object that are not in the specifiedlocales.locales[0]should be the default language- Overrides:
removeTranslationsOtherThanin classLocalizedObject- Parameters:
locales-
-