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 classProjectInformationImpl.Status
-
Field Summary
Fields Modifier and Type Field Description private Filefileprivate List<PropertyChangeListener>listenersprivate Stringnameprivate Projectprojectprivate ProjectInformationImpl.Statusstatus-
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 voidaddChangeListener(PropertyChangeListener listener)Add change listener.voidclose()voidfireChangeEvent(String eventName, Object oldValue, Object newValue)FilegetFile()Returns the file associated with this project.StringgetFileName()Returns the filename associated with this project.StringgetName()Returns the name of the project.ProjectgetProject()Returns the project this information class belongs to.booleanhasFile()Returns true if the project is associated with a file.booleanisClosed()Returns true if the project is closed.booleanisInvalid()Returns true if the project is invalid.booleanisOpen()Returns true if the project is open.voidopen()voidremoveChangeListener(PropertyChangeListener listener)Remove change listener.voidsetFile(File file)voidsetName(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:ProjectInformationReturns the project this information class belongs to.- Specified by:
getProjectin interfaceProjectInformation- Returns:
- project reference
-
isOpen
public boolean isOpen()
Description copied from interface:ProjectInformationReturns true if the project is open.- Specified by:
isOpenin interfaceProjectInformation- Returns:
- true if open, false otherwise
-
isClosed
public boolean isClosed()
Description copied from interface:ProjectInformationReturns true if the project is closed.- Specified by:
isClosedin interfaceProjectInformation- Returns:
- true if closed, false otherwise
-
isInvalid
public boolean isInvalid()
Description copied from interface:ProjectInformationReturns true if the project is invalid.- Specified by:
isInvalidin interfaceProjectInformation- Returns:
- true if invalid, false otherwise
-
hasFile
public boolean hasFile()
Description copied from interface:ProjectInformationReturns 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:
hasFilein interfaceProjectInformation- Returns:
- true if associated with a file, false otherwise
-
getFileName
public String getFileName()
Description copied from interface:ProjectInformationReturns the filename associated with this project.Returns an empty string if the project isn't associated with a file.
- Specified by:
getFileNamein interfaceProjectInformation- Returns:
- file name
- See Also:
ProjectInformation.hasFile()
-
getName
public String getName()
Description copied from interface:ProjectInformationReturns the name of the project.The name can't be null and has a default value (e.g. Project 1).
- Specified by:
getNamein interfaceProjectInformation- Returns:
- the project's name
-
setName
public void setName(String name)
-
getFile
public File getFile()
Description copied from interface:ProjectInformationReturns the file associated with this project.Returns null if the project isn't associated with a file.
- Specified by:
getFilein 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:ProjectInformationAdd change listener.- Specified by:
addChangeListenerin interfaceProjectInformation- Parameters:
listener- change listener
-
removeChangeListener
public void removeChangeListener(PropertyChangeListener listener)
Description copied from interface:ProjectInformationRemove change listener.- Specified by:
removeChangeListenerin interfaceProjectInformation- Parameters:
listener- change listener
-
-