Compare commits
9 Commits
Author | SHA1 | Date |
---|---|---|
Marcel Kapfer | 76e17e164a | |
Marcel Kapfer (mmk2410) | 3682719efa | |
Marcel Kapfer (mmk2410) | 62338503bd | |
Marcel Kapfer (mmk2410) | 9e395af263 | |
Marcel Kapfer (mmk2410) | 78e5ff74f2 | |
Marcel Kapfer (mmk2410) | 8e45e62cd0 | |
Marcel Kapfer (mmk2410) | 85261470cc | |
Marcel Kapfer (mmk2410) | 280f195755 | |
mmk2410 | 95cb753508 |
|
@ -0,0 +1,86 @@
|
|||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="mmk2410">
|
||||
<words>
|
||||
<w>abteilung</w>
|
||||
<w>affero</w>
|
||||
<w>aktivieren</w>
|
||||
<w>aktuelle</w>
|
||||
<w>aktuellste</w>
|
||||
<w>anleitung</w>
|
||||
<w>aufmerksam</w>
|
||||
<w>ausführliche</w>
|
||||
<w>beim</w>
|
||||
<w>bereinigen</w>
|
||||
<w>bist</w>
|
||||
<w>bitte</w>
|
||||
<w>dann</w>
|
||||
<w>diese</w>
|
||||
<w>eine</w>
|
||||
<w>einen</w>
|
||||
<w>einfügen</w>
|
||||
<w>entwickler</w>
|
||||
<w>erfolgreich</w>
|
||||
<w>fadb</w>
|
||||
<w>fehlenden</w>
|
||||
<w>fehlender</w>
|
||||
<w>fehler</w>
|
||||
<w>finden</w>
|
||||
<w>fullname</w>
|
||||
<w>geben</w>
|
||||
<w>gefunden</w>
|
||||
<w>geworden</w>
|
||||
<w>herunterladen</w>
|
||||
<w>hgap</w>
|
||||
<w>hsize</w>
|
||||
<w>hspacer</w>
|
||||
<w>installieren</w>
|
||||
<w>kannst</w>
|
||||
<w>kontakt</w>
|
||||
<w>kopieren</w>
|
||||
<w>letterspace</w>
|
||||
<w>lgpl</w>
|
||||
<w>licensors</w>
|
||||
<w>lizenz</w>
|
||||
<w>marcelkapfer</w>
|
||||
<w>mehr</w>
|
||||
<w>möglich</w>
|
||||
<w>neues</w>
|
||||
<w>nich</w>
|
||||
<w>nicht</w>
|
||||
<w>nochmal</w>
|
||||
<w>noncommercially</w>
|
||||
<w>normales</w>
|
||||
<w>recognization</w>
|
||||
<w>relicensing</w>
|
||||
<w>schließen</w>
|
||||
<w>schreibe</w>
|
||||
<w>scrollpane</w>
|
||||
<w>später</w>
|
||||
<w>starten</w>
|
||||
<w>sublicenses</w>
|
||||
<w>sublicensing</w>
|
||||
<w>sudo</w>
|
||||
<w>suppressions</w>
|
||||
<w>tabbedpane</w>
|
||||
<w>trat</w>
|
||||
<w>trello</w>
|
||||
<w>umwandler</w>
|
||||
<w>verbindung</w>
|
||||
<w>verfügbar</w>
|
||||
<w>verfügbarr</w>
|
||||
<w>versuch</w>
|
||||
<w>versuchen</w>
|
||||
<w>verwendest</w>
|
||||
<w>verzeichniss</w>
|
||||
<w>vgap</w>
|
||||
<w>vsize</w>
|
||||
<w>wenn</w>
|
||||
<w>willst</w>
|
||||
<w>wipo</w>
|
||||
<w>writtenmorse</w>
|
||||
<w>änderungen</w>
|
||||
<w>über</w>
|
||||
<w>überprüfen</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
|
@ -21,22 +21,6 @@
|
|||
<option name="OPEN_IN_BROWSER" value="true" />
|
||||
<option name="OPTION_INCLUDE_LIBS" value="false" />
|
||||
</component>
|
||||
<component name="ProjectInspectionProfilesVisibleTreeState">
|
||||
<entry key="Project Default">
|
||||
<profile-state>
|
||||
<expanded-state>
|
||||
<State>
|
||||
<id />
|
||||
</State>
|
||||
</expanded-state>
|
||||
<selected-state>
|
||||
<State>
|
||||
<id>Android</id>
|
||||
</State>
|
||||
</selected-state>
|
||||
</profile-state>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
<OptionsSetting value="true" id="Remove" />
|
||||
|
@ -47,7 +31,7 @@
|
|||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
File diff suppressed because it is too large
Load Diff
54
README.md
54
README.md
|
@ -1,43 +1,43 @@
|
|||
Morse Converter
|
||||
===============
|
||||
# Morse Converter (Desktop Client)
|
||||
|
||||
A writtenMorse and normal morse code converter.
|
||||
A detailed description about this program can be found on http://marcel-kapfer.de/writtenmorse.
|
||||
A writtenMorse and normal Morse code converter.
|
||||
A detailed description about this program can be found on the [GitLab Wiki](https://gitlab.com/mmk2410/writtenmorse-specs/wikis/Home).
|
||||
|
||||
## Content
|
||||
- [Contribute](#contribute)
|
||||
- [Trello Board](#trello-board)
|
||||
- [Packages](#packages)
|
||||
- [Linux](#linux)
|
||||
- [ubuntu](#ubuntu)
|
||||
## Prerequisites
|
||||
|
||||
* 2.0 or later: Java 8 or higher
|
||||
- 2.0 or earlier: Java 6 or higher
|
||||
|
||||
## Contributing
|
||||
|
||||
## Contribute
|
||||
|
||||
1. Fork it
|
||||
2. Create your feature branch (`git checkout -b my-new-feature`)
|
||||
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||
4. Push to the branch (`git push origin my-new-feature`)
|
||||
5. **Create New Pull Request**
|
||||
2. Create a feature branch with a meaningful name (`git checkout -b my-new-feature`)
|
||||
3. Add yourself to the CONTRIBUTORS file
|
||||
4. Commit your changes (`git commit -am 'Add some feature'`)
|
||||
5. Push to your branch (`git push origin my-new-feature`)
|
||||
6. Create a new merge request
|
||||
|
||||
Feel free to write me a mail at marcelmichaelkapfer@yahoo.co.nz or contact me on [Google+](https://plus.google.com/+MarcelMichaelKapfer) or [Twitter](https://twitter.com/MarcelKapfer).
|
||||
|
||||
|
||||
You should also check out the issues and the Trello board.
|
||||
|
||||
## Trello Board
|
||||
|
||||
[Feature & Development Board](https://trello.com/b/OUoy2iHg/morse-computer)
|
||||
If you have any questions feel free to write me a mail at [me@mmk2410.org](mailto:me@mmk2410.org) or contact me on [Twitter](https://twitter.com/mmk2410). If your question is more general, don't hesitate to create an issue.
|
||||
|
||||
## Packages
|
||||
|
||||
### Linux
|
||||
|
||||
#### Ubuntu
|
||||
|
||||
I created an Ubuntu repository for the app. You can use it by running the following lines:
|
||||
|
||||
``sudo apt-add-repository ppa:mmk2410/morse-converter``
|
||||
```
|
||||
sudo apt-add-repository ppa:mmk2410/morse-converter
|
||||
|
||||
``sudo apt-get update``
|
||||
sudo apt-get update
|
||||
|
||||
``sudo apt-get install morse-converter``
|
||||
sudo apt-get install morse-converter
|
||||
```
|
||||
|
||||
[Launchpad](https://launchpad.net/~mmk2410/+archive/ubuntu/morse-converter)
|
||||
View this package repository at [Launchpad](https://launchpad.net/~mmk2410/+archive/ubuntu/morse-converter).
|
||||
|
||||
#### Debian
|
||||
|
||||
You can use the Ubuntu packages (or even the repository) with Debian.
|
||||
|
|
|
@ -145,6 +145,7 @@
|
|||
</constraints>
|
||||
<properties>
|
||||
<foreground color="-4517120"/>
|
||||
<labelFor value="b553f"/>
|
||||
<text resource-bundle="de/marcelkapfer/c/morseconverter/text" key="aboutUpdateAvailable"/>
|
||||
<visible value="false"/>
|
||||
</properties>
|
||||
|
@ -160,4 +161,7 @@
|
|||
</tabbedpane>
|
||||
</children>
|
||||
</grid>
|
||||
<inspectionSuppressions>
|
||||
<suppress inspection="NoLabelFor"/>
|
||||
</inspectionSuppressions>
|
||||
</form>
|
||||
|
|
|
@ -36,21 +36,22 @@ import javax.swing.text.Element;
|
|||
import javax.swing.text.html.HTMLDocument;
|
||||
import javax.swing.text.html.HTMLEditorKit;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.datatransfer.Clipboard;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.event.*;
|
||||
import java.io.IOException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class Main extends JFrame {
|
||||
|
||||
// Version numbers for update check
|
||||
public static final int currentVersion = 193;
|
||||
public static final int currentVersion = 200;
|
||||
public static int latestVersion = currentVersion;
|
||||
|
||||
public static ResourceBundle resourceBundle = ResourceBundle.getBundle("de.marcelkapfer.c.morseconverter.text");
|
||||
public JTabbedPane morseConverterPane;
|
||||
private static final ResourceBundle resourceBundle = ResourceBundle.getBundle("de.marcelkapfer.c.morseconverter.text");
|
||||
private JTabbedPane morseConverterPane;
|
||||
private JPanel panel1;
|
||||
private JTextArea inputAreaWrittenMorse;
|
||||
private JTextArea outputAreaWrittenMorse;
|
||||
|
@ -95,13 +96,128 @@ public class Main extends JFrame {
|
|||
updateDialogButton.setText(resourceBundle.getString("aboutUpdateAvailableButton"));
|
||||
}
|
||||
|
||||
updateDialogButton.addActionListener(new ActionListener() {
|
||||
updateDialogButton.addActionListener(e -> updateDialog());
|
||||
|
||||
// Mouse listener for selecting text on left click in output text area
|
||||
outputAreaWrittenMorse.addMouseListener(new MouseListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
updateDialog();
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
outputAreaWrittenMorse.requestFocus();
|
||||
outputAreaWrittenMorse.selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
outputAreaNormalMorse.addMouseListener(new MouseListener() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
outputAreaNormalMorse.requestFocus();
|
||||
outputAreaNormalMorse.selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// Popup Menus
|
||||
|
||||
// Popup Menu for writtenMorse input text field
|
||||
|
||||
JPopupMenu wInputPopup = new JPopupMenu();
|
||||
addPopup(inputAreaWrittenMorse, wInputPopup);
|
||||
|
||||
// Item for paste
|
||||
JMenuItem pasteWInput = new JMenuItem(resourceBundle.getString("paste"));
|
||||
pasteWInput.addActionListener(e -> {
|
||||
onPaste(inputAreaWrittenMorse);
|
||||
instantWrittenMorseConvert();
|
||||
});
|
||||
wInputPopup.add(pasteWInput);
|
||||
|
||||
// Item for clear
|
||||
JMenuItem clearWInput = new JMenuItem(resourceBundle.getString("clear"));
|
||||
clearWInput.addActionListener(e -> clear(inputAreaWrittenMorse));
|
||||
wInputPopup.add(clearWInput);
|
||||
|
||||
// Popup Menu for writtenMorse output text field
|
||||
JPopupMenu wOutputPopup = new JPopupMenu();
|
||||
addPopup(outputAreaWrittenMorse, wOutputPopup);
|
||||
|
||||
// Item for copy
|
||||
JMenuItem copyWOutput = new JMenuItem(resourceBundle.getString("copy"));
|
||||
copyWOutput.addActionListener(e -> onCopy(outputAreaWrittenMorse));
|
||||
wOutputPopup.add(copyWOutput);
|
||||
|
||||
|
||||
// Popups for Normal Morse
|
||||
|
||||
// Popup for Normal Morse input text field
|
||||
JPopupMenu nInputMenu = new JPopupMenu();
|
||||
addPopup(inputAreaNormalMorse, nInputMenu);
|
||||
|
||||
// Item for paste
|
||||
JMenuItem nPasteInput = new JMenuItem(resourceBundle.getString("paste"));
|
||||
nPasteInput.addActionListener(e -> {
|
||||
onPaste(inputAreaNormalMorse);
|
||||
instantNormalMorseConvert();
|
||||
});
|
||||
nInputMenu.add(nPasteInput);
|
||||
|
||||
// Item for clear
|
||||
JMenuItem nClearInput = new JMenuItem(resourceBundle.getString("clear"));
|
||||
nClearInput.addActionListener(e -> clear(inputAreaNormalMorse));
|
||||
nInputMenu.add(nClearInput);
|
||||
|
||||
// Popup for output text field
|
||||
|
||||
JPopupMenu nOutputMenu = new JPopupMenu();
|
||||
addPopup(outputAreaNormalMorse, nOutputMenu);
|
||||
|
||||
// Menu item for copy
|
||||
JMenuItem nCopyOutput = new JMenuItem(resourceBundle.getString("copy"));
|
||||
nCopyOutput.addActionListener(e -> onCopy(outputAreaNormalMorse));
|
||||
nOutputMenu.add(nCopyOutput);
|
||||
|
||||
}
|
||||
// The holy main method
|
||||
public static void main(String[] args){
|
||||
|
@ -114,7 +230,7 @@ public class Main extends JFrame {
|
|||
// Starting the application
|
||||
JFrame main = new JFrame("Main");
|
||||
main.setContentPane(new Main().morseConverterPane);
|
||||
main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
main.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||
// Title
|
||||
main.setTitle(resourceBundle.getString("title"));
|
||||
main.pack();
|
||||
|
@ -158,4 +274,55 @@ public class Main extends JFrame {
|
|||
UpdateDialog.main(null);
|
||||
}
|
||||
|
||||
private static void addPopup(Component component, final JPopupMenu popup) {
|
||||
component.addMouseListener(new MouseAdapter() {
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (e.isPopupTrigger()) {
|
||||
showMenu(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (e.isPopupTrigger()) {
|
||||
showMenu(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void showMenu(MouseEvent e) {
|
||||
popup.show(e.getComponent(), e.getX(), e.getY());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Past function
|
||||
*/
|
||||
private void onPaste(JTextArea tf) {
|
||||
try {
|
||||
Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
|
||||
Transferable t = c.getContents(this);
|
||||
if (t == null)
|
||||
return;
|
||||
try {
|
||||
tf.setText((String) t.getTransferData(DataFlavor.stringFlavor));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}// try
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}// onPaste
|
||||
|
||||
/*
|
||||
* Copy function
|
||||
*/
|
||||
private void onCopy(JTextArea tf) {
|
||||
StringSelection selection = new StringSelection(tf.getText());
|
||||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
|
||||
clipboard.setContents(selection, selection);
|
||||
}
|
||||
|
||||
private void clear(JTextArea jTextArea) {
|
||||
jTextArea.setText("");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class DecodeNormalMorseManager {
|
|||
// Variables
|
||||
StringBuffer input = new StringBuffer();
|
||||
input = input.replace(0, input.length(), message.toString().toUpperCase());
|
||||
StringBuffer output = new StringBuffer();
|
||||
StringBuilder output = new StringBuilder();
|
||||
if (input.toString().equals("LETTERSPACE")) {
|
||||
output.replace(0, output.length(), " ");
|
||||
} else if (input.toString().equals("END OF WORK")) {
|
||||
|
|
|
@ -34,7 +34,7 @@ public class DecodeWrittenMorseManager {
|
|||
// Variables
|
||||
StringBuffer input = new StringBuffer();
|
||||
input = input.replace(0, input.length(), message.toString().toUpperCase());
|
||||
StringBuffer output = new StringBuffer();
|
||||
StringBuilder output = new StringBuilder();
|
||||
if (input.toString().equals("LETTERSPACE")) {
|
||||
output.replace(0, output.length(), "#");
|
||||
} else if (input.toString().equals("END OF WORK")) {
|
||||
|
|
|
@ -38,16 +38,16 @@ public class EncodeNormalMorseManager {
|
|||
}
|
||||
// Declaring variables
|
||||
String input;
|
||||
StringBuffer output = new StringBuffer();
|
||||
StringBuilder output = new StringBuilder();
|
||||
input = message.toString() + " ";
|
||||
input = input.replace(System.lineSeparator(), "\n");
|
||||
input = input.replace("\r", "\n");
|
||||
input = input.replace("\r\n", "\n");
|
||||
StringBuffer inputToSign = new StringBuffer(input);
|
||||
StringBuilder inputToSign = new StringBuilder(input);
|
||||
while (!inputToSign.toString().equals(" ")) {
|
||||
int d = 0;
|
||||
boolean signFull = true;
|
||||
StringBuffer sign = new StringBuffer();
|
||||
StringBuilder sign = new StringBuilder();
|
||||
while (signFull) {
|
||||
if (inputToSign.toString().startsWith(" ")) {
|
||||
output.append(" ");
|
||||
|
|
|
@ -37,16 +37,16 @@ public class EncodeWrittenMorseManager {
|
|||
}
|
||||
// Variables
|
||||
String input;
|
||||
StringBuffer output = new StringBuffer();
|
||||
StringBuilder output = new StringBuilder();
|
||||
input = message.toString().toUpperCase() + "#";
|
||||
input = input.replace(System.lineSeparator(), "\n");
|
||||
input = input.replace("\r", "\n");
|
||||
input = input.replace("\r\n", "\n");
|
||||
StringBuffer inputToSign = new StringBuffer(input);
|
||||
StringBuilder inputToSign = new StringBuilder(input);
|
||||
while (!inputToSign.toString().equals("#")) {
|
||||
int d = 0;
|
||||
boolean signFull = true;
|
||||
StringBuffer sign = new StringBuffer();
|
||||
StringBuilder sign = new StringBuilder();
|
||||
while (signFull) {
|
||||
if (inputToSign.toString().charAt(d) == '+'
|
||||
|| inputToSign.toString().charAt(d) == '#'
|
||||
|
|
|
@ -22,13 +22,14 @@ package de.marcelkapfer.c.morseconverter.intelligentCodeRecognization;
|
|||
*/
|
||||
|
||||
/**
|
||||
* Created by mmk on 5/31/15.
|
||||
* Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
||||
* Licensed under
|
||||
*/
|
||||
public class NormalMorseCodeRecognization {
|
||||
|
||||
public static Boolean isCode(String input){
|
||||
input = input.toLowerCase();
|
||||
if(input.contains("a") || input.contains("b") ||
|
||||
return !(input.contains("a") || input.contains("b") ||
|
||||
input.contains("c") || input.contains("d") ||
|
||||
input.contains("e") || input.contains("f") ||
|
||||
input.contains("g") || input.contains("h") ||
|
||||
|
@ -54,11 +55,7 @@ public class NormalMorseCodeRecognization {
|
|||
input.contains("+") || input.contains("_") ||
|
||||
input.contains("(") || input.contains(")") ||
|
||||
input.contains("=") || input.contains("/") ||
|
||||
input.contains("@") || input.contains("'")){
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
input.contains("@") || input.contains("'"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,13 +22,14 @@ package de.marcelkapfer.c.morseconverter.intelligentCodeRecognization;
|
|||
*/
|
||||
|
||||
/**
|
||||
* Created by mmk on 5/31/15.
|
||||
* Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
||||
* Licensed under
|
||||
*/
|
||||
public class WrittenMorseCodeRecognization {
|
||||
|
||||
public static Boolean isCode(String input){
|
||||
input = input.toLowerCase();
|
||||
if(input.contains("a") || input.contains("b") ||
|
||||
return !(input.contains("a") || input.contains("b") ||
|
||||
input.contains("c") || input.contains("d") ||
|
||||
input.contains("e") || input.contains("f") ||
|
||||
input.contains("g") || input.contains("h") ||
|
||||
|
@ -54,11 +55,7 @@ public class WrittenMorseCodeRecognization {
|
|||
input.contains("(") || input.contains(")") ||
|
||||
input.contains("=") || input.contains("/") ||
|
||||
input.contains("@") || input.contains("'") ||
|
||||
input.contains("$")){
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
input.contains("$"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
about=<body style\="font-family\: sans-serif">\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Version</b><br>1.9.3 beta\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Developer</b><br>Marcel Michael Kapfer\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Website</b><br>marcel-kapfer.de/writtenmorse\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Contact</b><br>marcelmichaelkapfer@yahoo.co.nz\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>License</b><br>GNU GPL v3.0\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Bug</b><br>If you found a bug, please write me a mail to marcelmichaelkapfer@yahoo.co.nz with a short description of the problem.\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>How to</b><br>You can find a detailed guide on marcel-kapfer.de/writtenmorse/\#howto_desktop\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Missing Code</b><br>If you discovered, that a code is missing, then write me a mail to marcelmichaelkapfer@yahoo.co.nz and tell me about it.\n</p>\n</p>\n</body>
|
||||
aboutUpdateAvailable=Update available
|
||||
about=<body style\="font-family\: sans-serif">\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Version</b><br>2.0.0\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Developer</b><br>Marcel Michael Kapfer\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Website</b><br>marcel-kapfer.de/writtenmorse\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Contact</b><br>marcelmichaelkapfer@yahoo.co.nz\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>License</b><br>GNU GPL v3.0\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Bug</b><br>If you found a bug, please write me a mail to marcelmichaelkapfer@yahoo.co.nz with a short description of the problem.\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>How to</b><br>You can find a detailed guide on marcel-kapfer.de/writtenmorse/\#howto_desktop\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Missing Code</b><br>If you discovered, that a code is missing, then write me a mail to marcelmichaelkapfer@yahoo.co.nz and tell me about it.\n</p>\n</p>\n</body>
|
||||
aboutUpdateAvailable=&Update available
|
||||
aboutUpdateAvailableButton=Install Update
|
||||
clear=Clear
|
||||
copy=Copy
|
||||
inputText=Enter your text
|
||||
paste=Paste
|
||||
tabAbout=About
|
||||
tabNormalMorse=Normal Morse
|
||||
title=Morse Converter
|
||||
|
@ -10,7 +13,7 @@ update-no-connection=The connection to the server was not possible.\nTry again l
|
|||
update-not-successful=Update not successful
|
||||
update-successful=Update successful.\nPlease restart the software to activate the changes.
|
||||
updateAvailable=An Update is available\!\nGo to the 'About' section for more.
|
||||
updateButton=Check for updates
|
||||
updateButton=&Check for updates
|
||||
updateDialogClose=Close
|
||||
updateDialogNewVersion=A new version of the Morse Converter is available.
|
||||
updateDialogUpToDateText=You're running the latest version.
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
about=<body style\="font-family\: sans-serif">\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Version</b><br>1.9.3 beta\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Entwickler</b><br>Marcel Michael Kapfer\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Website</b><br>marcel-kapfer.de/writtenmorse\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Kontakt</b><br>marcelmichaelkapfer@yahoo.co.nz\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Lizenz</b><br>GNU GPL v3.0\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Fehler</b><br>Wenn Du einen Fehler gefunden hast, schreibe mir bitte ein E-Mail an marcelmichaelkapfer@yahoo.co.nz\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>How to</b><br>Du kannst eine ausführliche Anleitung auf marcel-kapfer.de/writtenmorse/\#howto_android finden.\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Fehlender Code</b><br>Wenn Du auf einen fehlenden Code aufmerksam geworden bist, dann schreibe eine E-Mail an marcelmichaelkapfer@yahoo.co.nz.\n</p>\n</p>\n</body>
|
||||
about=<body style\="font-family\: sans-serif">\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Version</b><br>2.0.0\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Entwickler</b><br>Marcel Michael Kapfer\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Website</b><br>marcel-kapfer.de/writtenmorse\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Kontakt</b><br>marcelmichaelkapfer@yahoo.co.nz\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Lizenz</b><br>GNU GPL v3.0\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Fehler</b><br>Wenn Du einen Fehler gefunden hast, schreibe mir bitte ein E-Mail an marcelmichaelkapfer@yahoo.co.nz\n</p>\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>How to</b><br>Du kannst eine ausführliche Anleitung auf marcel-kapfer.de/writtenmorse/\#howto_android finden.\n<p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px">\n<b>Fehlender Code</b><br>Wenn Du auf einen fehlenden Code aufmerksam geworden bist, dann schreibe eine E-Mail an marcelmichaelkapfer@yahoo.co.nz.\n</p>\n</p>\n</body>
|
||||
aboutUpdateAvailable=Update verfügbar
|
||||
aboutUpdateAvailableButton=Update installieren
|
||||
clear=Bereinigen
|
||||
copy=Kopieren
|
||||
inputText=Geben Sie einen Text ein
|
||||
paste=Einfügen
|
||||
tabAbout=Über
|
||||
tabNormalMorse=Normales Morse
|
||||
title=Morse Umwandler
|
||||
|
|
|
@ -39,7 +39,7 @@ public class Update {
|
|||
* Argument: The URL of the file with the version number as a string
|
||||
*
|
||||
*/
|
||||
public static boolean isConnected(String url){
|
||||
public static boolean isConnected(@SuppressWarnings("SameParameterValue") String url){
|
||||
try {
|
||||
update = new URL(url);
|
||||
update.openStream();
|
||||
|
@ -57,7 +57,7 @@ public class Update {
|
|||
* Arguments: The path where the jar file is located, the name of the jar file
|
||||
*
|
||||
*/
|
||||
public static boolean update(String path, String filename){
|
||||
public static boolean update(String path, @SuppressWarnings("SameParameterValue") String filename){
|
||||
try {
|
||||
ReadableByteChannel updateChannel = Channels.newChannel(update.openStream());
|
||||
FileOutputStream updateOutputStream = new FileOutputStream(path + filename);
|
||||
|
@ -78,6 +78,7 @@ public class Update {
|
|||
* It is highly recommended to give also the version number of the current version as an argument
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public static int getLatestVersion(String versionFile){
|
||||
return getLatestVersion(versionFile, 0);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="10" bottom="10" right="10"/>
|
||||
<constraints>
|
||||
<xy x="48" y="54" width="551" height="297"/>
|
||||
<xy x="48" y="54" width="720" height="297"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Yes"/>
|
||||
<text value="&Yes"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="5723f" class="javax.swing.JButton" binding="buttonCancel">
|
||||
|
@ -42,7 +42,7 @@
|
|||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="No"/>
|
||||
<text value="&No"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
|
|
|
@ -32,13 +32,13 @@ import java.util.ResourceBundle;
|
|||
|
||||
public class UpdateDialog extends JDialog {
|
||||
private JPanel contentPane;
|
||||
public JButton buttonOK;
|
||||
public JButton buttonCancel;
|
||||
public JLabel updateDialogQuestion;
|
||||
public JLabel updateDialogNewVersion;
|
||||
private ResourceBundle resourceBundle = ResourceBundle.getBundle("de.marcelkapfer.c.morseconverter.text");
|
||||
private JButton buttonOK;
|
||||
private JButton buttonCancel;
|
||||
private JLabel updateDialogQuestion;
|
||||
private JLabel updateDialogNewVersion;
|
||||
private final ResourceBundle resourceBundle = ResourceBundle.getBundle("de.marcelkapfer.c.morseconverter.text");
|
||||
|
||||
public UpdateDialog() {
|
||||
private UpdateDialog() {
|
||||
setContentPane(contentPane);
|
||||
setModal(true);
|
||||
getRootPane().setDefaultButton(buttonOK);
|
||||
|
@ -48,17 +48,9 @@ public class UpdateDialog extends JDialog {
|
|||
updateDialogNewVersion.setVisible(false);
|
||||
updateDialogQuestion.setText(resourceBundle.getString("updateDialogUpToDateText"));
|
||||
}
|
||||
buttonOK.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
onOK();
|
||||
}
|
||||
});
|
||||
buttonOK.addActionListener(e -> onOK());
|
||||
|
||||
buttonCancel.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
onCancel();
|
||||
}
|
||||
});
|
||||
buttonCancel.addActionListener(e -> onCancel());
|
||||
|
||||
// call onCancel() when cross is clicked
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
|
@ -69,11 +61,7 @@ public class UpdateDialog extends JDialog {
|
|||
});
|
||||
|
||||
// call onCancel() on ESCAPE
|
||||
contentPane.registerKeyboardAction(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
onCancel();
|
||||
}
|
||||
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
|
||||
contentPane.registerKeyboardAction(e -> onCancel(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
|
||||
}
|
||||
|
||||
private void onOK() {
|
||||
|
|
Reference in New Issue