Skip to main content

bad performance javafx adobe illustrator interface

4 replies [Last post]
violetfairy
Offline
Joined: 2009-12-21
Points: 0

Hi,
sorry for my bad English...

I'm developing a desktop app with Java and JavaFX.

For my interface I'm using fxz files exported by Adobe Illustrator. When I add an instance of them to my scene I have serious problems with memory. I resolved this problem with -Xmx options, but my app has very bad performace, everything is very slow.

Do you have used .fxz file exported by Photoshop or Adobe Illustrator for your interface? Have you met similar problem?

My .fxz file use 148KB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pbenes
Offline
Joined: 2009-01-22
Points: 0

Hello,
maybe you could use the Node.cache and Node.cacheHint variables to use bitmap caching. But it is hard to say, it would be easier if you could provide link to your fxz files and app sources.

violetfairy
Offline
Joined: 2009-12-21
Points: 0

Hi, thanks for your answer.. I've some news, I don't think is a problem of memory. I've load a bigger file .fxz (367 KB against 148 KB ) and I haven't any problem.

How can I find where is the problem?

This is the source of my .fxz

[code]
/*
* Generated by JavaFX plugin for Adobe Photoshop.
* Created on Wed Mar 24 16:13:45 2010
*/
//@version 1.0

Group {
clip: Rectangle { x:0 y:0 width:1034 height:650 }
content: [
ImageView {
id: "Sfondo"
x: 0
y: 0
image: Image {
url: "{__DIR__}Sfondo.png"
}
},
ImageView {
id: "Oggetto_vettoriale_avanzato"
x: -3
y: -12
image: Image {
url: "{__DIR__}Oggetto_vettoriale_avanzato.png"
}
},
Group {
id: "Bottoni_centrali"
content: [
ImageView {
id: "SimboloStop"
x: 0
y: 0
image: Image {
url: "{__DIR__}SimboloStop.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}SimboloStop_vmask.png"
}
}
}
},
ImageView {
id: "SimboloPlay"
x: 538
y: 536
image: Image {
url: "{__DIR__}SimboloPlay.png"
}
},
ImageView {
id: "Simbolo_pausa"
visible: false
x: 541
y: 535
image: Image {
url: "{__DIR__}Simbolo_pausa.png"
}
},
ImageView {
id: "BottonePlay"
x: 497
y: 468
image: Image {
url: "{__DIR__}BottonePlay.png"
}
},
ImageView {
id: "SimboloSkipAvanti"
x: 643
y: 536
image: Image {
url: "{__DIR__}SimboloSkipAvanti.png"
}
},
ImageView {
id: "BottoneSkipAvanti"
x: 621
y: 477
image: Image {
url: "{__DIR__}BottoneSkipAvanti.png"
}
},
ImageView {
id: "BottoneStop_copia_2"
x: 282
y: 477
image: Image {
url: "{__DIR__}BottoneStop_copia_2.png"
}
},
ImageView {
id: "BottoneSkipIndietro"
x: 389
y: 477
image: Image {
url: "{__DIR__}BottoneSkipIndietro.png"
}
},
ImageView {
id: "SimboloSkipIndietro"
x: 413
y: 537
image: Image {
url: "{__DIR__}SimboloSkipIndietro.png"
}
},
]
},
Group {
id: "Barre_del_tempo_bassa"
content: [
ImageView {
id: "BarratemporaleFisica"
x: 0
y: 0
image: Image {
url: "{__DIR__}BarratemporaleFisica.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}BarratemporaleFisica_vmask.png"
}
}
}
},
ImageView {
id: "BarraTempo"
x: 0
y: 0
image: Image {
url: "{__DIR__}BarraTempo.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}BarraTempo_vmask.png"
}
}
}
},
Group {
content: [
ImageView {
id: "CursoreBarraTempo"
x: 0
y: 0
image: Image {
url: "{__DIR__}CursoreBarraTempo.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}CursoreBarraTempo_vmask.png"
}
}
}
},
]
effect: InnerShadow {
offsetX: 2.00
offsetY: 3.46
color: Color.rgb(0, 0, 0, 0.75)
radius: 4.00
choke: 0.08
}
},
]
},
Group {
id: "BottoniInversione"
content: [
ImageView {
id: "BottoneInversione"
x: 898
y: 505
image: Image {
url: "{__DIR__}BottoneInversione.png"
}
},
ImageView {
id: "BottoneInversione_Alto"
x: 44
y: 75
image: Image {
url: "{__DIR__}BottoneInversione_Alto.png"
}
},
]
},
Group {
id: "VolumeSinistra"
content: [
ImageView {
id: "VolumeSpento"
x: 178
y: 292
image: Image {
url: "{__DIR__}VolumeSpento.png"
}
},
ImageView {
id: "BottoneVolSpent"
x: 168
y: 343
image: Image {
url: "{__DIR__}BottoneVolSpent.png"
}
},
ImageView {
id: "Simbolo_Volume"
x: 54
y: 597
image: Image {
url: "{__DIR__}Simbolo_Volume.png"
}
},
ImageView {
id: "Volume_0_copia"
x: 0
y: 0
image: Image {
url: "{__DIR__}Volume_0_copia.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}Volume_0_copia_vmask.png"
}
}
}
},
ImageView {
id: "Simbolo__sini"
x: 66
y: 304
image: Image {
url: "{__DIR__}Simbolo__sini.png"
}
},
ImageView {
id: "SimboloMenoVol_copia"
x: 0
y: 0
image: Image {
url: "{__DIR__}SimboloMenoVol_copia.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}SimboloMenoVol_copia_vmask.png"
}
}
}
},
]
},
Group {
id: "VolumeDestra"
content: [
ImageView {
id: "Simbolo__des"
x: 946
y: 326
image: Image {
url: "{__DIR__}Simbolo__des.png"
}
},
ImageView {
id: "Simbolo_Volume_copia"
x: 931
y: 12
image: Image {
url: "{__DIR__}Simbolo_Volume_copia.png"
}
},
ImageView {
id: "BottoneVolSpent_copia"
x: 763
y: 238
image: Image {
url: "{__DIR__}BottoneVolSpent_copia.png"
}
},
ImageView {
id: "VolumeSpento_des"
x: 772
y: 310
image: Image {
url: "{__DIR__}VolumeSpento_des.png"
}
},
ImageView {
id: "SimboloMenoVol_copia_2"
x: 0
y: 0
image: Image {
url: "{__DIR__}SimboloMenoVol_copia_2.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}SimboloMenoVol_copia_2_vmask.png"
}
}
}
},
ImageView {
id: "Volume_0"
x: 0
y: 0
image: Image {
url: "{__DIR__}Volume_0.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}Volume_0_vmask.png"
}
}
}
},
]
},
Group {
id: "Barra_tempo_alta"
content: [
ImageView {
id: "BarratemporaleFisica_copia"
x: 0
y: 0
image: Image {
url: "{__DIR__}BarratemporaleFisica_copia.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}BarratemporaleFisica_copia_vmask.png"
}
}
}
},
ImageView {
id: "BarraTempo_alta"
x: 0
y: 0
image: Image {
url: "{__DIR__}BarraTempo_alta.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}BarraTempo_alta_vmask.png"
}
}
}
},
Group {
content: [
ImageView {
id: "CursoreBarraTempo_alta"
x: 0
y: 0
image: Image {
url: "{__DIR__}CursoreBarraTempo_alta.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}CursoreBarraTempo_alta_vmask.png"
}
}
}
},
]
effect: InnerShadow {
offsetX: 2.00
offsetY: 3.46
color: Color.rgb(0, 0, 0, 0.75)
radius: 4.00
choke: 0.08
}
},
]
},
ImageView {
id: "SpazioVideo"
opacity: 0.85
x: 0
y: 0
image: Image {
url: "{__DIR__}SpazioVideo.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}SpazioVideo_vmask.png"
}
}
}
},
Group {
id: "Bottoni_centrali_copia"
content: [
ImageView {
id: "SimboloStop_copia"
x: 0
y: 0
image: Image {
url: "{__DIR__}SimboloStop_copia.png"
}
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 0
y: 0
source: Image {
url: "{__DIR__}SimboloStop_copia_vmask.png"
}
}
}
},
ImageView {
id: "SimboloPlay_copia"
x: 422
y: 81
image: Image {
url: "{__DIR__}SimboloPlay_copia.png"
}
},
ImageView {
id: "BottonePlay_copia"
x: 390
y: 119
image: Image {
url: "{__DIR__}BottonePlay_copia.png"
}
},
ImageView {
id: "SimboloSkipAvanti_copia"
x: 309
y: 78
image: Image {
url: "{__DIR__}SimboloSkipAvanti_copia.png"
}
},
ImageView {
id: "BottoneSkipAvanti_copia"
x: 284
y: 120
image: Image {
url: "{__DIR__}BottoneSkipAvanti_copia.png"
}
},
ImageView {
id: "BottoneStop_copia_3"
x: 621
y: 119
image: Image {
url: "{__DIR__}BottoneStop_copia_3.png"
}
},
ImageView {
id: "BottoneSkipIndietro_copia"
x: 515
y: 119
image: Image {
url: "{__DIR__}BottoneSkipIndietro_copia.png"
}
},
ImageView {
id: "SimboloSkipIndietro_copia"
x: 540
y: 78
image: Image {
url: "{__DIR__}SimboloSkipIndietro_copia.png"
}
},
]
},
]
}

[/code]

And this is the code of auto generated UI .fx

[code]
package mypackage;

import java.lang.*;
import javafx.scene.Node;
import javafx.fxd.FXDNode;

public class PlayerUI extends FXDNode {

override public var url = "{__DIR__}Player.fxz";

public-read protected var BarraTempo: Node;
public-read protected var BarraTempo_alta: Node;
public-read protected var Barra_tempo_alta: Node;
public-read protected var BarratemporaleFisica: Node;
public-read protected var BarratemporaleFisica_copia: Node;
public-read protected var Barre_del_tempo_bassa: Node;
public-read protected var BottoneInversione: Node;
public-read protected var BottoneInversione_Alto: Node;
public-read protected var BottonePlay: Node;
public-read protected var BottonePlay_copia: Node;
public-read protected var BottoneSkipAvanti: Node;
public-read protected var BottoneSkipAvanti_copia: Node;
public-read protected var BottoneSkipIndietro: Node;
public-read protected var BottoneSkipIndietro_copia: Node;
public-read protected var BottoneStop_copia_2: Node;
public-read protected var BottoneStop_copia_3: Node;
public-read protected var BottoneVolSpent: Node;
public-read protected var BottoneVolSpent_copia: Node;
public-read protected var BottoniInversione: Node;
public-read protected var Bottoni_centrali: Node;
public-read protected var Bottoni_centrali_copia: Node;
public-read protected var CursoreBarraTempo: Node;
public-read protected var CursoreBarraTempo_alta: Node;
public-read protected var Oggetto_vettoriale_avanzato: Node;
public-read protected var Sfondo: Node;
public-read protected var SimboloMenoVol_copia: Node;
public-read protected var SimboloMenoVol_copia_2: Node;
public-read protected var SimboloPlay: Node;
public-read protected var SimboloPlay_copia: Node;
public-read protected var SimboloSkipAvanti: Node;
public-read protected var SimboloSkipAvanti_copia: Node;
public-read protected var SimboloSkipIndietro: Node;
public-read protected var SimboloSkipIndietro_copia: Node;
public-read protected var SimboloStop: Node;
public-read protected var SimboloStop_copia: Node;
public-read protected var Simbolo_Volume: Node;
public-read protected var Simbolo_Volume_copia: Node;
public-read protected var Simbolo__des: Node;
public-read protected var Simbolo__sini: Node;
public-read protected var Simbolo_pausa: Node;
public-read protected var SpazioVideo: Node;
public-read protected var VolumeDestra: Node;
public-read protected var VolumeSinistra: Node;
public-read protected var VolumeSpento: Node;
public-read protected var VolumeSpento_des: Node;
public-read protected var Volume_0: Node;
public-read protected var Volume_0_copia: Node;

override protected function contentLoaded() : Void {
BarraTempo=getNode("BarraTempo");
BarraTempo_alta=getNode("BarraTempo_alta");
Barra_tempo_alta=getNode("Barra_tempo_alta");
BarratemporaleFisica=getNode("BarratemporaleFisica");
BarratemporaleFisica_copia=getNode("BarratemporaleFisica_copia");
Barre_del_tempo_bassa=getNode("Barre_del_tempo_bassa");
BottoneInversione=getNode("BottoneInversione");
BottoneInversione_Alto=getNode("BottoneInversione_Alto");
BottonePlay=getNode("BottonePlay");
BottonePlay_copia=getNode("BottonePlay_copia");
BottoneSkipAvanti=getNode("BottoneSkipAvanti");
BottoneSkipAvanti_copia=getNode("BottoneSkipAvanti_copia");
BottoneSkipIndietro=getNode("BottoneSkipIndietro");
BottoneSkipIndietro_copia=getNode("BottoneSkipIndietro_copia");
BottoneStop_copia_2=getNode("BottoneStop_copia_2");
BottoneStop_copia_3=getNode("BottoneStop_copia_3");
BottoneVolSpent=getNode("BottoneVolSpent");
BottoneVolSpent_copia=getNode("BottoneVolSpent_copia");
BottoniInversione=getNode("BottoniInversione");
Bottoni_centrali=getNode("Bottoni_centrali");
Bottoni_centrali_copia=getNode("Bottoni_centrali_copia");
CursoreBarraTempo=getNode("CursoreBarraTempo");
CursoreBarraTempo_alta=getNode("CursoreBarraTempo_alta");
Oggetto_vettoriale_avanzato=getNode("Oggetto_vettoriale_avanzato");
Sfondo=getNode("Sfondo");
SimboloMenoVol_copia=getNode("SimboloMenoVol_copia");
SimboloMenoVol_copia_2=getNode("SimboloMenoVol_copia_2");
SimboloPlay=getNode("SimboloPlay");
SimboloPlay_copia=getNode("SimboloPlay_copia");
SimboloSkipAvanti=getNode("SimboloSkipAvanti");
SimboloSkipAvanti_copia=getNode("SimboloSkipAvanti_copia");
SimboloSkipIndietro=getNode("SimboloSkipIndietro");
SimboloSkipIndietro_copia=getNode("SimboloSkipIndietro_copia");
SimboloStop=getNode("SimboloStop");
SimboloStop_copia=getNode("SimboloStop_copia");
Simbolo_Volume=getNode("Simbolo_Volume");
Simbolo_Volume_copia=getNode("Simbolo_Volume_copia");
Simbolo__des=getNode("Simbolo__des");
Simbolo__sini=getNode("Simbolo__sini");
Simbolo_pausa=getNode("Simbolo_pausa");
SpazioVideo=getNode("SpazioVideo");
VolumeDestra=getNode("VolumeDestra");
VolumeSinistra=getNode("VolumeSinistra");
VolumeSpento=getNode("VolumeSpento");
VolumeSpento_des=getNode("VolumeSpento_des");
Volume_0=getNode("Volume_0");
Volume_0_copia=getNode("Volume_0_copia");
}

/**
* Check if some element with given id exists and write
* a warning if the element could not be found.
* The whole method can be removed if such warning is not required.
*/
protected override function getObject( id:String) : Object {
var obj = super.getObject(id);
if ( obj == null) {
System.err.println("WARNING: Element with id {id} not found in {url}");
}
return obj;
}
}
[/code]

I don't understand where is the problem

pbenes
Offline
Joined: 2009-01-22
Points: 0

Hi,
I can see you are using effects in your file - namely Blend and InnerShadow. Such effects may be a performance problem on some platforms without HW acceleration, maybe your other file is without them? Could it be the reason for different behavior?

Regards,
Pavel

violetfairy
Offline
Joined: 2009-12-21
Points: 0

Yes... I removed those effect and now it works! Thanks a lot! :)