How do I turn off animations in latest Substance Ribbon bar? - java

Background:
I'm working in a java swing client that uses Substance 5.1 with Flamingo 4.1 and am trying to upgrade to the most recent version of the newly maintained project Insubstantial 7.2.1
Problem:
It use to be that I could stop any and all animations (to gain CPU performance) by using this code:
UIManager.put(org.jvnet.lafwidget.LafWidget.ANIMATION_KIND,
org.jvnet.lafwidget.utils.LafConstants.AnimationKind.NONE);
However, in the latest version (and what seems like since version 6.0) there isn't an ANIMATION_KIND constant to use the the UIManager to stop the animations. It seems like I could use the following code to for a stop for all the given animation kinds, but this dosn't work either:
AnimationConfigurationManager.getInstance().disallowAnimations(AnimationFacet.ARM);
AnimationConfigurationManager.getInstance().disallowAnimations(AnimationFacet.FOCUS);
AnimationConfigurationManager.getInstance().disallowAnimations(AnimationFacet.FOCUS_LOOP_ANIMATION);
AnimationConfigurationManager.getInstance().disallowAnimations(AnimationFacet.GHOSTING_BUTTON_PRESS);
AnimationConfigurationManager.getInstance().disallowAnimations(AnimationFacet.GHOSTING_ICON_ROLLOVER);
AnimationConfigurationManager.getInstance().disallowAnimations(AnimationFacet.ICON_GLOW);
AnimationConfigurationManager.getInstance().disallowAnimations(AnimationFacet.PRESS);
AnimationConfigurationManager.getInstance().disallowAnimations(AnimationFacet.ROLLOVER);
AnimationConfigurationManager.getInstance().disallowAnimations(AnimationFacet.SELECTION);
I've also tried the class specific signatures of these methods with the same result.
The documentation in Kirill's old blog about Substance says there is a way to use a properties file as well, but there is no example given on what this should contain in either the blog or the documentation.
Question:
How do I stop all animations in the latest version of Insubstantial 7.2.1?

Related

JavaFX app appears under javaw.exe in windows Task Manager. How can i make it appear as an independent application

I created a small javaFX app that draws some pie charts and creates some reports etc. When I launch my app it appears under Javaw.exe in Windows Task Manager instead of appearing it as an independent app. How can I make it appear as an independent application in task manager and windows processes list?
In the below screenshot, "MyApp" appears under "Java(TM) Platform SE Binary"
I want it to appear independently like how the Scene Builder.exe appears in the same screenshot.
Screenshot of my task manager
I have tried launching the app from jar file and creating an exe using Launch4j, but it always appear under javaw.exe in task manager.
Launch4j dropped support for custom renaming of processes.
However, the name of the parent node displayed in task manager is the JVM you are using. You can rename the JVM manually (you'll find that recommended all over the place), but that is not a good solution, especially for production software.
The best method I've found is to use Apache Procrun to wrap the program in a windows service. The official documentation lacks thorough examples, so I strongly recommend this tutorial. It is a tad dated (2013), but still works. The author even made an example github project.

JNA - getting all visible window handles on OSX

I am looking for a way to get(in z order), move and resize visible windows on OSX using Java and JNA. Goal of the project is to manage 3rd party windows, so I do not own the windows and cannot access them via simple java code. I already do this on windows7/8, which is an easy task with the user32.dll. I already wasted hours googling but I cannot find any documentation or anything about how to accomplish this on the latest OSX. So my question is - what is the OSX equivalence to the User32.dll with stuff like FindWindow, EnumWindows, SetWindowPos etc?
Or any other advice on how to accomplish something like this.
You can try using old Carbon functions. PDF Reference. Looks like GetWindowList and GetNextWindow is what you need.
You can find a sample mapping for Carbon functions here

java applet using Next-generation plug-in

I have a web application (struts 1.3, Weblogic 10.3.0, Toplink, Oracle) that has a Java applet which isn’t working in the browser (IE7/8) when the Next-Generation Plug-in setting is enabled in the Java control panel but works fine when it’s disabled. The trouble is that this setting is set to disappear in an upcoming Java release meaning that my users would have to keep using Java 1.6_xx on their workstations as they are currently. I have little influence over which version they use because they are all governed by their local IT departments across the country. So, either I have to find a simple fix to allow the Next-Generation setting to work, or we have to look at replacing/rewriting the applet with something else (but would be a last resort due to funding constraints), most likely something AJAX-friendly so as to avoid the need for a plugin. This application is quite old, written around 2001 before AJAX was really around.
The main window has a left, right, and top frame (JSP’s), as well as a center frame which is where the applet is. The applet has a main content area in the middle and a lower panel at the bottom which has some buttons. The buttons tell the content area (which is basically a treegrid) what to do (Save, Copy, change status, etc ). When I press one of the buttons the entire window (surrounding frames plus the applet itself) repeat inside the area where the applet is. It’s like a kaleidoscope or like a repeating fractal pattern kind of thing, or like when you take a picture of yourself in the mirror and you see the room repeated over and over in the mirror. In this case it repeats for each button press and the repeated set gets smaller each time. Weird!!
So, based on my research, the Java Next-Generation plugin works differently by allowing more than one process or thread whereas the classic plugin only uses a single thread. So my suspicion is that a new process is being spawned for each button press. I tried using the “separate_jvm” applet parameter but it made no difference whether it was set to true or false. I don’t see any other applet parameters which seem to be relevant.
Another idea I had is that maybe it’s something to do with the JSP frameset, maybe something like “target=_top” needs to be added somewhere…but I’m not sure how this relates to applet threads if at all.
Anyone have any suggestions, ideas or experiences that might help?
you can use velocity to handle these type of problem and it will also help you for future enhancement also.
The problem is not related to version of IE but rather to version of Java. Below excerpt from letter of certificate provider (they took it from some forum, so direct link to source cannot be provided):
For JDK version higher than 1.6.0 and below 1.6_15, you can just
clear all kinds of cache in web browser, java console and java control
panel. Then it should works fine!
For JDK version between 1.6_15 and 1.6_30, you should disable the "next-generation java" option in java control panel.
For JDK version higher than 1.6_30, you should turn on "next-generation java" option in java control panel.

JavaFX: Why are there two different styles?

I am learning JavaFX. I'm adding it to a Java Desktop App and I'm doing this using Netbeans 7. I've been searching the internet for JavaFX examples for whatever I want to do (embed in swing, set background, add gradient, incorporate animation...). I am finding two JavaFX styles.
1st Example: http://download.oracle.com/javafx/2.0/visual_effects/jfxpub-visual_effects.htm
2nd Example: http://javafx.com/samples/MediaBox/
I also found this http://netbeans.org/features/javafx/composer.html which says JavaFX support is currently not available in NetBeans IDE 7.0. And the screen shot is handling an FX Project which I don't have a choice to make in my Netbeans 7. I do have sample FX projects that I can make but these are really Java projects with FX in it (the 1st style of FX).
My guess is that JavaFX has been somewhat redesigned in the latest version, JavaFX 2. The 2nd example being the older style and the 1st being the newer. It seems to me that the 1st example is more like an addition to Java instead of a separate language.
Did I guess right? What's up with the two styles of FX?
The NetBeans JavaFX Composer is a tool that create CustomNodes with JavaFX components, but works with JavaFX 1.3.
NetBeans 7.0 has a JavaFX plug-in, but to version 2.0 (actually in beta).
JavaFX 1.3 is a DSL script language that runs over JVM and JavaFX 2.0 returns to be a Java API. They are totally differents, but conserving same Classes and ideas (CSS style, visual effects, etc).

How to make JOGL 2.0 work with SWT?

I'm trying to get SWT working with the newest JOGL (2.0).
I tried SWT snippet 209, but it doesn't work. The problem is caused by the following line:
final GLContext context = GLDrawableFactory.getFactory().createExternalGLContext();
...but when I change getFactory() to getFactory(GLProfile.getDefault()) (to make it compatible with the new API), it crashes on createExternalGLContext() with javax.media.opengl.GLException: Error: current context null. I don't understand this message: I'm trying to create a new context, and it complains that the current is null. Why?
Maybe there is some other way to create a GLContext?
Or maybe it is possible to use GLEventListener with SWT GLCanvas?
PS. I placed my modified version of the snippet here.
Edit: now I understand the error message. Documentation says:
The underlying OpenGL context must be current on the current thread at the time this method is called.
How to create the first GLContext?
Easy way: Have your rendering class implement GLEventListener and move your GLContext creation code into the .init(...) callback (seems like the right location for the example you posted). Then add that listener to whatever GLCanvas or the like you're using as your display widget.
They cleaned up JOGL a decent bit recently so most examples won't even compile without a decent bit of massaging. If you're new to it, you might want to roll back to an older version with higher code example compatibility while you get spun up.
The tutorial at http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/ shows how to do exactly this. I modified the SWT snippet 209 starting from the JOGL2 version at http://github.com/sgothel/jogl-demos/blob/master/src/demos/swt/Snippet209.java.
My tutorial shows how to do it as an Eclipse RCP app (using only SWT, no AWT bridge). To do it as a standalone SWT app, there's a tutorial at https://sites.google.com/site/justinscsstuff/jogl-tutorials.

Categories

Resources