Skip to content

Commit 538d2dc

Browse files
committed
Quick indentation cleanuped
1 parent 209975a commit 538d2dc

File tree

8 files changed

+483
-483
lines changed

8 files changed

+483
-483
lines changed

build.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<import file="nbproject/build-impl.xml"/>
1313
<!--
1414
15-
There exist several targets which are by default empty and which can be
16-
used for execution of your tasks. These targets are usually executed
17-
before and after some main targets. They are:
15+
There exist several targets which are by default empty and which can be
16+
used for execution of your tasks. These targets are usually executed
17+
before and after some main targets. They are:
1818
1919
-pre-init: called before initialization of project properties
2020
-post-init: called after initialization of project properties
@@ -40,19 +40,19 @@
4040
</obfuscate>
4141
</target>
4242
43-
For list of available properties check the imported
44-
nbproject/build-impl.xml file.
43+
For list of available properties check the imported
44+
nbproject/build-impl.xml file.
4545
4646
4747
Another way to customize the build is by overriding existing main targets.
48-
The targets of interest are:
48+
The targets of interest are:
4949
5050
-init-macrodef-javac: defines macro for javac compilation
5151
-init-macrodef-junit: defines macro for junit execution
5252
-init-macrodef-debug: defines macro for class debugging
5353
-init-macrodef-java: defines macro for class execution
5454
-do-jar: JAR building
55-
run: execution of project
55+
run: execution of project
5656
-javadoc-build: Javadoc generation
5757
test-report: JUnit report generation
5858
@@ -64,10 +64,10 @@
6464
</exec>
6565
</target>
6666
67-
Notice that the overridden target depends on the jar target and not only on
68-
the compile target as the regular run target does. Again, for a list of available
67+
Notice that the overridden target depends on the jar target and not only on
68+
the compile target as the regular run target does. Again, for a list of available
6969
properties which you can use, check the target you are overriding in the
70-
nbproject/build-impl.xml file.
70+
nbproject/build-impl.xml file.
7171
7272
-->
7373
</project>

nbproject/build-impl.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ is divided into following sections:
2828
</condition>
2929
</fail>
3030
<target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
31-
<!--
31+
<!--
3232
======================
33-
INITIALIZATION SECTION
33+
INITIALIZATION SECTION
3434
======================
3535
-->
3636
<target name="-pre-init">

src/simplejavatexteditor/About.java

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* @license Apache (http://www.apache.org/licenses/LICENSE-2.0)
1010
* @create 2012-05-04
1111
* @update 2015-09-4
12-
*
13-
*
12+
*
13+
*
1414
* @modifiedby Achintha Gunasekara
1515
* @modweb http://www.achinthagunasekara.com
1616
* @modemail [email protected]
@@ -27,46 +27,46 @@ public class About {
2727
private final JPanel panel;
2828
private String contentText;
2929
private final JLabel text;
30-
31-
public About() {
32-
panel = new JPanel(new FlowLayout());
33-
panel.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
34-
frame = new JFrame();
35-
frame.setVisible(true);
36-
frame.setSize(500,300);
37-
text = new JLabel();
38-
}
39-
40-
public void me() {
41-
frame.setTitle("About Me - " + SimpleJavaTextEditor.NAME);
42-
43-
contentText =
44-
"<html><body><p>" +
45-
"Author: Pierre-Henry Soria<br />" +
46-
"Contact me at: " +
47-
"<a href='mailto:" + SimpleJavaTextEditor.AUTHOR_EMAIL + "?subject=About the NotePad PH Software'>" + SimpleJavaTextEditor.AUTHOR_EMAIL + "</a>" +
30+
31+
public About() {
32+
panel = new JPanel(new FlowLayout());
33+
panel.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
34+
frame = new JFrame();
35+
frame.setVisible(true);
36+
frame.setSize(500,300);
37+
text = new JLabel();
38+
}
39+
40+
public void me() {
41+
frame.setTitle("About Me - " + SimpleJavaTextEditor.NAME);
42+
43+
contentText =
44+
"<html><body><p>" +
45+
"Author: Pierre-Henry Soria<br />" +
46+
"Contact me at: " +
47+
"<a href='mailto:" + SimpleJavaTextEditor.AUTHOR_EMAIL + "?subject=About the NotePad PH Software'>" + SimpleJavaTextEditor.AUTHOR_EMAIL + "</a>" +
4848
"<br /><br />" +
4949
"Modified By: Achintha Gunasekara<br />" +
5050
"Contact me at: <a href='mailto:" + SimpleJavaTextEditor.EDITOR_EMAIL + "?subject=About the NotePad PH Software'>" + SimpleJavaTextEditor.EDITOR_EMAIL + "</a>" +
51-
"</p></body></html>";
52-
53-
text.setText(contentText);
54-
panel.add(text);
55-
frame.add(panel);
56-
}
57-
58-
public void software() {
59-
frame.setTitle("About Me - " + SimpleJavaTextEditor.NAME);
60-
61-
contentText =
62-
"<html><body><p>" +
63-
"Name: " + SimpleJavaTextEditor.NAME + "<br />" +
64-
"Version: " + SimpleJavaTextEditor.VERSION +
65-
"</p></body></html>";
66-
67-
text.setText(contentText);
68-
panel.add(text);
69-
frame.add(panel);
70-
}
71-
51+
"</p></body></html>";
52+
53+
text.setText(contentText);
54+
panel.add(text);
55+
frame.add(panel);
56+
}
57+
58+
public void software() {
59+
frame.setTitle("About Me - " + SimpleJavaTextEditor.NAME);
60+
61+
contentText =
62+
"<html><body><p>" +
63+
"Name: " + SimpleJavaTextEditor.NAME + "<br />" +
64+
"Version: " + SimpleJavaTextEditor.VERSION +
65+
"</p></body></html>";
66+
67+
text.setText(contentText);
68+
panel.add(text);
69+
frame.add(panel);
70+
}
71+
7272
}

src/simplejavatexteditor/AutoComplete.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,21 @@ public void insertUpdate(DocumentEvent e) {
105105
//Before checking for a keyword
106106
checkForBracket();
107107

108-
//Get the beginning of the word being typed
108+
//Get the beginning of the word being typed
109109
int start;
110110
for (start = pos; start >= 0; start--) {
111111
if (!Character.isLetter(content.charAt(start))) {
112112
break;
113113
}
114114
}
115115

116-
//Auto complete will start
116+
//Auto complete will start
117117
//after two characters are typed
118118
if (pos - start < 2) {
119119
return;
120120
}
121121

122-
//Search for a match on the word being typed
122+
//Search for a match on the word being typed
123123
//in the keywords ArrayList
124124
String prefix = content.substring(start + 1);
125125
int n = Collections.binarySearch(words, prefix);
@@ -139,7 +139,7 @@ public void insertUpdate(DocumentEvent e) {
139139
}
140140

141141
/**
142-
* Performs a check to see if the last
142+
* Performs a check to see if the last
143143
* key typed was one of the supported
144144
* bracket characters
145145
*/
@@ -176,7 +176,7 @@ private void setKeywords(String keyword) {
176176
}
177177

178178
/**
179-
* Handles the auto complete suggestion
179+
* Handles the auto complete suggestion
180180
* generated when the user is typing a
181181
* word that matches a keyword.
182182
*/

src/simplejavatexteditor/FEdit.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* @license Apache (http://www.apache.org/licenses/LICENSE-2.0)
1010
* @create 2012-05-04
1111
* @update 2015-09-4
12-
*
13-
*
12+
*
13+
*
1414
* @modifiedby Achintha Gunasekara
1515
* @modweb http://www.achinthagunasekara.com
1616
* @modemail [email protected]
@@ -22,8 +22,8 @@
2222

2323
public class FEdit {
2424

25-
public static void clear(JTextArea textArea) {
26-
textArea.setText("");
27-
}
28-
25+
public static void clear(JTextArea textArea) {
26+
textArea.setText("");
27+
}
28+
2929
}

src/simplejavatexteditor/Find.java

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* @license Apache (http://www.apache.org/licenses/LICENSE-2.0)
1010
* @create 2012-05-04
1111
* @update 2015-09-4
12-
*
13-
*
12+
*
13+
*
1414
* @modifiedby Achintha Gunasekara
1515
* @modweb http://www.achinthagunasekara.com
1616
* @modemail [email protected]
@@ -26,18 +26,18 @@
2626

2727
public class Find extends JFrame implements ActionListener {
2828

29-
private static final long serialVersionUID = 1L;
30-
int startIndex=0;
29+
private static final long serialVersionUID = 1L;
30+
int startIndex=0;
3131
int select_start=-1;
3232
JLabel lab1, lab2;
3333
JTextField textF, textR;
34-
JButton findBtn, findNext, replace, replaceAll, cancel;
34+
JButton findBtn, findNext, replace, replaceAll, cancel;
3535
private JTextArea txt;
36-
37-
38-
public Find(JTextArea text) {
39-
this.txt = text;
40-
36+
37+
38+
public Find(JTextArea text) {
39+
this.txt = text;
40+
4141
lab1 = new JLabel("Find:");
4242
lab2 = new JLabel("Replace:");
4343
textF = new JTextField(30);
@@ -47,14 +47,14 @@ public Find(JTextArea text) {
4747
replace = new JButton("Replace");
4848
replaceAll = new JButton("Replace All");
4949
cancel = new JButton("Cancel");
50-
50+
5151
// Set Layout NULL
5252
setLayout(null);
53-
53+
5454
// Set the width and height of the label
5555
int labWidth = 80;
5656
int labHeight = 20;
57-
57+
5858
// Adding labels
5959
lab1.setBounds(10,10, labWidth, labHeight);
6060
add(lab1);
@@ -64,45 +64,45 @@ public Find(JTextArea text) {
6464
add(lab2);
6565
textR.setBounds(10+labWidth, 10+labHeight+10, 120, 20);
6666
add(textR);
67-
67+
6868
// Adding buttons
6969
findBtn.setBounds(225, 6, 115, 20);
7070
add(findBtn);
7171
findBtn.addActionListener(this);
72-
72+
7373
findNext.setBounds(225, 28, 115, 20);
7474
add(findNext);
7575
findNext.addActionListener(this);
76-
76+
7777
replace.setBounds(225, 50, 115, 20);
7878
add(replace);
7979
replace.addActionListener(this);
80-
80+
8181
replaceAll.setBounds(225, 72, 115, 20);
8282
add(replaceAll);
8383
replaceAll.addActionListener(this);
84-
84+
8585
cancel.setBounds(225, 94, 115, 20);
8686
add(cancel);
8787
cancel.addActionListener(this);
88-
89-
88+
89+
9090
// Set the width and height of the window
9191
int width = 360;
9292
int height = 160;
93-
93+
9494
// Set size window
9595
setSize(width,height);
96-
96+
9797
// Set window position
9898
Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
9999
setLocation(center.x-width/2, center.y-height/2);
100100
setVisible(true);
101-
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
101+
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
102102
}
103-
103+
104104
public void find() {
105-
select_start = txt.getText().toLowerCase().indexOf(textF.getText().toLowerCase());
105+
select_start = txt.getText().toLowerCase().indexOf(textF.getText().toLowerCase());
106106
if(select_start == -1)
107107
{
108108
startIndex = 0;
@@ -112,11 +112,11 @@ public void find() {
112112
if(select_start == txt.getText().toLowerCase().lastIndexOf(textF.getText().toLowerCase()))
113113
{
114114
startIndex = 0;
115-
}
115+
}
116116
int select_end = select_start + textF.getText().length();
117117
txt.select(select_start, select_end);
118118
}
119-
119+
120120
public void findNext() {
121121
String selection = txt.getSelectedText();
122122
try
@@ -142,7 +142,7 @@ public void findNext() {
142142
int select_end = select_start+selection.length();
143143
txt.select(select_start, select_end);
144144
startIndex = select_end+1;
145-
145+
146146
if(select_start == txt.getText().toLowerCase().lastIndexOf(selection.toLowerCase()))
147147
{
148148
startIndex = 0;
@@ -151,7 +151,7 @@ public void findNext() {
151151
catch(NullPointerException e)
152152
{}
153153
}
154-
154+
155155
public void replace() {
156156
try
157157
{
@@ -162,10 +162,10 @@ public void replace() {
162162
catch(NullPointerException e)
163163
{
164164
System.out.print("Null Pointer Exception: "+e);
165-
}
165+
}
166166
}
167-
168-
public void replaceAll() {
167+
168+
public void replaceAll() {
169169
txt.setText(txt.getText().toLowerCase().replaceAll(textF.getText().toLowerCase(), textR.getText()));
170170
}
171171

@@ -191,5 +191,5 @@ else if(e.getSource() == cancel)
191191
this.setVisible(false);
192192
}
193193
}
194-
194+
195195
}

0 commit comments

Comments
 (0)