I've been brought into a project at work, and need to create compelling, modern user interfaces. The main problem is that the software is based in Eclipse using SWT for the graphics.
I've created a package on top of SWT that is similar to Quartz 2D in that it handles resolution independent drawing. I've been extending it to include tweening animation of properties in a manner similar to Core Animation. It's taken a lot of effort and research to get it to be clean and elegant. Java seems so restrictive and convoluted.
At the moment, I've created a proxy class for animation using the Reflection APIs. This is so that you can subclass the base View class, and add custom properties... and by inserting the proxy class, you can animate, without any additional code.
E.g.
So... all you need to do is create the getters and setters, and using the animator proxy, it will animate a transition.
That all works, except that the animator() method (InvocationHandler) has to return as the class interface. In any subclass, this means that the coder will have to create a animator() method and implementation for their class. This is the last stumbling block (I hope). But I cannot figure out how to remove that requirement.
No dynamic return types.
No dynamically extending of interfaces
No function pointers
No compiler macros.
Grrrrrrrrrrrrrrrr!
Help.
I've created a package on top of SWT that is similar to Quartz 2D in that it handles resolution independent drawing. I've been extending it to include tweening animation of properties in a manner similar to Core Animation. It's taken a lot of effort and research to get it to be clean and elegant. Java seems so restrictive and convoluted.
At the moment, I've created a proxy class for animation using the Reflection APIs. This is so that you can subclass the base View class, and add custom properties... and by inserting the proxy class, you can animate, without any additional code.
E.g.
Code:
view.setFrame(new Rect(10, 0, 50, 20)); // set the frame instantly
view.animator().setFrame(new Rect(10, 0, 50, 20)); // animate to the new values
So... all you need to do is create the getters and setters, and using the animator proxy, it will animate a transition.
That all works, except that the animator() method (InvocationHandler) has to return as the class interface. In any subclass, this means that the coder will have to create a animator() method and implementation for their class. This is the last stumbling block (I hope). But I cannot figure out how to remove that requirement.
No dynamic return types.
No dynamically extending of interfaces
No function pointers
No compiler macros.
Grrrrrrrrrrrrrrrr!
Help.