Class Project

All Implemented Interfaces:
ObjectInputValidation, Serializable, Cloneable, Comparable<Project>

This class encapsulates the information about a project on JMapServer.
See Also:
  • 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 project
      name - the name of the project
      desc - the description of the project
      mapUnit - the unit of the project
      distanceUnit - the distance unit of the project
      viewBounds - the bounding area of the data in the project
      displayUnit - 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 project
      name - the name of the project
      desc - the description of the project
      mapUnit - the unit of the project
      viewBounds - 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

      public OrientedRectangle getInitialExtent()
      Retrieves the bounding area of the project
      Returns:
      the bounding area of the project
    • getInitialViewBounds

      @Deprecated public OrientedRectangle getInitialViewBounds()
      Deprecated.
      use getInitialExtent() instead.
    • setInitialExtent

      public void setInitialExtent(OrientedRectangle extent)
      Sets the bounding area of the project
      Parameters:
      extent - the new bounding area of the project
      See Also:
    • setInitialViewBounds

      @Deprecated public void setInitialViewBounds(OrientedRectangle extent)
      Deprecated.
      use setInitialExtent(OrientedRectangle extent) instead.
    • getMaximumExtent

      public OrientedRectangle getMaximumExtent()
      Retrieves the defined maximum area of the project.
      Returns:
      the defined maximum area of the project
    • setMaximumExtent

      public void setMaximumExtent(OrientedRectangle extent)
      Sets the defined maximum area of the project.
      Parameters:
      extent - the new defined maximum area of the project
      See Also:
    • getMapUnit

      public JMapUnit getMapUnit()
      Retrieves the unit used in the project
      Returns:
      the unit used in the project
      See Also:
    • setMapUnit

      public void setMapUnit(JMapUnit unit)
      Sets the unit used in the project
      Parameters:
      unit - the new unit used in the project
      See Also:
    • getDistanceUnit

      public JMapUnit getDistanceUnit()
      Retrieves the unit used in the project
      Returns:
      the unit used in the project
      See Also:
    • setDistanceUnit

      public void setDistanceUnit(JMapUnit unit)
      Sets the unit used in the project
      Parameters:
      unit - the new unit used in the project
      See Also:
    • getInitialBGColor

      public Color getInitialBGColor()
      Retrieves the default background color of the project
      Returns:
      the background color of the directory
    • setInitialBGColor

      public void setInitialBGColor(Color color)
      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

      public String getName()
      Gets the name of this project.
      Returns:
      name
    • getName

      public String getName(Locale locale)
      Gets the name of this project for a specific locale.
      Parameters:
      locale -
      Returns:
      name.
    • setName

      public void setName(String name)
      Sets the name of this project.
      Parameters:
      name - the new given name.
    • setName

      public void setName(String name, Locale locale)
      Sets the name of this project for the specified Locale.
      Parameters:
      name - the new given name.
      locale - the locale for this name
    • getDescription

      public String getDescription()
      Gets the description.
      Returns:
      the description string
    • getDescription

      public String getDescription(Locale locale)
      Gets the description of this project for a specific locale.
      Parameters:
      locale -
      Returns:
      name.
    • setDescription

      public void setDescription(String description)
      Sets the Description
      Parameters:
      description - the associated description string.
    • setDescription

      public void setDescription(String description, Locale locale)
      Sets the description of this project for the specified Locale.
      Parameters:
      description - the new given description.
      locale - the locale for this description
    • update

      public void update(Project project)
      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

      public ViewSettings getDefaultViewSettings()
      Gets a ViewSetting instance containing the default view settings.
      Returns:
      the corresponding ViewSettings instance.
      See Also:
    • clone

      public Object clone()
      Overrides clone to return a new instance of Project that is the exact copy of the caller
      Overrides:
      clone in class Object
      Returns:
      the clone instance
    • 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

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(Project o)
      Implementation of the interface Comparable
      Specified by:
      compareTo in interface Comparable<Project>
      Parameters:
      o - the object to compare with
      Returns:
      An integer. See Comparable for more details.
    • validateObject

      public void validateObject()
      Specified by:
      validateObject in interface ObjectInputValidation
    • getDefaultLanguage

      public String getDefaultLanguage()
    • getAvailableLanguages

      public List<String> getAvailableLanguages()
    • isNamed

      public boolean isNamed(String value)
      Checks if the project is named (including available translations, case insensitive) as the specified value.
      Parameters:
      value -
      Returns:
    • removeTranslationsOtherThan

      public void removeTranslationsOtherThan(Locale[] locales)
      Description copied from class: LocalizedObject
      Removes any Locale from this object that are not in the specified locales. locales[0] should be the default language
      Overrides:
      removeTranslationsOtherThan in class LocalizedObject
      Parameters:
      locales -