directshow what is the best component to use - java

hi every one there please i need some info
i have created app using directshow &c++ for image processing
so the thing is that i need to create a sophisticated GUI i have used win32 components which don't fulfill my needs and my expectations plus difficult to tweak specailly with events
so i got to find a solution i thought about using jni and merge c++'s functionality with java's the swing components .
the other choice is to use the window form(.net) but if i'm right i need to use directshow.net (i don't know how to use it )

Qt is most often called the best C++ framework for building GUIs.
Windows Forms is quite nice. Don't be afraid of using DirectShow.Net, it looks very similar to C++ but easier. You can take a look at GraphEditPlus, it can generate DirectShow graph building code in both C++ and C# (for DirectShow.Net), so you can see how semantically the same code looks in two languages. Also, GraphEditPlus itself is an example of Windows Forms application working with DirectShow.

"but if i'm right i need to use directshow.net".
No, not really. You can create an activex control in C++ that wraps your current code and use that instead in .Net with Windows.Forms.

Related

Can you use Java Swing in c++

This may be a bit of an odd question, but I would like to know if you can use Java inside c++14. I don't really care for GTK (I find it confusing and over complicated). Swing, however, is very easy to use, and you can get a working project very quickly. So I would like to know if you can use Java Swing inside c++, so I can use Swing as the foreground, as in what you see like graphics, and use c++ for the background, as in stuff you cant see, like calculations and objects and stuff. So if I can have c++ code tell Swing what to look like, or when to update, that would be very useful for the project I have in mind. Thanks in advance for any advice I may receive.
EDIT: Being able to use c++14 inside Java would be acceptable as well. Also, if anyone could get me example code also, this would be very helpful. Thanks!
You shouldn't run Java from C++, but rather C++ from Java. Oracle gives you a way to load native shared libraries, using JNI.
So you would create your view in Java, using Swing, then you would update your view by calling C++ functions that were pre-compiled and exported in a shared library.
That said, using JNI is quite tricky and the speed improvements of C++ might not be worth it; so you should consider using only Java (or only C++ and a library to create your GUI, such as Qt)
In which direction you go is a matter of taste (loading the JVM from a C++ program or loading DLLs from the JVM side).
Usually you go the way which is more logical, e.g. if you already have a C++ program you likely want to load the JVM from the C++ side. That would be your case. Especially if the Java you want to add is essentially "scripting" the C++ application.
If you already have a Java program and want to access a C++ DLL, you load the DLL from Java and write a simple JNI / native Java class.
In our times you would use tools like JNA for that (instead of JNI): https://github.com/java-native-access/jna
Or you can use SWIG to generate wrappers for your C++ classes: http://www.swig.org/

Can I build attractive GUI in Java?

Can I build attractive GUI in Java? If yes, how should I do it? Or should I use some other language or tool to do it?
Filthy Rich Clients is a good book for learning how to use Java to build attractive GUIs that go beyond the usual Swing look.
You can use SWT, which as the other answer mentions is nice for a more native look. You can use JavaFx if you want to add a lot of visual candy, or you can use flash or other technologies and just perform remote operations.
Good luck.
You can just modify Swing look'n'feel as per this Java tutorial.
Attractive is quite subjective, but you can take a look to the Substance LaF (https://substance.dev.java.net/) and the Pushing Pixels blog (http://www.pushing-pixels.org)
If you are looking for a native look and feel in every platform you could use SWT. It's the one used in Eclipse.
You can build very attractive GUI using Java. You can use SWT: The Standard Widget Toolkit.
You have also mentioned if you can use other programming language then you can go for VIsual Basic.It will be easier than compare to Java. As we have to just drag and drop over there.
There are lots of answers on here about using SWT for an attractive native look and feel. However, I would suggest that Swing, set to use the native look and feel, is pixel perfect now, at least on Windows, using java 6. There is no longer a reason to use SWT. I work on a very large Swing project and you would be hard pressed to tell it is not a native windows app.
Edit: Here are a couple of links to some Sun blogs posts that touch on the subject -
http://weblogs.java.net/blog/bino_george/archive/2004/11/hifi_swing_or_i_1.html
http://weblogs.java.net/blog/chet/archive/2006/10/java_on_vista_y.html
Java is just a language. You cannot build a GUI in Java. Period.
The JDK libraries, however, can build guis through various means. You can use AWT, Swing, SWT, JavaFX or GWT libraries to build GUIs--or you can build your own library if you really want.
You can also just create an AWT frame and draw anything you want in it. (I worked on an waveform analyzer (o-scope looking thing) with a GUI written entirely in AWT.
Now, most of those libraries are fairly platform independent, if you want to restrict yourself to a single platform, you can do anything that can be done in C or any other language.
Therefore your question doesn't make too much sense. Are you saying that you want to put in minimum effort and get a good interface? Swing will be less effort than just about any other toolkit out there and can be skinned in more ways than most.
Or are you saying that you want to specify the exact GUI? In that case, don't use swing but there are a bunch of alternatives that should do just what you want.
Can you be more specific (Do you really want help?), or were you just trying to bash Java?

Extensible GUI framework for Java

I'm a fan of swing and find it has done everything I need except for extensible GUIs. I can make small parts extensible programmatically, but if I want to plug in an optional feature it can be quite tedious to dynamically generate every component being altered.
The short period I spent writing a Firefox plug in got me very interested in the idea of Overlays.
Does there exist anything for Java with a similar concept?
It would of course be good to know more precisely what do you mean by "extensible" GUI.
In my work most needs for extending Swing components are nicely fulfilled by JXLayer. For example, things like implementing validation notification layer, blocking with progress indication etc.
"to plug in"
Do you mean plugins?
Take a look here:
http://karussell.wordpress.com/2009/09/16/plugable-swing-a-hello-world-osgi-example/
similar things are possible with NetBeans lookup class (openide) and the ServiceLoader included in JDK6:
http://weblogs.java.net/blog/2008/08/12/simple-dependency-injection-serviceloader-jdk-6
For an extensible GUI framework look here:
http://karussell.wordpress.com/2009/10/08/java-application-frameworks-not-only-client-side/
Update: Now with griffon you can do this too
There have been multiple attempts at projects that can convert an xml document into a java GUI.
JavaFX would be ideal, but that requires 1.6u10 or better.
Take a look at the SwingBean framework.
It's kind of cool, because it allows you to generate user interfaces through xml files.
Here is the link: http://swingbean.sourceforge.net/

Activex from java application?

Is it possible to easily embed ActiveX controls in Java application? Is it worth it. In my next project I should either use existing activex in Java app or have to reimplement everything from scratch, so I'm wondering what will be less hassle.
I don't think there's a way to do this without resorting to a third party library. (Or rolling your own, but you did say "easily".)
SWT (The "Standard Widget Toolkit") contains support for embedding ActiveX controls. SWT is an alternative to Swing, though there is a degree of interoperability between them.
Here's an example of embedding Windows Media Player in an SWT window.
Alternatively there's the Jacob project, though I haven't used that myself.
As for "is it worth it?" Well, I can say from experience that SWT makes it relatively easy, but unless your application can gracefully deal with not having them available, by relying on COM components you are losing the ability to run on multiple platforms that makes Java attractive in the first place.
It really depends on how much you are going to have to re-implement. The Jacob project is quite good (we use it extensively for automation of Excel and Word), but you have to really understand COM to use it, especially the vagaries of the IDispatch interface (very few people who use ActiveX / COM actually understand COM - they just rely on Microsoft's template generation).
If you are just trying to save yourself some typing for some simple DAO objects, you'll probably be better off re-implementing (heck, you could probably take the DTD and write a script to generate Java code for it).
http://www.codeproject.com/KB/cross-platform/javacom.aspx?msg=1776281 might help if you're willing to do stuff by hand...
Doesn't seem quite as flexible though...

Embedding XULRunner application on Java

My goal is to get Limewire(JAVA) and Songbird(XULRunner) to run together.
I was thinking the best way is to run the XUL application(songbird) inside a JAVA swing panel. Is there another way?
Would it be better or possible to have the GUI entirely in XUL, and then access my JAVA objects somehow?
How would I go about doing this?
Thanks
Take a look at JRex, as it might let you peek into a couple of ideas.
Other than that, I'd also research about Rhinohide as well.
Take a look at DJ Native Swing, a native Swing implementation using SWT and Xulrunner.
I am currently researching XUL for a new product and I came across JavaXPCOM which allows Java code to interact with XPCOM objects. I'm still wrapping my head around the Mozilla stack, but from what I understand all XULRunner applications use XPCOM. Therefore, it seems like you should be able to embed Songbird with this approach.
The official XUL implementation by Mozilla and is heavily dependent on Gecko.
Gecko is not written in Java nor embedded in AWT/Swing/SWT (at least without using JNI).
So, the short answer is: no. You must either use JNI or use heavy, complex and incomplete third party libaries.
However, JavaXPCOM seems to allow embedding Gecko: https://developer.mozilla.org/en/JavaXPCOM
But in that case you'll depend on Gecko... and I don't know if that's enough to run Songbird.
I would examine Limewire's source code. If there's a clean separation between UI and the rest of the application, I would try finding a solution to instantiate and invoke Limewire's non-UI code from within a Songbird extension.
I would take a look at eclipse swt's embedding of
xulrunner:
http://www.eclipse.org/swt/faq.php#whatisbrowser

Categories

Resources