Skip to content

Commit 94d106b

Browse files
authored
Merge pull request #54 from FridaTveit/RemoveUnneededThisInFrameHelp
Issue #41: Removed unneeded uses of 'this' in FrameHelp
2 parents 57ad195 + 3ed6f14 commit 94d106b

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/main/java/net/sf/javaanpr/gui/windows/FrameHelp.java

+26-26
Original file line numberDiff line numberDiff line change
@@ -47,57 +47,57 @@ public enum MODE {
4747
* @throws IOException in case the file to show in given mode failed to load
4848
*/
4949
public FrameHelp(MODE mode) throws IOException { // TODO javadoc
50-
this.initComponents();
50+
initComponents();
5151
this.mode = mode;
5252
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
53-
int width = this.getWidth();
54-
int height = this.getHeight();
55-
this.setLocation((screenSize.width - width) / 2, (screenSize.height - height) / 2);
53+
int width = getWidth();
54+
int height = getHeight();
55+
setLocation((screenSize.width - width) / 2, (screenSize.height - height) / 2);
5656
if (mode == MODE.SHOW_ABOUT) {
5757
URL url = getClass().getResource(Configurator.getConfigurator().getPathProperty("help_file_about"));
58-
this.editorPane.setPage(url);
58+
editorPane.setPage(url);
5959
} else if (mode == MODE.SHOW_HELP) {
6060
URL url = getClass().getResource(Configurator.getConfigurator().getPathProperty("help_file_help"));
61-
this.editorPane.setPage(url);
61+
editorPane.setPage(url);
6262
}
63-
this.setVisible(true);
63+
setVisible(true);
6464
}
6565

6666
private void initComponents() {
67-
this.jScrollPane1 = new JScrollPane();
68-
this.editorPane = new JEditorPane();
69-
this.helpWindowClose = new JButton();
67+
jScrollPane1 = new JScrollPane();
68+
editorPane = new JEditorPane();
69+
helpWindowClose = new JButton();
7070

71-
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
72-
this.setTitle("JavaANPR - Help");
73-
this.setResizable(false);
74-
this.jScrollPane1.setViewportView(this.editorPane);
71+
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
72+
setTitle("JavaANPR - Help");
73+
setResizable(false);
74+
jScrollPane1.setViewportView(editorPane);
7575

76-
this.helpWindowClose.setFont(new java.awt.Font("Arial", 0, 11));
77-
this.helpWindowClose.setText("Close");
78-
this.helpWindowClose.addActionListener(new java.awt.event.ActionListener() {
76+
helpWindowClose.setFont(new java.awt.Font("Arial", 0, 11));
77+
helpWindowClose.setText("Close");
78+
helpWindowClose.addActionListener(new java.awt.event.ActionListener() {
7979
@Override
8080
public void actionPerformed(java.awt.event.ActionEvent evt) {
81-
FrameHelp.this.helpWindowCloseActionPerformed(evt);
81+
helpWindowCloseActionPerformed(evt);
8282
}
8383
});
8484

85-
GroupLayout layout = new GroupLayout(this.getContentPane());
86-
this.getContentPane().setLayout(layout);
85+
GroupLayout layout = new GroupLayout(getContentPane());
86+
getContentPane().setLayout(layout);
8787
layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.LEADING)
8888
.add(layout.createSequentialGroup().addContainerGap()
8989
.add(layout.createParallelGroup(GroupLayout.LEADING)
90-
.add(GroupLayout.TRAILING, this.helpWindowClose)
91-
.add(this.jScrollPane1, GroupLayout.DEFAULT_SIZE, 514, Short.MAX_VALUE))
90+
.add(GroupLayout.TRAILING, helpWindowClose)
91+
.add(jScrollPane1, GroupLayout.DEFAULT_SIZE, 514, Short.MAX_VALUE))
9292
.addContainerGap()));
9393
layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.LEADING).add(GroupLayout.TRAILING,
9494
layout.createSequentialGroup().addContainerGap()
95-
.add(this.jScrollPane1, GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
96-
.addPreferredGap(LayoutStyle.RELATED).add(this.helpWindowClose).addContainerGap()));
97-
this.pack();
95+
.add(jScrollPane1, GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
96+
.addPreferredGap(LayoutStyle.RELATED).add(helpWindowClose).addContainerGap()));
97+
pack();
9898
}
9999

100100
private void helpWindowCloseActionPerformed(ActionEvent evt) {
101-
this.dispose();
101+
dispose();
102102
}
103103
}

0 commit comments

Comments
 (0)