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
FieldsModifier and TypeFieldDescriptionprotected Filterprotected ObjectListprotected Registryprotected GraphState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTo 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 voidabstract voiddispose()abstract voidabstract voidgetFile()getId()getName()Returns theRegistrywhich is linked with this instance.protected abstract voidvoidinit()abstract voidinitialize(JobManager jm) protected abstract voidabstract Command[]voidloadProjectFile(FilterSource fs, Map initParams, Context context) protected voidprotected voidvoidremoveFile(SourceFile sf, Context context) voidremoveNode(Node node, Context context) voidrenameFile(SourceFile file, String newName, Context context) voidrenameItem(Item node, String newName, Context context) Rename a given Item using the JobManager of the given contextbooleansave()saves Project to the location from which it was openedbooleanSave Object (normally the Registry) to a given location Maybe obsolete in this design since the object should always be the RegistrybooleanSaves file to given locationvoidvoidChecks 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 openedvoidvoidsetLogFilter(Filter newFilter) voidsetMimeType(MimeType mimeType) voiddefines the name in the local variable as well as in the registryvoidsetPendingLogs(ObjectList newList) voidsetSourceFileContent(SourceFile file, InputStream ins) voidsetSourceFileContent(String fileName, InputStream ins) abstract voidabstract voidtoSourceFile(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:RegistryContextReturns theRegistrywhich is linked with this instance.- Specified by:
getRegistryin 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()
-