Moved to IntelliJ; intelligent code recognization; instant convertng, new UI

This commit is contained in:
mmk2410 2015-05-31 23:21:32 +02:00
parent 3d25da5e61
commit 0cd8b05940
154 changed files with 1369 additions and 39101 deletions

3
src/META-INF/MANIFEST.MF Normal file
View file

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: de.marcelkapfer.c.morseconverter.Main

View file

@ -1,134 +0,0 @@
/*
* This is a programm for Morse.
*
* Copyright (C) 2014 - 2015 Marcel Michael Kapfer (marcelmichaelkapfer@yahoo.co.nz)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
* Version: 1.1.1
*
*/
package de.marcel_kapfer.c.morseconverter;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import javax.swing.border.TitledBorder;
import java.util.ResourceBundle;
public class About extends JDialog {
private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("de.marcel_kapfer.c.morseconverter.strings"); //$NON-NLS-1$
/**
*
*/
private static final long serialVersionUID = 1L;
private final JPanel contentPanel = new JPanel();
/**
* Launch the application.
*/
public static void main(String[] args) {
try {
About dialog = new About();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog.
*/
public About() {
setResizable(false);
setUndecorated(true);
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
setBounds(100, 100, 450, 223);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
JPanel panel = new JPanel();
panel.setBorder(new TitledBorder(null, BUNDLE.getString("About.panel.borderTitle"), TitledBorder.LEADING, TitledBorder.TOP, null, null)); //$NON-NLS-1$
panel.setBounds(5, 17, 436, 148);
contentPanel.add(panel);
panel.setLayout(null);
JLabel lblDeveloper = new JLabel(BUNDLE.getString("About.lblDeveloper.text")); //$NON-NLS-1$
lblDeveloper.setBounds(124, 17, 307, 15);
panel.add(lblDeveloper);
JLabel lblDev = new JLabel(BUNDLE.getString("About.lblDev.text")); //$NON-NLS-1$
lblDev.setBounds(12, 17, 100, 15);
panel.add(lblDev);
JLabel lblWeb = new JLabel(BUNDLE.getString("About.lblWeb.text")); //$NON-NLS-1$
lblWeb.setBounds(12, 44, 100, 15);
panel.add(lblWeb);
JLabel lblCont = new JLabel(BUNDLE.getString("About.lblCont.text")); //$NON-NLS-1$
lblCont.setBounds(12, 71, 100, 15);
panel.add(lblCont);
JLabel lblVer = new JLabel(BUNDLE.getString("About.lblVer.text")); //$NON-NLS-1$
lblVer.setBounds(12, 98, 100, 15);
panel.add(lblVer);
JLabel lblLic = new JLabel(BUNDLE.getString("About.lblLic.text")); //$NON-NLS-1$
lblLic.setBounds(12, 125, 100, 15);
panel.add(lblLic);
JLabel lblWebsite = new JLabel(BUNDLE.getString("About.lblWebsite.text")); //$NON-NLS-1$
lblWebsite.setBounds(124, 44, 307, 15);
panel.add(lblWebsite);
JLabel lblContact = new JLabel(BUNDLE.getString("About.lblContact.text")); //$NON-NLS-1$
lblContact.setBounds(124, 71, 307, 15);
panel.add(lblContact);
JLabel lblVersion = new JLabel(BUNDLE.getString("About.lblVersion.text")); //$NON-NLS-1$
lblVersion.setBounds(124, 98, 307, 15);
panel.add(lblVersion);
JLabel lblLicense = new JLabel(BUNDLE.getString("About.lblLicense.text")); //$NON-NLS-1$
lblLicense.setBounds(124, 125, 307, 15);
panel.add(lblLicense);
{
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane, BorderLayout.SOUTH);
{
JButton cancelButton = new JButton(BUNDLE.getString("About.cancelButton.text")); //$NON-NLS-1$
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
dispose();
}
});
cancelButton.setActionCommand(BUNDLE.getString("About.cancelButton.actionCommand")); //$NON-NLS-1$
buttonPane.add(cancelButton);
}
}
}
}

View file

@ -1,121 +0,0 @@
/*
* This is a programm for Morse.
*
* Copyright (C) 2014 - 2015 Marcel Michael Kapfer (marcelmichaelkapfer@yahoo.co.nz)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
* Version: 1.1.1
*
*/
package de.marcel_kapfer.c.morseconverter;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import javax.swing.border.TitledBorder;
import java.util.ResourceBundle;
public class Bug extends JDialog {
private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("de.marcel_kapfer.c.morseconverter.strings"); //$NON-NLS-1$
/**
*
*/
private static final long serialVersionUID = 1L;
private final JPanel contentPanel = new JPanel();
/**
* Launch the application.
*/
public static void main(String[] args) {
try {
Bug dialog = new Bug();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog.
*/
public Bug() {
setUndecorated(true);
setResizable(false);
setBounds(100, 100, 575, 263);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(0, 0, 0, 0));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
JPanel panel = new JPanel();
panel.setBorder(new TitledBorder(null, BUNDLE.getString("Bug.panel.borderTitle"), TitledBorder.LEADING, TitledBorder.TOP, null, null)); //$NON-NLS-1$
panel.setBounds(5, 17, 558, 199);
contentPanel.add(panel);
panel.setLayout(null);
JLabel lblIntro = new JLabel(BUNDLE.getString("Bug.lblIntro.text")); //$NON-NLS-1$
lblIntro.setBounds(5, 17, 541, 15);
panel.add(lblIntro);
JLabel lblAddress = new JLabel(BUNDLE.getString("Bug.lblAddress.text")); //$NON-NLS-1$
lblAddress.setBounds(5, 44, 419, 15);
panel.add(lblAddress);
JLabel lblTitleIntro = new JLabel(BUNDLE.getString("Bug.lblTitleIntro.text")); //$NON-NLS-1$
lblTitleIntro.setBounds(5, 71, 92, 15);
panel.add(lblTitleIntro);
JLabel lblTitle = new JLabel(BUNDLE.getString("Bug.lblTitle.text")); //$NON-NLS-1$
lblTitle.setBounds(5, 98, 541, 15);
panel.add(lblTitle);
JLabel lblDescription = new JLabel(BUNDLE.getString("Bug.lblDescription.text")); //$NON-NLS-1$
lblDescription.setBounds(5, 125, 426, 15);
panel.add(lblDescription);
JLabel lblReproduce = new JLabel(BUNDLE.getString("Bug.lblReproduce.text")); //$NON-NLS-1$
lblReproduce.setBounds(5, 152, 325, 15);
panel.add(lblReproduce);
JLabel lblThanks = new JLabel(BUNDLE.getString("Bug.lblThanks.text")); //$NON-NLS-1$
lblThanks.setBounds(5, 179, 148, 15);
panel.add(lblThanks);
{
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane, BorderLayout.SOUTH);
{
JButton cancelButton = new JButton(BUNDLE.getString("Bug.cancelButton.text")); //$NON-NLS-1$
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
dispose();
}
});
cancelButton.setActionCommand(BUNDLE.getString("Bug.cancelButton.actionCommand")); //$NON-NLS-1$
buttonPane.add(cancelButton);
}
}
}
}

View file

@ -1,105 +0,0 @@
/*
* This is a programm for Morse.
*
* Copyright (C) 2014 - 2015 Marcel Michael Kapfer (marcelmichaelkapfer@yahoo.co.nz)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
* Version: 1.1.1
*
*/
package de.marcel_kapfer.c.morseconverter;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.border.TitledBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.ResourceBundle;
public class HowTo extends JDialog {
private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("de.marcel_kapfer.c.morseconverter.strings"); //$NON-NLS-1$
/**
*
*/
private static final long serialVersionUID = 1L;
private final JPanel contentPanel = new JPanel();
/**
* Launch the application.
*/
public static void main(String[] args) {
try {
HowTo dialog = new HowTo();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog.
*/
public HowTo() {
setTitle(BUNDLE.getString("HowTo.this.title")); //$NON-NLS-1$
setUndecorated(true);
setBounds(100, 100, 579, 128);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
{
JPanel jPanel = new JPanel();
jPanel.setBorder(new TitledBorder(null, BUNDLE.getString("HowTo.jPanel.borderTitle"), TitledBorder.LEADING, TitledBorder.TOP, null, null)); //$NON-NLS-1$
jPanel.setBounds(5, 12, 562, 68);
contentPanel.add(jPanel);
jPanel.setLayout(null);
{
JLabel lblIntro = new JLabel(BUNDLE.getString("HowTo.lblIntro.text")); //$NON-NLS-1$
lblIntro.setBounds(5, 17, 448, 15);
jPanel.add(lblIntro);
}
{
JLabel lblHttpwwwmarcelkapferdeprojectsmorseindexhtmlhowto = new JLabel(BUNDLE.getString("HowTo.lblHttpwwwmarcelkapferdeprojectsmorseindexhtmlhowto.text")); //$NON-NLS-1$
lblHttpwwwmarcelkapferdeprojectsmorseindexhtmlhowto.setBounds(5, 41, 545, 15);
jPanel.add(lblHttpwwwmarcelkapferdeprojectsmorseindexhtmlhowto);
}
}
{
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane, BorderLayout.SOUTH);
{
JButton cancelButton = new JButton(BUNDLE.getString("HowTo.cancelButton.text")); //$NON-NLS-1$
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
dispose();
}
});
cancelButton.setActionCommand(BUNDLE.getString("HowTo.cancelButton.actionCommand")); //$NON-NLS-1$
buttonPane.add(cancelButton);
}
}
}
}

View file

@ -1,121 +0,0 @@
/*
* This is a programm for Morse.
*
* Copyright (C) 2014 - 2015 Marcel Michael Kapfer (marcelmichaelkapfer@yahoo.co.nz)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
* Version: 1.1.1
*
*/
package de.marcel_kapfer.c.morseconverter;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import javax.swing.border.TitledBorder;
import java.util.ResourceBundle;
public class MissingCode extends JDialog {
private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("de.marcel_kapfer.c.morseconverter.strings"); //$NON-NLS-1$
/**
*
*/
private static final long serialVersionUID = 1L;
private final JPanel contentPanel = new JPanel();
/**
* Launch the application.
*/
public static void main(String[] args) {
try {
MissingCode dialog = new MissingCode();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog.
*/
public MissingCode() {
setUndecorated(true);
setResizable(false);
setBounds(100, 100, 522, 263);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(0, 0, 0, 0));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
JPanel panel = new JPanel();
panel.setBorder(new TitledBorder(null, BUNDLE.getString("MissingCode.panel.borderTitle"), TitledBorder.LEADING, TitledBorder.TOP, null, null)); //$NON-NLS-1$
panel.setBounds(5, 17, 505, 199);
contentPanel.add(panel);
panel.setLayout(null);
JLabel lblIntro = new JLabel(BUNDLE.getString("MissingCode.lblIntro.text")); //$NON-NLS-1$
lblIntro.setBounds(5, 17, 488, 15);
panel.add(lblIntro);
JLabel lblAddress = new JLabel(BUNDLE.getString("MissingCode.lblAddress.text")); //$NON-NLS-1$
lblAddress.setBounds(5, 71, 419, 15);
panel.add(lblAddress);
JLabel lblTitleIntro = new JLabel(BUNDLE.getString("MissingCode.lblTitleIntro.text")); //$NON-NLS-1$
lblTitleIntro.setBounds(5, 98, 92, 15);
panel.add(lblTitleIntro);
JLabel lblTitle = new JLabel(BUNDLE.getString("MissingCode.lblTitle.text")); //$NON-NLS-1$
lblTitle.setBounds(5, 125, 419, 15);
panel.add(lblTitle);
JLabel lblThanks = new JLabel(BUNDLE.getString("MissingCode.lblThanks.text")); //$NON-NLS-1$
lblThanks.setBounds(5, 179, 148, 15);
panel.add(lblThanks);
JLabel lblIntroTwo = new JLabel(BUNDLE.getString("MissingCode.lblIntroTwo.text")); //$NON-NLS-1$
lblIntroTwo.setBounds(5, 44, 488, 15);
panel.add(lblIntroTwo);
JLabel lblMissingCode = new JLabel(BUNDLE.getString("MissingCode.lblMissingCode.text")); //$NON-NLS-1$
lblMissingCode.setBounds(5, 152, 488, 15);
panel.add(lblMissingCode);
{
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane, BorderLayout.SOUTH);
{
JButton cancelButton = new JButton(BUNDLE.getString("MissingCode.cancelButton.text")); //$NON-NLS-1$
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
dispose();
}
});
cancelButton.setActionCommand(BUNDLE.getString("MissingCode.cancelButton.actionCommand")); //$NON-NLS-1$
buttonPane.add(cancelButton);
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,82 +0,0 @@
#Field ResourceBundle: BUNDLE
#Sun Feb 15 22:59:16 CET 2015
About.cancelButton.actionCommand=Cancel
About.cancelButton.text=Close
About.lblCont.text=Contact
About.lblContact.text=marcelmichaelkapfer@yahoo.co.nz
About.lblDev.text=Developer
About.lblDeveloper.text=Marcel Kapfer
About.lblLic.text=License
About.lblLicense.text=GNU v3.0
About.lblVer.text=Version
About.lblVersion.text=1.1.1 17th February 2015
About.lblWeb.text=Website
About.lblWebsite.text=marcel-kapfer.de/projects/morse
About.panel.borderTitle=About
Bug.cancelButton.actionCommand=Cancel
Bug.cancelButton.text=Cancel
Bug.lblAddress.text=marcelmichaelkapfer@yahoo.co.nz
Bug.lblDescription.text=a short description of the bug
Bug.lblIntro.text=If you found a bug, please write me a mail to
Bug.lblReproduce.text=and how to re-produce the bug.
Bug.lblThanks.text=Thank you very much
Bug.lblTitle.text=Bug in Morse Version [your program version]
Bug.lblTitleIntro.text=with the title
Bug.panel.borderTitle=Bug
HowTo.cancelButton.actionCommand=Cancel
HowTo.cancelButton.text=Cancel
HowTo.jPanel.borderTitle=How to
HowTo.lblHttpwwwmarcelkapferdeprojectsmorseindexhtmlhowto.text=http\://www.marcel-kapfer.de/projects/morse/index.html\#howto_desktop
HowTo.lblIntro.text=A detailed description about how to use this software is on\:
HowTo.this.title=How to
MissingCode.cancelButton.actionCommand=Cancel
MissingCode.cancelButton.text=Cancel
MissingCode.lblAddress.text=marcelmichaelkapfer@yahoo.co.nz
MissingCode.lblIntro.text=If you found out that a code is missing,
MissingCode.lblIntroTwo.text=please write me a mail to
MissingCode.lblMissingCode.text=and tell me which code is missing.
MissingCode.lblThanks.text=Thank you very much
MissingCode.lblTitle.text=Missing Code in Morse Version [your program version]
MissingCode.lblTitleIntro.text=with the title
MissingCode.panel.borderTitle=Missing Code
Morse.btnConvert.text=Convert
Morse.btnConvert.toolTipText=Convert the insert text to the choosen code
Morse.btnSelectInput.text=Select Input Text
Morse.btnSelectInput.toolTipText=Select the whole text of the input box
Morse.chckbxmntmClipboardAutomatic.text=Copy automatically into Clipboard
Morse.chckbxmntmClipboardAutomatic.toolTipText=Copy the text form the output field automatically into your clipboard
Morse.lblEnterYourText.text=Enter your text\:
Morse.mnClipboard.text=Clipboard
Morse.mnMain.text=Main Menu
Morse.mntmAbout.text=About
Morse.mntmAbout.toolTipText=Information about the Software
Morse.mntmBug.text=Bug
Morse.mntmBug.toolTipText=Information about handling a bug
Morse.mntmCopy.text=Copy into Clipboard
Morse.mntmCopy.toolTipText=Copy the text from the output field into your clipboard
Morse.mntmExit.text=Exit
Morse.mntmHowTo.text=How to
Morse.mntmHowTo.toolTipText=Information about how to use the software
Morse.mntmIpDelete.text=Delete text
Morse.mntmIpDelete.toolTipText=Delete the whole text
Morse.mntmIpPaste.text=Paste from Clipboard
Morse.mntmIpPaste.toolTipText=Paste the text from your Clipboard into the input field
Morse.mntmMissingCode.text=Missing Code
Morse.mntmMissingCode.toolTipText=Information about handling a missing code
Morse.mntmOpClipboardCopy.text=Copy into Clipboard
Morse.mntmOpSelect.text=Select Text
Morse.mntnIpSelect.text=Select text
Morse.mntnIpSelect.toolTipText=Select the whole text
Morse.mntnPaste.text=Paste from Clipboard
Morse.mntnPaste.toolTipText=Paste the text from your Clipboard into the input field
Morse.rdbtnllm.text=Text to Morse
Morse.rdbtnllm.toolTipText=convert normal text into normal morse code
Morse.rdbtnllwm.text=Text to writtenMorse
Morse.rdbtnllwm.toolTipText=Convert normal text into writtenMorse
Morse.rdbtnmll.text=Morse to Text
Morse.rdbtnmll.toolTipText=Convert normal morse code into normal text
Morse.rdbtnwmll.text=writtenMorse to Text
Morse.rdbtnwmll.toolTipText=Convert writtenMorse into normal text
Morse.tfInput.toolTipText=Enter here your text
Morse.tfOutput.toolTipText=This is the output text field
Morse.this.title=Morse Converter

View file

@ -1,82 +0,0 @@
#Field ResourceBundle: BUNDLE
#Sun Feb 15 22:59:16 CET 2015
About.cancelButton.actionCommand=Schlie\u00DFen
About.cancelButton.text=Schlie\u00DFen
About.lblCont.text=Kontakt
About.lblContact.text=marcelmichaelkapfer@yahoo.co.nz
About.lblDev.text=Entwickler
About.lblDeveloper.text=Marcel Kapfer
About.lblLic.text=Lizenz
About.lblLicense.text=GNU v3.0
About.lblVer.text=Version
About.lblVersion.text=1.1.1 17. Februar 2015
About.lblWeb.text=Website
About.lblWebsite.text=marcel-kapfer.de/projects/morse/
About.panel.borderTitle=\u00DCber
Bug.cancelButton.actionCommand=Schlie\u00DFen
Bug.cancelButton.text=Schlie\u00DFen
Bug.lblAddress.text=marcelmichaelkapfer@yahoo.co.nz
Bug.lblDescription.text=eine kurze Beschreibung des Fehlers
Bug.lblIntro.text=Wenn Sie einen Fehler entdeckt haben, schreiben Sie mit bitte eine Mail an
Bug.lblReproduce.text=und wie man diesen reproduzieren kann
Bug.lblThanks.text=Vielen Dank
Bug.lblTitle.text=Fehler in Morse Version [Ihre Programm Version]
Bug.lblTitleIntro.text=mit dem Titel
Bug.panel.borderTitle=Fehler
HowTo.cancelButton.actionCommand=Schlie\u00DFen
HowTo.cancelButton.text=Schlie\u00DFen
HowTo.jPanel.borderTitle=Bedienung
HowTo.lblHttpwwwmarcelkapferdeprojectsmorseindexhtmlhowto.text=http\://www.marcel-kapfer.de/projects/morse/index.html\#howto_desktop
HowTo.lblIntro.text=Eine genaue Anleitung ist hier zu finden\:
HowTo.this.title=Bedienung
MissingCode.cancelButton.actionCommand=Schlie\u00DFen
MissingCode.cancelButton.text=Schlie\u00DFen
MissingCode.lblAddress.text=marcelmichaelkapfer@yahoo.co.nz
MissingCode.lblIntro.text=Wenn Sie auf einen fehlenden Code aufmerksam geworden bist,
MissingCode.lblIntroTwo.text=schreiben Sie mir bitte eine Email an
MissingCode.lblMissingCode.text=und benachrichtigen Sie mich \u00FCber den fehlenden Code
MissingCode.lblThanks.text=Vielen Dank
MissingCode.lblTitle.text=Fehlender Code in Morse Converter [Ihre Program Version]
MissingCode.lblTitleIntro.text=mit dem Titel
MissingCode.panel.borderTitle=Fehlender Code
Morse.btnConvert.text=Umwandeln
Morse.btnConvert.toolTipText=Umwandelt den eingegebenen Text zum ausgew\u00E4hlten Code
Morse.btnSelectInput.text=Eingabetext ausw\u00E4hlen
Morse.btnSelectInput.toolTipText=W\u00E4hlt den ganzen Text des Eingabe-Felds aus
Morse.chckbxmntmClipboardAutomatic.text=Automatisch in die Zwischenablage kopieren
Morse.chckbxmntmClipboardAutomatic.toolTipText=Kopiert den umgewandelten Text automatisch in die Zwischenablage
Morse.lblEnterYourText.text=Geben Sie Ihren Text ein\:
Morse.mnClipboard.text=Zwischenablage
Morse.mnMain.text=Hauptmen\u00FC
Morse.mntmAbout.text=\u00DCber
Morse.mntmAbout.toolTipText=Informationen \u00FCber die Software
Morse.mntmBug.text=Fehler
Morse.mntmBug.toolTipText=Informationen \u00FCber die Fehlerbehandlung
Morse.mntmCopy.text=In die Zwischenablage kopieren
Morse.mntmCopy.toolTipText=Kopiert den umgewandelten Text in Ihre Zwischenablage
Morse.mntmExit.text=Verlassen
Morse.mntmHowTo.text=Benutzung
Morse.mntmHowTo.toolTipText=Informationen \u00FCber die Benutzung der Software
Morse.mntmIpDelete.text=Text l\u00F6schen
Morse.mntmIpDelete.toolTipText=L\u00F6scht den ganzen Text
Morse.mntmIpPaste.text=Von der Zwischenablage einf\u00FCgen
Morse.mntmIpPaste.toolTipText=F\u00FCgt den Text von Ihrer Zwischenablage in das Eingabefeld ein
Morse.mntmMissingCode.text=Fehlender Code
Morse.mntmMissingCode.toolTipText=Informationen \u00FCber das Umgehen mit fehlenden Code
Morse.mntmOpClipboardCopy.text=In die Zwischenablage kopieren
Morse.mntmOpSelect.text=Text ausw\u00E4hlen
Morse.mntnIpSelect.text=Text ausw\u00E4hlen
Morse.mntnIpSelect.toolTipText=W\u00E4hlt den ganzen Text aus
Morse.mntnPaste.text=Aus der Zwischenablage einf\u00FCgen
Morse.mntnPaste.toolTipText=F\u00FCgt den Text von Ihrer Zwischenablage in das Eingabefeld ein
Morse.rdbtnllm.text=Text zu Morse
Morse.rdbtnllm.toolTipText=Wandelt normalen Text in Morse Code um
Morse.rdbtnllwm.text=Text zu writtenMorse
Morse.rdbtnllwm.toolTipText=Wandelt normalen Text in writtenMorse um
Morse.rdbtnmll.text=Morse zu Text
Morse.rdbtnmll.toolTipText=Wandelt normales Morse in normalen Text um
Morse.rdbtnwmll.text=writtenMorse zu Text
Morse.rdbtnwmll.toolTipText=Wandelt writtenMorse in normalen Text um
Morse.tfInput.toolTipText=Geben Sie Ihren Text hier ein
Morse.tfOutput.toolTipText=Dies ist das Ausgabefeld
Morse.this.title=Morse Converter

View file

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="de.marcelkapfer.c.morseconverter.Main">
<grid id="27dc6" binding="panel1" default-binding="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="826" height="404"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="2d52b" binding="morseConverterPane">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<minimum-size width="800" height="400"/>
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="6882f" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="writtenMorse"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="b553f">
<constraints>
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="de105" class="javax.swing.JTextArea" binding="inputAreaWrittenMorse">
<constraints/>
<properties>
<lineWrap value="true"/>
<text value="Enter your text"/>
</properties>
</component>
</children>
</scrollpane>
<scrollpane id="a581d">
<constraints>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="10212" class="javax.swing.JTextArea" binding="outputAreaWrittenMorse">
<constraints/>
<properties>
<editable value="false"/>
<lineWrap value="true"/>
<text value=""/>
</properties>
</component>
</children>
</scrollpane>
</children>
</grid>
<grid id="abf8c" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Normal Morse"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="3916e">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="b5dfc" class="javax.swing.JTextArea" binding="inputAreaNormalMorse">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
<scrollpane id="c419b">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="bc69d" class="javax.swing.JTextArea" binding="outputAreaNormalMorse">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
</children>
</grid>
<grid id="4a85e" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="About"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</form>

View file

@ -0,0 +1,114 @@
package de.marcelkapfer.c.morseconverter;
/*
This is a Java application for converting writtenMorse and normal morse code.
Copyright (C) 2014-2015 Marcel Michael Kapfer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Marcel Michael Kapfer
marcelmichaelkapfer@yahoo.co.nz
*/
import de.marcelkapfer.c.morseconverter.engine.DecodeNormalMorseManager;
import de.marcelkapfer.c.morseconverter.engine.DecodeWrittenMorseManager;
import de.marcelkapfer.c.morseconverter.engine.EncodeNormalMorseManager;
import de.marcelkapfer.c.morseconverter.engine.EncodeWrittenMorseManager;
import de.marcelkapfer.c.morseconverter.intelligentCodeRecognization.NormalMorseCodeRecognization;
import de.marcelkapfer.c.morseconverter.intelligentCodeRecognization.WrittenMorseCodeRecognization;
import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
/**
* Created by mmk on 5/31/15.
*/
public class Main extends JFrame {
public JTabbedPane morseConverterPane;
private JPanel panel1;
private JTextArea inputAreaWrittenMorse;
private JTextArea outputAreaWrittenMorse;
private JTextArea inputAreaNormalMorse;
private JTextArea outputAreaNormalMorse;
// Contains mainly listeners
public Main() {
// Listener for the writtenMorse input field
inputAreaWrittenMorse.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
instantWrittenMorseConvert();
}
});
// Listener for the normal Morse input field
inputAreaNormalMorse.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
instantNormalMorseConvert();
}
});
}
// The holy main method
public static void main(String[] args){
// Tries to present the app in an native look
try{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e){
e.printStackTrace();
}
// Starting the application
JFrame main = new JFrame("Main");
main.setContentPane(new Main().morseConverterPane);
main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Title
main.setTitle("Morse Converter");
main.pack();
// Window position and Size
main.setBounds(100, 100, 800, 400);
// MAKE IT HAPPEN :D
main.setVisible(true);
}
// Method for converting writtenMorse
private void instantWrittenMorseConvert(){
// Gets the text from the input field
String input = inputAreaWrittenMorse.getText();
// checks if the code is a writtenMorse code
if(WrittenMorseCodeRecognization.isCode(input)) {
// converts the code into normal letters
outputAreaWrittenMorse.setText(EncodeWrittenMorseManager.getEncodedString(input));
} else {
// converts the code into writtenMorse
outputAreaWrittenMorse.setText(DecodeWrittenMorseManager.getDecodedString(input));
}
}
// Method for converting normal Morse
private void instantNormalMorseConvert(){
// Gets the text from the input field
String input = inputAreaNormalMorse.getText();
// cechs if the code is a normal Morse code
if(NormalMorseCodeRecognization.isCode(input)){
// converts the code into normal letters
outputAreaNormalMorse.setText(EncodeNormalMorseManager.getEncodedString(input));
} else {
// converts the code into writtenMorse
outputAreaNormalMorse.setText(DecodeNormalMorseManager.getDecodedString(input));
}
}
}

View file

@ -0,0 +1,245 @@
package de.marcelkapfer.c.morseconverter.engine;
/*
This is a Java application for converting writtenMorse and normal morse code.
Copyright (C) 2014-2015 Marcel Michael Kapfer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Marcel Michael Kapfer
marcelmichaelkapfer@yahoo.co.nz
*/
public class DecodeNormalMorseManager {
public static String getDecodedString(String inputMessage) {
if(inputMessage.equals("")){
return "Please enter at least one character";
} else {
StringBuffer message = new StringBuffer(inputMessage);
if (message.toString().endsWith(" ")) {
message = message.deleteCharAt(message.length() - 1);
}
// Variables
StringBuffer input = new StringBuffer();
input = input.replace(0, input.length(), message.toString().toUpperCase());
StringBuffer output = new StringBuffer();
if (input.toString().equals("LETTERSPACE")) {
output.replace(0, output.length(), " ");
} else if (input.toString().equals("END OF WORK")) {
output.replace(0, output.length(), "...-.-");
} else if (input.toString().equals("ERROR")) {
output.replace(0, output.length(), "........");
} else if (input.toString().equals("STARTING SIGNAL")) {
output.replace(0, output.length(), "-.-.-");
} else if (input.toString().equals("ENDING SIGNAL")) {
output.replace(0, output.length(), ".-.-.");
} else if (input.toString().equals("UNDERSTOOD")) {
output.replace(0, output.length(), "...-.");
} else if (input.toString().equals("WAIT")) {
output.replace(0, output.length(), ".-...");
} else if (input.toString().equals("SOS")) {
output.replace(0, output.length(), "...---...");
} else if (input.toString().equals("LETTER SPACE")) {
output.replace(0, output.length(), " ");
} else if (input.toString().equals("WORD SPACE")) {
output.replace(0, output.length(), " ");
} else {
for (int c = input.length(); c > 0; c--) {
if (input.toString().startsWith(" ")) {
if (output.toString().endsWith(" ")) {
output.delete(output.length() - 3, output.length());
}
output.append(" ");
input.delete(0, 1);
} else if (input.toString().startsWith("A")) {
output.append(".- ");
input.delete(0, 1);
} else if (input.toString().startsWith("B")) {
output.append("-... ");
input.delete(0, 1);
} else if (input.toString().startsWith("C")) {
output.append("-.-. ");
input.delete(0, 1);
} else if (input.toString().startsWith("D")) {
output.append("-.. ");
input.delete(0, 1);
} else if (input.toString().startsWith("E")) {
output.append(". ");
input.delete(0, 1);
} else if (input.toString().startsWith("F")) {
output.append("..-. ");
input.delete(0, 1);
} else if (input.toString().startsWith("G")) {
output.append("--. ");
input.delete(0, 1);
} else if (input.toString().startsWith("H")) {
output.append(".... ");
input.delete(0, 1);
} else if (input.toString().startsWith("I")) {
output.append(".. ");
input.delete(0, 1);
} else if (input.toString().startsWith("J")) {
output.append(".--- ");
input.delete(0, 1);
} else if (input.toString().startsWith("K")) {
output.append("-.- ");
input.delete(0, 1);
} else if (input.toString().startsWith("L")) {
output.append(".-.. ");
input.delete(0, 1);
} else if (input.toString().startsWith("M")) {
output.append("-- ");
input.delete(0, 1);
} else if (input.toString().startsWith("N")) {
output.append("-. ");
input.delete(0, 1);
} else if (input.toString().startsWith("O")) {
output.append("--- ");
input.delete(0, 1);
} else if (input.toString().startsWith("P")) {
output.append(".--. ");
input.delete(0, 1);
} else if (input.toString().startsWith("Q")) {
output.append("--.- ");
input.delete(0, 1);
} else if (input.toString().startsWith("R")) {
output.append(".-. ");
input.delete(0, 1);
} else if (input.toString().startsWith("S")) {
output.append("... ");
input.delete(0, 1);
} else if (input.toString().startsWith("T")) {
output.append("- ");
input.delete(0, 1);
} else if (input.toString().startsWith("U")) {
output.append("..- ");
input.delete(0, 1);
} else if (input.toString().startsWith("V")) {
output.append("...- ");
input.delete(0, 1);
} else if (input.toString().startsWith("W")) {
output.append(".-- ");
input.delete(0, 1);
} else if (input.toString().startsWith("X")) {
output.append("-..- ");
input.delete(0, 1);
} else if (input.toString().startsWith("Y")) {
output.append("-.-- ");
input.delete(0, 1);
} else if (input.toString().startsWith("Z")) {
output.append("--.. ");
input.delete(0, 1);
} else if (input.toString().startsWith("0")) {
output.append("----- ");
input.delete(0, 1);
} else if (input.toString().startsWith("1")) {
output.append(".---- ");
input.delete(0, 1);
} else if (input.toString().startsWith("2")) {
output.append("..--- ");
input.delete(0, 1);
} else if (input.toString().startsWith("3")) {
output.append("...-- ");
input.delete(0, 1);
} else if (input.toString().startsWith("4")) {
output.append("....- ");
input.delete(0, 1);
} else if (input.toString().startsWith("5")) {
output.append("..... ");
input.delete(0, 1);
} else if (input.toString().startsWith("6")) {
output.append("-.... ");
input.delete(0, 1);
} else if (input.toString().startsWith("7")) {
output.append("--... ");
input.delete(0, 1);
} else if (input.toString().startsWith("8")) {
output.append("---.. ");
input.delete(0, 1);
} else if (input.toString().startsWith("9")) {
output.append("----. ");
input.delete(0, 1);
} else if (input.toString().startsWith("Ä")) {
output.append(".-.- ");
input.delete(0, 1);
} else if (input.toString().startsWith("Ö")) {
output.append("---. ");
input.delete(0, 1);
} else if (input.toString().startsWith("Ü")) {
output.append("..-- ");
input.delete(0, 1);
} else if (input.toString().startsWith("ß")) {
output.append("...--... ");
input.delete(0, 1);
} else if (input.toString().startsWith(".")) {
output.append(".-.-.- ");
input.delete(0, 1);
} else if (input.toString().startsWith(",")) {
output.append("--..-- ");
input.delete(0, 1);
} else if (input.toString().startsWith(":")) {
output.append("---... ");
input.delete(0, 1);
} else if (input.toString().startsWith(";")) {
output.append("-.-.-. ");
input.delete(0, 1);
} else if (input.toString().startsWith("?")) {
output.append("..--.. ");
input.delete(0, 1);
} else if (input.toString().startsWith("!")) {
output.append("-.-.-- ");
input.delete(0, 1);
} else if (input.toString().startsWith("-")) {
output.append("-....- ");
input.delete(0, 1);
} else if (input.toString().startsWith("_")) {
output.append("..--.- ");
input.delete(0, 1);
} else if (input.toString().startsWith("(")) {
output.append("-.--. ");
input.delete(0, 1);
} else if (input.toString().startsWith(")")) {
output.append("-.--.- ");
input.delete(0, 1);
} else if (input.toString().startsWith("=")) {
output.append("-...- ");
input.delete(0, 1);
} else if (input.toString().startsWith("+")) {
output.append(".-.-. ");
input.delete(0, 1);
} else if (input.toString().startsWith("/")) {
output.append("-..-. ");
input.delete(0, 1);
} else if (input.toString().startsWith("@")) {
output.append(".--.-. ");
input.delete(0, 1);
} else if (input.toString().startsWith("'")) {
output.append(".----. ");
input.delete(0, 1);
} else if (input.toString().startsWith("$")) {
output.append("...-..- ");
input.delete(0, 1);
} else {
output.replace(0, output.length(), "Code not listed or wrong.");
}
}
if (output.toString().endsWith(" ")) {
output.delete(output.length() - 3, output.length());
}
}
return output.toString();
}
}
}

View file

@ -0,0 +1,246 @@
package de.marcelkapfer.c.morseconverter.engine;
/*
This is a Java application for converting writtenMorse and normal morse code.
Copyright (C) 2014-2015 Marcel Michael Kapfer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Marcel Michael Kapfer
marcelmichaelkapfer@yahoo.co.nz
*/
public class DecodeWrittenMorseManager {
public static String getDecodedString(String inputMessage) {
if(inputMessage.equals("")){
return "Please enter at least one character";
} else {
StringBuffer message = new StringBuffer(inputMessage);
if (message.toString().endsWith(" ")) {
message = message.deleteCharAt(message.length() - 1);
}
// Variables
StringBuffer input = new StringBuffer();
input = input.replace(0, input.length(), message.toString().toUpperCase());
StringBuffer output = new StringBuffer();
if (input.toString().equals("LETTERSPACE")) {
output.replace(0, output.length(), "#");
} else if (input.toString().equals("END OF WORK")) {
output.replace(0, output.length(), "000101");
} else if (input.toString().equals("ERROR")) {
output.replace(0, output.length(), "00000000");
} else if (input.toString().equals("STARTING SIGNAL")) {
output.replace(0, output.length(), "10101");
} else if (input.toString().equals("ENDING SIGNAL")) {
output.replace(0, output.length(), "01010");
} else if (input.toString().equals("UNDERSTOOD")) {
output.replace(0, output.length(), "00010");
} else if (input.toString().equals("WAIT")) {
output.replace(0, output.length(), "01000");
} else if (input.toString().equals("SOS")) {
output.replace(0, output.length(), "000111000");
} else if (input.toString().equals("LETTER SPACE")) {
output.replace(0, output.length(), "##");
} else if (input.toString().equals("WORD SPACE")) {
output.replace(0, output.length(), "+");
} else {
for (int c = input.length(); c > 0; c--) {
if (input.toString().startsWith(" ")) {
if (output.toString().endsWith("#")) {
output.delete(output.length() - 1, output.length());
}
output.append("+");
input.delete(0, 1);
} else if (input.toString().startsWith("A")) {
output.append("01#");
input.delete(0, 1);
} else if (input.toString().startsWith("B")) {
output.append("1000#");
input.delete(0, 1);
} else if (input.toString().startsWith("C")) {
output.append("1010#");
input.delete(0, 1);
} else if (input.toString().startsWith("D")) {
output.append("100#");
input.delete(0, 1);
} else if (input.toString().startsWith("E")) {
output.append("0#");
input.delete(0, 1);
} else if (input.toString().startsWith("F")) {
output.append("0010#");
input.delete(0, 1);
} else if (input.toString().startsWith("G")) {
output.append("110#");
input.delete(0, 1);
} else if (input.toString().startsWith("H")) {
output.append("0000#");
input.delete(0, 1);
} else if (input.toString().startsWith("I")) {
output.append("00#");
input.delete(0, 1);
} else if (input.toString().startsWith("J")) {
output.append("0111#");
input.delete(0, 1);
} else if (input.toString().startsWith("K")) {
output.append("101#");
input.delete(0, 1);
} else if (input.toString().startsWith("L")) {
output.append("0100#");
input.delete(0, 1);
} else if (input.toString().startsWith("M")) {
output.append("11#");
input.delete(0, 1);
} else if (input.toString().startsWith("N")) {
output.append("10#");
input.delete(0, 1);
} else if (input.toString().startsWith("O")) {
output.append("111#");
input.delete(0, 1);
} else if (input.toString().startsWith("P")) {
output.append("0110#");
input.delete(0, 1);
} else if (input.toString().startsWith("Q")) {
output.append("1101#");
input.delete(0, 1);
} else if (input.toString().startsWith("R")) {
output.append("010#");
input.delete(0, 1);
} else if (input.toString().startsWith("S")) {
output.append("000#");
input.delete(0, 1);
} else if (input.toString().startsWith("T")) {
output.append("1#");
input.delete(0, 1);
} else if (input.toString().startsWith("U")) {
output.append("001#");
input.delete(0, 1);
} else if (input.toString().startsWith("V")) {
output.append("0001#");
input.delete(0, 1);
} else if (input.toString().startsWith("W")) {
output.append("011#");
input.delete(0, 1);
} else if (input.toString().startsWith("X")) {
output.append("1001#");
input.delete(0, 1);
} else if (input.toString().startsWith("Y")) {
output.append("1011#");
input.delete(0, 1);
} else if (input.toString().startsWith("Z")) {
output.append("1100#");
input.delete(0, 1);
} else if (input.toString().startsWith("0")) {
output.append("11111#");
input.delete(0, 1);
} else if (input.toString().startsWith("1")) {
output.append("01111#");
input.delete(0, 1);
} else if (input.toString().startsWith("2")) {
output.append("00111#");
input.delete(0, 1);
} else if (input.toString().startsWith("3")) {
output.append("00011#");
input.delete(0, 1);
} else if (input.toString().startsWith("4")) {
output.append("00001#");
input.delete(0, 1);
} else if (input.toString().startsWith("5")) {
output.append("00000#");
input.delete(0, 1);
} else if (input.toString().startsWith("6")) {
output.append("10000#");
input.delete(0, 1);
} else if (input.toString().startsWith("7")) {
output.append("11000#");
input.delete(0, 1);
} else if (input.toString().startsWith("8")) {
output.append("11100#");
input.delete(0, 1);
} else if (input.toString().startsWith("9")) {
output.append("11110#");
input.delete(0, 1);
} else if (input.toString().startsWith("Ä")) {
output.append("0101#");
input.delete(0, 1);
} else if (input.toString().startsWith("Ö")) {
output.append("1110#");
input.delete(0, 1);
} else if (input.toString().startsWith("Ü")) {
output.append("0011#");
input.delete(0, 1);
} else if (input.toString().startsWith("ß")) {
output.append("00011000#");
input.delete(0, 1);
} else if (input.toString().startsWith(".")) {
output.append("010101#");
input.delete(0, 1);
} else if (input.toString().startsWith(",")) {
output.append("110011#");
input.delete(0, 1);
} else if (input.toString().startsWith(":")) {
output.append("111000#");
input.delete(0, 1);
} else if (input.toString().startsWith(";")) {
output.append("101010#");
input.delete(0, 1);
} else if (input.toString().startsWith("?")) {
output.append("001100#");
input.delete(0, 1);
} else if (input.toString().startsWith("!")) {
output.append("101011#");
input.delete(0, 1);
} else if (input.toString().startsWith("-")) {
output.append("100001#");
input.delete(0, 1);
} else if (input.toString().startsWith("_")) {
output.append("001101#");
input.delete(0, 1);
} else if (input.toString().startsWith("(")) {
output.append("10110#");
input.delete(0, 1);
} else if (input.toString().startsWith(")")) {
output.append("101101#");
input.delete(0, 1);
} else if (input.toString().startsWith("=")) {
output.append("10001#");
input.delete(0, 1);
} else if (input.toString().startsWith("+")) {
output.append("01010#");
input.delete(0, 1);
} else if (input.toString().startsWith("/")) {
output.append("10010#");
input.delete(0, 1);
} else if (input.toString().startsWith("@")) {
output.append("011010#");
input.delete(0, 1);
} else if (input.toString().startsWith("'")) {
output.append("011110#");
input.delete(0, 1);
} else if (input.toString().startsWith("$")) {
output.append("0001001#");
input.delete(0, 1);
} else {
output.replace(0, output.length(), "Code not listed or wrong.");
}
}
if (output.toString().endsWith("#")) {
output.delete(output.length() - 1, output.length());
}
}
return output.toString();
}
}
}

View file

@ -0,0 +1,196 @@
package de.marcelkapfer.c.morseconverter.engine;
/*
This is a Java application for converting writtenMorse and normal morse code.
Copyright (C) 2014-2015 Marcel Michael Kapfer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Marcel Michael Kapfer
marcelmichaelkapfer@yahoo.co.nz
*/
/*
* Code for converting morse code into latin letters
*/
public class EncodeNormalMorseManager {
public static String getEncodedString(String inputMessage) {
if(inputMessage.equals("")){
return "Please enter at least one character";
} else {
// Converts the input string into a StringBuffer
StringBuffer message = new StringBuffer(inputMessage);
// Delete the space at the end which is automatically set through some keyboards
if (message.toString().endsWith(" ")) {
message = message.deleteCharAt(message.length() - 1);
}
// Declaring variables
String input;
StringBuffer output = new StringBuffer();
input = message.toString() + " ";
StringBuffer inputToSign = new StringBuffer(input);
while (!inputToSign.toString().equals(" ")) {
int d = 0;
boolean signFull = true;
StringBuffer sign = new StringBuffer();
while (signFull) {
if (inputToSign.toString().startsWith(" ")) {
output.append(" ");
inputToSign.delete(d, d + 7);
} else if (inputToSign.toString().substring(d, d + 3).equals(" ")) {
if (d == 0) {
inputToSign.delete(0, 3);
} else {
sign.replace(0, sign.length(), inputToSign
.toString().substring(0, d));
inputToSign.delete(0, d);
signFull = false;
}
} else {
d++;
}
}
if (sign.toString().equals(".-")) {
output.append("A");
} else if (sign.toString().equals("-...")) {
output.append("B");
} else if (sign.toString().equals("-.-.")) {
output.append("C");
} else if (sign.toString().equals("-..")) {
output.append("D");
} else if (sign.toString().equals(".")) {
output.append("E");
} else if (sign.toString().equals("..-.")) {
output.append("F");
} else if (sign.toString().equals("--.")) {
output.append("G");
} else if (sign.toString().equals("....")) {
output.append("H");
} else if (sign.toString().equals("..")) {
output.append("I");
} else if (sign.toString().equals(".---")) {
output.append("J");
} else if (sign.toString().equals("-.-")) {
output.append("K");
} else if (sign.toString().equals(".-..")) {
output.append("L");
} else if (sign.toString().equals("--")) {
output.append("M");
} else if (sign.toString().equals("-.")) {
output.append("N");
} else if (sign.toString().equals("---")) {
output.append("O");
} else if (sign.toString().equals(".--.")) {
output.append("P");
} else if (sign.toString().equals("--.-")) {
output.append("Q");
} else if (sign.toString().equals(".-.")) {
output.append("R");
} else if (sign.toString().equals("...")) {
output.append("S");
} else if (sign.toString().equals("-")) {
output.append("T");
} else if (sign.toString().equals("..-")) {
output.append("U");
} else if (sign.toString().equals("...-")) {
output.append("V");
} else if (sign.toString().equals(".--")) {
output.append("W");
} else if (sign.toString().equals("-..-")) {
output.append("X");
} else if (sign.toString().equals("-.--")) {
output.append("Y");
} else if (sign.toString().equals("--..")) {
output.append("Z");
} else if (sign.toString().equals("-----")) {
output.append(". (zero)");
} else if (sign.toString().equals(".----")) {
output.append("-");
} else if (sign.toString().equals("..---")) {
output.append("2");
} else if (sign.toString().equals("...--")) {
output.append("3");
} else if (sign.toString().equals("....-")) {
output.append("4");
} else if (sign.toString().equals(".....")) {
output.append("5");
} else if (sign.toString().equals("-....")) {
output.append("6");
} else if (sign.toString().equals("--...")) {
output.append("7");
} else if (sign.toString().equals("---..")) {
output.append("8");
} else if (sign.toString().equals("----.")) {
output.append("9");
} else if (sign.toString().equals(".-.-")) {
output.append("Ä");
} else if (sign.toString().equals("---.")) {
output.append("Ö");
} else if (sign.toString().equals("..--")) {
output.append("Ü");
} else if (sign.toString().equals("...--...")) {
output.append("ß");
} else if (sign.toString().equals("----")) {
output.append("CH");
} else if (sign.toString().equals(".-.-.-")) {
output.append(".");
} else if (sign.toString().equals("--..--")) {
output.append(",");
} else if (sign.toString().equals("---...")) {
output.append(":");
} else if (sign.toString().equals("-.-.-.")) {
output.append(";");
} else if (sign.toString().equals("..--..")) {
output.append("?");
} else if (sign.toString().equals("-.-.--")) {
output.append("!");
} else if (sign.toString().equals("-....-")) {
output.append("-");
} else if (sign.toString().equals("..--.-")) {
output.append("_");
} else if (sign.toString().equals("-.--.")) {
output.append("(");
} else if (sign.toString().equals("-.--.-")) {
output.append(")");
} else if (sign.toString().equals(".----.")) {
output.append("'");
} else if (sign.toString().equals("-...-")) {
output.append("=");
} else if (sign.toString().equals(".-.-.")) {
output.append("+ or End of the signal");
} else if (sign.toString().equals("-..-.")) {
output.append("/");
} else if (sign.toString().equals(".--.-.")) {
output.append("@");
} else if (sign.toString().equals("-.-.-")) {
output.append("Begin of the signal");
} else if (sign.toString().equals("-...-")) {
output.append("Wait");
} else if (sign.toString().equals("...-.")) {
output.append("Understood");
} else if (sign.toString().equals("...-.-")) {
output.append("End of work");
} else if (sign.toString().equals("...---...")) {
output.append("SOS");
} else if (sign.toString().equals("........")) {
output.append("Error");
} else {
output.replace(0, output.length(), "Code not listed or wrong.");
}
}
return output.toString();
}
}
}

View file

@ -0,0 +1,197 @@
package de.marcelkapfer.c.morseconverter.engine;
/*
This is a Java application for converting writtenMorse and normal morse code.
Copyright (C) 2014-2015 Marcel Michael Kapfer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Marcel Michael Kapfer
marcelmichaelkapfer@yahoo.co.nz
*/
/*
* Code for converting writtenMorse to latin letters
*/
public class EncodeWrittenMorseManager {
public static String getEncodedString(String inputMessage) {
if(inputMessage.equals("")){
return "Please enter at least one character";
} else {
StringBuffer message = new StringBuffer(inputMessage);
if (message.toString().endsWith(" ")) {
message = message.deleteCharAt(message.length() - 1);
}
// Variables
String input;
StringBuffer output = new StringBuffer();
input = message.toString().toUpperCase() + "#";
StringBuffer inputToSign = new StringBuffer(input);
while (!inputToSign.toString().equals("#")) {
int d = 0;
boolean signFull = true;
StringBuffer sign = new StringBuffer();
while (signFull) {
if (inputToSign.toString().charAt(d) == '+'
|| inputToSign.toString().charAt(d) == '#') {
if (d == 0) {
if (inputToSign.toString().startsWith("+")) {
output.append(" ");
}
inputToSign.deleteCharAt(0);
} else {
sign.replace(0, sign.length(), inputToSign
.toString().substring(0, d));
inputToSign.delete(0, d);
signFull = false;
}
} else {
d++;
}
}
if (sign.toString().equals("01")) {
output.append("A");
} else if (sign.toString().equals("1000")) {
output.append("B");
} else if (sign.toString().equals("1010")) {
output.append("C");
} else if (sign.toString().equals("100")) {
output.append("D");
} else if (sign.toString().equals("0")) {
output.append("E");
} else if (sign.toString().equals("0010")) {
output.append("F");
} else if (sign.toString().equals("110")) {
output.append("G");
} else if (sign.toString().equals("0000")) {
output.append("H");
} else if (sign.toString().equals("00")) {
output.append("I");
} else if (sign.toString().equals("0111")) {
output.append("J");
} else if (sign.toString().equals("101")) {
output.append("K");
} else if (sign.toString().equals("0100")) {
output.append("L");
} else if (sign.toString().equals("11")) {
output.append("M");
} else if (sign.toString().equals("10")) {
output.append("N");
} else if (sign.toString().equals("111")) {
output.append("O");
} else if (sign.toString().equals("0110")) {
output.append("P");
} else if (sign.toString().equals("1101")) {
output.append("Q");
} else if (sign.toString().equals("010")) {
output.append("R");
} else if (sign.toString().equals("000")) {
output.append("S");
} else if (sign.toString().equals("1")) {
output.append("T");
} else if (sign.toString().equals("001")) {
output.append("U");
} else if (sign.toString().equals("0001")) {
output.append("V");
} else if (sign.toString().equals("011")) {
output.append("W");
} else if (sign.toString().equals("1001")) {
output.append("X");
} else if (sign.toString().equals("1011")) {
output.append("Y");
} else if (sign.toString().equals("1100")) {
output.append("Z");
} else if (sign.toString().equals("11111")) {
output.append("0 (zero)");
} else if (sign.toString().equals("01111")) {
output.append("1");
} else if (sign.toString().equals("00111")) {
output.append("2");
} else if (sign.toString().equals("00011")) {
output.append("3");
} else if (sign.toString().equals("00001")) {
output.append("4");
} else if (sign.toString().equals("00000")) {
output.append("5");
} else if (sign.toString().equals("10000")) {
output.append("6");
} else if (sign.toString().equals("11000")) {
output.append("7");
} else if (sign.toString().equals("11100")) {
output.append("8");
} else if (sign.toString().equals("11110")) {
output.append("9");
} else if (sign.toString().equals("0101")) {
output.append("Ä");
} else if (sign.toString().equals("1110")) {
output.append("Ö");
} else if (sign.toString().equals("0011")) {
output.append("Ü");
} else if (sign.toString().equals("00011000")) {
output.append("ß");
} else if (sign.toString().equals("1111")) {
output.append("CH");
} else if (sign.toString().equals("010101")) {
output.append(".");
} else if (sign.toString().equals("110011")) {
output.append(",");
} else if (sign.toString().equals("111000")) {
output.append(":");
} else if (sign.toString().equals("101010")) {
output.append(";");
} else if (sign.toString().equals("001100")) {
output.append("?");
} else if (sign.toString().equals("101011")) {
output.append("!");
} else if (sign.toString().equals("100001")) {
output.append("-");
} else if (sign.toString().equals("001101")) {
output.append("_");
} else if (sign.toString().equals("10110")) {
output.append("(");
} else if (sign.toString().equals("101101")) {
output.append(")");
} else if (sign.toString().equals("011110")) {
output.append("'");
} else if (sign.toString().equals("10001")) {
output.append("=");
} else if (sign.toString().equals("01010")) {
output.append("+ or End of the signal");
} else if (sign.toString().equals("10010")) {
output.append("/");
} else if (sign.toString().equals("011010")) {
output.append("@");
} else if (sign.toString().equals("10101")) {
output.append("Begin of the signal");
} else if (sign.toString().equals("10001")) {
output.append("Wait");
} else if (sign.toString().equals("00010")) {
output.append("Understood");
} else if (sign.toString().equals("000101")) {
output.append("End of work");
} else if (sign.toString().equals("000111000")) {
output.append("SOS");
} else if (sign.toString().equals("00000000")) {
output.append("Error");
} else {
output.replace(0, output.length(), "Code not listed or wrong.");
}
}
return output.toString();
}
}
}

View file

@ -0,0 +1,64 @@
package de.marcelkapfer.c.morseconverter.intelligentCodeRecognization;
/*
This is a Java application for converting writtenMorse and normal morse code.
Copyright (C) 2014-2015 Marcel Michael Kapfer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Marcel Michael Kapfer
marcelmichaelkapfer@yahoo.co.nz
*/
/**
* Created by mmk on 5/31/15.
*/
public class NormalMorseCodeRecognization {
public static Boolean isCode(String input){
input = input.toLowerCase();
if(input.contains("a") || input.contains("b") ||
input.contains("c") || input.contains("d") ||
input.contains("e") || input.contains("f") ||
input.contains("g") || input.contains("h") ||
input.contains("i") || input.contains("j") ||
input.contains("k") || input.contains("l") ||
input.contains("m") || input.contains("n") ||
input.contains("o") || input.contains("p") ||
input.contains("q") || input.contains("r") ||
input.contains("s") || input.contains("t") ||
input.contains("u") || input.contains("v") ||
input.contains("w") || input.contains("x") ||
input.contains("y") || input.contains("z") ||
input.contains("0") || input.contains("1") ||
input.contains("2") || input.contains("3") ||
input.contains("4") || input.contains("5") ||
input.contains("6") || input.contains("7") ||
input.contains("8") || input.contains("9") ||
input.contains("Ä") || input.contains("Ö") ||
input.contains("Ü") || input.contains("ß") ||
input.contains("$") || input.contains(",") ||
input.contains(":") || input.contains(";") ||
input.contains("!") || input.contains("?") ||
input.contains("+") || input.contains("_") ||
input.contains("(") || input.contains(")") ||
input.contains("=") || input.contains("/") ||
input.contains("@") || input.contains("'")){
return false;
} else {
return true;
}
}
}

View file

@ -0,0 +1,64 @@
package de.marcelkapfer.c.morseconverter.intelligentCodeRecognization;
/*
This is a Java application for converting writtenMorse and normal morse code.
Copyright (C) 2014-2015 Marcel Michael Kapfer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Marcel Michael Kapfer
marcelmichaelkapfer@yahoo.co.nz
*/
/**
* Created by mmk on 5/31/15.
*/
public class WrittenMorseCodeRecognization {
public static Boolean isCode(String input){
input = input.toLowerCase();
if(input.contains("a") || input.contains("b") ||
input.contains("c") || input.contains("d") ||
input.contains("e") || input.contains("f") ||
input.contains("g") || input.contains("h") ||
input.contains("i") || input.contains("j") ||
input.contains("k") || input.contains("l") ||
input.contains("m") || input.contains("n") ||
input.contains("o") || input.contains("p") ||
input.contains("q") || input.contains("r") ||
input.contains("s") || input.contains("t") ||
input.contains("u") || input.contains("v") ||
input.contains("w") || input.contains("x") ||
input.contains("y") || input.contains("z") ||
input.contains("2") || input.contains("3") ||
input.contains("4") || input.contains("5") ||
input.contains("6") || input.contains("7") ||
input.contains("8") || input.contains("9") ||
input.contains("Ä") || input.contains("Ö") ||
input.contains("Ü") || input.contains("ß") ||
input.contains(".") || input.contains(",") ||
input.contains(":") || input.contains(";") ||
input.contains("!") || input.contains("?") ||
input.contains("-") || input.contains("_") ||
input.contains("(") || input.contains(")") ||
input.contains("=") || input.contains("/") ||
input.contains("@") || input.contains("'") ||
input.contains("$")){
return false;
} else {
return true;
}
}
}