Package elki.gui.minigui
Class MiniGUI
- java.lang.Object
-
- elki.application.AbstractApplication
-
- elki.gui.minigui.MiniGUI
-
@Alias({"mini","minigui"}) public class MiniGUI extends AbstractApplication
Minimal GUI built around a table-based parameter editor.- Since:
- 0.3
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classMiniGUI.SettingsComboboxModelClass to interface between the saved settings list and a JComboBox.-
Nested classes/interfaces inherited from class elki.application.AbstractApplication
AbstractApplication.Par
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringACTION_QUITQuit action, for mnemonics.private java.lang.StringAPP_PREFIXPrefix for application package.protected javax.swing.JComboBox<java.lang.String>appComboCombo box for choosing the application to run.private javax.swing.JTextFieldcommandLineCommand line output field.(package private) javax.swing.JFrameframeThe frameprivate static LoggingLOGELKI logger for the GUI.private java.lang.Class<? extends AbstractApplication>mainclsApplication to configure / run.private static java.lang.StringNEWLINENewline used in output.protected LogPaneloutputAreaLogging output area.(package private) javax.swing.JPanelpanelThe main panel.protected DynamicParametersparametersParameter storage.protected ParameterTableparameterTableThe parameter table.protected javax.swing.JButtonrunButtonThe "run" button.static java.lang.StringSAVED_SETTINGS_FILENAMEFilename for saved settings.protected javax.swing.JComboBox<java.lang.String>savedComboCombo box for saved settings.protected MiniGUI.SettingsComboboxModelsavedSettingsModelModel to link the combobox with.protected SavedSettingsFilestoreSettings storage.-
Fields inherited from class elki.application.AbstractApplication
REFERENCE, VERSION
-
-
Constructor Summary
Constructors Constructor Description MiniGUI()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoSetParameters(java.util.List<java.lang.String> params)Do the actual setParameters invocation.private java.lang.Stringformat(java.lang.Object... params)Format objects to a command line.private voidformatTo(java.lang.StringBuilder buf, java.lang.String s)Format a single string for the command line.private voidformatTo(java.lang.StringBuilder buf, java.util.List<?> params)Format a list of strings to a buffer.protected voidloadLatest()Auto-load the last task from the history file.static voidmain(java.lang.String[] args)Main method that just spawns the UI.protected voidreportErrors(SerializedParameterization config)Report errors in a single error log record.voidrun()Runs the application.private voidsetupAppChooser()Setup the application chooser.private voidsetupCommandLine()Setup command line fieldprivate voidsetupLoadSaveButtons()Create the load and save buttons.private voidsetupLoggingArea()Setup logging areaprivate voidsetupParameterTable()Setup the parameter tableprotected voidstartTask()Do a full run of the KDDTask with the specified parameters.private java.lang.Stringstrip_prefix(java.lang.String nam)Strip the APP_PREFIX prefix.protected voidupdateParameterTable()Serialize the parameter table and run setParameters().-
Methods inherited from class elki.application.AbstractApplication
printErrorMessage, runCLIApplication, usage
-
-
-
-
Field Detail
-
SAVED_SETTINGS_FILENAME
public static final java.lang.String SAVED_SETTINGS_FILENAME
Filename for saved settings.- See Also:
- Constant Field Values
-
NEWLINE
private static final java.lang.String NEWLINE
Newline used in output.
-
LOG
private static final Logging LOG
ELKI logger for the GUI.
-
ACTION_QUIT
private static final java.lang.String ACTION_QUIT
Quit action, for mnemonics.- See Also:
- Constant Field Values
-
frame
javax.swing.JFrame frame
The frame
-
panel
javax.swing.JPanel panel
The main panel.
-
outputArea
protected LogPanel outputArea
Logging output area.
-
parameterTable
protected ParameterTable parameterTable
The parameter table.
-
parameters
protected DynamicParameters parameters
Parameter storage.
-
store
protected SavedSettingsFile store
Settings storage.
-
appCombo
protected javax.swing.JComboBox<java.lang.String> appCombo
Combo box for choosing the application to run.
-
savedCombo
protected javax.swing.JComboBox<java.lang.String> savedCombo
Combo box for saved settings.
-
savedSettingsModel
protected MiniGUI.SettingsComboboxModel savedSettingsModel
Model to link the combobox with.
-
runButton
protected javax.swing.JButton runButton
The "run" button.
-
maincls
private java.lang.Class<? extends AbstractApplication> maincls
Application to configure / run.
-
commandLine
private javax.swing.JTextField commandLine
Command line output field.
-
APP_PREFIX
private java.lang.String APP_PREFIX
Prefix for application package.
-
-
Method Detail
-
setupAppChooser
private void setupAppChooser()
Setup the application chooser.
-
setupParameterTable
private void setupParameterTable()
Setup the parameter table
-
setupLoadSaveButtons
private void setupLoadSaveButtons()
Create the load and save buttons.
-
setupCommandLine
private void setupCommandLine()
Setup command line field
-
setupLoggingArea
private void setupLoggingArea()
Setup logging area
-
updateParameterTable
protected void updateParameterTable()
Serialize the parameter table and run setParameters().
-
doSetParameters
protected void doSetParameters(java.util.List<java.lang.String> params)
Do the actual setParameters invocation.- Parameters:
params- Parameters
-
strip_prefix
private java.lang.String strip_prefix(java.lang.String nam)
Strip the APP_PREFIX prefix.- Parameters:
nam- class name to strip the prefix from- Returns:
- Stripped name
-
format
private java.lang.String format(java.lang.Object... params)
Format objects to a command line.- Parameters:
params- Parameters to format (Strings, or list of strings)- Returns:
- Formatted string
-
formatTo
private void formatTo(java.lang.StringBuilder buf, java.util.List<?> params)Format a list of strings to a buffer.- Parameters:
buf- Output bufferparams- List of strings
-
formatTo
private void formatTo(java.lang.StringBuilder buf, java.lang.String s)Format a single string for the command line.- Parameters:
buf- Output buffers- String
-
loadLatest
protected void loadLatest()
Auto-load the last task from the history file.
-
startTask
protected void startTask()
Do a full run of the KDDTask with the specified parameters.
-
reportErrors
protected void reportErrors(SerializedParameterization config)
Report errors in a single error log record.- Parameters:
config- Parameterization
-
run
public void run()
Description copied from class:AbstractApplicationRuns the application.- Specified by:
runin classAbstractApplication
-
main
public static void main(java.lang.String[] args)
Main method that just spawns the UI.- Parameters:
args- command line parameters
-
-