I have a lot of code that retrieves streaming statuses from Twitter, does search, retrieves trends, and a lot more. Each one is wrapped in class and has methods to be called. However, all of these have to be manipulated with mouse clicks. for example, if user clicks somewhere on a worldmap (on homescreen), he should see another window that shows search results. But if the user clicks on a particular button on the screen, he should be able to see a completely different window with its own controls (like mouse events).
But now everything is manipulated only by draw method, and I have to use a lot of if statements and flags to control everything. Yet, I fail somehow.
What is the best way to solve the problem?
I hope my question is not too long. Thanks!
1