at.tuwien.ifs.somtoolbox.apps.viewer.controls
Class PlaySOMPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by at.tuwien.ifs.commons.gui.controls.TitledCollapsiblePanel
                      extended by at.tuwien.ifs.somtoolbox.apps.viewer.controls.AbstractViewerControl
                          extended by at.tuwien.ifs.somtoolbox.apps.viewer.controls.AbstractSelectionPanel
                              extended by at.tuwien.ifs.somtoolbox.apps.viewer.controls.PlaySOMPanel
All Implemented Interfaces:
UnitSelectionListener, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ListSelectionListener

public class PlaySOMPanel
extends AbstractSelectionPanel
implements ActionListener

This class represents the panel for the PlaySOM,
it provides controls for exporting and editing of selected playlists.

Version:
$Id: PlaySOMPanel.java 3873 2010-10-28 09:29:58Z frank $
Author:
Michael Dittenbach
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class at.tuwien.ifs.commons.gui.controls.TitledCollapsiblePanel
TitledCollapsiblePanel.Orientation
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  JButton btClearHist
           
private  JButton btDelSelected
           
private  JButton btEvalSOM
           
private  JButton btExportPlaylist
           
private  JButton btPlayAll
           
private  JButton btPlaySelected
           
private  JButton btRhythmPatternVis
           
private  JButton buttonSummarise
           
private  JCheckBox chkCountHist
           
private  String CLEAR_COUNT_HIST
           
private  String DELETE_SELECTED
           
private  String EVAL_SOM
           
private  AbstractViewerControl evalPanel
           
private  String EXPORT_PLAYLIST
           
private  JLabel lblSearch
           
private  JFrame parent
           
 String PLAY_ALL
           
private  String PLAY_SELECTED
           
private  JRadioButton rbFlat
           
private  JRadioButton rbSmoothed
           
private  String SEARCH
           
private static long serialVersionUID
           
private  String SHOW_COUNT_HIST
           
private  String SHOW_RHYTHM_PATTERN
           
private  String SUMMARISE
           
private  JTextField txSearchField
           
 
Fields inherited from class at.tuwien.ifs.somtoolbox.apps.viewer.controls.AbstractSelectionPanel
absPathVectors, currentSelectionArea, itemListener, listScrollers, markedUnits, playlistmodels, playlists, selections, unitsInPlaylist
 
Fields inherited from class at.tuwien.ifs.somtoolbox.apps.viewer.controls.AbstractViewerControl
SMALL_INSETS, smallerFont, smallFont, state
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PlaySOMPanel(CommonSOMViewerStateData state)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
private  boolean compareOrderIndex(String string, int ind_greater, int ind_smaller)
          compare "ordering index" of a filename if it is smaller or greater than (a) certain value(s) ordering index is assumed to be a number between two points before the filename extension e.g.
private  void enableButtons(boolean bool)
           
 Dimension getMinimumSize()
           
private  Point getPosOfNextInt(String string, int startpos)
          parses a String for next integer, skipping spaces
protected  void initGUIElements()
          creates the GUI elements of the Panel (a few JButtons and the JList)
private  void searchFilenames(String query, boolean createHistogram)
          traverses all units of the map and searches for the query string as substring of the document filenames updates the playlist with the filenames found and marks the according units on the map
 void showRhythmPattern(double[] vector, String dispname)
          show RhythmPattern(s) of weight vector(s) of currently selected unit(s)
 void showRhythmPattern(String[] vecNames)
          show RhythmPattern(s) of selected vector(s)
 void unitSelectionChanged(Object[] selection, boolean newSelection)
          called whenever the selection has changed, the new selection is added to the JList and to the list of the file's absolute pathnames
 
Methods inherited from class at.tuwien.ifs.somtoolbox.apps.viewer.controls.AbstractSelectionPanel
addListScrollPanels, addSingleListScrollPanel, addToList, addToList, clearList, getItemListener, getSelectedSongs, getSelectedSongs, markUnit, setItemListener, unmarkUnits, valueChanged
 
Methods inherited from class at.tuwien.ifs.somtoolbox.apps.viewer.controls.AbstractViewerControl
isFullFunctional, setIcon, setSelected, setVisible
 
Methods inherited from class at.tuwien.ifs.commons.gui.controls.TitledCollapsiblePanel
add, add, add, add, add, getContentBackground, getContentBorder, getContentPane, getDecoratorPadding, getHorizontalTitleAlignment, getHorizontalTitleTextPosition, getIcon, getIconTitleGap, getLayout, getOrientation, getPreferredSize, getShowTitleDecoration, getTitle, getTitleBackground, getTitleBorder, isAnimated, isCollapsed, pack, remove, remove, removeAll, setAnimated, setCollapsed, setContentBackground, setContentBorder, setContentPane, setDecoratorPadding, setHorizontalTitleAlignment, setHorizontalTitleTextPosition, setIcon, setIconTitleGap, setLayout, setOrientation, setShowTitleDecoration, setTitle, setTitleBackground, setTitleBorder
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

btPlaySelected

private JButton btPlaySelected

btPlayAll

private JButton btPlayAll

btDelSelected

private JButton btDelSelected

btExportPlaylist

private JButton btExportPlaylist

btRhythmPatternVis

private JButton btRhythmPatternVis

btEvalSOM

private JButton btEvalSOM

buttonSummarise

private JButton buttonSummarise

rbFlat

private JRadioButton rbFlat

rbSmoothed

private JRadioButton rbSmoothed

btClearHist

private JButton btClearHist

txSearchField

private JTextField txSearchField

lblSearch

private JLabel lblSearch

chkCountHist

private JCheckBox chkCountHist

PLAY_SELECTED

private final String PLAY_SELECTED
See Also:
Constant Field Values

PLAY_ALL

public final String PLAY_ALL
See Also:
Constant Field Values

DELETE_SELECTED

private final String DELETE_SELECTED
See Also:
Constant Field Values

EXPORT_PLAYLIST

private final String EXPORT_PLAYLIST
See Also:
Constant Field Values

SEARCH

private final String SEARCH
See Also:
Constant Field Values

SHOW_RHYTHM_PATTERN

private final String SHOW_RHYTHM_PATTERN
See Also:
Constant Field Values

SHOW_COUNT_HIST

private final String SHOW_COUNT_HIST
See Also:
Constant Field Values

CLEAR_COUNT_HIST

private final String CLEAR_COUNT_HIST
See Also:
Constant Field Values

SUMMARISE

private final String SUMMARISE
See Also:
Constant Field Values

EVAL_SOM

private final String EVAL_SOM
See Also:
Constant Field Values

parent

private JFrame parent

evalPanel

private AbstractViewerControl evalPanel
Constructor Detail

PlaySOMPanel

public PlaySOMPanel(CommonSOMViewerStateData state)
Method Detail

initGUIElements

protected void initGUIElements()
creates the GUI elements of the Panel (a few JButtons and the JList)


actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

unitSelectionChanged

public void unitSelectionChanged(Object[] selection,
                                 boolean newSelection)
called whenever the selection has changed, the new selection is added to the JList and to the list of the file's absolute pathnames

Specified by:
unitSelectionChanged in interface UnitSelectionListener
Overrides:
unitSelectionChanged in class AbstractSelectionPanel

enableButtons

private void enableButtons(boolean bool)

getPosOfNextInt

private Point getPosOfNextInt(String string,
                              int startpos)
parses a String for next integer, skipping spaces

Parameters:
string - to parse
startpos - starting position within string for search
Returns:
Point: x contains start position of integer, y end position (null if parsing fails)

compareOrderIndex

private boolean compareOrderIndex(String string,
                                  int ind_greater,
                                  int ind_smaller)
compare "ordering index" of a filename if it is smaller or greater than (a) certain value(s) ordering index is assumed to be a number between two points before the filename extension e.g. mypieceofmusic.0345.mp3 -> ordering index is 345

Parameters:
string - filename string containing an ordering index (e.g. mypieceofmusic.0345.mp3)
ind_greater - integer, ordering index must be greater in comparison (if set to -1, ind_greater will be ignored)
ind_smaller - integer, ordering index must be smaller in comparison (if set to -1, ind_smaller will be ignored)
Returns:
true if comparison result is true, false if comparison result is false or ordering index could not be parsed

searchFilenames

private void searchFilenames(String query,
                             boolean createHistogram)
traverses all units of the map and searches for the query string as substring of the document filenames updates the playlist with the filenames found and marks the according units on the map

Parameters:
query - the string for querying the filenames
createHistogram - if set to true, the results is shown in an Islands of Music / SDH like manner if set to false, the units containing the items found are marked with a single color

showRhythmPattern

public void showRhythmPattern(double[] vector,
                              String dispname)
show RhythmPattern(s) of weight vector(s) of currently selected unit(s)


showRhythmPattern

public void showRhythmPattern(String[] vecNames)
show RhythmPattern(s) of selected vector(s)


getMinimumSize

public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent