Package org.gephi.project.impl
Class WorkspaceInformationImpl
- java.lang.Object
-
- org.gephi.project.impl.WorkspaceInformationImpl
-
- All Implemented Interfaces:
WorkspaceInformation
public class WorkspaceInformationImpl extends Object implements WorkspaceInformation
- Author:
- Mathieu Bastian
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WorkspaceInformationImpl.Status
-
Field Summary
Fields Modifier and Type Field Description private List<PropertyChangeListener>
listeners
private String
name
private String
source
private WorkspaceInformationImpl.Status
status
-
Fields inherited from interface org.gephi.project.api.WorkspaceInformation
EVENT_CLOSE, EVENT_OPEN, EVENT_RENAME, EVENT_SET_SOURCE
-
-
Constructor Summary
Constructors Constructor Description WorkspaceInformationImpl(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(PropertyChangeListener listener)
Add change listener.void
close()
void
fireChangeEvent(String eventName, Object oldValue, Object newValue)
String
getName()
Returns the name of the workspace.String
getSource()
Returns the workspace's source or null if missing.WorkspaceInformationImpl.Status
getStatus()
boolean
hasSource()
Returns true if the workspace has a source.void
invalid()
boolean
isClosed()
Returns true if the workspace is closed.boolean
isInvalid()
Returns true if the workspace is invalid.boolean
isOpen()
Returns true if the workspace is open.void
open()
void
removeChangeListener(PropertyChangeListener listener)
Remove change listener.void
setName(String name)
void
setSource(String source)
String
toString()
-
-
-
Field Detail
-
listeners
private final transient List<PropertyChangeListener> listeners
-
name
private String name
-
status
private WorkspaceInformationImpl.Status status
-
source
private String source
-
-
Constructor Detail
-
WorkspaceInformationImpl
public WorkspaceInformationImpl(String name)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:WorkspaceInformation
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 interfaceWorkspaceInformation
- Returns:
- the workspace's name
-
setName
public void setName(String name)
-
getStatus
public WorkspaceInformationImpl.Status getStatus()
-
getSource
public String getSource()
Description copied from interface:WorkspaceInformation
Returns the workspace's source or null if missing.- Specified by:
getSource
in interfaceWorkspaceInformation
- Returns:
- workspace's source or null if missing
-
setSource
public void setSource(String source)
-
hasSource
public boolean hasSource()
Description copied from interface:WorkspaceInformation
Returns true if the workspace has a source.- Specified by:
hasSource
in interfaceWorkspaceInformation
- Returns:
- true if has a source, false otherwise
-
open
public void open()
-
close
public void close()
-
invalid
public void invalid()
-
isOpen
public boolean isOpen()
Description copied from interface:WorkspaceInformation
Returns true if the workspace is open.- Specified by:
isOpen
in interfaceWorkspaceInformation
- Returns:
- true if open, false otherwise
-
isClosed
public boolean isClosed()
Description copied from interface:WorkspaceInformation
Returns true if the workspace is closed.- Specified by:
isClosed
in interfaceWorkspaceInformation
- Returns:
- true if closed, false otherwise
-
isInvalid
public boolean isInvalid()
Description copied from interface:WorkspaceInformation
Returns true if the workspace is invalid.- Specified by:
isInvalid
in interfaceWorkspaceInformation
- Returns:
- true if invalid, false otherwise
-
addChangeListener
public void addChangeListener(PropertyChangeListener listener)
Description copied from interface:WorkspaceInformation
Add change listener.- Specified by:
addChangeListener
in interfaceWorkspaceInformation
- Parameters:
listener
- change listener
-
removeChangeListener
public void removeChangeListener(PropertyChangeListener listener)
Description copied from interface:WorkspaceInformation
Remove change listener.- Specified by:
removeChangeListener
in interfaceWorkspaceInformation
- Parameters:
listener
- change listener
-
-