Basically, I want to combine the Eclipse compiler+Java source editor with a nice Java GUI for image editing/processing in order to allow code-based image processing plugin development directly inside the image processing app.
What's the easiest solution for doing that? Start off with Eclipse and build an image processing tool out of it? Or just use parts of Eclipse (editor+compiler)? Are there any example projects doing something similar?
Marvin Framework provides feature extensibility through plug-in interface. Basically, it allow you to implement an image processing algorithm as a Java class that can be loaded dynamically on your application.
Regarding your idea, consider a Java application combining an image editing software and a source code editor. After writing the image processing algorithm, the user clicks on "Execute". The application:
saves the source code as .java file.
call the Java compiter to generate the .class
Load the new class dynamically into the application through Java Reflection
It is basically what MarvinEditor does to let developers to add new plug-ins to the application. Take a look at Marvin Prototyping Environment. It's similar to your idea.
Related
I have a javafx project already in Intellij but doing the view/gui stuff is just kinda tedious. I found scenebuilder and would like to use it for my existing project, but dont know how to "import" it. I understood that I need fxml files, but dont know where to create them etc.
Can anyone help me? Thanks!
Create your FXML files and edit them in SceneBuilder.
As James_D notes in comments:
There's no tool I know of for converting Java-based UI to FXML. You would just have to re-do all the view in FXML one way or another if you want to use SceneBuilder.
You can also edit the FXML text directly in your IDE for small simple changes, but, in general for large projects with a lot of FXML files, it will probably be better to do most of the editing or at least the initial FXML creation using SceneBuilder.
Search the web for a good tutorial on FXML if you need one.
As you are using Idea, to get started use the JavaFX new project wizard and slowly copy in, then port over parts of your existing application from your existing project as you replace the view logic.
Idea (or at least some recent version of it that I have tried) does have the ability to use SceneBuilder embedded in the IDE, though I have found that functionality is a bit flaky, so I don't advise using that at this time.
However, you can also configure the IDE to link to and use an external SceneBuilder installation, which works fine. Follow the instructions at:
Open files in Scene Builder from Idea.
Stand-alone SceneBuilder is available for free from Gluon:
SceneBuilder download.
Use a build tool like maven, following the maven standard directory layout for file placement.
Follow the standards and conventions for resource lookup outlined in the:
Eden coding resource guide.
You don't need to fully convert all view logic from Java code to FXML, you can have an application which mixes the two paradigms and that can work well, just choose what works best for your application components.
I am displaying a list of files; i.e. xls, doc, pdf, odt etc., in my Java application (Eclipse RCP). When the user clicks on the file, I want to launch the appropriate (according to what the OS thinks) native application, just like it happens in Windows Explorer or the Finder.
And while I am here: It would be nice to also display the same icons that Finder or Explorer use for the different file types.
Is there a library or Eclipse plugin for this?
What you want is java.awt.Desktop:
Desktop.getDesktop().open( file );
I have found an API in Eclipse's SWT now that seems to do the trick:
org.eclipse.swt.program.Program "provides access to facilities for discovering operating system specific aspects of external program launching."
It has methods to find the program for a given file extension, get the program's icon, and even launch the program.
Sounds like you're after the Java Activation Framework ("JAF"). This API lets you determine what files are and what actions you can do on them. Or alternatively the Java Desktop Integration Component ("JDIC"). JDIC allows you to create and no doubt query file associations.
Both projects seem to be in a semi-abandoned state howeer (sigh). But that's par for the course for Sun these days. Only other thing I know of is some Windows specific third party library that's based on JNI called Winpack. It does a bunch of other things too.
You can get the associated icon using the FileSystemView class (Java 1.4+).
I have a working Java code that I would like to visualize using processing. I also found the tutorial on how to include processing within eclipse and am also already able to create a canvas, etc.
What I want to do now is to actually do the visualization. I found a nice project that is exactly what I need. However, the author provides PDE files.
How can I include PDE files in my java project? Is that even possible?
The PDE files that are available in that project are simply text files. You can either use them in your code directly, or better yet, try to understand what they're doing and adapt the code to your own purposes.
But to answer your question, you don't include PDE files in a Java project. You included the Processing library jars on your classpath, which give you access to things like the PApplet class. Then you can include a PApplet (which is just like a Processing sketch, in fact a Processing sketch is a PApplet) in your Java application and pass it whatever information you want.
More info here: http://processing.org/tutorials/eclipse/
I'm developing a project for doing Content Based Image Retrieval where front end will be in java.
The main issue is about choosing tool for performing image processing. Since Matlab provides a lot of functionality for doing CBIR. But the main problem about using Matlab is that you need to have Matlab installed on every computer using the application.
Is there any other way in which I can do my project (Using other tools or driver) so that my application will run without using any other tools ???
Or can I develop entire application in Matlab only and deploy it as a standalone application ???
Thank you..
There are plenty of image processing libraries, for example for Java: ImageJ, there is also one by the Apache Commons project. If you need higher-level computer vision libraries there is OpenCV for C++ that also has bindings for Java, for example.
You can also develop the entire application in Matlab, but to deploy a stand alone application requires this requires licensing Mathworks Builder NE (which can be expensive). Matlab is very good for research and prototyping purposes.
There are other alternatives that are amenable to quick prototyping for example Python and PIL.
I think the bottom line is that there are plenty of options.
Java image utilities library: A Java library for loading, editing, analyzing and saving pixel image files.
It supports various file formats.
Provides demo applications for the command line. It has AWT GUI toolkit too.
Matlab is an excellent tool for prototyping as already pointed out by carlosdc. Matlab offers limited options with regard to UI programming. GUIDE is ok for small projects, but hinders more than it helps on bigger ones.
With MATLAB Builder JA you're able to compile your Matlab code into Java classes.
With regard to plotting time series in real time, libraries like JFreeChart are way slower.
I think OpenCV is one of the best libraries out there for image processing but Java Advanced Imaging is also quite good but doesn't has as much features and examples. Color similarity would be simple in JAI but shape probably would involve more code.
If you choose to use OpenCV I think you have at least two possible binding implementations for Java. The one my group uses is this one. It has some Processing dependencies.
Regardless of what library you choose be prepared for some frustration. Matlab users are used to all the nice features it provides and when they have to port their code to other languages end having to write a lot more code.
Well, after a long search finally I've found the way to deploy Matlab code along with java that too standalone application..
The steps are simple::--
1. Go and get Javabuilder.jar file located at location::
Matlab\toolbox\javabuilder\jar\javabuilder.jar
Next type deploytool in Matlabs command line...
deploytool window will open now create a new java project.
Select Matlab files that you want to use.
The deploytool will now convert the .m file to .jar file.
Now use both of the above mentioned jar files and develop your java compatible matlab code
and thats the way you can create the standalone application of matlab..
Is there a free decent java GUI descriptor language (probably XML based), which has a Glade-like (WYSIWYG) GUI builder?
Netbeans IDE. Whenever you use its GUI editor, it stores the GUI in XML, in a *.form file.
For example if your create a class com.some.package.MyForm which extends some Swing component or window, look for this file $SRCDIR/com/some/package/MyForm.java and $SRCDIR/com/some/package/MyForm.form.
The former is the actual Java class that gets compiled. The latter is a file that Netbeans uses to store the GUI in XML format. This is what netbeans uses to generate the auto-gen'd code that goes in the code fold to initiliase the GUI.
HTH
Edit:
I do acknowledge that the Netbeans IDE probably isn't the best one out there, and I personally use it only because it's already built into the IDE that I use anyway. For me it gets the job done, and I may sometimes have to manually apply tweaks in the code to get what I want. It's a no-frills, XML-based, Java GUI, WYSIWYG editor.
Sorry this is prob not the answer you were looking for but have you looked into using flex? The markup in Flex is all XML based and the builder is very good.
Blaze DS can then be used to communicate between flex and Java.
Dont know any pure xml layout frameworks off the top of my head. Whats your reason for wanting an XML based UI?
Simple googling yields me many like http://swingml.sourceforge.net/, http://jfcml.sourceforge.net/,http://cookxml.yuanheng.org/cookswing/etc.
You can try JavaFX, it is too a cool DSL way of representing the Swing components and it provides more of its own for API for animation and graphics usage.
Netbeans and eclipse have plugins/extensions to do DnD development for it.