if (model.getState() != READY) throw new IllegalStateException("This method should only be " + "invoked in the READY state.");
switch (model.getState()) { case READY: case NEW: break; default: throw new IllegalStateException("This method should only be " + "invoked in the READY or NEW state."); }
    public void showClassifier(ImageData object, int mode)    {        if (model.getState() != READY)            throw new IllegalStateException("This method should only be " +                "invoked in the READY state.");        if (object == null)             throw new IllegalArgumentException("Object cannot be null.");        removeEditor();        model.setEditorType(CLASSIFIER_EDITOR);        Classifier classifier = ClassifierFactory.getClassifier(this, mode,                                                     object);        classifier.addPropertyChangeListener(controller);        classifier.activate();        view.addComponent(classifier.getUI());    }