Back to project page model-explorer.
The source code is released under:
Apache License
If you think the Android project model-explorer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.etaoin.myopengltest.core.main.context; // ww w . j av a 2 s . c o m import java.util.ArrayList; import java.util.List; /** * Responsible for swapping between contexts and send events to the right context. */ public class ContextManager { private List<Context> contexts; private Context currentContext; public ContextManager() { contexts = new ArrayList<Context>(); } public void addContext(Context context) { contexts.add(context); } public void addCurrentContext(Context context) { contexts.add(context); currentContext = context; } public void initialize() { for (Context context : contexts) { context.initialize(); } } public void draw() { currentContext.draw(); } public Context getCurrentContext() { return currentContext; } }