1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
package tim.prune;
import javax.swing.JFrame;
import tim.prune.config.Config;
import tim.prune.gui.IconManager;
/**
* Generic function class for launching from the app
*/
public abstract class GenericFunction
{
/** Reference to app object */
protected final App _app;
/** Reference to parent frame */
protected final JFrame _parentFrame;
/**
* Constructor
* @param inApp app object
*/
public GenericFunction(App inApp)
{
_app = inApp;
_parentFrame = inApp.getFrame();
}
/**
* Begin the function
*/
public abstract void begin();
/**
* @return the function name
*/
public String getName() {
return I18nManager.getText(getNameKey());
}
/**
* @return the key for the function name
*/
public abstract String getNameKey();
/**
* @return config object
*/
protected Config getConfig() {
return _app.getConfig();
}
/**
* @return icon manager
*/
protected IconManager getIconManager() {
return _app.getIconManager();
}
}
|