1
Fork 0
mirror of https://github.com/Steffo99/unimore-oop-2020-cleaver.git synced 2024-11-21 23:54:20 +00:00

Replace "key" with "password" in labels

This commit is contained in:
Steffo 2020-01-12 17:50:50 +01:00
parent 3ec0b145b7
commit 3ec4d180d6
6 changed files with 21 additions and 21 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -26,14 +26,14 @@ public class CryptRow extends OptionRow {
protected final JSeparator separator; protected final JSeparator separator;
/** /**
* A label with "Key" written on it. * A label with "Password" written on it.
*/ */
protected final JLabel keyLabel; protected final JLabel passwordLabel;
/** /**
* The {@link JTextField} where the user can input the desired encryption key for the files, in form of a {@link String}. * The {@link JTextField} where the user can input the desired encryption key for the files, in form of a {@link String}.
*/ */
protected final JTextField keyTextField; protected final JTextField passwordTextField;
/** /**
* Construct a CryptRow. * Construct a CryptRow.
@ -54,13 +54,13 @@ public class CryptRow extends OptionRow {
this.add(Box.createHorizontalStrut(8)); this.add(Box.createHorizontalStrut(8));
keyLabel = new JLabel("Key"); passwordLabel = new JLabel("Password");
this.add(keyLabel); this.add(passwordLabel);
this.add(Box.createHorizontalStrut(8)); this.add(Box.createHorizontalStrut(8));
keyTextField = new JTextField(); passwordTextField = new JTextField();
this.add(keyTextField); this.add(passwordTextField);
this.add(Box.createHorizontalStrut(8)); this.add(Box.createHorizontalStrut(8));
@ -75,7 +75,7 @@ public class CryptRow extends OptionRow {
if(!cryptCheckBox.isSelected()) { if(!cryptCheckBox.isSelected()) {
return null; return null;
} }
return new PasswordConfig(keyTextField.getText()); return new PasswordConfig(passwordTextField.getText());
} }
@Override @Override
@ -88,7 +88,7 @@ public class CryptRow extends OptionRow {
* Refresh the enabled/disabled and editable/non-editable status of all components in the SplitRow. * Refresh the enabled/disabled and editable/non-editable status of all components in the SplitRow.
*/ */
protected void update() { protected void update() {
keyTextField.setEnabled(cryptCheckBox.isEnabled()); passwordTextField.setEnabled(cryptCheckBox.isEnabled());
keyTextField.setEditable(cryptCheckBox.isSelected()); passwordTextField.setEditable(cryptCheckBox.isSelected());
} }
} }

View file

@ -15,14 +15,14 @@ import javax.swing.*;
*/ */
public class KeyRow extends OptionRow { public class KeyRow extends OptionRow {
/** /**
* A label with "Encryption key" written on it. * A label with "Password" written on it.
*/ */
protected final JLabel keyLabel; protected final JLabel passwordLabel;
/** /**
* The text field where the user can input the encryption key. * The text field where the user can input the encryption key.
*/ */
protected final JTextField keyTextField; protected final JTextField passwordTextField;
/** /**
* A label with "(if required)" written on it. * A label with "(if required)" written on it.
@ -37,13 +37,13 @@ public class KeyRow extends OptionRow {
this.add(Box.createHorizontalStrut(8)); this.add(Box.createHorizontalStrut(8));
keyLabel = new JLabel("Encryption key"); passwordLabel = new JLabel("Password");
this.add(keyLabel); this.add(passwordLabel);
this.add(Box.createHorizontalStrut(8)); this.add(Box.createHorizontalStrut(8));
keyTextField = new JTextField(); passwordTextField = new JTextField();
this.add(keyTextField); this.add(passwordTextField);
this.add(Box.createHorizontalStrut(8)); this.add(Box.createHorizontalStrut(8));
@ -56,15 +56,15 @@ public class KeyRow extends OptionRow {
} }
/** /**
* @return The encryption key inserted in the {@link #keyTextField}. * @return The encryption key inserted in the {@link #passwordTextField}.
*/ */
public String getKey() { public String getKey() {
return keyTextField.getText(); return passwordTextField.getText();
} }
@Override @Override
public void setEditable(boolean value) { public void setEditable(boolean value) {
keyTextField.setEditable(value); passwordTextField.setEditable(value);
this.update(); this.update();
} }
@ -72,6 +72,6 @@ public class KeyRow extends OptionRow {
* Refresh the enabled/disabled and editable/non-editable status of all components in the KeyRow. * Refresh the enabled/disabled and editable/non-editable status of all components in the KeyRow.
*/ */
protected void update() { protected void update() {
keyTextField.setEnabled(keyTextField.isEditable()); passwordTextField.setEnabled(passwordTextField.isEditable());
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 893 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1 KiB