Bug 430 : applet placement problems when sketch is run externally
Last modified: 2007-02-03 09:43




Status:
RESOLVED
Resolution:
DUPLICATE of bug 511
Priority:
P2
Severity:
normal

 

Reporter:
ddf
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2006-11-03 09:26
Processing 0119
Windows XP SP2

When using a class that extends another class, the size of the applet
sometimes gets messed up when running it from the dev environment.

<code>
Foo bar;

void setup()
{
size(600, 400);
frameRate(30);
smooth();
ellipseMode(CENTER_RADIUS);
bar = new Foo();
}

void draw()
{
background(255);
stroke(0);
noFill();
ellipse(width/2, height/2, 5, 5);
}

class Foo extends Object
{
Foo()
{
super();
}
}
</code>
Additional Comment #1 From ddf 2006-11-03 09:28
Dangit, that snipped has more in it than necessary. Here is the simpler
version that causes the same problem (why can't we edit bugs?):

Foo bar;

void setup()
{
size(600, 400);
bar = new Foo();
}

void draw()
{
background(255);
}

class Foo extends Object
{
Foo()
{
super();
}
}
Additional Comment #2 From fry 2006-11-03 20:31
*** Bug 429 has been marked as a duplicate of this bug. ***
Additional Comment #3 From fry 2006-11-03 20:33
can you post as many details about your machine as possible? also, what
version of java do you have installed?

i've been getting random reports of the window size being incorrect, but i
can't reproduce it here and need to figure out a way to make it happen.
Additional Comment #4 From ddf 2006-11-04 08:06
System:

Microsoft Windows XP
Home Edition
Version 2002
Service Pack 2

Computer:

Intel Pentium 4 CPU 3.20 GHz
512 MB of RAM

Video Card:

NVIDIA GeForce2 GTS
AGP 4X
32 MB VRAM
DirectX 9.0

Java 1.5

Did I miss anything?
Additional Comment #5 From fry 2006-11-04 11:57
thanks, some other tidbits:

1) do you have hyperthreading (HT) enabled, or dual processors? i.e. when
you open up the task manager, do you get one or two graphs for the cpu
usage (meaning one or two "processors", whether real or not)

2) how consistently can you make this happen?

3) which release of java 1.5 are you on? does it happen with the version of
processing that includes java?

4) does it happen with 0115?

5) does it happen when running inside a web browser?

i've received a few random reports on this, and am wanting to track it
down. i believe it has something to do with threading changes introduced in
0116, and therefore it shows up on very fast or very slow machines. but i'm
trying to figure out what sort of scenario triggers it.
Additional Comment #6 From ddf 2006-11-04 16:27
Yes, Hyper Threading is enabled.

It happens about 40% of the time with the code I've posted here. On another
more complicated sketch it started happening almost 100% of the time.
Usually the windown comes up as 100x100, sometimes it comes up at the right
dimentions, but the drawing area is translated.

Java is Version 1.5.0 (build 1.5.0_07-b03)

Yes, it happens in 0115 (expert).

I don't know if it happens with the version that comes with Java. Would I
need to uninstall Java to test that?

It doesn't happen in the web browser.
Additional Comment #7 From fry 2006-11-04 16:33
to use the version of p5 that includes java, just download using the
"windows" link (versus the "windows without java" one). as long as you're
not using libraries, and using this exact code, you don't need to uninstall
1.5. but to be sure, add a println(javaVersion); to the beginning of your
code to make sure it's 1.4.

once you've confirmed that it's 1.4 that's running with that version,
remove the println(), since the println() may actually interrupt the
threads enough such that the bug will go away :)
Additional Comment #8 From ddf 2006-11-04 16:51
Ok, I downloaded 0118 with java. Did the println thing, it said 1.4 and,
incidentally, the bug happened the very first time I ran the sketch, it was
the windows-dimensions-correct-but-drawing-area-translated variety.

Then I removed the println and started it a bunch, got the small window
like 6 times in a row at one point, also got some correct starts.
Additional Comment #9 From ddf 2006-11-18 07:20
I'm getting this bug in a sketch that doesn't use extends, just so you
know. I can upload the source if you want.
Additional Comment #10 From fry 2006-11-19 09:14
the "extends" issue is simply that any code that includes "extends" will be
run externally. as will any code that uses a library, or has a "data"
folder larger than about 1MB. or if you are specifying the amount of RAM to
use in preferences, etc...
Additional Comment #11 From fry 2007-02-03 09:43


*** This bug has been marked as a duplicate of 511 ***