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

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.MultichannelPlaybackPanel
All Implemented Interfaces:
UnitSelectionListener, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ListSelectionListener

public class MultichannelPlaybackPanel
extends AbstractSelectionPanel
implements ActionListener, ListSelectionListener

Version:
$Id: MultichannelPlaybackPanel.java 3877 2010-11-02 15:43:17Z frank $
Author:
Ewald Peiszer
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
(package private)  Vector[][] aavGPNs
          Stores the assignments for each cell of the layout table.
protected  ActivityGridModel actmod
           
protected  TPlaybackThreadDataRecord[] aPtdata
          Is created and filled when parsing layout table
(package private)  boolean bAssignmentChanged
           
private  boolean bIgnoreNextSelectionChange
          If true, changes of the selection in the SOMPane will be ignored.
(package private)  BorderLayout borderLayout1
           
(package private)  JButton btn_autoassign
           
(package private)  JButton btn_findme
           
(package private)  JToggleButton btn_findme_loop
           
(package private)  JButton btn_gen
           
(package private)  JButton btn_load
           
(package private)  JButton btn_save
           
(package private)  JButton btn_start
           
protected  FindMeLoopThread fmlt
           
(package private)  GridBagLayout gridBagLayout1
           
(package private)  GridBagLayout gridBagLayout2
           
protected  GrowingSOM gsom
           
(package private)  JLabel jLabel3
           
(package private)  JLabel jLabel4
           
(package private)  JLabel jLabel5
           
(package private)  JLabel jLabel6
           
(package private)  JPanel jPanel1
           
(package private)  JScrollPane jScrollPane1
           
(package private)  JScrollPane jScrollPane2
           
(package private)  JScrollPane jScrollPane3
           
(package private)  JTabbedPane jTabbedPane1
           
protected  LinkedHashMap<String,PlaybackThread> lhmThreads
           
(package private)  JList li_lines
           
protected  MapPNode map
           
(package private)  JPanel pnl_layout_table_gen
           
private static long serialVersionUID
           
protected  SOMPane somPane
           
(package private)  LayoutTable tb_layout
           
(package private)  DefaultTableModel tbmod_layout
           
(package private)  JTextPane tp_help
           
(package private)  JTextPane tpHint
           
(package private)  JTextField txt_table_x
           
(package private)  JTextField txt_table_y
           
 
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
MultichannelPlaybackPanel(CommonSOMViewerStateData state, SOMPane somPane)
           
 
Method Summary
 void actionPerformed(ActionEvent parm1)
           
(package private)  boolean confirmNewAssignment()
          Let the user confirm that the current assignment will be lost if he/she continues
(package private)  boolean confirmNewAssignmentAndSpeakerLayout()
          Let the user confirm that the current assignment AND SPEAKER LAYOUT will be lost if he/she continues
protected  String[] createFileArray(String[] asInputs, String sDatadir)
          Adds the data directory (or "fileprefix") to each music file in the given array.
private  void dummyInit()
           
 Dimension getMinimumSize()
           
(package private)  boolean isValidOrConfirmed()
           Parses the data in layout table and constructs the array used to create the PlaybackThreads
private  void jbInit()
           
private  void myInit()
          "handwritten" Swing related init-stuff, in order not to interfere with JBuilder's automatically generated code
 void setToolTipsForLayoutTable()
          Iterates through cells of layout table and constructs an array with strings for those cells, that have been assigned.
 void setVisible(boolean visible)
          We print relevant command line parameters if this panel is shown
 void unitSelectionChanged(Object[] selection, boolean newSelection)
          called whenever the selection in the somPane has changed
 void valueChanged(ListSelectionEvent e)
          Is called if the selection of tb_layout changes.
 
Methods inherited from class at.tuwien.ifs.somtoolbox.apps.viewer.controls.AbstractSelectionPanel
addListScrollPanels, addSingleListScrollPanel, addToList, addToList, clearList, getItemListener, getSelectedSongs, getSelectedSongs, markUnit, setItemListener, unmarkUnits
 
Methods inherited from class at.tuwien.ifs.somtoolbox.apps.viewer.controls.AbstractViewerControl
isFullFunctional, setIcon, setSelected
 
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

borderLayout1

BorderLayout borderLayout1

jTabbedPane1

JTabbedPane jTabbedPane1

jPanel1

JPanel jPanel1

gridBagLayout1

GridBagLayout gridBagLayout1

gridBagLayout2

GridBagLayout gridBagLayout2

li_lines

JList li_lines

jScrollPane1

JScrollPane jScrollPane1

btn_findme_loop

JToggleButton btn_findme_loop

btn_findme

JButton btn_findme

jLabel3

JLabel jLabel3

pnl_layout_table_gen

JPanel pnl_layout_table_gen

txt_table_x

JTextField txt_table_x

jLabel4

JLabel jLabel4

txt_table_y

JTextField txt_table_y

jLabel5

JLabel jLabel5

btn_gen

JButton btn_gen

jScrollPane2

JScrollPane jScrollPane2

btn_autoassign

JButton btn_autoassign

btn_start

JButton btn_start

jLabel6

JLabel jLabel6

jScrollPane3

JScrollPane jScrollPane3

tp_help

JTextPane tp_help

btn_load

JButton btn_load

btn_save

JButton btn_save

tpHint

JTextPane tpHint

tb_layout

LayoutTable tb_layout

tbmod_layout

DefaultTableModel tbmod_layout

aavGPNs

Vector[][] aavGPNs
Stores the assignments for each cell of the layout table.

The vector contains GeneralUnitPNodes


bAssignmentChanged

boolean bAssignmentChanged

somPane

protected SOMPane somPane

map

protected MapPNode map

gsom

protected GrowingSOM gsom

fmlt

protected FindMeLoopThread fmlt

bIgnoreNextSelectionChange

private boolean bIgnoreNextSelectionChange
If true, changes of the selection in the SOMPane will be ignored.

Used if selection is programmatically removed (because anotehr cell in layout table is being selected; then the assigment should not be changed.


aPtdata

protected TPlaybackThreadDataRecord[] aPtdata
Is created and filled when parsing layout table


lhmThreads

protected LinkedHashMap<String,PlaybackThread> lhmThreads

actmod

protected ActivityGridModel actmod
Constructor Detail

MultichannelPlaybackPanel

public MultichannelPlaybackPanel(CommonSOMViewerStateData state,
                                 SOMPane somPane)
Method Detail

dummyInit

private void dummyInit()
                throws Exception
Throws:
Exception

jbInit

private void jbInit()
             throws Exception
Throws:
Exception

myInit

private void myInit()
"handwritten" Swing related init-stuff, in order not to interfere with JBuilder's automatically generated code


confirmNewAssignment

boolean confirmNewAssignment()
Let the user confirm that the current assignment will be lost if he/she continues


confirmNewAssignmentAndSpeakerLayout

boolean confirmNewAssignmentAndSpeakerLayout()
Let the user confirm that the current assignment AND SPEAKER LAYOUT will be lost if he/she continues


createFileArray

protected String[] createFileArray(String[] asInputs,
                                   String sDatadir)
Adds the data directory (or "fileprefix") to each music file in the given array.

Both asInputs and sDatadir may be null.

Returns:
array of string of the same size as the input array or a zero-sized array if asInputs is null

isValidOrConfirmed

boolean isValidOrConfirmed()

Parses the data in layout table and constructs the array used to create the PlaybackThreads

Checks if the data is valid.

If not valid, asks the user for confirmation.

Returns:
true if data is valid OR user has confirmed in case of invalidity

actionPerformed

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

unitSelectionChanged

public void unitSelectionChanged(Object[] selection,
                                 boolean newSelection)
called whenever the selection in the somPane has changed

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

setToolTipsForLayoutTable

public void setToolTipsForLayoutTable()
Iterates through cells of layout table and constructs an array with strings for those cells, that have been assigned.

Unassigned cells' strings remain null

Finally the array is given to the layout table.


getMinimumSize

public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent

valueChanged

public void valueChanged(ListSelectionEvent e)
Is called if the selection of tb_layout changes. Since it is not possible to determine the table from the event's source, tb_layout is hardcoded.

The method marks all units on the mapPane who are assigned to at least one of the selected cells of tb_layout

Specified by:
valueChanged in interface ListSelectionListener
Overrides:
valueChanged in class AbstractSelectionPanel

setVisible

public void setVisible(boolean visible)
We print relevant command line parameters if this panel is shown

Overrides:
setVisible in class AbstractViewerControl
See Also:
Component.setVisible(boolean)