Skip to content

Commit

Permalink
2024.6
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleDee73 committed May 20, 2024
1 parent 2b989ce commit 90888ca
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/yass/YassActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ public void actionPerformed(ActionEvent e) {
table.rehyphenate();
}
};
private final Action shiftEnding = new AbstractAction(I18.get("edit_shiftEnding")) {
public void actionPerformed(ActionEvent e) {
table.shiftEnding();
}
};
private final Action findLyrics = new AbstractAction(I18.get("edit_lyrics_find")) {
public void actionPerformed(ActionEvent e) {
lyrics.find();
Expand Down Expand Up @@ -3508,6 +3513,7 @@ public void mousePressed(MouseEvent e) {
menu.addSeparator();

menu.add(reHyphenate);
menu.add(shiftEnding);
menu.add(findLyrics);
menu.add(spellLyrics);

Expand Down Expand Up @@ -6849,6 +6855,10 @@ public void registerLibraryActions(JComponent c) {
am.put("reHyphenate", reHyphenate);
reHyphenate.putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_MASK));

im.put(KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.SHIFT_DOWN_MASK), "shiftEnding");
am.put("shiftEnding", shiftEnding);
shiftEnding.putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.SHIFT_DOWN_MASK));

im.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK), "selectAllSongs");
am.put("selectAllSongs", selectAllSongs);
selectAllSongs.putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK));
Expand Down
22 changes: 22 additions & 0 deletions src/yass/YassTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -3892,6 +3892,28 @@ public void rehyphenate() {
tm.fireTableDataChanged();
}

public void shiftEnding() {
if (getSelectedRows().length != 2) {
return;
}
int selectedRowIndex = getSelectedRows()[0];
YassRow secondSyllable = getRowAt(selectedRowIndex + 1);
if (!secondSyllable.isNote() && !secondSyllable.getTrimmedText().startsWith("~")) {
return;
}
YassRow firstSyllable = getRowAt(selectedRowIndex);
if (!firstSyllable.isNote() || firstSyllable.getTrimmedText().length() == 1 || firstSyllable.endsWithSpace()) {
return;
}
String newSecond = "~" + StringUtils.right(firstSyllable.getTrimmedText(), 1) + secondSyllable.getTrimmedText()
.substring(1);
String newFirst = StringUtils.left(firstSyllable.getText(), firstSyllable.getText().length() - 1);
secondSyllable.setText(newSecond + (secondSyllable.endsWithSpace() ? YassRow.SPACE : ""));
firstSyllable.setText(newFirst);
tm.fireTableDataChanged();
getSelectionModel().setSelectionInterval(selectedRowIndex, selectedRowIndex + 1);
}

public void pasteRows() {
int startRow = getSelectionModel().getMinSelectionIndex();
if (startRow < 0) {
Expand Down
1 change: 1 addition & 0 deletions src/yass/resources/i18/yass_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ edit_normal = Normal
edit_minus = Minus einfügen
edit_space = Leerzeichen einfügen
edit_rehyphenate = Silbentrennung prüfen
edit_shiftEnding = Silbenende schieben
edit_lyrics_find = Finden...
edit_spellcheck = Rechtschreibung...
edit_darkmode = Dunkles Design an/aus
Expand Down
1 change: 1 addition & 0 deletions src/yass/resources/i18/yass_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ edit_normal = Mark As Normal
edit_minus = Insert Minus
edit_space = Insert Space
edit_rehyphenate = Re-Hyphenate
edit_shiftEnding = Shift Syllable Ending
edit_lyrics_find = Find...
edit_spellcheck = Spell-Correct...
edit_darkmode = Toggle dark mode
Expand Down
1 change: 1 addition & 0 deletions src/yass/resources/i18/yass_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ edit_normal = Marcar como Normal
edit_minus = Insertar Signo Menos
edit_space = Insertar Espacio
edit_rehyphenate = Re-Hyphenate
edit_shiftEnding = Shift Syllable Ending
edit_lyrics_find = Buscar...
edit_spellcheck = Corregir Ortografía...
edit_darkmode = Alternar el modo oscuro
Expand Down
1 change: 1 addition & 0 deletions src/yass/resources/i18/yass_hu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ edit_normal = Normál hangjegy
edit_minus = Kötõjel beszúrása
edit_space = Szóköz beszúrása
edit_rehyphenate = Re-Hyphenate
edit_shiftEnding = Shift Syllable Ending
edit_lyrics_find = Keresés...
edit_spellcheck = Helyesírás...
edit_darkmode = Váltás sötét mód
Expand Down
1 change: 1 addition & 0 deletions src/yass/resources/i18/yass_pl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ edit_normal = Mark As Normal
edit_minus = Insert Minus
edit_space = Insert Space
edit_rehyphenate = Re-Hyphenate
edit_shiftEnding = Shift Syllable Ending
edit_lyrics_find = Find...
edit_spellcheck = Spell-Correct...
edit_darkmode = Toggle dark mode
Expand Down

0 comments on commit 90888ca

Please sign in to comment.