Rename some variables to more appropriate names.

This commit is contained in:
Danila Fedorin 2017-07-26 17:18:40 -07:00
parent e06feaa581
commit 2b7a68e179
1 changed files with 13 additions and 15 deletions

View File

@ -5,8 +5,6 @@ import org.nwapw.abacus.tree.NumberReducer;
import org.nwapw.abacus.tree.TreeNode; import org.nwapw.abacus.tree.TreeNode;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -56,7 +54,7 @@ public class Window extends JFrame {
/** /**
* The panel where the output occurs. * The panel where the output occurs.
*/ */
private JPanel outputPanel; private JPanel calculationPanel;
/** /**
* The text area reserved for the last output. * The text area reserved for the last output.
*/ */
@ -90,7 +88,7 @@ public class Window extends JFrame {
/** /**
* The side panel for separate configuration. * The side panel for separate configuration.
*/ */
private JPanel sidePanel; private JPanel settingsPanel;
/** /**
* Panel for elements relating to number * Panel for elements relating to number
* system selection. * system selection.
@ -166,10 +164,10 @@ public class Window extends JFrame {
lastOutputArea = new JTextArea(lastOutput); lastOutputArea = new JTextArea(lastOutput);
lastOutputArea.setEditable(false); lastOutputArea.setEditable(false);
outputPanel = new JPanel(); calculationPanel = new JPanel();
outputPanel.setLayout(new BorderLayout()); calculationPanel.setLayout(new BorderLayout());
outputPanel.add(historyScroll, BorderLayout.CENTER); calculationPanel.add(historyScroll, BorderLayout.CENTER);
outputPanel.add(lastOutputArea, BorderLayout.SOUTH); calculationPanel.add(lastOutputArea, BorderLayout.SOUTH);
numberSystemList = new JComboBox<>(); numberSystemList = new JComboBox<>();
@ -189,15 +187,15 @@ public class Window extends JFrame {
functionSelectPanel.add(functionList); functionSelectPanel.add(functionList);
functionSelectPanel.setMaximumSize(functionSelectPanel.getPreferredSize()); functionSelectPanel.setMaximumSize(functionSelectPanel.getPreferredSize());
sidePanel = new JPanel(); settingsPanel = new JPanel();
sidePanel.setAlignmentX(Component.LEFT_ALIGNMENT); settingsPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
sidePanel.setLayout(new BoxLayout(sidePanel, BoxLayout.PAGE_AXIS)); settingsPanel.setLayout(new BoxLayout(settingsPanel, BoxLayout.PAGE_AXIS));
sidePanel.add(numberSystemPanel); settingsPanel.add(numberSystemPanel);
sidePanel.add(functionSelectPanel); settingsPanel.add(functionSelectPanel);
pane = new JTabbedPane(); pane = new JTabbedPane();
pane.add("Calculator", outputPanel); pane.add("Calculator", calculationPanel);
pane.add("Settings", sidePanel); pane.add("Settings", settingsPanel);
pane.addChangeListener(e -> { pane.addChangeListener(e -> {
int selectionIndex = pane.getSelectedIndex(); int selectionIndex = pane.getSelectedIndex();
boolean enabled = BUTTON_ENABLED[selectionIndex]; boolean enabled = BUTTON_ENABLED[selectionIndex];