Android : How to allow methods within my engine to be edited , without editing its Java class (or the equivalent)

on Monday, March 23, 2015


I'm currently working on a UI Engine called PlaneUI


To give you a basic idea, it's a touch UI system where the entire screen is made up of "Planes", which can show content, as well as be used as buttons. (Additional Info Below)


To make development implementing this system feasible and make it open to other developers, I made a class called PlaneView which extends SurfaceView which internally handles all of the Plane management. The only thing that needs to be added by the developer using this engine is the content to be drawn on each Plane, and what happens when these Planes are pressed, released etc.


Currently, methods within PlaneView, such as draw, press, release, etc. are called when a Plane is drawing its content, gets pressed, released etc. However, in this case, developers need to go into the PlaneView class and add code into the declaration of these methods, such as the content to draw, and actions to be taken when pressed, released etc.


Is there any Java programming mechanism(?) I can use so that developers can define these things within their own classes?


I apologize about the excessive use of abstract language. I'll take any advise about terminology or my possible misconceptions about the Java language (I've been programming with GML on Game Maker Studio, and started Java only recently)


0 comments:

Post a Comment