Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
berndmoos committed Apr 5, 2024
1 parent 16dddbb commit 4fcb0d6
Show file tree
Hide file tree
Showing 27 changed files with 269 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentShown"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
Expand All @@ -23,7 +26,7 @@

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Container class="javax.swing.JPanel" name="mainPanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
Expand All @@ -32,24 +35,24 @@

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Component class="javax.swing.JLabel" name="bookmarkNameLabel">
<Properties>
<Property name="text" type="java.lang.String" value="Bookmark name: "/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTextField1">
<Component class="javax.swing.JTextField" name="bookmarkNameTextField">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 20]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField1ActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bookmarkNameTextFieldActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Container class="javax.swing.JPanel" name="okCancelPanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="South"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -35,59 +39,64 @@ 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();
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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() {
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() {
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
}// </editor-fold>//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:
Expand All @@ -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
Expand All @@ -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();
Expand All @@ -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

}
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;

/**
*
Expand All @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<SyntheticProperty name="formSizePolicy" type="int" value="2"/>
</SyntheticProperties>
<Events>
<EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentShown"/>
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
</Events>
<AuxValues>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package org.exmaralda.partitureditor.jexmaraldaswing;

import javax.swing.JOptionPane;

/**
*
* @author Thomas
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
*/
Expand All @@ -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;
}

Expand All @@ -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());
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.1" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<NonVisualComponents>
Expand All @@ -13,7 +13,11 @@
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentShown"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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
Expand All @@ -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"));
}

Expand All @@ -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
*/
Expand Down Expand Up @@ -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() {
Expand Down
Loading

0 comments on commit 4fcb0d6

Please sign in to comment.