Fabricio Sanchez

Ranch Hand
+ Follow
since Mar 11, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Fabricio Sanchez

Hi there, I've been trying to create a JOGL offscreenDrawable without PBuffers as some of our clients have older machines that don't work with PBuffers.
In a PBuffer situation I can create the offscreen drawable, draw into it and extract a BufferedImage to save to file as a .png without any problems:


I'm new to JOGL and have been trying to solve this for over a week now and I'm going round in circles.

This is what I have so far, split into 3 sections:
1. Create GLDrawable, GLContext and make GLContext current (Where I have problems)
2. Render to GLContext (Working ok)
3. Get a BufferedImage from the current context and save to a png file (works fine, no problems there)

The code below Fails because of the fact that method glBindBuffer is not available in the offscreen drawable I created (glBindBuffer is available in my main drawable that is visible in the application):
Anyway I want to move away from buffers, maybe use FBOs, which probably means the code needs to change a bit.

glBindBuffer:false
javax.media.opengl.GLException: Method "glBindBuffer" not available
at jogamp.opengl.gl4.GL4bcImpl.glBindBuffer(GL4bcImpl.java:311)
at com.jogamp.opengl.util.awt.TextRenderer$Pipelined_QuadRenderer.drawVertexArrays(TextRenderer.java:1810)
at com.jogamp.opengl.util.awt.TextRenderer$Pipelined_QuadRenderer.draw(TextRenderer.java:1791)
at com.jogamp.opengl.util.awt.TextRenderer$Pipelined_QuadRenderer.access$000(TextRenderer.java:1733)
at com.jogamp.opengl.util.awt.TextRenderer.flushGlyphPipeline(TextRenderer.java:813)
at com.jogamp.opengl.util.awt.TextRenderer.endRendering(TextRenderer.java:709)
at com.jogamp.opengl.util.awt.TextRenderer.endRendering(TextRenderer.java:545)

I hope I am missing something basic that someone can give me a hand with.

Than you,

Fabricio

Forgot to say, I'm using jogl from JogAmp.org version 2.0-b58-20120620
9 years ago
Hi Domenico, unfortunately not.

We are abandoning javaFX at the moment and I've been looking at xuggler to try and implement a java video player as the java media framework wasn't very straight forward...

Fabricio
11 years ago
Hi there,

I want to play video files on my javaFx application.
I converted my video files to fmx files using on2 flix standard (demo version) as it's the only format that is supported on all operating systems.
(I had very little luck encoding to AVI files that could be played by javaFx on Windows).

My application is embedded in a web page but can also be launched (from its jnlp file).
I have a small video that is integrated into my GUI and when the user clicks on it, a bigger window pops-up with a bigger version of the video.

The Problem:
The FXM video files work ok sometimes but most of the time they sporadically crash the application and behave erratically, that is, pause/play/stop don't work and sometimes the sound of the video will play but the image (and application) freezes/crashes.


Does anyone have any suggestions on what to use to play videos within javaFx? I'm not happy with fxm files as they leave a lot to be desired in terms of application robustness and functionality.


Thank you in advance,

Fabricio
12 years ago
Thank you Jim,

That worked. My extension class is just a dummy class now as I have to create and initialise everything outside it and then just set the initialisation values as you suggested.
Double the work until they fix this bug, but as long as it works.

Here's a description of what I'm doing for anyone who might want to try it:
12 years ago
Hi there,

I want to extend class javafx.animation.KeyValue so that I can attach extra information to a KeyValue animation (inside a Timeline KeyFrame).

The problem I have is that the only way I've found of instantiating a KeyValue for a KeyFrame is:


So how can I initialise my subclass to something meaningful using the syntax above?
Solution Attempt 1:



I've also tried to generate an inner KeyValue, which I think works, however, I can't tie it in to the superclass public-init variables.
Solution Attempt 2:


For the above to work, I want to override the following variables that exist in javafx.animation.KeyValue


Any ideas?

Thank you,

Fabricio

12 years ago
I think I found my own solution.
Declare the variables outside the public class .. { .. }
So, in my case:



After that, I could access them just the same as public static final ints in java.

Hope this helps someone else.

Cheers,

Fabricio
12 years ago
Hi there,

I can't find a way in javafx to use public static final int variables.
Can anyone tell me the official way to do this (or a work around)?

Example in java:


javaFx attempted code:


However the above doesn't work. I'm guessing because maybe I'm trying to access a value before the object has been initialised.

Any help greatly appreciated.

Best regards,

Fabricio
12 years ago
Thank you Michael.

That works. Although strangely, when I'm resizing the JFrame (making it smaller) it doesn't fire a ComponentListesner.componentResized event immediately. When I make the JFrame bigger it fires it straight away.

It's a shame there isn't a standard isResizing (or startResize, endResize) event that can be caught directly from the JFrame.

Thanks again.

Fabricio
12 years ago
Thanks Maneesh,

That is the second thing I tried (see original post), the only problem is that no MouseEvents are fired on the resize border around the JFrame, so nothing gets picked up as the JFrame is resizing.
(If I was interested in resizing a component within it, it would be fine as MouseEvent are fired within components)

Any other ideas?

Fabricio
12 years ago
Hi there,

I'm trying to override the paint method on a JFrame so that the frame is blank as it is resized and when the resize is finished it gets back to normal and redraws.


Overriding ComponentListesner.componentResized(ComponentEvent e) only tells me when the JFrame resize is completed. Ideally I want to disable painting as the JFrame is resizing.
So that's no good


Also tried overriding:
MouseListener.mousePressed (to record the jframe's width and height)
MouseMotionListener.mouseDragged( to compare current jframe size with recorded ones above, and if so stop paint() on JFrame)
MouseListener.mouseReleased( to reset the paint() method back to normal and repaint the JFrame)
However, this doesn't work as when resizing the JFrame no MouseEvents are fired

Another way I found was to create a separate Thread that would report on the size of the JFrame at various intervals. This is not ideal, as I don't wan't to waste resources like, I don't want a separate thread for something that will not be used that much.

Does anyone know a better way of accomplishing this?

Thank you,

Fabricio
12 years ago
Thank you for the quick reply, Ulf.

I do know that the jar files are cached by default.

I just want o know how to access the resources contained within them (the cached version, if available) as opposed to always connecting to the server version of the files.

I also want to know if this is the default behavior of applets (that is to access server resources instead of local cached resources with the getResource method) or if I'm doing something wrong.

Thank you,

regards,

Fabricio
13 years ago
Hi there,

I have a textures.jar file on my server (specified with the archive parameter within the applet tag) with a class to use as an anchor and some images. When I run the applet, this is how I get to the images:

URL url = TextureAnchor.class.getResource("image.gif");

I then build an ImageIcon from the images and use as normal.

If I print out the url,
System.out.println( "url: " + url.toString() );
// I get: url: http://www.mysite.co.uk/textures.jar!/image.gif

My question:
How can I make sure that the applet is getting the resource from the local cached version (on the client) instead of going to the server for it?

Does this mean that every time I use a getResource() on an applet it goes to the server for it?

Thank you,

Regards,

Fabricio
13 years ago
Hi There,

I have my main jar file containing classes and within that I have another jar file full of images and a library.xml file to manage those images as such:

utilities.jar
- com/esp/textures/JarTextureLibrary.class
- com/esp/textures/textures.jar
- library.xml
- bricks/brick_01.gif
- bricks/brick_02.gif
- etc...

In code I do the following


I then modify the URL by:


I then proceed to read the xml file from this newly created xmlString.

Now this doesn't work because of the multiple "!/" that appear on the final resulting URL giving me the following error message:

xml�library�location�is:�jar:file:/C:/current/lib/utilities.jar!/com/esp/textures/textures.jar!/library.xml
JAR entry com/esp/textures/textures.jar!/library.xml not found in C:\current\lib\utilities.jar

Any ideas how I can read not only the library file (library.xml) but also the images contained within it?

Is the only way to extract the textures.jar file locally and then try and access it?

Thank you in advance,

Regards,

Fabricio
13 years ago
Hi there,

I want to create localised standard buttons that say "Yes", "No", "Ok" and "Cancel". Is there a way to get to these Strings?

I've tried looking at the source code for JOptionPane but couldn't find what I'm looking for.

Thank you,

Fabricio
14 years ago
Thank you very much for all your help Ulf.

I will test all those things we talked about to see if I can really control all the aspects of caching and updating jar files.

From what you said it seems that (within the applet and java plug-in framework )I can do all that I set out to do.

Regards,

Fab.
16 years ago