From 4fcb0d6db64e3d8dc725f94d252b2130a6fc4b12 Mon Sep 17 00:00:00 2001 From: berndmoos Date: Fri, 5 Apr 2024 12:24:37 +0200 Subject: [PATCH] #462, #458, #456 --- .../swing/EditSegmentationErrorsDialog.java | 1 + .../jexmaraldaswing/AddBookmarkDialog.form | 13 ++- .../jexmaraldaswing/AddBookmarkDialog.java | 74 +++++++----- .../jexmaraldaswing/BookmarksDialog.java | 9 +- .../EditTimelineItemDialog.form | 1 + .../EditTimelineItemDialog.java | 25 +++- .../ModifyAbsoluteTimesDialog.form | 6 +- .../ModifyAbsoluteTimesDialog.java | 16 ++- .../SaveBasicTranscriptionAsDialog.java | 19 ++- .../BasicTranscriptionTableModel.java | 6 +- .../partiture/PartiturEditor.java | 2 + .../partiture/PartitureTableWithActions.java | 109 ++++++++++++++++-- .../partiture/fileActions/TestOutput133.java | 40 ------- .../timelineActions/AddBookmarkAction.java | 11 +- .../timelineActions/AnchorTimelineAction.java | 4 +- .../timelineActions/BookmarksAction.java | 11 +- .../CompleteTimelineAction.java | 3 +- .../ConfirmTimelineItemAction.java | 7 +- .../EditTimelineItemAction.java | 5 +- .../InsertTimelineItemAction.java | 7 +- .../MakeTimelineConsistentAction.java | 6 +- .../timelineActions/RemoveAllGapsAction.java | 6 +- .../timelineActions/RemoveGapAction.java | 7 +- .../RemoveInterpolatedTimesAction.java | 6 +- .../timelineActions/RemoveTimesAction.java | 6 +- .../RemoveUnusedTimelineItemsAction.java | 7 +- .../timelineActions/SmoothTimelineAction.java | 8 +- 27 files changed, 269 insertions(+), 146 deletions(-) delete mode 100644 src/org/exmaralda/partitureditor/partiture/fileActions/TestOutput133.java diff --git a/src/org/exmaralda/partitureditor/jexmaralda/segment/swing/EditSegmentationErrorsDialog.java b/src/org/exmaralda/partitureditor/jexmaralda/segment/swing/EditSegmentationErrorsDialog.java index 0758009a..5c12ee22 100644 --- a/src/org/exmaralda/partitureditor/jexmaralda/segment/swing/EditSegmentationErrorsDialog.java +++ b/src/org/exmaralda/partitureditor/jexmaralda/segment/swing/EditSegmentationErrorsDialog.java @@ -306,6 +306,7 @@ public void show(){ super.show(); } + @Override public void valueChanged(javax.swing.event.ListSelectionEvent e) { if (tableIsUpdating || e.getValueIsAdjusting()) return; int row = errorsTable.getSelectedRow(); diff --git a/src/org/exmaralda/partitureditor/jexmaraldaswing/AddBookmarkDialog.form b/src/org/exmaralda/partitureditor/jexmaraldaswing/AddBookmarkDialog.form index 1338e4ea..7e047646 100644 --- a/src/org/exmaralda/partitureditor/jexmaraldaswing/AddBookmarkDialog.form +++ b/src/org/exmaralda/partitureditor/jexmaraldaswing/AddBookmarkDialog.form @@ -9,6 +9,9 @@ + + + @@ -23,7 +26,7 @@ - + @@ -32,24 +35,24 @@ - + - + - + - + diff --git a/src/org/exmaralda/partitureditor/jexmaraldaswing/AddBookmarkDialog.java b/src/org/exmaralda/partitureditor/jexmaraldaswing/AddBookmarkDialog.java index 2c01ecc1..9fe94eef 100644 --- a/src/org/exmaralda/partitureditor/jexmaraldaswing/AddBookmarkDialog.java +++ b/src/org/exmaralda/partitureditor/jexmaraldaswing/AddBookmarkDialog.java @@ -17,12 +17,16 @@ public class AddBookmarkDialog extends JEscapeDialog { TimelineItem TLI; - /** Creates new form AddBookmarkDialog */ + + /** Creates new form AddBookmarkDialog + * @param parent + * @param modal + * @param tli */ public AddBookmarkDialog(java.awt.Frame parent, boolean modal, TimelineItem tli) { super(parent, modal); initComponents(); TLI = tli.makeCopy(); - jTextField1.setText(TLI.getBookmark()); + bookmarkNameTextField.setText(TLI.getBookmark()); Internationalizer.internationalizeDialogToolTips(this); } @@ -35,31 +39,38 @@ public TimelineItem getTimelineItem(){ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ - private void initComponents() {//GEN-BEGIN:initComponents - jPanel1 = new javax.swing.JPanel(); - jLabel1 = new javax.swing.JLabel(); - jTextField1 = new javax.swing.JTextField(); - jPanel2 = new javax.swing.JPanel(); + // //GEN-BEGIN:initComponents + private void initComponents() { + + mainPanel = new javax.swing.JPanel(); + bookmarkNameLabel = new javax.swing.JLabel(); + bookmarkNameTextField = new javax.swing.JTextField(); + okCancelPanel = new javax.swing.JPanel(); okButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); - setTitle("Add bookmark"); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.X_AXIS)); + setTitle("Add bookmark"); + addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentShown(java.awt.event.ComponentEvent evt) { + formComponentShown(evt); + } + }); - jLabel1.setText("Bookmark name: "); - jPanel1.add(jLabel1); + mainPanel.setLayout(new javax.swing.BoxLayout(mainPanel, javax.swing.BoxLayout.LINE_AXIS)); - jTextField1.setPreferredSize(new java.awt.Dimension(200, 20)); - jTextField1.addActionListener(new java.awt.event.ActionListener() { + bookmarkNameLabel.setText("Bookmark name: "); + mainPanel.add(bookmarkNameLabel); + + bookmarkNameTextField.setPreferredSize(new java.awt.Dimension(200, 20)); + bookmarkNameTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - jTextField1ActionPerformed(evt); + bookmarkNameTextFieldActionPerformed(evt); } }); + mainPanel.add(bookmarkNameTextField); - jPanel1.add(jTextField1); - - getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); + getContentPane().add(mainPanel, java.awt.BorderLayout.CENTER); okButton.setText("OK"); okButton.addActionListener(new java.awt.event.ActionListener() { @@ -67,8 +78,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { okButtonActionPerformed(evt); } }); - - jPanel2.add(okButton); + okCancelPanel.add(okButton); cancelButton.setText("Cancel"); cancelButton.addActionListener(new java.awt.event.ActionListener() { @@ -76,18 +86,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); + okCancelPanel.add(cancelButton); - jPanel2.add(cancelButton); - - getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH); + getContentPane().add(okCancelPanel, java.awt.BorderLayout.SOUTH); pack(); - }//GEN-END:initComponents + }// //GEN-END:initComponents - private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed + private void bookmarkNameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bookmarkNameTextFieldActionPerformed // TODO add your handling code here: okButtonActionPerformed(evt); - }//GEN-LAST:event_jTextField1ActionPerformed + }//GEN-LAST:event_bookmarkNameTextFieldActionPerformed private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed // TODO add your handling code here: @@ -96,10 +105,14 @@ private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN- private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed // TODO add your handling code here: - TLI.setBookmark(jTextField1.getText()); + TLI.setBookmark(bookmarkNameTextField.getText()); change=true; this.dispose(); }//GEN-LAST:event_okButtonActionPerformed + + private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown + bookmarkNameTextField.requestFocus(); + }//GEN-LAST:event_formComponentShown /** * @param args the command line arguments @@ -108,6 +121,7 @@ public static void main(String args[]) { //new AddBookmarkDialog(new javax.swing.JFrame(), true).show(); } + @Override public void show(){ java.awt.Dimension dialogSize = this.getPreferredSize(); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); @@ -116,12 +130,12 @@ public void show(){ } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel bookmarkNameLabel; + private javax.swing.JTextField bookmarkNameTextField; private javax.swing.JButton cancelButton; - private javax.swing.JLabel jLabel1; - private javax.swing.JPanel jPanel1; - private javax.swing.JPanel jPanel2; - private javax.swing.JTextField jTextField1; + private javax.swing.JPanel mainPanel; private javax.swing.JButton okButton; + private javax.swing.JPanel okCancelPanel; // End of variables declaration//GEN-END:variables } diff --git a/src/org/exmaralda/partitureditor/jexmaraldaswing/BookmarksDialog.java b/src/org/exmaralda/partitureditor/jexmaraldaswing/BookmarksDialog.java index 9f8d276b..30436561 100644 --- a/src/org/exmaralda/partitureditor/jexmaraldaswing/BookmarksDialog.java +++ b/src/org/exmaralda/partitureditor/jexmaraldaswing/BookmarksDialog.java @@ -11,10 +11,8 @@ import org.exmaralda.partitureditor.search.SearchResultListener; import org.exmaralda.partitureditor.jexmaralda.Timeline; import org.exmaralda.partitureditor.jexmaralda.TimelineItem; -import org.exmaralda.partitureditor.jexmaralda.*; import javax.swing.*; import java.util.*; -import org.exmaralda.partitureditor.search.*; /** * @@ -28,7 +26,10 @@ public class BookmarksDialog extends javax.swing.JDialog { javax.swing.event.EventListenerList listenerList = new javax.swing.event.EventListenerList(); - /** Creates new form BookmarksDialog */ + /** Creates new form BookmarksDialog + * @param parent + * @param modal + * @param tl */ public BookmarksDialog(java.awt.Frame parent, boolean modal, Timeline tl) { super(parent, modal); timeline = tl; @@ -39,7 +40,7 @@ public BookmarksDialog(java.awt.Frame parent, boolean modal, Timeline tl) { bookmarksListModel.addElement(tli.getBookmark()); } bookmarksList.setModel(bookmarksListModel); - if (allBookmarks.size()>0){ + if (!allBookmarks.isEmpty()){ bookmarksList.setSelectedIndex(0); } Internationalizer.internationalizeDialogToolTips(this); diff --git a/src/org/exmaralda/partitureditor/jexmaraldaswing/EditTimelineItemDialog.form b/src/org/exmaralda/partitureditor/jexmaraldaswing/EditTimelineItemDialog.form index 9b3a95d1..98b6d915 100644 --- a/src/org/exmaralda/partitureditor/jexmaraldaswing/EditTimelineItemDialog.form +++ b/src/org/exmaralda/partitureditor/jexmaraldaswing/EditTimelineItemDialog.form @@ -8,6 +8,7 @@ + diff --git a/src/org/exmaralda/partitureditor/jexmaraldaswing/EditTimelineItemDialog.java b/src/org/exmaralda/partitureditor/jexmaraldaswing/EditTimelineItemDialog.java index c5f2c52b..69224f2d 100644 --- a/src/org/exmaralda/partitureditor/jexmaraldaswing/EditTimelineItemDialog.java +++ b/src/org/exmaralda/partitureditor/jexmaraldaswing/EditTimelineItemDialog.java @@ -8,6 +8,8 @@ package org.exmaralda.partitureditor.jexmaraldaswing; +import javax.swing.JOptionPane; + /** * * @author Thomas @@ -17,7 +19,10 @@ public class EditTimelineItemDialog extends JEscapeDialog { org.exmaralda.partitureditor.jexmaralda.TimelineItem timelineItem; - /** Creates new form EditTimelineItemDialog */ + /** Creates new form EditTimelineItemDialog + * @param parent + * @param modal + * @param tli */ public EditTimelineItemDialog(java.awt.Frame parent,boolean modal, org.exmaralda.partitureditor.jexmaralda.TimelineItem tli) { super (parent, modal); timelineItem = tli.makeCopy(); @@ -61,6 +66,11 @@ private void initComponents() { absoluteTimeTextField = new javax.swing.JTextField(); setTitle("Edit timeline item"); + addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentShown(java.awt.event.ComponentEvent evt) { + formComponentShown(evt); + } + }); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); @@ -149,6 +159,10 @@ private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_clos dispose (); }//GEN-LAST:event_closeDialog + private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown + absoluteTimeTextField.requestFocus(); + }//GEN-LAST:event_formComponentShown + /** * @param args the command line arguments */ @@ -172,8 +186,10 @@ public boolean editTimelineItem(){ java.awt.Dimension dialogSize = this.getPreferredSize(); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation(screenSize.width/2 - dialogSize.width/2, screenSize.height/2 - dialogSize.height/2); - show(); - absoluteTimeTextField.requestFocus(); + //show(); + setVisible(true); + //requestFocus(); + //absoluteTimeTextField.requestFocus(); return change; } @@ -187,8 +203,7 @@ private void evaluateTextField(){ dispose (); } catch (NumberFormatException nfe){ - javax.swing.JOptionPane errorDialog = new javax.swing.JOptionPane(); - errorDialog.showMessageDialog(this, "The number format is not correct." + nfe.getLocalizedMessage()); + JOptionPane.showMessageDialog(this, "The number format is not correct." + nfe.getLocalizedMessage()); absoluteTimeTextField.setText(new String()); } } diff --git a/src/org/exmaralda/partitureditor/jexmaraldaswing/ModifyAbsoluteTimesDialog.form b/src/org/exmaralda/partitureditor/jexmaraldaswing/ModifyAbsoluteTimesDialog.form index e8ba185d..cecebf9b 100644 --- a/src/org/exmaralda/partitureditor/jexmaraldaswing/ModifyAbsoluteTimesDialog.form +++ b/src/org/exmaralda/partitureditor/jexmaraldaswing/ModifyAbsoluteTimesDialog.form @@ -1,4 +1,4 @@ - +
@@ -13,7 +13,11 @@ + + + + diff --git a/src/org/exmaralda/partitureditor/jexmaraldaswing/ModifyAbsoluteTimesDialog.java b/src/org/exmaralda/partitureditor/jexmaraldaswing/ModifyAbsoluteTimesDialog.java index f111801e..1fd0d4cc 100644 --- a/src/org/exmaralda/partitureditor/jexmaraldaswing/ModifyAbsoluteTimesDialog.java +++ b/src/org/exmaralda/partitureditor/jexmaraldaswing/ModifyAbsoluteTimesDialog.java @@ -112,6 +112,11 @@ private void initComponents() { setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle(FOLKERInternationalizer.getString("dialog.times.title")); + addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentShown(java.awt.event.ComponentEvent evt) { + formComponentShown(evt); + } + }); mainPanel.setLayout(new javax.swing.BoxLayout(mainPanel, javax.swing.BoxLayout.Y_AXIS)); @@ -255,8 +260,8 @@ private void useCheckPointButtonActionPerformed(java.awt.event.ActionEvent evt) double m = targetMS / sourceMS; scaleTextField.setText(Double.toString(m)); - } catch (Exception e){ - e.printStackTrace(); + } catch (Exception ex){ + System.out.println(ex.getMessage()); JOptionPane.showMessageDialog(this, FOLKERInternationalizer.getString("dialog.times.wrongformat")); } }//GEN-LAST:event_useCheckPointButtonActionPerformed @@ -267,7 +272,7 @@ private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS approved = true; dispose(); } catch (Exception ex) { - ex.printStackTrace(); + System.out.println(ex.getMessage()); JOptionPane.showMessageDialog(this, FOLKERInternationalizer.getString("dialog.times.wrongformat")); } @@ -278,6 +283,10 @@ private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN- dispose(); }//GEN-LAST:event_cancelButtonActionPerformed + private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown + this.requestFocus(); + }//GEN-LAST:event_formComponentShown + /** * @param args the command line arguments */ @@ -308,6 +317,7 @@ public static void main(String args[]) { /* Create and display the dialog */ java.awt.EventQueue.invokeLater(new Runnable() { + @Override public void run() { ModifyAbsoluteTimesDialog dialog = new ModifyAbsoluteTimesDialog(null, 0, new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { diff --git a/src/org/exmaralda/partitureditor/jexmaraldaswing/fileDialogs/SaveBasicTranscriptionAsDialog.java b/src/org/exmaralda/partitureditor/jexmaraldaswing/fileDialogs/SaveBasicTranscriptionAsDialog.java index 99da645f..7d785395 100644 --- a/src/org/exmaralda/partitureditor/jexmaraldaswing/fileDialogs/SaveBasicTranscriptionAsDialog.java +++ b/src/org/exmaralda/partitureditor/jexmaraldaswing/fileDialogs/SaveBasicTranscriptionAsDialog.java @@ -36,14 +36,19 @@ public SaveBasicTranscriptionAsDialog(BasicTranscription t) { setDialogTitle("Save basic transcription as"); } - /** Creates new SaveBasicTranscriptionAsDialog */ + /** Creates new SaveBasicTranscriptionAsDialog + * @param startDirectory + * @param t */ public SaveBasicTranscriptionAsDialog(String startDirectory, BasicTranscription t) { super(startDirectory); transcription = t; setDialogTitle("Save basic transcription as"); } - /** Creates new SaveBasicTranscriptionAsDialog */ + /** Creates new SaveBasicTranscriptionAsDialog + * @param startDirectory + * @param t + * @param tft */ public SaveBasicTranscriptionAsDialog(String startDirectory, BasicTranscription t, TierFormatTable tft) { super(startDirectory); @@ -56,7 +61,10 @@ public SaveBasicTranscriptionAsDialog(String startDirectory, BasicTranscription } - /** Creates new SaveBasicTranscriptionAsDialog */ + /** Creates new SaveBasicTranscriptionAsDialog + * @param startDirectory + * @param t + * @param showDTDPanel */ public SaveBasicTranscriptionAsDialog(String startDirectory, BasicTranscription t, boolean showDTDPanel) { super(startDirectory, showDTDPanel); transcription = t; @@ -87,7 +95,10 @@ public boolean saveTranscriptionAs(java.awt.Component parent){ checkExtension(); proceed=checkOverwrite(parent); } - else {success = false; return success;} + else { + success = false; + return success; + } } try { if (saveTierFormatTableCheckBox.isSelected()){ diff --git a/src/org/exmaralda/partitureditor/partiture/BasicTranscriptionTableModel.java b/src/org/exmaralda/partitureditor/partiture/BasicTranscriptionTableModel.java index c5c97cfd..9caf843e 100644 --- a/src/org/exmaralda/partitureditor/partiture/BasicTranscriptionTableModel.java +++ b/src/org/exmaralda/partitureditor/partiture/BasicTranscriptionTableModel.java @@ -1008,7 +1008,9 @@ public void removeTimes() { } - /** sets the timeline item at the specified position to a new value */ + /** sets the timeline item at the specified position to a new value + * @param col + * @param newTimelineItem */ public void editTimelineItem(int col, TimelineItem newTimelineItem){ TimelineItem tli = transcription.getBody().getCommonTimeline().getTimelineItemAt(col); tli.setTime(newTimelineItem.getTime()); @@ -1027,7 +1029,7 @@ public void confirmTimelineItems(int startCol, int endCol) { TimelineItem tli = transcription.getBody().getCommonTimeline().getTimelineItemAt(c); tli.setType(""); fireColumnLabelChanged(c); - } + } } diff --git a/src/org/exmaralda/partitureditor/partiture/PartiturEditor.java b/src/org/exmaralda/partitureditor/partiture/PartiturEditor.java index dfb1bb76..80608af7 100644 --- a/src/org/exmaralda/partitureditor/partiture/PartiturEditor.java +++ b/src/org/exmaralda/partitureditor/partiture/PartiturEditor.java @@ -343,6 +343,8 @@ private void initExit(){ exitAction = new javax.swing.AbstractAction(Internationalizer.getString("Exit")){ @Override public void actionPerformed(java.awt.event.ActionEvent e) { + // 05-04-2024: new for #456 + if (table.IS_SAVING_IN_BACKGROUND) return; exitForm(null); } }; diff --git a/src/org/exmaralda/partitureditor/partiture/PartitureTableWithActions.java b/src/org/exmaralda/partitureditor/partiture/PartitureTableWithActions.java index fe9f61e3..ceafaa4d 100644 --- a/src/org/exmaralda/partitureditor/partiture/PartitureTableWithActions.java +++ b/src/org/exmaralda/partitureditor/partiture/PartitureTableWithActions.java @@ -45,6 +45,7 @@ import org.exmaralda.partitureditor.partiture.menus.TablePopupMenu; import com.klg.jclass.table.*; +import java.awt.Color; import java.awt.Desktop; import java.awt.Font; @@ -58,14 +59,22 @@ import java.net.URISyntaxException; import java.util.logging.Level; import java.util.logging.Logger; +import javax.swing.border.Border; import javax.swing.event.DocumentListener; import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerException; import org.exmaralda.common.ExmaraldaApplication; import org.exmaralda.common.helpers.Internationalizer; +import org.exmaralda.folker.application.ApplicationControl; +import org.exmaralda.folker.data.EventListTranscription; +import org.exmaralda.folker.data.TranscriptionHead; import org.exmaralda.folker.timeview.TimeSelectionListener; +import org.exmaralda.folker.utilities.FOLKERInternationalizer; +import org.exmaralda.folker.utilities.PreferencesUtilities; import org.exmaralda.partitureditor.fsm.FSMException; +import org.exmaralda.partitureditor.jexmaralda.TierFormatTable; import org.exmaralda.partitureditor.partiture.legacyActions.LegacyExportAction; import org.exmaralda.partitureditor.partiture.legacyActions.LegacyImportAction; import org.exmaralda.partitureditor.partiture.legacyActions.LegacyOutputAction; @@ -1165,6 +1174,9 @@ public void beforeEditCell(final com.klg.jclass.table.JCEditCellEvent evt) { setupLinkPanel(); } + // 05-04-2023: new for #458 + Border editorBorder = BorderFactory.createMatteBorder(1, 2, 0, 0, Color.BLUE); + /** called when editing of an event starts * @param evt */ @Override @@ -1177,6 +1189,8 @@ public void editCell(final com.klg.jclass.table.JCEditCellEvent evt) { } editor = (PartitureCellStringEditor)(evt.getEditingComponent()); editor.setPopupMenu(eventPopupMenu); + // 05-04-2023: new for #458 + editor.setBorder(editorBorder); keyboardDialog.getKeyboardPanel().addListener(editor); // changed 09-05-2017 - issue #87 if (multimodalDialog!=null && (multimodalDialog.multimodalPanel!=null)){ @@ -1512,7 +1526,9 @@ private void save(){ try{ //getModel().getTranscription().writeXMLToFile(getFilename(),"none"); // 02-06-2023 issue #398 - getModel().getTranscription().writeXMLToFile(getFilename(), "none", this.getModel().getTierFormatTable()); + //getModel().getTranscription().writeXMLToFile(getFilename(), "none", this.getModel().getTierFormatTable()); + // 05-04-2023 issue #456 + saveInThread(); } catch (IOException t){ saveTranscription(); } @@ -1521,6 +1537,74 @@ private void save(){ saveTranscription(); } } + + // 05-04-2024: new for #456 + public boolean IS_SAVING_IN_BACKGROUND = false; + + // 05-04-2024: new for #456 + private void saveInThread() throws IOException { + // changed 12-05-2009: do the saving in a thread + // changed 29-05-2009: take care not to close the application while the save thread is running + final BasicTranscription finalTranscription = getModel().getTranscription(); + final TierFormatTable finalTierFormatTable = getModel().getTierFormatTable(); + final String finalFilename = getFilename(); + Thread saveThread = new Thread(new Runnable(){ + + @Override + public void run() { + // now this is really weird: the writeXML method first transforms the event list transcription + // into an EXMARaLDA basic transcription. Then this basic transcription is transformed via a stylesheet + // into a FOLKER transcription + try { + System.out.println("Start saving..."); + IS_SAVING_IN_BACKGROUND = true; + //applicationFrame.mainPanel.progressBar.setVisible(true); + newAction.setEnabled(false); + saveAction.setEnabled(false); + saveAsAction.setEnabled(false); + openAction.setEnabled(false); + importAction.setEnabled(false); + exportAction.setEnabled(false); + //exitAction.setEnabled(false); + //System.out.println("STATION 1"); + status(FOLKERInternationalizer.getString("status.saving") + finalFilename + "..."); + progressBar.setVisible(true); + + + finalTranscription.writeXMLToFile(finalFilename, "none", finalTierFormatTable); + + //System.out.println("STATION 2"); + //setCurrentFilePath(finalFilename); + status(FOLKERInternationalizer.getString("status.saved1") + + finalFilename + + FOLKERInternationalizer.getString("status.saved2")); + transcriptionChanged = false; + System.out.println("Done saving..."); + } catch (IOException ex) { + Logger.getLogger(ApplicationControl.class.getName()).log(Level.SEVERE, null, ex); + JOptionPane.showMessageDialog(parent, ex.getMessage()); + status(FOLKERInternationalizer.getString("status.saveerror") + finalFilename + "."); + } finally { + //exitAction.setEnabled(true); + newAction.setEnabled(true); + openAction.setEnabled(true); + importAction.setEnabled(true); + exportAction.setEnabled(true); + saveAction.setEnabled(true); + saveAsAction.setEnabled(true); + progressBar.setVisible(false); + IS_SAVING_IN_BACKGROUND = false; + System.out.println("SAVE_THREAD_FINALLY"); + } + } + + }); + + System.out.println("STARTING SAVE THREAD"); + saveThread.start(); + + } + /** saves the current transcription under a new name */ private void saveTranscription(){ @@ -1632,8 +1716,7 @@ boolean exit(){ if (transcriptionChanged){ proceed = checkSave(); } - if (!proceed) return false; - return true; + return proceed; } // *********************************************************************************** // @@ -2173,12 +2256,14 @@ public void launchBrowser(File file){ } } - /** does nothing */ + /** does nothing + * @param documentEvent */ @Override public void changedUpdate(javax.swing.event.DocumentEvent documentEvent) { } - /** adjusts the width of the current cell when the user enters text */ + /** adjusts the width of the current cell when the user enters text + * @param documentEvent */ @Override public void insertUpdate(javax.swing.event.DocumentEvent documentEvent) { if ((getModel().timeProportional) || (!currentCellHasSpanOne)) return; @@ -2622,7 +2707,7 @@ public void processError(String file, String tier, String start) { this.setupMedia(); } } catch (JexmaraldaException | SAXException ex) { - ex.printStackTrace(); + System.out.println(ex.getMessage()); JOptionPane.showMessageDialog(this, ex.getLocalizedMessage()); } // added 09-04-2010 @@ -2840,12 +2925,12 @@ public void clearSearchResult() { } void setMediaPlaybackRate(double newRate) { - if (player instanceof JDSPlayer){ - ((JDSPlayer)player).setPlaybackRate(newRate); - } else if (player instanceof AVFPlayer){ - ((AVFPlayer)player).setPlaybackRate(newRate); - } else if (player instanceof JavaFXPlayer){ - ((JavaFXPlayer)player).setPlaybackRate(newRate); + if (player instanceof JDSPlayer jDSPlayer){ + jDSPlayer.setPlaybackRate(newRate); + } else if (player instanceof AVFPlayer aVFPlayer){ + aVFPlayer.setPlaybackRate(newRate); + } else if (player instanceof JavaFXPlayer javaFXPlayer){ + javaFXPlayer.setPlaybackRate(newRate); } } diff --git a/src/org/exmaralda/partitureditor/partiture/fileActions/TestOutput133.java b/src/org/exmaralda/partitureditor/partiture/fileActions/TestOutput133.java deleted file mode 100644 index d8ff64ce..00000000 --- a/src/org/exmaralda/partitureditor/partiture/fileActions/TestOutput133.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template - */ -package org.exmaralda.partitureditor.partiture.fileActions; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.exmaralda.partitureditor.fsm.FSMException; -import org.exmaralda.partitureditor.jexmaralda.BasicTranscription; -import org.exmaralda.partitureditor.jexmaralda.JexmaraldaException; -import org.exmaralda.partitureditor.jexmaralda.ListTranscription; -import org.exmaralda.partitureditor.jexmaralda.segment.GATSegmentation; -import org.xml.sax.SAXException; - -/** - * - * @author bernd - */ -public class TestOutput133 { - - /** - * @param args the command line arguments - */ - public static void main(String[] args) { - try { - new TestOutput133().doit(); - } catch (SAXException | JexmaraldaException | FSMException | IOException ex) { - Logger.getLogger(TestOutput133.class.getName()).log(Level.SEVERE, null, ex); - } - } - - private void doit() throws SAXException, JexmaraldaException, FSMException, IOException { - BasicTranscription bt = new BasicTranscription("C:\\Users\\bernd\\Dropbox\\work\\2023_Tschannen\\EXAMPLE_1_MONDADA_MOZZARELLA.exb"); - ListTranscription lt = new GATSegmentation().BasicToIntonationUnitList(bt); - lt.writeXMLToFile("C:\\Users\\bernd\\Dropbox\\work\\2023_Tschannen\\EXAMPLE_2_MONDADA_MOZZARELLA.exl", "none"); - } - -} diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/AddBookmarkAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/AddBookmarkAction.java index cda05e1e..febe00cc 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/AddBookmarkAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/AddBookmarkAction.java @@ -8,9 +8,7 @@ import org.exmaralda.partitureditor.jexmaraldaswing.AddBookmarkDialog; import org.exmaralda.partitureditor.jexmaralda.TimelineItem; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; /** * @@ -18,11 +16,14 @@ */ public class AddBookmarkAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of AddBookmarkAction */ + /** Creates a new instance of AddBookmarkAction + * @param t + * @param icon */ public AddBookmarkAction(PartitureTableWithActions t, javax.swing.ImageIcon icon) { super("Add bookmark...", icon, t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("addBookmarkAction!"); table.commitEdit(true); @@ -33,7 +34,9 @@ public void actionPerformed(java.awt.event.ActionEvent actionEvent) { private void addBookmark(){ TimelineItem timelineItem = table.getModel().getTimelineItem(table.selectionStartCol); AddBookmarkDialog dialog = new AddBookmarkDialog(table.parent, true, timelineItem); - dialog.show(); + dialog.setLocationRelativeTo(table.parent); + dialog.setVisible(true); + dialog.requestFocus(); if (dialog.change){ table.getModel().editBookmark(table.selectionStartCol, dialog.getTimelineItem()); } diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/AnchorTimelineAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/AnchorTimelineAction.java index ccd8b503..f2c6bdda 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/AnchorTimelineAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/AnchorTimelineAction.java @@ -15,11 +15,13 @@ */ public class AnchorTimelineAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of CompleteTimelineAction */ + /** Creates a new instance of CompleteTimelineAction + * @param t */ public AnchorTimelineAction(PartitureTableWithActions t) { super("Anchor timeline", t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("anchorTimelineAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/BookmarksAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/BookmarksAction.java index a5403b34..62886298 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/BookmarksAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/BookmarksAction.java @@ -8,9 +8,7 @@ import org.exmaralda.partitureditor.jexmaraldaswing.BookmarksDialog; import org.exmaralda.partitureditor.jexmaralda.Timeline; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; /** * @@ -18,11 +16,14 @@ */ public class BookmarksAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of BookmarksAction */ + /** Creates a new instance of BookmarksAction + * @param t + * @param icon */ public BookmarksAction(PartitureTableWithActions t, javax.swing.ImageIcon icon) { super("Bookmarks...", icon, t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("BookmarksAction!"); table.commitEdit(true); @@ -34,7 +35,9 @@ private void bookmarks(){ Timeline tl = table.getModel().getTranscription().getBody().getCommonTimeline(); BookmarksDialog dialog = new BookmarksDialog(table.parent, false, tl); dialog.addSearchResultListener(table); - dialog.show(); + dialog.setLocationRelativeTo(table.parent); + dialog.setVisible(true); + //dialog.show(); } } diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/CompleteTimelineAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/CompleteTimelineAction.java index 435160ef..f80e616a 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/CompleteTimelineAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/CompleteTimelineAction.java @@ -17,7 +17,8 @@ */ public class CompleteTimelineAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of CompleteTimelineAction */ + /** Creates a new instance of CompleteTimelineAction + * @param t */ public CompleteTimelineAction(PartitureTableWithActions t) { super("Interpolate timeline...", t); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control shift I")); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/ConfirmTimelineItemAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/ConfirmTimelineItemAction.java index c2663777..eee9948e 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/ConfirmTimelineItemAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/ConfirmTimelineItemAction.java @@ -7,10 +7,7 @@ package org.exmaralda.partitureditor.partiture.timelineActions; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; -import org.exmaralda.partitureditor.praatPanel.*; /** * @@ -18,11 +15,13 @@ */ public class ConfirmTimelineItemAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of ConfirmTimelineItemAction */ + /** Creates a new instance of ConfirmTimelineItemAction + * @param t */ public ConfirmTimelineItemAction(PartitureTableWithActions t) { super("Confirm timeline item(s)", t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("confirmTimelineItemAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/EditTimelineItemAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/EditTimelineItemAction.java index 78085da0..564573e9 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/EditTimelineItemAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/EditTimelineItemAction.java @@ -19,11 +19,14 @@ */ public class EditTimelineItemAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of EditTimelineItemAction */ + /** Creates a new instance of EditTimelineItemAction + * @param t + * @param icon */ public EditTimelineItemAction(PartitureTableWithActions t, javax.swing.ImageIcon icon) { super("Edit timeline item...", icon, t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("editTimelineItemAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/InsertTimelineItemAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/InsertTimelineItemAction.java index 23a96cc0..9c1a1149 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/InsertTimelineItemAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/InsertTimelineItemAction.java @@ -6,9 +6,7 @@ package org.exmaralda.partitureditor.partiture.timelineActions; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; import org.exmaralda.partitureditor.partiture.undo.UndoInformation; /** @@ -17,11 +15,14 @@ */ public class InsertTimelineItemAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of InsertTimelineItemAction */ + /** Creates a new instance of InsertTimelineItemAction + * @param t + * @param icon */ public InsertTimelineItemAction(PartitureTableWithActions t, javax.swing.ImageIcon icon) { super("Insert timeline item", icon, t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("insertTimelineItemAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/MakeTimelineConsistentAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/MakeTimelineConsistentAction.java index 4059d131..e4a493a9 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/MakeTimelineConsistentAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/MakeTimelineConsistentAction.java @@ -6,9 +6,7 @@ package org.exmaralda.partitureditor.partiture.timelineActions; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; import org.exmaralda.partitureditor.partiture.undo.UndoInformation; /** @@ -17,11 +15,13 @@ */ public class MakeTimelineConsistentAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of MakeTimelineConsistentAction */ + /** Creates a new instance of MakeTimelineConsistentAction + * @param t */ public MakeTimelineConsistentAction(PartitureTableWithActions t) { super("Make timeline consistent", t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("makeTimelineConsistentAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveAllGapsAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveAllGapsAction.java index c74dc8e4..42c9f9c1 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveAllGapsAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveAllGapsAction.java @@ -6,9 +6,7 @@ package org.exmaralda.partitureditor.partiture.timelineActions; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; import org.exmaralda.partitureditor.partiture.undo.UndoInformation; /** @@ -17,11 +15,13 @@ */ public class RemoveAllGapsAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of RemoveAllGapsAction */ + /** Creates a new instance of RemoveAllGapsAction + * @param t */ public RemoveAllGapsAction(PartitureTableWithActions t) { super("Remove all gaps", t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("removeAllGapsAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveGapAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveGapAction.java index a8e053f5..83fa5ad6 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveGapAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveGapAction.java @@ -6,9 +6,7 @@ package org.exmaralda.partitureditor.partiture.timelineActions; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; import org.exmaralda.partitureditor.partiture.undo.UndoInformation; /** @@ -17,11 +15,14 @@ */ public class RemoveGapAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of RemoveGapAction */ + /** Creates a new instance of RemoveGapAction + * @param t + * @param icon */ public RemoveGapAction(PartitureTableWithActions t, javax.swing.ImageIcon icon) { super("Remove gap", icon, t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("removeGapAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveInterpolatedTimesAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveInterpolatedTimesAction.java index 435a678b..b35cd2c3 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveInterpolatedTimesAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveInterpolatedTimesAction.java @@ -6,9 +6,7 @@ package org.exmaralda.partitureditor.partiture.timelineActions; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; /** * @@ -16,11 +14,13 @@ */ public class RemoveInterpolatedTimesAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of RemoveInterpolatedTimesAction */ + /** Creates a new instance of RemoveInterpolatedTimesAction + * @param t */ public RemoveInterpolatedTimesAction(PartitureTableWithActions t) { super("Remove interpolated times", t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("removeInterpolatedTimesAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveTimesAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveTimesAction.java index d09f77ee..aa102960 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveTimesAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveTimesAction.java @@ -7,9 +7,7 @@ package org.exmaralda.partitureditor.partiture.timelineActions; import javax.swing.JOptionPane; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; /** * @@ -17,11 +15,13 @@ */ public class RemoveTimesAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of RemoveInterpolatedTimesAction */ + /** Creates a new instance of RemoveInterpolatedTimesAction + * @param t */ public RemoveTimesAction(PartitureTableWithActions t) { super("Remove times", t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("removeTimesAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveUnusedTimelineItemsAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveUnusedTimelineItemsAction.java index eb82f5cf..a7cc891c 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveUnusedTimelineItemsAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/RemoveUnusedTimelineItemsAction.java @@ -6,9 +6,7 @@ package org.exmaralda.partitureditor.partiture.timelineActions; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; import org.exmaralda.partitureditor.partiture.undo.UndoInformation; /** @@ -17,11 +15,14 @@ */ public class RemoveUnusedTimelineItemsAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of RemoveUnusedTimelineItemsAction */ + /** Creates a new instance of RemoveUnusedTimelineItemsAction + * @param t + * @param icon */ public RemoveUnusedTimelineItemsAction(PartitureTableWithActions t, javax.swing.ImageIcon icon) { super("Remove unused timeline items", icon, t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("removeUnusedTimelineItemsAction!"); table.commitEdit(true); diff --git a/src/org/exmaralda/partitureditor/partiture/timelineActions/SmoothTimelineAction.java b/src/org/exmaralda/partitureditor/partiture/timelineActions/SmoothTimelineAction.java index 9df15e8e..53c7e93c 100644 --- a/src/org/exmaralda/partitureditor/partiture/timelineActions/SmoothTimelineAction.java +++ b/src/org/exmaralda/partitureditor/partiture/timelineActions/SmoothTimelineAction.java @@ -6,9 +6,7 @@ package org.exmaralda.partitureditor.partiture.timelineActions; -import org.exmaralda.partitureditor.jexmaralda.*; import org.exmaralda.partitureditor.partiture.*; -import org.exmaralda.partitureditor.jexmaraldaswing.*; /** * @@ -16,11 +14,13 @@ */ public class SmoothTimelineAction extends org.exmaralda.partitureditor.partiture.AbstractTableAction { - /** Creates a new instance of RemoveAllGapsAction */ + /** Creates a new instance of RemoveAllGapsAction + * @param t */ public SmoothTimelineAction(PartitureTableWithActions t) { super("Smooth timeline...", t); } + @Override public void actionPerformed(java.awt.event.ActionEvent actionEvent) { System.out.println("smoothTimelineAction!"); table.commitEdit(true); @@ -33,7 +33,7 @@ public void actionPerformed(java.awt.event.ActionEvent actionEvent) { table.transcriptionChanged = true; } catch (NumberFormatException ex) { javax.swing.JOptionPane.showMessageDialog(table.getParent(), "Invalid number format"); - ex.printStackTrace(); + System.out.println(ex.getLocalizedMessage()); } }