Class BookmarksManager.BookmarkNode
java.lang.Object
gaiasky.gui.bookmarks.BookmarksManager.BookmarkNode
- Enclosing class:
BookmarksManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Type of bookmark enum. -
Field Summary
FieldsModifier and TypeFieldDescriptionChildren, if any.Camera direction, for positional bookmarks.The name of the focus object in location bookmarks.static final String
Regular expression that defines the format of positional bookmarks, which is:The name of this node.static final String
Token to use for null values.The parent of this node, null if root.The full path.Camera position, for positional bookmarks.The text of the bookmark in the bookmarks.txt file.Time, for location bookmarks.Camera up vector, for positional bookmarks.The UUID, for location bookmarks. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Counts the number of bookmarks this bookmark contains.void
void
boolean
boolean
Checks if this bookmark is a folder (i.e.boolean
Checks if this bookmark is of typeBookmarksManager.BookmarkNode.BookmarkType.LOCATION
.boolean
Checks if this bookmark is of typeBookmarksManager.BookmarkNode.BookmarkType.OBJECT
.This method loads the settings file for this bookmark.toString()
-
Field Details
-
NULL_TOKEN
-
LOC_BOOKMARK_REGEX
Regular expression that defines the format of positional bookmarks, which is:
All terms may be null, except the name of the bookmark.{[x,y,z]|[dx,dy,dz]|[ux,uy,uz]|instant|name|id|focus}
- See Also:
-
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
The name of this node. -
position
Camera position, for positional bookmarks. -
direction
Camera direction, for positional bookmarks. -
up
Camera up vector, for positional bookmarks. -
time
Time, for location bookmarks. -
uuid
The UUID, for location bookmarks. -
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
The full path. -
parent
The parent of this node, null if root. -
children
Children, if any. -
type
-
-
Constructor Details
-
BookmarkNode
-
-
Method Details
-
initializeText
public void initializeText() -
loadSettingsFromFile
This method loads the settings file for this bookmark. This operation should happen every time a bookmark is made 'active'. -
insert
-
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
-
getFirstFolderAncestor
-
isDescendantOf
-
isTypeFolder
public boolean isTypeFolder()Checks if this bookmark is a folder (i.e. of typeBookmarksManager.BookmarkNode.BookmarkType.FOLDER
).- Returns:
- True if this is a folder.
-
isTypeObject
public boolean isTypeObject()Checks if this bookmark is of typeBookmarksManager.BookmarkNode.BookmarkType.OBJECT
.- Returns:
- True if this is an object bookmark.
-
isTypeLocation
public boolean isTypeLocation()Checks if this bookmark is of typeBookmarksManager.BookmarkNode.BookmarkType.LOCATION
.- Returns:
- True if this is a location bookmark.
-