mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 16:58:56 +00:00
* #2449 bump maven-checkstyle-plugin from 3.1.0 to 3.2.0 + resolve checkstyle issues * remove FileSelectorJFrame.java to resolve checkstyle issue * remove FileSelectorJFrame.java to resolve checkstyle issue * remove FileSelectorJFrame.java to resolve checkstyle issue * add refactored file with correct filename to resolve checkstyle issue * add the test data * change filenames from JFrame to Jframe for checkstyle * fix code smell from sonar report * add new testcases to improve the test coverage * remove code smell
This commit is contained in:
@@ -26,7 +26,6 @@ package com.iluwatar.presentationmodel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JList;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -100,7 +99,7 @@ public class View {
|
||||
/**
|
||||
* save the data to PresentationModel.
|
||||
*/
|
||||
public void saveToPMod() {
|
||||
public void saveToMod() {
|
||||
LOGGER.info("Save data to PresentationModel");
|
||||
model.setArtist(txtArtist.getText());
|
||||
model.setTitle(txtTitle.getText());
|
||||
@@ -111,7 +110,7 @@ public class View {
|
||||
/**
|
||||
* load the data from PresentationModel.
|
||||
*/
|
||||
public void loadFromPMod() {
|
||||
public void loadFromMod() {
|
||||
LOGGER.info("Load data from PresentationModel");
|
||||
txtArtist.setText(model.getArtist());
|
||||
txtTitle.setText(model.getTitle());
|
||||
@@ -133,7 +132,7 @@ public class View {
|
||||
@Override
|
||||
public void mouseClicked(final MouseEvent e) {
|
||||
model.setSelectedAlbumNumber(albumList.getSelectedIndex() + 1);
|
||||
loadFromPMod();
|
||||
loadFromMod();
|
||||
}
|
||||
});
|
||||
b1.add(albumList);
|
||||
@@ -162,15 +161,15 @@ public class View {
|
||||
apply.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(final MouseEvent e) {
|
||||
saveToPMod();
|
||||
loadFromPMod();
|
||||
saveToMod();
|
||||
loadFromMod();
|
||||
}
|
||||
});
|
||||
cancel = new JButton("Cancel");
|
||||
cancel.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(final MouseEvent e) {
|
||||
loadFromPMod();
|
||||
loadFromMod();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user