dguitar.gui
Class SongInternalFrame

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JInternalFrame
                  extended bydguitar.gui.SongInternalFrame
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.InternalFrameListener, i18n.Internationalized, java.awt.MenuContainer, OptionsDisplay, Playable, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class SongInternalFrame
extends javax.swing.JInternalFrame
implements javax.swing.event.InternalFrameListener, i18n.Internationalized, OptionsDisplay, Playable

this class represents a JInternalFrame for any new of Open file

Author:
Mauricio Gracia
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JInternalFrame
javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  boolean closeIt
           
private  DisplayOptions displayOptions
           
private  java.lang.String file
           
private  javax.swing.JFileChooser fileChooser
           
private  long finish
           
private  GPSong gpSong
           
private  javax.swing.JSeparator jSeparator1
           
private  javax.swing.JScrollPane JSP
           
private  javax.swing.JMenuBar menuChild
           
private  javax.swing.JMenu menuFile
           
private  javax.swing.JMenuItem menuFileClose
           
private  javax.swing.JMenuItem menuFileExportMidi
           
private  javax.swing.JMenuItem menuFilePrint
           
private  javax.swing.JMenuItem menuFileScoreInformation
           
private  javax.swing.JMenuItem menuFileStats
           
private  javax.swing.JMenuItem menuFileTextView
           
private  javax.swing.JMenu menuView
           
private  javax.swing.JMenuItem menuViewColorOptions
           
private  javax.swing.JCheckBoxMenuItem menuViewMinPiece
           
private  javax.swing.JCheckBoxMenuItem menuViewMultiTrack
           
private  javax.swing.JCheckBoxMenuItem menuViewMusicCursors
           
private  javax.swing.JCheckBoxMenuItem menuViewSingleMusicCursorsColor
           
private  javax.swing.JCheckBoxMenuItem menuViewUnsupportedEffects
           
private  DGuitar parent
           
(package private)  MasterPlayer player
           
private  boolean playing
           
(package private)  PlayToolBar playToolBar
           
private  ScoreInformationDialog SID
           
private  Song song
           
private  SongPanel songPanel
           
private  long start
           
private  common.ScrollText STStats
           
private  common.ScrollText STTextView
           
private  common.SwingWorker workerPlay
           
private  common.SwingWorker workerStats
           
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
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.Container
 
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, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SongInternalFrame()
           
SongInternalFrame(java.lang.String Filename, DGuitar JF, DisplayOptions DO, PlayToolBar aPlayToolBar)
           
 
Method Summary
private  void close()
           
private  void commonConstructor(java.lang.String Filename, javax.swing.JFileChooser aFileChooser)
           
private  void componentsCreate()
           
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 DisplayOptions getDisplayOptions()
           
 boolean hasChanged()
           
private  void initComponents()
          This method is called from within the constructor to initialize the form.
private  void initSongAndPlayer()
           
 void internalFrameActivated(javax.swing.event.InternalFrameEvent evt)
           
 void internalFrameClosed(javax.swing.event.InternalFrameEvent evt)
           
 void internalFrameClosing(javax.swing.event.InternalFrameEvent evt)
           
 void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt)
           
 void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt)
           
 void internalFrameIconified(javax.swing.event.InternalFrameEvent evt)
           
 void internalFrameOpened(javax.swing.event.InternalFrameEvent evt)
           
 boolean isPlaying()
           
private  void menuFileCloseActionPerformed(java.awt.event.ActionEvent evt)
           
private  void menuFileExportMidiActionPerformed(java.awt.event.ActionEvent evt)
           
private  void menuFilePrintActionPerformed(java.awt.event.ActionEvent evt)
           
private  void menuFileScoreInformationActionPerformed(java.awt.event.ActionEvent evt)
           
private  void menuFileStatsActionPerformed(java.awt.event.ActionEvent evt)
           
private  void menuFileTextViewActionPerformed(java.awt.event.ActionEvent evt)
           
 void pause()
           
 void print()
           
 boolean readAndDisplay(GPInputStream GPis)
          This method readsAndDisplay a piece from a GPInputStream GPis
 void setDisplayOptions(DisplayOptions aDisplayOptions)
          This methods apply the aDisplayOptions values to this Song
private  void setEnableComponents(boolean enable)
          This methods disable the components that may interfere with the playing of the song
 void setLangText()
           
 void setPlaying(boolean playing)
           
private  java.lang.String trimExtension()
           
private  void viewColorOptions(java.awt.event.ActionEvent evt)
           
private  void viewDisplayColorDialog()
           
private  void viewMinPiece(java.awt.event.ActionEvent evt)
           
private  void viewMultiTrack(java.awt.event.ActionEvent evt)
           
private  void viewMusicCursors(java.awt.event.ActionEvent evt)
           
private  void viewSingleMusicCursorsColor(java.awt.event.ActionEvent evt)
           
private  void viewUnsupportedEffects(java.awt.event.ActionEvent evt)
           
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, dispose, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, toFront, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

closeIt

private boolean closeIt

file

private java.lang.String file

parent

private DGuitar parent

jSeparator1

private javax.swing.JSeparator jSeparator1

JSP

private javax.swing.JScrollPane JSP

menuChild

private javax.swing.JMenuBar menuChild

menuFile

private javax.swing.JMenu menuFile

menuFileClose

private javax.swing.JMenuItem menuFileClose

menuFileExportMidi

private javax.swing.JMenuItem menuFileExportMidi

menuFilePrint

private javax.swing.JMenuItem menuFilePrint

menuFileScoreInformation

private javax.swing.JMenuItem menuFileScoreInformation

menuFileStats

private javax.swing.JMenuItem menuFileStats

menuFileTextView

private javax.swing.JMenuItem menuFileTextView

menuView

private javax.swing.JMenu menuView

menuViewColorOptions

private javax.swing.JMenuItem menuViewColorOptions

menuViewMinPiece

private javax.swing.JCheckBoxMenuItem menuViewMinPiece

menuViewMultiTrack

private javax.swing.JCheckBoxMenuItem menuViewMultiTrack

menuViewMusicCursors

private javax.swing.JCheckBoxMenuItem menuViewMusicCursors

menuViewSingleMusicCursorsColor

private javax.swing.JCheckBoxMenuItem menuViewSingleMusicCursorsColor

menuViewUnsupportedEffects

private javax.swing.JCheckBoxMenuItem menuViewUnsupportedEffects

fileChooser

private javax.swing.JFileChooser fileChooser

gpSong

private GPSong gpSong

player

MasterPlayer player

playing

private boolean playing

songPanel

private SongPanel songPanel

SID

private ScoreInformationDialog SID

song

private Song song

STStats

private common.ScrollText STStats

STTextView

private common.ScrollText STTextView

workerPlay

private common.SwingWorker workerPlay

displayOptions

private DisplayOptions displayOptions

workerStats

private common.SwingWorker workerStats

start

private long start

finish

private long finish

playToolBar

PlayToolBar playToolBar
Constructor Detail

SongInternalFrame

public SongInternalFrame()

SongInternalFrame

public SongInternalFrame(java.lang.String Filename,
                         DGuitar JF,
                         DisplayOptions DO,
                         PlayToolBar aPlayToolBar)
Method Detail

commonConstructor

private void commonConstructor(java.lang.String Filename,
                               javax.swing.JFileChooser aFileChooser)

setDisplayOptions

public void setDisplayOptions(DisplayOptions aDisplayOptions)
This methods apply the aDisplayOptions values to this Song

Specified by:
setDisplayOptions in interface OptionsDisplay
Parameters:
aDisplayOptions -

getDisplayOptions

public DisplayOptions getDisplayOptions()
Specified by:
getDisplayOptions in interface OptionsDisplay

close

private void close()

componentsCreate

private void componentsCreate()

viewDisplayColorDialog

private void viewDisplayColorDialog()

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), Hashtable

hasChanged

public boolean hasChanged()

initComponents

private void initComponents()
This method is called from within the constructor to initialize the form. WARNING: do NOT modify this code. The content of this method is always regenerated by the Form Editor.


initSongAndPlayer

private void initSongAndPlayer()

internalFrameActivated

public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt)
Specified by:
internalFrameActivated in interface javax.swing.event.InternalFrameListener

internalFrameClosed

public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt)
Specified by:
internalFrameClosed in interface javax.swing.event.InternalFrameListener

internalFrameClosing

public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt)
Specified by:
internalFrameClosing in interface javax.swing.event.InternalFrameListener

internalFrameDeactivated

public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt)
Specified by:
internalFrameDeactivated in interface javax.swing.event.InternalFrameListener

internalFrameDeiconified

public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt)
Specified by:
internalFrameDeiconified in interface javax.swing.event.InternalFrameListener

internalFrameIconified

public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt)
Specified by:
internalFrameIconified in interface javax.swing.event.InternalFrameListener

internalFrameOpened

public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt)
Specified by:
internalFrameOpened in interface javax.swing.event.InternalFrameListener

menuFileCloseActionPerformed

private void menuFileCloseActionPerformed(java.awt.event.ActionEvent evt)

menuFileExportMidiActionPerformed

private void menuFileExportMidiActionPerformed(java.awt.event.ActionEvent evt)

menuFilePrintActionPerformed

private void menuFilePrintActionPerformed(java.awt.event.ActionEvent evt)

menuFileScoreInformationActionPerformed

private void menuFileScoreInformationActionPerformed(java.awt.event.ActionEvent evt)

menuFileStatsActionPerformed

private void menuFileStatsActionPerformed(java.awt.event.ActionEvent evt)

menuFileTextViewActionPerformed

private void menuFileTextViewActionPerformed(java.awt.event.ActionEvent evt)

viewColorOptions

private void viewColorOptions(java.awt.event.ActionEvent evt)

viewMinPiece

private void viewMinPiece(java.awt.event.ActionEvent evt)

viewMultiTrack

private void viewMultiTrack(java.awt.event.ActionEvent evt)

viewMusicCursors

private void viewMusicCursors(java.awt.event.ActionEvent evt)

viewSingleMusicCursorsColor

private void viewSingleMusicCursorsColor(java.awt.event.ActionEvent evt)

viewUnsupportedEffects

private void viewUnsupportedEffects(java.awt.event.ActionEvent evt)

print

public void print()

readAndDisplay

public boolean readAndDisplay(GPInputStream GPis)
This method readsAndDisplay a piece from a GPInputStream GPis

Parameters:
GPis - is a non-null GPinputStream
Returns:
if the process was successfull

setEnableComponents

private void setEnableComponents(boolean enable)
This methods disable the components that may interfere with the playing of the song


setLangText

public void setLangText()
Specified by:
setLangText in interface i18n.Internationalized

trimExtension

private java.lang.String trimExtension()

setPlaying

public void setPlaying(boolean playing)
Specified by:
setPlaying in interface Playable
Parameters:
playing - The playing to set.

isPlaying

public boolean isPlaying()
Specified by:
isPlaying in interface Playable
Returns:
Returns the playing.

pause

public void pause()
Specified by:
pause in interface Playable