I think the main cause of performance slowness is rendering
not layout code
that because I have to calculate every transformed pixel
and it's not linear affine transform
for example for dashboard transform I have
float k1 = sinea / (float)w;
int xx = (int)Math.round(w*(1-cosa)+x*cosa);
float k =
(positiveDirection)?(float)x:(float)(w-x);
int yy = (int)Math.round(y + (h/2-y)*k1 *k);//as
you can see yy is a nonlinear function of x and y
where w is width of the image and h is height of it
aditionally for cube effect I have to keep coordinate of right side of
the left image to equal to the coordinate
of the left side of right image:
so if left image rotate to angle alpha then right image should rotate to
float beta =
180*(float)Math.acos(1-cosa)/(float)Math.PI;
all of these manipulations take time, not differences between
ArrayLists and vectors
besides the size of that vector is too small to worry about performance
I think
On Dec 18, 2004, at 7:41 PM, Craig Mattocks wrote:
Any reason why Vectors are used instead of faster ArrayLists? Is
micro-level synchronization required?
I blindly searched for "Vector" (case sensitive, capitalized word
only) and replaced it with "ArrayList" in the file
AnimatingCardLayout.java and noticed no ill effects. Haven't
rigorously measured performance differences yet...
Yes, letting the user set an animation frame rate (as in Java games)
would be a nice feature -- display a slider to control it in the demo.
:-)
Tres kool project, guys!
Craig
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden
Dmitry Markman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden