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 class
MiniGUI.SettingsComboboxModel
Class 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.String
ACTION_QUIT
Quit action, for mnemonics.private java.lang.String
APP_PREFIX
Prefix for application package.protected javax.swing.JComboBox<java.lang.String>
appCombo
Combo box for choosing the application to run.private javax.swing.JTextField
commandLine
Command line output field.(package private) javax.swing.JFrame
frame
The frameprivate static Logging
LOG
ELKI logger for the GUI.private java.lang.Class<? extends AbstractApplication>
maincls
Application to configure / run.private static java.lang.String
NEWLINE
Newline used in output.protected LogPanel
outputArea
Logging output area.(package private) javax.swing.JPanel
panel
The main panel.protected DynamicParameters
parameters
Parameter storage.protected ParameterTable
parameterTable
The parameter table.protected javax.swing.JButton
runButton
The "run" button.static java.lang.String
SAVED_SETTINGS_FILENAME
Filename for saved settings.protected javax.swing.JComboBox<java.lang.String>
savedCombo
Combo box for saved settings.protected MiniGUI.SettingsComboboxModel
savedSettingsModel
Model to link the combobox with.protected SavedSettingsFile
store
Settings 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 void
doSetParameters(java.util.List<java.lang.String> params)
Do the actual setParameters invocation.private java.lang.String
format(java.lang.Object... params)
Format objects to a command line.private void
formatTo(java.lang.StringBuilder buf, java.lang.String s)
Format a single string for the command line.private void
formatTo(java.lang.StringBuilder buf, java.util.List<?> params)
Format a list of strings to a buffer.protected void
loadLatest()
Auto-load the last task from the history file.static void
main(java.lang.String[] args)
Main method that just spawns the UI.protected void
reportErrors(SerializedParameterization config)
Report errors in a single error log record.void
run()
Runs the application.private void
setupAppChooser()
Setup the application chooser.private void
setupCommandLine()
Setup command line fieldprivate void
setupLoadSaveButtons()
Create the load and save buttons.private void
setupLoggingArea()
Setup logging areaprivate void
setupParameterTable()
Setup the parameter tableprotected void
startTask()
Do a full run of the KDDTask with the specified parameters.private java.lang.String
strip_prefix(java.lang.String nam)
Strip the APP_PREFIX prefix.protected void
updateParameterTable()
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:AbstractApplication
Runs the application.- Specified by:
run
in classAbstractApplication
-
main
public static void main(java.lang.String[] args)
Main method that just spawns the UI.- Parameters:
args
- command line parameters
-
-