public class FileSelector
extends javax.swing.JDialog
Provides a file selector window for choosing files with a certain set of extensions.
javax.swing.JDialog.AccessibleJDialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
private javax.swing.JTabbedPane |
content |
(package private) UiController |
controller |
static java.lang.String |
FILE_TYPE_ABC |
static java.lang.String |
FILE_TYPE_ALDA |
static java.lang.String |
FILE_TYPE_AUDIO |
static java.lang.String |
FILE_TYPE_LY |
static java.lang.String |
FILE_TYPE_MIDI |
static java.lang.String |
FILE_TYPE_MPL |
static java.lang.String |
FILE_TYPE_MSCORE_EXP |
static java.lang.String |
FILE_TYPE_MSCORE_IMP |
static java.lang.String |
FILE_TYPE_SOUND_FILE |
static java.lang.String |
FILE_TYPE_SOUND_URL |
(package private) java.util.ArrayList<MidicaFileChooser> |
fileChoosers |
private byte |
filePurpose |
private java.lang.String |
fileType |
private boolean |
isSound |
static byte |
READ |
private static long |
serialVersionUID |
private java.util.HashMap<java.lang.String,java.lang.String> |
tabs |
static byte |
WRITE |
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
FileSelector(UiView v,
UiController c)
Creates a new file selector window.
|
Modifier and Type | Method and Description |
---|---|
private void |
addKeyBindings()
Adds key bindings to the info window.
|
java.lang.String |
getFileType()
Returns the file type.
|
void |
init(java.lang.String type,
byte filePurpose)
Initializes and shows the file selector window including the
JFileChooser . |
private void |
initUI()
Initializes the user interface.
|
boolean |
mustDirectlyImport()
Returns true if the currently selected file chooser has a checked ‘direct import’ checkbox.
|
void |
rememberDirectory()
Sets the directory of the chosen file in the config.
|
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
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, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private static final long serialVersionUID
public static final java.lang.String FILE_TYPE_MPL
public static final java.lang.String FILE_TYPE_ALDA
public static final java.lang.String FILE_TYPE_AUDIO
public static final java.lang.String FILE_TYPE_ABC
public static final java.lang.String FILE_TYPE_MIDI
public static final java.lang.String FILE_TYPE_LY
public static final java.lang.String FILE_TYPE_MSCORE_IMP
public static final java.lang.String FILE_TYPE_MSCORE_EXP
public static final java.lang.String FILE_TYPE_SOUND_FILE
public static final java.lang.String FILE_TYPE_SOUND_URL
public static final byte READ
public static final byte WRITE
private java.lang.String fileType
private byte filePurpose
private boolean isSound
java.util.ArrayList<MidicaFileChooser> fileChoosers
UiController controller
private java.util.HashMap<java.lang.String,java.lang.String> tabs
private javax.swing.JTabbedPane content
public FileSelector(UiView v, UiController c)
Creates a new file selector window.
v
- Parent view.c
- Listener for file choosing events.public void init(java.lang.String type, byte filePurpose)
Initializes and shows the file selector window including the JFileChooser
. Sets a FileExtensionFilter
for selecting the files by type.
If this file selector contains tabs, than the type parameter is used for the file selector in the first tab. It’s changed later, if the tab is switched.
type
- File type by which the files are filtered.filePurpose
- Purpose for which the file is going to be opened. Possible values are READ or WRITE.public boolean mustDirectlyImport()
Returns true if the currently selected file chooser has a checked ‘direct import’ checkbox. Returns false if no such checkbox is available in the file chooser, of if the checkbox is not checked.
private void initUI()
Initializes the user interface.
public java.lang.String getFileType()
Returns the file type.
public void rememberDirectory()
Sets the directory of the chosen file in the config.
Remembers the directory of that file so that next time the selector defaults to the same directory if the same file type for the same purpose is going to be opened.
private void addKeyBindings()
Adds key bindings to the info window.