Netbeans version of State Pattern