Package org.gephi.project.impl
Class ProjectInformationImpl
- java.lang.Object
-
- org.gephi.project.impl.ProjectInformationImpl
-
- All Implemented Interfaces:
ProjectInformation
public class ProjectInformationImpl extends Object implements ProjectInformation
- Author:
- Mathieu Bastian
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProjectInformationImpl.Status
-
Field Summary
Fields Modifier and Type Field Description private File
file
private List<PropertyChangeListener>
listeners
private String
name
private Project
project
private ProjectInformationImpl.Status
status
-
Fields inherited from interface org.gephi.project.api.ProjectInformation
EVENT_CLOSE, EVENT_OPEN, EVENT_RENAME, EVENT_SET_FILE
-
-
Constructor Summary
Constructors Constructor Description ProjectInformationImpl(Project project, 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)
File
getFile()
Returns the file associated with this project.String
getFileName()
Returns the filename associated with this project.String
getName()
Returns the name of the project.Project
getProject()
Returns the project this information class belongs to.boolean
hasFile()
Returns true if the project is associated with a file.boolean
isClosed()
Returns true if the project is closed.boolean
isInvalid()
Returns true if the project is invalid.boolean
isOpen()
Returns true if the project is open.void
open()
void
removeChangeListener(PropertyChangeListener listener)
Remove change listener.void
setFile(File file)
void
setName(String name)
-
-
-
Field Detail
-
project
private final Project project
-
listeners
private final transient List<PropertyChangeListener> listeners
-
name
private String name
-
status
private ProjectInformationImpl.Status status
-
file
private File file
-
-
Method Detail
-
open
public void open()
-
close
public void close()
-
getProject
public Project getProject()
Description copied from interface:ProjectInformation
Returns the project this information class belongs to.- Specified by:
getProject
in interfaceProjectInformation
- Returns:
- project reference
-
isOpen
public boolean isOpen()
Description copied from interface:ProjectInformation
Returns true if the project is open.- Specified by:
isOpen
in interfaceProjectInformation
- Returns:
- true if open, false otherwise
-
isClosed
public boolean isClosed()
Description copied from interface:ProjectInformation
Returns true if the project is closed.- Specified by:
isClosed
in interfaceProjectInformation
- Returns:
- true if closed, false otherwise
-
isInvalid
public boolean isInvalid()
Description copied from interface:ProjectInformation
Returns true if the project is invalid.- Specified by:
isInvalid
in interfaceProjectInformation
- Returns:
- true if invalid, false otherwise
-
hasFile
public boolean hasFile()
Description copied from interface:ProjectInformation
Returns true if the project is associated with a file.A project is associated with a file if it has been saved/loaded to/from a file.
- Specified by:
hasFile
in interfaceProjectInformation
- Returns:
- true if associated with a file, false otherwise
-
getFileName
public String getFileName()
Description copied from interface:ProjectInformation
Returns the filename associated with this project.Returns an empty string if the project isn't associated with a file.
- Specified by:
getFileName
in interfaceProjectInformation
- Returns:
- file name
- See Also:
ProjectInformation.hasFile()
-
getName
public String getName()
Description copied from interface:ProjectInformation
Returns the name of the project.The name can't be null and has a default value (e.g. Project 1).
- Specified by:
getName
in interfaceProjectInformation
- Returns:
- the project's name
-
setName
public void setName(String name)
-
getFile
public File getFile()
Description copied from interface:ProjectInformation
Returns the file associated with this project.Returns null if the project isn't associated with a file.
- Specified by:
getFile
in interfaceProjectInformation
- Returns:
- file or null if none
- See Also:
ProjectInformation.hasFile()
-
setFile
public void setFile(File file)
-
addChangeListener
public void addChangeListener(PropertyChangeListener listener)
Description copied from interface:ProjectInformation
Add change listener.- Specified by:
addChangeListener
in interfaceProjectInformation
- Parameters:
listener
- change listener
-
removeChangeListener
public void removeChangeListener(PropertyChangeListener listener)
Description copied from interface:ProjectInformation
Remove change listener.- Specified by:
removeChangeListener
in interfaceProjectInformation
- Parameters:
listener
- change listener
-
-