3.0 Release - Details in README.md

This commit is contained in:
NotAlexNoyle committed 2017-11-22 01:44:35 -05:00
1 parent 73c0fa5b95
commit cb6486b011
7 files changed
+89 -15

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="Eobard/src"/>
<classpathentry kind="lib" path="Eobard.jar"/>
<classpathentry kind="output" path="Eobard/bin"/>
</classpath>
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Eobard</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
/eobard/
Binary file not shown.
+42 -11
View File
@@ -10,25 +10,56 @@ public class Eobard {
// init main
public static void main(String[] args) {
// Receives and stores string from user
String stringToReverse = JOptionPane.showInputDialog(null, "String To Reverse:");
// Receives text input from user and stores it in a string
String stringToReverse = JOptionPane.showInputDialog(null, "Text To Reverse:", "Eobard", JOptionPane.INFORMATION_MESSAGE);
// Calls stringReverser method and stores output as String
String result = stringReverser(stringToReverse);
// Displays result to user
JOptionPane.showMessageDialog(null, result);
// Keeps track of whether or not the user input is blank
boolean isPopulated = false;
// Runs while user input is blank
while(isPopulated == false) {
// Checks individual characters to see if they are comprised of only whitespace
for(int i = 0; i < stringToReverse.length(); i++) {
// If a non-whitespace character is found, the loop will stop next time
if(Character.isWhitespace(stringToReverse.charAt(i)) == false) {
// Breaks out of loops when user input contains non-whitespace characters
isPopulated = true;
}
}
// Runs if user input is not whitespace
if(isPopulated) {
// Calls stringReverser method and stores output as String
String result = stringReverser(stringToReverse);
// Displays result to user (with formatting)
JOptionPane.showConfirmDialog(null, new Object[]{"Reversed Text: ", result}, "Eobard", JOptionPane.DEFAULT_OPTION);
}
// Runs if user input is whitespace
else {
// Asks user to re-enter their input so that it is not blank (until it is or the user closes the program). Passes the value to original input string for re-evaluation
stringToReverse = JOptionPane.showInputDialog(null, "You left the search field blank, please try again:", "Eobard", JOptionPane.INFORMATION_MESSAGE);
}
}
}
// Main string reverser method (functionality of program)
// String manipulation method
public static String stringReverser(String stringMessenger) {
// Declare character array that is equal to the length of the string
char[] stringReverserArray = new char[stringMessenger.length()];
// Declares 'i' to count down, and j to count up, thus, allowing the program to manipulate characters both forward and backward
// // includes correction for zero index(s)
// Declares 'i' to count down, and j to count up, thus, allowing the program to manipulate characters both forward and backward. Includes correction for zero index(s)
for(int i = stringMessenger.length() - 1, j = 0; i > -1; i--) {
// Adds characters from the length of the string to zero to the index of stringReverserList in the reverse counting direction
@@ -39,7 +70,7 @@ public class Eobard {
}
// Purges first half of string (unreversed section)
// Purges first half of string (non-reversed section)
stringMessenger = stringMessenger.substring((stringMessenger.length() / 2), stringMessenger.length());
// Returns string in question
+22 -4
View File
@@ -1,17 +1,35 @@
# Eobard
This task can be done in much less lines and much less visual complexity by using the "StringBuilder" class, but I wanted to build it on my own to practice writing Java, so the only thing I allowed myself to use is basic programmatic operations.
An Java desktop application for reversing any text quickly and elegantly. Built with elementaryOS.
Changelog:
- Version 2.0 - The much unexpected release! Eobard is now completely refactored and documented. This version eliminates the need for the "ArrayList" library, and now the only non-default library used is JOptionPane. I also fixed the readme a bit.
- Version 3.0:
- Changed GUI to use "text" terminology rather than "string".
- Completely refactored input validation to check for input comprised entirely of whitespace.
- Added more documentation
- Fancified input dialog boxes
- Branded as actual application instead of practice code
- Added TODO section
- Added new screenshots
- Version 2.0 - The much unexpected release! Eobard is now completely refactored and documented. This version eliminates the need for the "ArrayList" library, and now the only non-default library used is JOptionPane. I also fixed the readme a bit.
- Version 1.0 - Initial Release
TO-DO:
- Polish input dialog boxes even more.
- Handle exits (close / cancel operations) better.
- Add custom icons and simpler install/launch procedures.
Screenshots:
![First Launch](http://i.imgur.com/aGiGjwJ.png)
![First Launch](https://i.imgur.com/17Umd6n.png)
![Result](http://i.imgur.com/aG123cc.png)
![Input Validation Error](https://i.imgur.com/BX2STou.png)
![Result](https://i.imgur.com/l1iMu2H.png)
To run: