public class ProjectInformationImpl extends Object implements ProjectInformation
Modifier and Type | Class and Description |
---|---|
static class |
ProjectInformationImpl.Status |
Modifier and Type | Field and Description |
---|---|
private File |
file |
private List<PropertyChangeListener> |
listeners |
private String |
name |
private Project |
project |
private ProjectInformationImpl.Status |
status |
EVENT_CLOSE, EVENT_OPEN, EVENT_RENAME, EVENT_SET_FILE
Constructor and Description |
---|
ProjectInformationImpl(Project project,
String name) |
Modifier and Type | Method and 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) |
private final Project project
private String name
private ProjectInformationImpl.Status status
private File file
private final transient List<PropertyChangeListener> listeners
public void open()
public void close()
public Project getProject()
ProjectInformation
getProject
in interface ProjectInformation
public boolean isOpen()
ProjectInformation
isOpen
in interface ProjectInformation
public boolean isClosed()
ProjectInformation
isClosed
in interface ProjectInformation
public boolean isInvalid()
ProjectInformation
isInvalid
in interface ProjectInformation
public boolean hasFile()
ProjectInformation
A project is associated with a file if it has been saved/loaded to/from a file.
hasFile
in interface ProjectInformation
public String getFileName()
ProjectInformation
Returns an empty string if the project isn't associated with a file.
getFileName
in interface ProjectInformation
ProjectInformation.hasFile()
public void setName(String name)
public String getName()
ProjectInformation
The name can't be null and has a default value (e.g. Project 1).
getName
in interface ProjectInformation
public File getFile()
ProjectInformation
Returns null if the project isn't associated with a file.
getFile
in interface ProjectInformation
ProjectInformation.hasFile()
public void setFile(File file)
public void addChangeListener(PropertyChangeListener listener)
ProjectInformation
addChangeListener
in interface ProjectInformation
listener
- change listenerpublic void removeChangeListener(PropertyChangeListener listener)
ProjectInformation
removeChangeListener
in interface ProjectInformation
listener
- change listenerCopyright © 2007–2015 Gephi Consortium. All rights reserved.