/** * Register and perform the command * * @param model Model to configure * @param operations_manager OperationsManager where command will be reg'ed * @param new_color New value */ public ChangePlotBackgroundCommand( final Model model, final UndoableActionManager operations_manager, final RGB new_color) { super(Messages.Color); this.model = model; this.old_color = model.getPlotBackground(); this.new_color = new_color; operations_manager.execute(this); }
/** {@inheritDoc} */ @Override public void undo() { model.setPlotBackground(old_color); }
/** {@inheritDoc} */ @Override public void run() { model.setPlotBackground(new_color); }