java.lang.Object
de.grogra.pf.ui.Project
- All Implemented Interfaces:
RegistryContext
- Direct Known Subclasses:
ProjectImpl
The abstract Project class holds all information regarding the Project, such
as the registry, the file and mimeType and the name of the project This class
also holds all functions for any file interaction with the project. Not to be
confused with projectGraph hosted in the registry (which is a GraphManager).
- Author:
- Tim Oberländer
-
Field Summary
Modifier and TypeFieldDescriptionprotected Filter
protected ObjectList
protected Registry
protected GraphState
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
To add a node the used workbench must be added as a parameter to provide a context that contains a JobManageraddSourceFile
(File file, MimeType mt) Add a new SourceFile to the ProjectaddSourceFile
(File file, MimeType mt, Object dest) Add a new sourceFile to the project at a specific destination If no destination is null the file is added to the default locationaddSourceFile
(String fileName, MimeType mt, InputStream ins, Object des) To add a SourceFile from a stream an empty file is created and the stream is written in itabstract void
abstract void
dispose()
abstract void
abstract void
getFile()
getId()
getName()
Returns theRegistry
which is linked with this instance.protected abstract void
void
init()
abstract void
initialize
(JobManager jm) protected abstract void
abstract Command[]
void
loadProjectFile
(FilterSource fs, Map initParams, Context context) protected void
protected void
void
removeFile
(SourceFile sf, Context context) void
removeNode
(Node node, Context context) void
renameFile
(SourceFile file, String newName, Context context) void
renameItem
(Item node, String newName, Context context) Rename a given Item using the JobManager of the given contextboolean
save()
saves Project to the location from which it was openedboolean
Save Object (normally the Registry) to a given location Maybe obsolete in this design since the object should always be the Registryboolean
Saves file to given locationvoid
void
Checks if the file and the mimetype is not null and if GroIMP is able to write to this file Type The defined file is only used to save changes to the same location from which the file was openedvoid
void
setLogFilter
(Filter newFilter) void
setMimeType
(MimeType mimeType) void
defines the name in the local variable as well as in the registryvoid
setPendingLogs
(ObjectList newList) void
setSourceFileContent
(SourceFile file, InputStream ins) void
setSourceFileContent
(String fileName, InputStream ins) abstract void
abstract void
toSourceFile
(File file, MimeType mt, Object dest) create a sourceFile form a fileprotected abstract void
-
Field Details
-
regState
-
registry
-
logFilter
-
pendingLogs
-
-
Constructor Details
-
Project
-
-
Method Details
-
init
public void init() -
dispose
public abstract void dispose() -
getId
-
setId
-
loadProjectFile
-
setName
defines the name in the local variable as well as in the registry- Parameters:
name
-
-
getName
-
getMimeType
-
setMimeType
-
getRegistry
Description copied from interface:RegistryContext
Returns theRegistry
which is linked with this instance.- Specified by:
getRegistry
in interfaceRegistryContext
- Returns:
- the registry linked with this instance
-
getFile
-
setFile
-
setFile
Checks if the file and the mimetype is not null and if GroIMP is able to write to this file Type The defined file is only used to save changes to the same location from which the file was opened- Parameters:
file
-mimeType
-
-
save
public boolean save()saves Project to the location from which it was opened- Returns:
-
saveAs
Saves file to given location- Parameters:
file
-mimeType
-- Returns:
-
save
Save Object (normally the Registry) to a given location Maybe obsolete in this design since the object should always be the Registry- Parameters:
object
-f
-mt
-- Returns:
-
addNode
To add a node the used workbench must be added as a parameter to provide a context that contains a JobManager- Parameters:
node
-context
-
-
removeFile
-
removeNode
-
renameItem
Rename a given Item using the JobManager of the given context- Parameters:
node
-newName
-context
-
-
renameFile
-
addSourceFile
To add a SourceFile from a stream an empty file is created and the stream is written in it- Parameters:
fileName
-mt
-ins
-dest
-- Returns:
-
setSourceFileContent
- Throws:
IOException
-
setSourceFileContent
- Throws:
IOException
-
addSourceFile
Add a new SourceFile to the Project- Parameters:
file
-mt
-- Returns:
-
addSourceFile
Add a new sourceFile to the project at a specific destination If no destination is null the file is added to the default location- Parameters:
file
-mt
-dest
-- Returns:
-
toSourceFile
create a sourceFile form a file- Parameters:
file
-mt
-dest
-- Returns:
-
logInfo
-
logInfo
-
getLogFilter
-
getPendingLogs
-
setLogFilter
-
setPendingLogs
-
initialize
-
updateName
protected abstract void updateName() -
listFunctions
-
execute
-
execute
-
compile
-
getState
-
stopLocalFileSynchronization
public abstract void stopLocalFileSynchronization() -
startLocalFileSynchronization
public abstract void startLocalFileSynchronization() -
initLogger
protected abstract void initLogger()
-