dguitar.gui
Class DGuitar

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended bydguitar.gui.DGuitar
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, i18n.Internationalized, java.awt.MenuContainer, OptionsDisplay, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class DGuitar
extends javax.swing.JFrame
implements i18n.Internationalized, OptionsDisplay

This is the DGuitar main class which represents the main window

Author:
Mauricio Gracia Gutiérrez
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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 static About about
          The About component that is shown.
private static java.lang.String authors
           
protected static java.awt.Image[] Buttons
           
private  boolean captureErrors
          Set to true if you want Capture the Sytem.err to the LogStream
protected static javax.swing.ImageIcon[] Clefs
          The Clefs represented as ImagesIcon[]
private static boolean closableLogWindow
           
private  boolean confirmLoad
          Set to true if you want a confirmation dialog after file is loaded
private  int currentFileType
          Indicates the current File Type
private  java.lang.String currentSkin
          The current skin being used.
static DGDesktopPane desktopPane
           
private static java.util.Properties DGO
          A Properties object that stores current values of options
private static java.lang.String DGproperties
          Name of the file were the preferences of DGuitar are stored
private  java.lang.String DGpropertiesAbsolute
          The Absolute or Full path were the properties of DGuitar are being stored
protected static java.awt.Image[] DisabledButtons
           
private  DisplayOptions displayOptions
          The current DisplayOptions for all the songs
protected static javax.swing.ImageIcon[] Dynamics
          The icons that hold the 8 Dynamics simbols, paino, fortissimo,etc..
private static boolean EnableUnfinishedFeatures
           
protected static javax.swing.ImageIcon[] EONs
          The EffectsOnNote images
 boolean evaluate
          set to true evaluate performance in time of certains parts of the program and log it
private static boolean fastLoad
           
protected  DGFileChooser fileChooser
          This variable stores a preloaded JFileChooser
private  java.io.File filePath
          The location of the GTP files
private  java.util.Vector files
          a Vector that contains a list of files show in the WINDOW MENU
static GPFileFilter gpFileFilter
           
private static boolean hasOptionsChanged
          If this variable is set to true..and user exits program..ask if he wants to save them
private  boolean hasPathChanged
          Indicates if the location of the files has changed in order to recalculate statistics
static boolean isRelease
          Is this version a "release" (true) or a "developer"
static java.lang.String javaSpecVersion
          A class variable that holds the information on the detected java version
static java.lang.String javaVendorExpected
          A class variable that stores the expected java vendor
static java.lang.String javaVersionExpected
          A class variable that stores the expected java version
static java.lang.String javaVMvendor
          A class variable that holds the information on the detected java vendor
private  javax.swing.JSeparator jSeparator1
           
private  javax.swing.JSeparator jSeparator2
           
static java.util.PropertyResourceBundle lang
          The resource bundle that allows INTERNATIONALIZATION (also called I18N)
private static java.lang.String langPath
           
private  java.lang.String lauchPath
          This variable stores the current launch path
private static java.util.Locale locale
          The locale (INTERNATIONIZATION) that java detected
protected static javax.swing.ImageIcon Logo
           
private static boolean LogWindowExits
           
protected static common.LogStream LS
           
private  javax.swing.JMenuBar menu
           
private  javax.swing.JMenu menuAbout
           
private  javax.swing.JMenuItem menuAboutAuthors
           
private  javax.swing.JMenuItem menuAboutLicense
           
private  javax.swing.JMenu menuMidi
           
private  javax.swing.JMenuItem menuMidiDevices
           
private  javax.swing.JMenuItem menuMidiTest
           
private  javax.swing.JMenu menuOptions
           
private  javax.swing.JCheckBoxMenuItem menuOptionsConfirmLoad
           
private  javax.swing.JCheckBoxMenuItem menuOptionsEnableUnfinishedFeatures
           
private  javax.swing.JCheckBoxMenuItem menuOptionsEvaluate
           
private  javax.swing.JCheckBoxMenuItem menuOptionsFastLoad
           
private  javax.swing.JMenuItem menuOptionsFileLocation
           
private static SongOptionsMenu menuOptionsForAllSongs
           
private  javax.swing.JMenu menuOptionsLanguage
           
private  javax.swing.JMenuItem menuOptionsLog
           
private  javax.swing.JCheckBoxMenuItem menuOptionsLogToFile
           
private  javax.swing.JCheckBoxMenuItem menuOptionsLogToWindow
           
private  javax.swing.JMenuItem menuOptionsReloadStoredSettings
           
private  javax.swing.JMenuItem menuOptionsSaveCurrentSettings
           
private  javax.swing.JMenu menuProgram
           
private  javax.swing.JMenuItem menuProgramExit
           
private  javax.swing.JMenuItem menuProgramNew
           
private  javax.swing.JMenuItem menuProgramOpenGP
           
private  javax.swing.JMenuItem menuProgramOpenMidi
           
private  javax.swing.JMenuItem menuProgramOpenURL
           
private  javax.swing.JMenuItem menuProgramStats
           
private  javax.swing.JMenu menuWindows
           
private  javax.swing.JMenuItem menuWindowsCascade
           
private  javax.swing.JMenuItem menuWindowsCloseAll
           
private  int menuWindowsOperationsCount
           
private static common.Midi midi
           
static MIDFileFilter midiFileFilter
           
private static int MIN_HEIGHT
          The minimum required Height to run DGuitar
private static int MIN_WIDTH
          The mininum required Width to run DGuitar
protected static java.lang.String msg
          A variable that holds the current message that should be showed.
protected static java.awt.Image[] Notes
          there are 8 note durations (including 128th duration !!)
static java.lang.String operationalSystem
           
private  PlayToolBar playToolBar
          A toolbar that contains a PLAY button, an other controls and information
private static java.awt.Dimension screenSize
           
protected static javax.swing.ImageIcon[] Silences
          The Silence represented as ImagesIcon[]
private  common.ScrollText STstats
           
 java.util.Vector supportedExtensions
          A list of the supportedExtension according to the available CoDecs
private static java.io.PrintStream sysErr
           
static java.awt.Toolkit toolkit
          a static, or class variable, that stores the current ToolKit
 java.lang.String userHome
          A variable that points to the user.home System property
static java.lang.String version
          The version of the DGuitar program
private  common.SwingWorker worker
           
 
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.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, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DGuitar()
          Constructs a DGuitar main window using LS as the LosStream
 
Method Summary
private static void aboutAuthors()
          this method displays information about the autors, this is used also by the DGuitarApplet
private  void aboutLicense()
          this lets any body knows that this program is released unde GNU/GPL
private  void addDropSupport()
          This method add suppor for the DROP part of "Drag and Drop"
 void addMidiAbout(javax.swing.JMenuBar MB)
          this method is use to add the Midi and About Menus to the given MenuBar
private  void addToolBars()
           
private  boolean booleanProperty(java.lang.String key, java.lang.String defaultValue)
          Tries to load the boolean key from the properties file
private  void checkFileLocation()
          When the location specify by the file is incorrect this method is used
 void close()
           
 void closeAllWindows()
           
private  void configureMenuOptionsLanguage()
           
(package private) static void correctJavaVersion()
           
protected  void createFileChooser()
          Checks if the fileChooser exists, creates it if necesary and resets its values
static void detectOperationalSystem()
          This method detects the operational system and stores it on DGuitar.operationalSystem
 void detectSupportedExtensions()
          This methods detects the supported extensions of DGuitar and fills the java.util.List supportedExtensions array.
private  void determineLaunchPath()
           
(package private)  void displayGP(java.lang.String aFileName, byte[] bytes)
          this method display a GP file
(package private)  void displayMID(java.lang.String aFileName)
          this method display a MID file
 void displayMultipleFiles(java.util.List listOfFiles)
          This method iterates over the listOfFiles and opens them.
private  void errorSkin()
          Display and error message about loading a skins
private  void fileLoad(java.lang.String file)
          this methods loads a FILE, using a ProgressBar as necesary
private  void formWindowClosing(java.awt.event.WindowEvent evt)
          this methods cloases any open Internal frame, and then exits
 CodecFileFilter getCodecFileFilter()
          Obtains a CodecFileFilter object for the current fileType
 DisplayOptions getDisplayOptions()
           
private  java.lang.String getFilePath()
           
static java.util.PropertyResourceBundle getLang()
           
 java.lang.String[] getLangAvailable()
          This method gets the AvailableLanguages from the LANG folder
 java.lang.String getLangPath()
           
 java.lang.String getLaunchPath()
           
(package private) static boolean higherJavaVersion()
           
 void init(common.LogStream LogS, boolean captureErrs)
           
private  void initComponents()
          This method is called from within the constructor to initialize the form.
private  void internalFrameAdd(javax.swing.JInternalFrame JIF)
          this methos is used to add a internalFrame
protected static void internalFrameLocate(javax.swing.JInternalFrame JIF)
          this method locates a new internalFrame, the desktopPane.add(JIF) has alreacdy been called
protected static void internalFrameOptSize(javax.swing.JInternalFrame JIF)
          Sets the optimum size for a internalFrame ;
 boolean isSupportedExtension(java.lang.String aFileName)
          Returns true if the Filename is on of the supported extensions
 void load()
           
 void loadAndDisplay(java.io.File file, boolean checkExtension)
          This method loads and displays a File according to its extension
private  void loadCurrentSkin()
          this methods loads the Current Sking or the defualt if current skin fails
private  java.awt.Image loadImage(java.lang.String path)
          Loads a Image from the given path, returns null if unsuccessfull
private  boolean loadImages(java.lang.String basePath, java.lang.String baseName, int from, int to, java.awt.Image[] img)
          this method loadImages into a Image array
private  boolean loadImages(java.lang.String basePath, java.lang.String baseName, int from, int to, javax.swing.ImageIcon[] ii)
          this method loadImages into a ImageIcon array
private  java.util.PropertyResourceBundle loadLanguage(java.lang.String path, java.lang.String language)
           
private  java.util.PropertyResourceBundle loadPropertyResourceBundle(java.lang.String path)
          load a ResourceBungle for the I18N
 boolean loadSkin(java.lang.String nameOfSkin)
          this methos loads the skin nameOfSkin
static void main(java.lang.String[] args)
           
private  void menuCreate()
           
private  void menuExitActionPerformed(java.awt.event.ActionEvent evt)
          The action that is performed when the main program exits
private  void menuMidiDevicesActionPerformed()
          this method creates and displays a MidiDevices form
private  void menuMidiTestActionPerformed()
          this method creates and displays a MidiTest form
private  void menuOpenGPActionPerformed(java.awt.event.ActionEvent evt)
           
private  void menuOpenMidiActionPerformed(java.awt.event.ActionEvent evt)
          When a MID is about to be open, isGuitarPro is set to false
private  void menuOpenURLActionPerformed(java.awt.event.ActionEvent evt)
          Opens a URL (http) direclty
private  void menuOptionsConfirmLoadActionPerformed(java.awt.event.ActionEvent evt)
          Does the user want to confirm file loads ?
private  void menuOptionsEvaluateActionPerformed(java.awt.event.ActionEvent evt)
          do you want to evaluate the performance of the program ?
private  void menuOptionsFastLoadActionPerformed(java.awt.event.ActionEvent evt)
           
private  void menuOptionsFileLocationActionPerformed(java.awt.event.ActionEvent evt)
          this methods allow the user to set the location of the files
private  void menuOptionsValuesUpdate()
          This method must be called when the values are changed direclty without user intervention
private  void menuStatsActionPerformed(java.awt.event.ActionEvent evt)
          When the statistics options is selected, display them
private  void OpenedListAdd(java.lang.String file)
          Add a String to the Window Menu, and set the ActionListener
(package private)  boolean OpenedListContains(java.lang.String file)
          returns true if the FILE is on the list
 void OpenedListRemove(java.lang.String file)
          Remove a string from the Windows menu
private  void preferencesApply()
          this method apply the preferences loaded from the file or the default
private  boolean preferencesLoad()
          This method tries to load the preferences file
private  boolean preferencesStore()
          This method tries to save the preferences to a file
private  void preferencesUse()
          reads the Keys from the Properties file and set the related variables or the default ones
private  void readAndShow(java.lang.String aFileName, java.io.InputStream IS)
          It reads from the InputStream, and display the PIECE or and error readAndShow used the variable fileName for the title of the window
private  void refreshDisplayOptions()
           
private  void refreshLangText()
           
static boolean requirementsOK()
          this method checks for requirements: screen resolution is checked Java vendor and version
 void setDisplayOptions(DisplayOptions displayOptions)
           
private static void setEnableUnfinishedFeatures(boolean enable)
          This method performs the actual enabling or disabling of features
static void setLang(java.util.PropertyResourceBundle lang)
           
 void setLangText()
          Set the language messages for the menus
private  void setLogCheckBoxes()
          Set the log CheckBoxes according to the DGuitar.typeOfLog
private  short shortProperty(java.lang.String key, short defaultValue)
           
 java.lang.String shortTitle()
           
static java.lang.Object showCustomInputDialog(java.awt.Component parent, java.lang.String title, java.lang.Object message, boolean input, java.lang.String init)
           
protected  void showDialogOk(java.lang.String title, java.lang.Object message)
          this method allows to show a message on a information dialog the Object can be a String or a Component see JOptionPane
private  void showFileChooserAndOpen()
          Show file chooser, respond to the actions, and load a file as necesary
(package private)  void showMessageAlreadyOpen(java.lang.String aFileName)
          this message is showed when a file is already open
private  void showTextFile(java.lang.String title, java.lang.String file, boolean scroll, int w, int h)
          this method shows a file on a ScrollText or ScrollTextPane according to the value of scroll
private  void switchLog()
           
static java.lang.String version()
          Returns a string like "DGuitar A.B.C" or "DGuitar (under testing) A.B.C"
 
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, 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, setIconImage, 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, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, 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, isOpaque, 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, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, 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

captureErrors

private boolean captureErrors
Set to true if you want Capture the Sytem.err to the LogStream


confirmLoad

private boolean confirmLoad
Set to true if you want a confirmation dialog after file is loaded


currentSkin

private java.lang.String currentSkin
The current skin being used.


DGpropertiesAbsolute

private final java.lang.String DGpropertiesAbsolute
The Absolute or Full path were the properties of DGuitar are being stored


evaluate

public boolean evaluate
set to true evaluate performance in time of certains parts of the program and log it


fileChooser

protected DGFileChooser fileChooser
This variable stores a preloaded JFileChooser


currentFileType

private int currentFileType
Indicates the current File Type


filePath

private java.io.File filePath
The location of the GTP files


files

private java.util.Vector files
a Vector that contains a list of files show in the WINDOW MENU


hasPathChanged

private boolean hasPathChanged
Indicates if the location of the files has changed in order to recalculate statistics


hasOptionsChanged

private static boolean hasOptionsChanged
If this variable is set to true..and user exits program..ask if he wants to save them


lauchPath

private java.lang.String lauchPath
This variable stores the current launch path


closableLogWindow

private static boolean closableLogWindow

LogWindowExits

private static boolean LogWindowExits

EnableUnfinishedFeatures

private static boolean EnableUnfinishedFeatures

jSeparator1

private javax.swing.JSeparator jSeparator1

jSeparator2

private javax.swing.JSeparator jSeparator2

menu

private javax.swing.JMenuBar menu

menuAbout

private javax.swing.JMenu menuAbout

menuAboutAuthors

private javax.swing.JMenuItem menuAboutAuthors

menuAboutLicense

private javax.swing.JMenuItem menuAboutLicense

menuMidi

private javax.swing.JMenu menuMidi

menuMidiDevices

private javax.swing.JMenuItem menuMidiDevices

menuMidiTest

private javax.swing.JMenuItem menuMidiTest

menuOptions

private javax.swing.JMenu menuOptions

menuOptionsConfirmLoad

private javax.swing.JCheckBoxMenuItem menuOptionsConfirmLoad

menuOptionsEvaluate

private javax.swing.JCheckBoxMenuItem menuOptionsEvaluate

menuOptionsFastLoad

private javax.swing.JCheckBoxMenuItem menuOptionsFastLoad

menuOptionsFileLocation

private javax.swing.JMenuItem menuOptionsFileLocation

menuOptionsForAllSongs

private static SongOptionsMenu menuOptionsForAllSongs

menuOptionsLanguage

private javax.swing.JMenu menuOptionsLanguage

menuOptionsLog

private javax.swing.JMenuItem menuOptionsLog

menuOptionsLogToFile

private javax.swing.JCheckBoxMenuItem menuOptionsLogToFile

menuOptionsLogToWindow

private javax.swing.JCheckBoxMenuItem menuOptionsLogToWindow

menuOptionsEnableUnfinishedFeatures

private javax.swing.JCheckBoxMenuItem menuOptionsEnableUnfinishedFeatures

menuOptionsReloadStoredSettings

private javax.swing.JMenuItem menuOptionsReloadStoredSettings

menuOptionsSaveCurrentSettings

private javax.swing.JMenuItem menuOptionsSaveCurrentSettings

menuProgram

private javax.swing.JMenu menuProgram

menuProgramExit

private javax.swing.JMenuItem menuProgramExit

menuProgramNew

private javax.swing.JMenuItem menuProgramNew

menuProgramOpenGP

private javax.swing.JMenuItem menuProgramOpenGP

menuProgramOpenMidi

private javax.swing.JMenuItem menuProgramOpenMidi

menuProgramOpenURL

private javax.swing.JMenuItem menuProgramOpenURL

menuProgramStats

private javax.swing.JMenuItem menuProgramStats

menuWindows

private javax.swing.JMenu menuWindows

menuWindowsCascade

private javax.swing.JMenuItem menuWindowsCascade

menuWindowsCloseAll

private javax.swing.JMenuItem menuWindowsCloseAll

menuWindowsOperationsCount

private int menuWindowsOperationsCount

STstats

private common.ScrollText STstats

supportedExtensions

public java.util.Vector supportedExtensions
A list of the supportedExtension according to the available CoDecs


userHome

public java.lang.String userHome
A variable that points to the user.home System property


worker

private common.SwingWorker worker

about

private static About about
The About component that is shown.


authors

private static java.lang.String authors

Buttons

protected static final java.awt.Image[] Buttons

DisabledButtons

protected static final java.awt.Image[] DisabledButtons

Clefs

protected static final javax.swing.ImageIcon[] Clefs
The Clefs represented as ImagesIcon[]


desktopPane

public static DGDesktopPane desktopPane

DGO

private static java.util.Properties DGO
A Properties object that stores current values of options


DGproperties

private static final java.lang.String DGproperties
Name of the file were the preferences of DGuitar are stored

See Also:
Constant Field Values

displayOptions

private DisplayOptions displayOptions
The current DisplayOptions for all the songs


Dynamics

protected static final javax.swing.ImageIcon[] Dynamics
The icons that hold the 8 Dynamics simbols, paino, fortissimo,etc..


EONs

protected static final javax.swing.ImageIcon[] EONs
The EffectsOnNote images


fastLoad

private static boolean fastLoad

gpFileFilter

public static GPFileFilter gpFileFilter

isRelease

public static final boolean isRelease
Is this version a "release" (true) or a "developer"

See Also:
Constant Field Values

operationalSystem

public static java.lang.String operationalSystem

javaVendorExpected

public static final java.lang.String javaVendorExpected
A class variable that stores the expected java vendor

See Also:
Constant Field Values

javaVMvendor

public static java.lang.String javaVMvendor
A class variable that holds the information on the detected java vendor


javaSpecVersion

public static java.lang.String javaSpecVersion
A class variable that holds the information on the detected java version


javaVersionExpected

public static final java.lang.String javaVersionExpected
A class variable that stores the expected java version

See Also:
Constant Field Values

lang

public static java.util.PropertyResourceBundle lang
The resource bundle that allows INTERNATIONALIZATION (also called I18N)


langPath

private static java.lang.String langPath

locale

private static java.util.Locale locale
The locale (INTERNATIONIZATION) that java detected


Logo

protected static javax.swing.ImageIcon Logo

playToolBar

private PlayToolBar playToolBar
A toolbar that contains a PLAY button, an other controls and information


LS

protected static common.LogStream LS

midi

private static common.Midi midi

midiFileFilter

public static MIDFileFilter midiFileFilter

MIN_HEIGHT

private static int MIN_HEIGHT
The minimum required Height to run DGuitar


MIN_WIDTH

private static int MIN_WIDTH
The mininum required Width to run DGuitar


msg

protected static java.lang.String msg
A variable that holds the current message that should be showed.


Notes

protected static final java.awt.Image[] Notes
there are 8 note durations (including 128th duration !!)


screenSize

private static java.awt.Dimension screenSize

Silences

protected static final javax.swing.ImageIcon[] Silences
The Silence represented as ImagesIcon[]


sysErr

private static java.io.PrintStream sysErr

toolkit

public static java.awt.Toolkit toolkit
a static, or class variable, that stores the current ToolKit


version

public static final java.lang.String version
The version of the DGuitar program

See Also:
Constant Field Values
Constructor Detail

DGuitar

public DGuitar()
Constructs a DGuitar main window using LS as the LosStream

Method Detail

aboutAuthors

private static void aboutAuthors()
this method displays information about the autors, this is used also by the DGuitarApplet


correctJavaVersion

static void correctJavaVersion()

getLang

public static java.util.PropertyResourceBundle getLang()
Returns:
Returns the lang.

higherJavaVersion

static boolean higherJavaVersion()

internalFrameLocate

protected static void internalFrameLocate(javax.swing.JInternalFrame JIF)
this method locates a new internalFrame, the desktopPane.add(JIF) has alreacdy been called


internalFrameOptSize

protected static void internalFrameOptSize(javax.swing.JInternalFrame JIF)
Sets the optimum size for a internalFrame ;


main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException
Parameters:
args - the command line arguments
Throws:
java.io.FileNotFoundException

detectOperationalSystem

public static void detectOperationalSystem()
This method detects the operational system and stores it on DGuitar.operationalSystem


requirementsOK

public static boolean requirementsOK()
this method checks for requirements: screen resolution is checked Java vendor and version


setLang

public static void setLang(java.util.PropertyResourceBundle lang)
Parameters:
lang - The lang to set.

showCustomInputDialog

public static java.lang.Object showCustomInputDialog(java.awt.Component parent,
                                                     java.lang.String title,
                                                     java.lang.Object message,
                                                     boolean input,
                                                     java.lang.String init)
Parameters:
parent - - the parent component
title - - the title of the dialog
message - - the String or Panel you want to show
input - - if you want an input box or not
init - - the initial value if you want input
Returns:
a Dialog as you requested to be created

version

public static java.lang.String version()
Returns a string like "DGuitar A.B.C" or "DGuitar (under testing) A.B.C"


aboutLicense

private void aboutLicense()
this lets any body knows that this program is released unde GNU/GPL


addMidiAbout

public void addMidiAbout(javax.swing.JMenuBar MB)
this method is use to add the Midi and About Menus to the given MenuBar


addToolBars

private void addToolBars()

booleanProperty

private boolean booleanProperty(java.lang.String key,
                                java.lang.String defaultValue)
Tries to load the boolean key from the properties file

Parameters:
key - the name of the kay
defaultValue - the value to return if key is not found
Returns:
a boolean value of the key or the default if key is not found

shortProperty

private short shortProperty(java.lang.String key,
                            short defaultValue)

checkFileLocation

private void checkFileLocation()
When the location specify by the file is incorrect this method is used


closeAllWindows

public void closeAllWindows()

close

public void close()

configureMenuOptionsLanguage

private void configureMenuOptionsLanguage()

createFileChooser

protected void createFileChooser()
Checks if the fileChooser exists, creates it if necesary and resets its values


detectSupportedExtensions

public void detectSupportedExtensions()
This methods detects the supported extensions of DGuitar and fills the java.util.List supportedExtensions array.


isSupportedExtension

public boolean isSupportedExtension(java.lang.String aFileName)
Returns true if the Filename is on of the supported extensions

Parameters:
aFileName - the fileName to check

displayGP

void displayGP(java.lang.String aFileName,
               byte[] bytes)
this method display a GP file


displayMID

void displayMID(java.lang.String aFileName)
this method display a MID file


displayMultipleFiles

public void displayMultipleFiles(java.util.List listOfFiles)
This method iterates over the listOfFiles and opens them. If the type of file is not supported, and error message is printed

Parameters:
listOfFiles - a List that contains File objects

errorSkin

private void errorSkin()
Display and error message about loading a skins


fileLoad

private void fileLoad(java.lang.String file)
this methods loads a FILE, using a ProgressBar as necesary


formWindowClosing

private void formWindowClosing(java.awt.event.WindowEvent evt)
this methods cloases any open Internal frame, and then exits


getFilePath

private java.lang.String getFilePath()

getLaunchPath

public java.lang.String getLaunchPath()
Returns:
Returns the lauchPath.

getLangAvailable

public java.lang.String[] getLangAvailable()
This method gets the AvailableLanguages from the LANG folder

Returns:
a String array in the form of { "en", "es", "de", "fr", "pt_BR" }

getLangPath

public java.lang.String getLangPath()

init

public void init(common.LogStream LogS,
                 boolean captureErrs)

load

public void load()
          throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

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.


internalFrameAdd

private void internalFrameAdd(javax.swing.JInternalFrame JIF)
this methos is used to add a internalFrame


loadCurrentSkin

private void loadCurrentSkin()
this methods loads the Current Sking or the defualt if current skin fails


loadImage

private java.awt.Image loadImage(java.lang.String path)
Loads a Image from the given path, returns null if unsuccessfull


loadImages

private boolean loadImages(java.lang.String basePath,
                           java.lang.String baseName,
                           int from,
                           int to,
                           java.awt.Image[] img)
this method loadImages into a Image array


loadImages

private boolean loadImages(java.lang.String basePath,
                           java.lang.String baseName,
                           int from,
                           int to,
                           javax.swing.ImageIcon[] ii)
this method loadImages into a ImageIcon array


loadLanguage

private java.util.PropertyResourceBundle loadLanguage(java.lang.String path,
                                                      java.lang.String language)

loadPropertyResourceBundle

private java.util.PropertyResourceBundle loadPropertyResourceBundle(java.lang.String path)
load a ResourceBungle for the I18N


loadSkin

public boolean loadSkin(java.lang.String nameOfSkin)
this methos loads the skin nameOfSkin


switchLog

private void switchLog()
                throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

setLogCheckBoxes

private void setLogCheckBoxes()
Set the log CheckBoxes according to the DGuitar.typeOfLog


menuCreate

private void menuCreate()

menuExitActionPerformed

private void menuExitActionPerformed(java.awt.event.ActionEvent evt)
The action that is performed when the main program exits

Parameters:
evt -

menuMidiDevicesActionPerformed

private void menuMidiDevicesActionPerformed()
this method creates and displays a MidiDevices form


menuMidiTestActionPerformed

private void menuMidiTestActionPerformed()
this method creates and displays a MidiTest form


menuOpenGPActionPerformed

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

menuOpenMidiActionPerformed

private void menuOpenMidiActionPerformed(java.awt.event.ActionEvent evt)
When a MID is about to be open, isGuitarPro is set to false


menuOpenURLActionPerformed

private void menuOpenURLActionPerformed(java.awt.event.ActionEvent evt)
Opens a URL (http) direclty

Parameters:
evt -

menuOptionsConfirmLoadActionPerformed

private void menuOptionsConfirmLoadActionPerformed(java.awt.event.ActionEvent evt)
Does the user want to confirm file loads ?


menuOptionsEvaluateActionPerformed

private void menuOptionsEvaluateActionPerformed(java.awt.event.ActionEvent evt)
do you want to evaluate the performance of the program ?


menuOptionsFastLoadActionPerformed

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

menuOptionsFileLocationActionPerformed

private void menuOptionsFileLocationActionPerformed(java.awt.event.ActionEvent evt)
this methods allow the user to set the location of the files


menuOptionsValuesUpdate

private void menuOptionsValuesUpdate()
This method must be called when the values are changed direclty without user intervention


menuStatsActionPerformed

private void menuStatsActionPerformed(java.awt.event.ActionEvent evt)
When the statistics options is selected, display them


OpenedListAdd

private void OpenedListAdd(java.lang.String file)
Add a String to the Window Menu, and set the ActionListener


OpenedListContains

boolean OpenedListContains(java.lang.String file)
returns true if the FILE is on the list


OpenedListRemove

public void OpenedListRemove(java.lang.String file)
Remove a string from the Windows menu


preferencesApply

private void preferencesApply()
                       throws java.io.FileNotFoundException
this method apply the preferences loaded from the file or the default

Throws:
java.io.FileNotFoundException

preferencesLoad

private boolean preferencesLoad()
This method tries to load the preferences file

Returns:
true if the file was loaded.

preferencesStore

private boolean preferencesStore()
This method tries to save the preferences to a file

Returns:
true if the file was stored.

preferencesUse

private void preferencesUse()
                     throws java.io.FileNotFoundException
reads the Keys from the Properties file and set the related variables or the default ones

Throws:
java.io.FileNotFoundException

setEnableUnfinishedFeatures

private static void setEnableUnfinishedFeatures(boolean enable)
This method performs the actual enabling or disabling of features


readAndShow

private void readAndShow(java.lang.String aFileName,
                         java.io.InputStream IS)
It reads from the InputStream, and display the PIECE or and error readAndShow used the variable fileName for the title of the window


refreshDisplayOptions

private void refreshDisplayOptions()

refreshLangText

private void refreshLangText()

determineLaunchPath

private void determineLaunchPath()

setLangText

public void setLangText()
Set the language messages for the menus

Specified by:
setLangText in interface i18n.Internationalized

shortTitle

public java.lang.String shortTitle()

showDialogOk

protected void showDialogOk(java.lang.String title,
                            java.lang.Object message)
this method allows to show a message on a information dialog the Object can be a String or a Component see JOptionPane


getCodecFileFilter

public CodecFileFilter getCodecFileFilter()
Obtains a CodecFileFilter object for the current fileType

Returns:
the CodecFileFilter object associated for a filetype

showFileChooserAndOpen

private void showFileChooserAndOpen()
Show file chooser, respond to the actions, and load a file as necesary


loadAndDisplay

public void loadAndDisplay(java.io.File file,
                           boolean checkExtension)
This method loads and displays a File according to its extension

Parameters:
file -

showMessageAlreadyOpen

void showMessageAlreadyOpen(java.lang.String aFileName)
this message is showed when a file is already open


showTextFile

private void showTextFile(java.lang.String title,
                          java.lang.String file,
                          boolean scroll,
                          int w,
                          int h)
this method shows a file on a ScrollText or ScrollTextPane according to the value of scroll


addDropSupport

private void addDropSupport()
This method add suppor for the DROP part of "Drag and Drop"


setDisplayOptions

public void setDisplayOptions(DisplayOptions displayOptions)
Specified by:
setDisplayOptions in interface OptionsDisplay
Parameters:
displayOptions - The displayOptions to set.

getDisplayOptions

public DisplayOptions getDisplayOptions()
Specified by:
getDisplayOptions in interface OptionsDisplay
Returns:
Returns the displayOptions.