View Javadoc

1   /**********************************************
2    * Copyright (C) 2011 Lukas Laag
3    * This file is part of svgreal.
4    * 
5    * svgreal is free software: you can redistribute it and/or modify
6    * it under the terms of the GNU General Public License as published by
7    * the Free Software Foundation, either version 3 of the License, or
8    * (at your option) any later version.
9    * 
10   * svgreal is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   * 
15   * You should have received a copy of the GNU General Public License
16   * along with svgreal.  If not, see http://www.gnu.org/licenses/
17   **********************************************/
18  package org.vectomatic.svg.edit.client.command;
19  
20  
21  /**
22   * Interface for command factories. Command factories
23   * are responsible for translating user input into
24   * instances of ICommand
25   */
26  public interface ICommandFactory {
27  	public IFactoryInstantiator<?> getInstantiator();
28  	/**
29  	 * Returns the status to display in the status line in
30  	 * the command factory toolbar
31  	 * @return the status to display in the status line in
32  	 * the command factory toolbar
33  	 */
34  	public String getStatus();
35  	/**
36  	 * Invoked when the user selects this command factory (through
37  	 * the command toolbar, the context menu, or implicitely by editing
38  	 * a field in the inspector).
39  	 * @param requester The object requesting this command to start
40  	 */
41  	public void start(Object requester);
42  	/**
43  	 * Invoked when this command factory terminates its lifecycle (on
44  	 * its own accord or because or because another command factory
45  	 * preempts it, or because the end-user terminates it)
46  	 */
47  	public void stop();
48  }