Class WorkspaceImpl

  • All Implemented Interfaces:
    Workspace, org.openide.util.Lookup.Provider

    public class WorkspaceImpl
    extends Object
    implements Workspace
    Author:
    Mathieu Bastian
    • Field Detail

      • instanceContent

        private final transient org.openide.util.lookup.InstanceContent instanceContent
      • lookup

        private final transient org.openide.util.Lookup lookup
      • id

        private final int id
    • Constructor Detail

      • WorkspaceImpl

        public WorkspaceImpl​(ProjectImpl project,
                             int id)
    • Method Detail

      • add

        public void add​(Object instance)
        Description copied from interface: Workspace
        Adds an instance to this workspaces lookup.
        Specified by:
        add in interface Workspace
        Parameters:
        instance - the instance that is to be pushed to the lookup
      • remove

        public void remove​(Object instance)
        Description copied from interface: Workspace
        Removes an instance from this workspaces lookup.
        Specified by:
        remove in interface Workspace
        Parameters:
        instance - the instance that is to be removed from the lookup
      • getLookup

        public org.openide.util.Lookup getLookup()
        Description copied from interface: Workspace
        Get any instance in the current lookup. All important API in Gephi are storing models in this lookup.

        May contains:

        • GraphModel
        • LayoutModel
        • StatisticsModel
        • FiltersModel
        • PreviewModel
        • ...
        Specified by:
        getLookup in interface org.openide.util.Lookup.Provider
        Specified by:
        getLookup in interface Workspace
        Returns:
        the workspace's lookup
      • getProject

        public ProjectImpl getProject()
        Description copied from interface: Workspace
        Returns the project this workspace belong to
        Specified by:
        getProject in interface Workspace
        Returns:
        the workspace's project
      • getId

        public int getId()
        Description copied from interface: Workspace
        Returns the workspace unique identifier
        Specified by:
        getId in interface Workspace
        Returns:
        the workspace id
      • isOpen

        public boolean isOpen()
        Description copied from interface: Workspace
        Returns true if the workspace is open.
        Specified by:
        isOpen in interface Workspace
        Returns:
        true if open, false otherwise
      • isClosed

        public boolean isClosed()
        Description copied from interface: Workspace
        Returns true if the workspace is closed.
        Specified by:
        isClosed in interface Workspace
        Returns:
        true if closed, false otherwise
      • isInvalid

        public boolean isInvalid()
        Description copied from interface: Workspace
        Returns true if the workspace is invalid.
        Specified by:
        isInvalid in interface Workspace
        Returns:
        true if invalid, false otherwise
      • close

        protected void close()
      • open

        protected void open()
      • getName

        public String getName()
        Description copied from interface: Workspace
        Returns the name of the workspace.

        The name can't be null and has a default value (e.g. Workspace 1).

        Specified by:
        getName in interface Workspace
        Returns:
        the workspace's name
      • hasSource

        public boolean hasSource()
        Description copied from interface: Workspace
        Returns true if the workspace has a source.
        Specified by:
        hasSource in interface Workspace
        Returns:
        true if has a source, false otherwise
      • getSource

        public String getSource()
        Description copied from interface: Workspace
        Returns the workspace's source or null if missing.
        Specified by:
        getSource in interface Workspace
        Returns:
        workspace's source or null if missing