|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
bodhidharma.ConfigureFileLocationsJFrame
public class ConfigureFileLocationsJFrame
Part of the Bodhidharma automatic music classification project. This is the first dialog box that users of the software are presented with.
This dialog box allows one to choose the paths of the current project, the file containing the musical taxonomy used to train classifiers, the list of recordings to train and/or classify, the features of these recordings, the trained classifying systm, the prefences file and the current directory.
These paths may be chosen by typing them in (except for
the project field) or by pressing onBrwose buttons, which
will bring up a reusable JFileChoose
dialog box.
The Load Project button may be pressed in order to load a project name and its associated file paths into this dialog box.
The Clear Paths button clears all text fields.
The Restore Original Defaults button loads the hardcoded defaults into this dialog box.
The Save As Startup Defaults button saves the contents of the dialog box as the defaults that will fill the dialog box when it is instantiated.
The Start New Project button brings up a dialog box that allows the user to choose the name of a new project and where to save it. The project XML file is then created at the given location with the given name. A new directory with the same name (minus the .xml) is created. The current directory is updated to this directory. The user is asked if s/he would like to copy the files referred to by the existing entries to the new directory. The text fields and fields are all updated.
The Cancel button hides this dialog box. Any changes that were made are lost, except for the creation of new project files.
The OK button hides this window and instantiates the main window. If the main window has already been created, it is replaced.
The path fields of this dialog box hold the paths of these pieces of information after they have been chosen, and may be referenced by other objects.
The setTaxonomyPath
, setFeaturesPath
and
setRecordingsPath
methods can be called to reset the
appropriate fields and text fields.
The browse methods of this class can also be called by other
objects to bring up the JFileChoose
dialog box to change
these file paths individually. The newly updated path field(s) can
then be accessed by other objects.
Objects of this class also hold a JFileChoose
dialog box that can be called by other classes in the project.
Objects of this class also holdo a reference to the most recently
spawned main window.
The loadProject
method may also be called by other objects
in order to load an entirely new project_file XML without going through
this dialog box manually.
The saveFileExternally
method may also be called by
other objects in order to save a file, potentially with a
JFileChooser
dialog box, and, if appropriate, update
the path fields of this dialog box.
The getFile
method may also be called by other
objects in order to get a File from a given path.
The saveProjectFile
method may also be called by other
objects in order to save the current project paths in the current
project_file.
The startNewProject
method may also be called by other
methods to bring up a dialog box allowing the creation of a new project.
The defaults that are loaded when an object of this class is instantiated are set by the default_file_locations.xml file found in the same directory as this class. The only field of this file that is considered is the project file that it refers to, which is then loaded. This default_file_locations file will be automatically recreated if it is absent.
Bodhidharma
,
MainJFrame
,
FileFilterXML
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
java.lang.String |
classifiers_path
Path of the file holding the current classification system. |
java.lang.String |
current_directory
Path of the current directory |
java.lang.String |
features_path
Path of the current list of feature settings. |
MainJFrame |
main_window
The main window of the Bodhidharma GUI |
java.lang.String |
preferences_path
Path of the preferences file. |
java.lang.String |
project_path
Path of the current project. |
java.lang.String |
recordings_list_path
Path of the current list of recordings intended for training and/or testing. |
java.lang.String |
taxonomy_path
Path of the current musical taxonomy file. |
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ConfigureFileLocationsJFrame()
Basic constructor. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Calls the appropriate methods when the buttons are pressed. |
boolean |
browseClassifiersPath(boolean called_externally)
Opens a JFileChooser dialog box that only displays
directories and .xml files. |
boolean |
browseCurrentDirectoryPath(boolean called_externally)
Opens a JFileChooser dialog box that only displays
directories. |
boolean |
browseFeaturesPath(boolean called_externally)
Opens a JFileChooser dialog box that only displays
directories and .xml files. |
boolean |
browsePreferencesPath(boolean called_externally)
Opens a JFileChooser dialog box that only displays
directories and .xml files. |
boolean |
browseRecordingsPath(boolean called_externally)
Opens a JFileChooser dialog box that only displays
directories and .xml files. |
boolean |
browseTaxonomyPath(boolean called_externally)
Opens a JFileChooser dialog box that only displays
directories and .xml files. |
void |
commenceClassifiying(java.lang.String output_classifications_path)
Commences classifying the recordings specified in this ConfigureFileLocationsJFrame using the classifiers specified in the ConfigureFileLocationsJFrame and the preferences and taxonomy specified in this ConfigureFileLocationsJFrame. |
void |
commenceFeatureExtraction()
Perform feature extraction and saves the results. |
void |
commenceTraining(java.lang.String train_save_path)
Commences training on the recordings specified in this ConfigureFileLocationsJFrame. |
java.io.File |
getFile(java.lang.String path,
boolean can_erase)
Gets a File object based on the given path. |
void |
loadProject(java.lang.String project_path,
boolean called_externally)
Takes in the path of an XML project file (of type file_locations). |
java.io.File |
saveFileExternally(boolean can_erase,
java.lang.String file_type)
Opens a JFileChooser dialog box that allows the user to choose
the path of the file to be saved. |
void |
saveProjectFile(java.lang.String path,
java.lang.String comments,
boolean can_erase)
Saves a project_file XML file in the specified location with the specified comments. |
void |
setClassifiersPath(java.lang.String new_path)
Sets the classifiers_path classifiers_text_field fields to the value of the parameter. |
void |
setCurrentDirectory(java.lang.String new_path)
Sets the current_directory current_directory_text_field fields to the value of the parameter. |
void |
setFeaturesPath(java.lang.String new_path)
Sets the features_path features_text_field fields to the value of the parameter. |
void |
setPreferencesPath(java.lang.String new_path)
Sets the preferences_path preferences_text_field fields to the value of the parameter. |
void |
setProjectPath(java.lang.String new_path)
Sets the project_path project_text_field fields to the value of the parameter. |
void |
setRecordingsPath(java.lang.String new_path)
Sets the recordings_list_path recordings_text_field fields to the value of the parameter. |
void |
setTaxonomyPath(java.lang.String new_path)
Sets the taxonomy_path taxonomy_text_field fields to the value of the parameter. |
void |
startNewProject()
Brings up a dialog box that allows the user to choose the name of a new project and where to save it. |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
public java.lang.String project_path
public java.lang.String taxonomy_path
public java.lang.String features_path
public java.lang.String recordings_list_path
public java.lang.String classifiers_path
public java.lang.String preferences_path
public java.lang.String current_directory
public MainJFrame main_window
Constructor Detail |
---|
public ConfigureFileLocationsJFrame()
Method Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
event
- The event that is to be reacted to.public void loadProject(java.lang.String project_path, boolean called_externally)
If the argument does not point to a valid project file of if
null is passed as the argument, then choose the file using
a JFileChooser
dialog box.
project_path
- Path of a valid file_locations XML file.called_externally
- True if called by an external object, false if called internally.public void setProjectPath(java.lang.String new_path)
new_path
- The new path.public void setTaxonomyPath(java.lang.String new_path)
new_path
- The new path.public void setFeaturesPath(java.lang.String new_path)
new_path
- The new path.public void setRecordingsPath(java.lang.String new_path)
new_path
- The new path.public void setClassifiersPath(java.lang.String new_path)
new_path
- The new path.public void setPreferencesPath(java.lang.String new_path)
new_path
- The new path.public void setCurrentDirectory(java.lang.String new_path)
new_path
- The new path.public boolean browseTaxonomyPath(boolean called_externally)
JFileChooser
dialog box that only displays
directories and .xml files. Allows user to choose the path for
the XML file holding the musical taxonomy.
called_externally
- True if called by an external object, false if called internally.
FileFilterXML
public boolean browseRecordingsPath(boolean called_externally)
JFileChooser
dialog box that only displays
directories and .xml files. Allows user to choose the path for
the XML file holding the recordings list.
called_externally
- True if called by an external object, false if called internally.
FileFilterXML
public boolean browseFeaturesPath(boolean called_externally)
JFileChooser
dialog box that only displays
directories and .xml files. Allows user to choose the path for
the XML file holding the features for the given recording.
called_externally
- True if called by an external object, false if called internally.
FileFilterXML
public boolean browseClassifiersPath(boolean called_externally)
JFileChooser
dialog box that only displays
directories and .xml files. Allows user to choose the path for
the XML file holding the classification system.
called_externally
- True if called by an external object, false if called internally.
FileFilterXML
public boolean browsePreferencesPath(boolean called_externally)
JFileChooser
dialog box that only displays
directories and .xml files. Allows user to choose the path for
the XML file holding the preferences.
called_externally
- True if called by an external object, false if called internally.
FileFilterXML
public boolean browseCurrentDirectoryPath(boolean called_externally)
JFileChooser
dialog box that only displays
directories. Allows user to choose the path for the current default
directory. Sets the current directory to that value.
called_externally
- True if called by an external object, false if called internally.
public java.io.File saveFileExternally(boolean can_erase, java.lang.String file_type)
JFileChooser
dialog box that allows the user to choose
the path of the file to be saved. Makes sure can write to this path and
returns the corresponding File. Displays an error dialog box if there is a
problem. Returns null if can or should not save.
The file_type parameter specifies the type of file to be saved. The appropriate fields and and text fields are updated if the file type is recognized.
Automatically adds .xml as an extension if this is not already present.
can_erase
- Whether or not existing files with the specified path should be overwritten without asking the user.file_type
- The code identifying the type of XML file.
public void saveProjectFile(java.lang.String path, java.lang.String comments, boolean can_erase)
path
- The path under which the file is to be saved.contents
- The contents of the file to save.can_erase
- True means user is not warned if user is overwrting a file, false means is warned.public void startNewProject()
public java.io.File getFile(java.lang.String path, boolean can_erase)
path
- The path under which the file is to be saved.can_erase
- Whether or not the file should be automatically overwritten if it already exists.public void commenceFeatureExtraction()
public void commenceTraining(java.lang.String train_save_path)
train_save_path
- The path to save the trained classifiers.
If null, then saves them to the path
specified in this ConfigureFileLocationsJFrame.public void commenceClassifiying(java.lang.String output_classifications_path)
output_classifications_path
- The path to save the output
classifications.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |