/* This file is part of the algoviz@vt collection of algorithm visualizations. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this distribution. If not, see . */ package bst; /** * An abstraction for a state the tree can be in. Only has one subclass at the moment * * @author Andy Street, alstreet@vt.edu * @version Apr 22, 2009 * */ public abstract class State { private String feedbackText; /* The operation type of this State */ private Operation opType; /** * @param o The operation of this state. * @param t The string to display (usually some information about the * operation). */ public State(Operation o, String t) { feedbackText = t; opType = o; } /** * Gets the text associated with this State. * @return the text associated with the State. */ public String getText() { return feedbackText; } /** * @return This state's operation type. */ public Operation getOpType() { return this.opType; } public abstract void onStateFocused(TreePanel tp, boolean goingForward); public abstract void onStateUnfocused(TreePanel tp); public abstract void draw(TreePanel tp, boolean prev); }