Class BookmarksManager.BookmarkNode

java.lang.Object
gaiasky.gui.bookmarks.BookmarksManager.BookmarkNode
Enclosing class:
BookmarksManager

public static class BookmarksManager.BookmarkNode extends Object
  • Field Details

    • NULL_TOKEN

      public static final String NULL_TOKEN
      Token to use for null values.
      See Also:
    • LOC_BOOKMARK_REGEX

      public static final String LOC_BOOKMARK_REGEX
      Regular expression that defines the format of positional bookmarks, which is:

      {[x,y,z]|[dx,dy,dz]|[ux,uy,uz]|instant|name|id|focus}

      All terms may be null, except the name of the bookmark.
      See Also:
    • text

      public String text

      The text of the bookmark in the bookmarks.txt file. This coincides with the name for regular bookmarks. For positional bookmarks, this has the format:

      {[x,y,z]|[dx,dy,dz]|[ux,uy,uz]|instant|name|id|focus}
    • name

      public String name
      The name of this node.
    • position

      @Null public Vector3D position
      Camera position, for positional bookmarks.
    • direction

      @Null public Vector3D direction
      Camera direction, for positional bookmarks.
    • up

      @Null public Vector3D up
      Camera up vector, for positional bookmarks.
    • time

      @Null public Instant time
      Time, for location bookmarks.
    • uuid

      @Null public String uuid
      The UUID, for location bookmarks.
    • focus

      @Null public String focus
      The name of the focus object in location bookmarks. If this is set, the camera is set to focus mode with this focus when the bookmark is activated. Leave null to use free camera mode.
    • path

      public Path path
      The full path.
    • parent

      The parent of this node, null if root.
    • children

      Children, if any.
    • type

  • Constructor Details

    • BookmarkNode

      public BookmarkNode(Path path, boolean folder)
  • Method Details

    • initializeText

      public void initializeText()
    • loadSettingsFromFile

      public Settings loadSettingsFromFile()
      This method loads the settings file for this bookmark. This operation should happen every time a bookmark is made 'active'.
    • insert

      public void insert(BookmarksManager.BookmarkNode node)
    • countBookmarksRec

      public int countBookmarksRec()
      Counts the number of bookmarks this bookmark contains. If it is a leaf bookmark (location or object), this method returns 1. If it is a folder bookmark, it returns the number of leaf bookmarks within.
      Returns:
      The number of contained bookmarks in this bookmark.
    • toString

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

      public BookmarksManager.BookmarkNode getFirstFolderAncestor()
    • isDescendantOf

      public boolean isDescendantOf(BookmarksManager.BookmarkNode other)
    • isTypeFolder

      public boolean isTypeFolder()
      Checks if this bookmark is a folder (i.e. of type BookmarksManager.BookmarkNode.BookmarkType.FOLDER).
      Returns:
      True if this is a folder.
    • isTypeObject

      public boolean isTypeObject()
      Checks if this bookmark is of type BookmarksManager.BookmarkNode.BookmarkType.OBJECT.
      Returns:
      True if this is an object bookmark.
    • isTypeLocation

      public boolean isTypeLocation()
      Checks if this bookmark is of type BookmarksManager.BookmarkNode.BookmarkType.LOCATION.
      Returns:
      True if this is a location bookmark.