Hi
I have a panel that draws alot of things. To make drawing effecient I am using a BufferedImage so that I dont have to draw everything, everytime something happens.
My paintComponent only has to 'if' statements:
if(!extraOnly) //paint something
paint something
if(listener.getRectangle() != null) // Paint something
I like the idea of using state pattern, but I am not sure its the right moment to use it? I don't like the idea of having to set a boolean for extraOnly and maybe there has also gotten pattern fever in me :). Each state would only have one method, draw(Graphics g)
Since this is the view part of my application in a MVC pattern, I am also unsure of using state pattern is wrong. Shouldn't state be part of the model and not the view?