java.lang.Object
de.grogra.pf.registry.Plugin
de.grogra.pf.ui.UIApplication
de.grogra.imp.IMP
- All Implemented Interfaces:
RegistryContext
,Command
,CommandPlugin
,WorkbenchManager
,ResourceConverter
public final class IMP
extends UIApplication
implements CommandPlugin, ResourceConverter, WorkbenchManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Command
static final I18NBundle
static final IOFlavor
static final MimeType
Fields inherited from class de.grogra.pf.ui.UIApplication
pm, selected, ui, wbm
Fields inherited from interface de.grogra.util.ResourceConverter
CAT, LINK
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addEdgeBits
(Node source, Node target, int bits, Context context) static void
static OptionsSource
addOptionFile
(Item item, Object info, Context ctx) static SourceDirectory
addSourceDirectory
(String dirName, Context ctx, Object dest) static SourceFile
addSourceFile
(File file, MimeType mt, Context ctx) static SourceFile
addSourceFile
(File file, MimeType mt, Context ctx, Object dest) boolean
canHandleConversion
(String name) void
Wrapper that close a workbench whose id contained in infostatic void
closeWorkbench
(Context ctx) void
Dispose a workbench - should be deregistered firstvoid
closeWorkbench
(ProjectWorkbench w, Command afterDispose) Dispose a workbench - should be deregistered first Execute the afterDispose command (usually a popup for saving)convert
(String name, String argument, I18NBundle bundle) void
Create a new workbench from the templates !!!!protected ProjectWorkbench
Mainworkbench onlyprotected ProjectWorkbench
createWorkbench
(Project p, Map initParams) Only for mainworkbenchcreateWorkbench
(ProjectFactory pf, FilterSource fs, Map initParams) Create workbench not the main onecreateWorkbench
(Object projectId) Create a new workbench around the Project of the given idstatic void
delOptionFile
(Item item, Object info, Context ctx) void
deregister a workbench to this managervoid
exit()
static void
static void
exportGraphToFile
(GraphManager graphManager, File file) static Color
getAWTColor
(float r, float g, float b, float a) static Color
getAWTColor
(Tuple3f color) Used with command linesGet the last selected workbench by the applicationstatic SourceDirectory
getDirectoryToAdd
(Context ctx) static Object
getFileToAdd
(Context ctx) static IMP
getWorkbench
(Object id) need to be addapted with objectlist, as the id can get out of the object list sizereturn the object workbenchesReturning the ID of a workbenchboolean
Check if the workbench is managed by this managervoid
listExamples
(Object info) void
listProjects
(Object info) void
listTemplates
(Object info) Return the list of workbench handled by the managervoid
listWorkbenches
(Object info) void
loadExample
(Object info) open
(FilterSource fs, Map initParams) wrapper to open a workbench, that contains a filtersource and param in the infostatic void
openClientWorkbench
(Connection server, Context context) static void
openClientWorkbench
(Item item, Object info, Context context) static void
openNewWokbench
(Item item, Object info, Context ctx) This command is used to open filtersourceFactory Items as templates it checks if the item selected in the menu group is a filtersourceFactory and if so opens a new instance of the sourcevoid
Register a workbench to this managerstatic void
removeEdgeBits
(Node source, Node target, int bits, Context context) static void
run
(Application app) void
run
(Object info, Context ctx, CommandItem item) protected void
selectWorkbench
(Object info) static Tuple3f
void
start
(IMPWorkbench workbench, Window feedback) void
startup()
This method is invoked when the plugin is activated, i.e., when the first class defined by the plugin is loaded (except for the Plugin class itself).void
stop()
static SourceDirectory
toSourceDirectory
(String name, Context ctx, Object dest) static SourceFile
toSourceFile
(File file, MimeType mt, Context ctx) static SourceFile
toSourceFile
(File file, MimeType mt, Context ctx, Object dest) static void
writeGraph
(Context ctx, GraphManager graphManager, MimeType mt, File file) static void
writeGraph
(Context ctx, GraphManager graphManager, MimeType mt, OutputStream out, String outName) static void
writeImage
(Context ctx, RenderedImage r, MimeType mt, File file) static void
writeImage
(Context ctx, RenderedImage r, MimeType mt, OutputStream out, String outName) static void
writeImage
(Image img, File file) Methods inherited from class de.grogra.pf.ui.UIApplication
close, close, create, create, createWB, getMainWorkbench, getProjectManager, getToolkit, getWorkbenchManager, init, listExamples, listProjects, listTemplates, listWorkbenches, loadExample, loadExample, open, open, run, selectWorkbench, selectWorkbench, setMainWorkbench, stop
Methods inherited from class de.grogra.pf.registry.Plugin
checkConfigure, getI18NBundle, getPluginDescriptor, getRegistry, initialize, shutdown
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.grogra.pf.registry.RegistryContext
getRegistry
-
Field Details
-
I18N
-
TYPES_MIME_TYPE
-
TYPES_FLAVOR
-
CLOSE
-
-
Constructor Details
-
IMP
public IMP()
-
-
Method Details
-
getInstance
-
startup
public void startup()Description copied from class:Plugin
This method is invoked when the plugin is activated, i.e., when the first class defined by the plugin is loaded (except for the Plugin class itself). The default implementation executes all executable items in the directory/hooks/startup/name
, wherename
is the name of the plugin.The method
Plugin.initialize()
has been invoked before. Only if this invocation has returnedtrue
, the plugin may be activated. -
canHandleConversion
- Specified by:
canHandleConversion
in interfaceResourceConverter
-
convert
- Specified by:
convert
in interfaceResourceConverter
-
run
-
start
-
exit
public void exit()- Specified by:
exit
in classUIApplication
-
run
- Specified by:
run
in interfaceCommandPlugin
-
export
-
writeImage
-
writeImage
-
writeImage
public static void writeImage(Context ctx, RenderedImage r, MimeType mt, OutputStream out, String outName) -
closeWorkbench
-
openClientWorkbench
- Throws:
IOException
-
openClientWorkbench
- Throws:
IOException
-
getFileToAdd
-
toSourceFile
- Parameters:
file
-mt
-ctx
-dest
- An Item, the node where the file will be added- Returns:
-
toSourceFile
-
addSourceFile
-
addSourceFile
-
addNode
-
addEdgeBits
-
removeEdgeBits
-
getAWTColor
-
getAWTColor
-
setColor
-
exportGraphToFile
-
writeGraph
-
writeGraph
public static void writeGraph(Context ctx, GraphManager graphManager, MimeType mt, OutputStream out, String outName) -
getDirectoryToAdd
-
toSourceDirectory
-
addSourceDirectory
-
addOptionFile
-
delOptionFile
-
getCommandName
Used with command lines- Specified by:
getCommandName
in interfaceCommand
- Returns:
- this commands's name
-
getCurrentWorkbench
Description copied from class:UIApplication
Get the last selected workbench by the application- Specified by:
getCurrentWorkbench
in classUIApplication
- Returns:
- The current workbench for this application
-
openNewWokbench
This command is used to open filtersourceFactory Items as templates it checks if the item selected in the menu group is a filtersourceFactory and if so opens a new instance of the source -
open
wrapper to open a workbench, that contains a filtersource and param in the info- Specified by:
open
in classUIApplication
- Throws:
Exception
-
open
- Specified by:
open
in classUIApplication
-
close
Wrapper that close a workbench whose id contained in info- Specified by:
close
in classUIApplication
-
create
Create a new workbench from the templates !!!! Not used- Specified by:
create
in classUIApplication
- Throws:
IOException
Exception
-
loadExample
- Specified by:
loadExample
in classUIApplication
- Throws:
Exception
-
listExamples
- Specified by:
listExamples
in classUIApplication
-
listTemplates
- Specified by:
listTemplates
in classUIApplication
-
selectWorkbench
- Specified by:
selectWorkbench
in classUIApplication
-
listWorkbenches
- Specified by:
listWorkbenches
in classUIApplication
-
listProjects
- Specified by:
listProjects
in classUIApplication
-
stop
public void stop()- Specified by:
stop
in classUIApplication
-
getWorkbench
need to be addapted with objectlist, as the id can get out of the object list size- Specified by:
getWorkbench
in interfaceWorkbenchManager
- Returns:
- Throws:
IndexOutOfBoundsException
-
getWorkbenches
Description copied from interface:WorkbenchManager
return the object workbenches- Specified by:
getWorkbenches
in interfaceWorkbenchManager
-
listWorkbenches
Description copied from interface:WorkbenchManager
Return the list of workbench handled by the manager- Specified by:
listWorkbenches
in interfaceWorkbenchManager
- Returns:
- a list of Workbench (shouldn't this return Workbench[]? and an array?)
-
getWorkbenchId
Description copied from interface:WorkbenchManager
Returning the ID of a workbench- Specified by:
getWorkbenchId
in interfaceWorkbenchManager
- Returns:
-
registerWorkbench
Description copied from interface:WorkbenchManager
Register a workbench to this manager- Specified by:
registerWorkbench
in interfaceWorkbenchManager
-
deregisterWorkbench
Description copied from interface:WorkbenchManager
deregister a workbench to this manager- Specified by:
deregisterWorkbench
in interfaceWorkbenchManager
-
closeWorkbench
Description copied from interface:WorkbenchManager
Dispose a workbench - should be deregistered first- Specified by:
closeWorkbench
in interfaceWorkbenchManager
-
closeWorkbench
Description copied from interface:WorkbenchManager
Dispose a workbench - should be deregistered first Execute the afterDispose command (usually a popup for saving)- Specified by:
closeWorkbench
in interfaceWorkbenchManager
-
isManager
Description copied from interface:WorkbenchManager
Check if the workbench is managed by this manager- Specified by:
isManager
in interfaceWorkbenchManager
- Returns:
-
createWorkbench
Create workbench not the main one- Specified by:
createWorkbench
in interfaceWorkbenchManager
-
createWorkbench
Only for mainworkbench- Specified by:
createWorkbench
in interfaceWorkbenchManager
- Returns:
- Throws:
IOException
-
createWorkbench
Description copied from interface:WorkbenchManager
Create a new workbench around the Project of the given id- Specified by:
createWorkbench
in interfaceWorkbenchManager
- Returns:
-
createWorkbench
Mainworkbench only- Parameters:
p
-- Returns:
-
createWorkbench
-