From 8a8b457c98e207d809a7616e73eb59bfe197a7a5 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 31 Mar 2016 11:43:21 -0400 Subject: More code maintenance --- .../java/bjc/utils/gui/ListParameterPanel.java | 41 +++++++++++----------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/gui/ListParameterPanel.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/gui/ListParameterPanel.java b/BJC-Utils2/src/main/java/bjc/utils/gui/ListParameterPanel.java index 6272b5f..42c5761 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/gui/ListParameterPanel.java +++ b/BJC-Utils2/src/main/java/bjc/utils/gui/ListParameterPanel.java @@ -22,46 +22,45 @@ import bjc.utils.gui.layout.VLayout; * The type of data stored in the list */ public class ListParameterPanel extends JPanel { - /** - * Version id for serialization - */ + // Version id for serialization private static final long serialVersionUID = 3442971104975491571L; /** * Create a new panel using the specified actions for doing things * - * @param addAct + * @param addAction * The action that provides items - * @param editAct + * @param editAction * The action that edits items - * @param removeAct + * @param removeAction * The action that removes items */ - public ListParameterPanel(Supplier addAct, Consumer editAct, - Consumer removeAct) { - this(addAct, editAct, removeAct, null); + public ListParameterPanel(Supplier addAction, + Consumer editAction, Consumer removeAction) { + this(addAction, editAction, removeAction, null); } /** * Create a new panel using the specified actions for doing things * - * @param addAct + * @param addAction * The action that provides items - * @param editAct + * @param editAction * The action that edits items - * @param removeAct + * @param removeAction * The action that removes items - * @param defVals + * @param defaultValues * The default values to put in the list */ - public ListParameterPanel(Supplier addAct, Consumer editAct, - Consumer removeAct, FunctionalList defVals) { + public ListParameterPanel(Supplier addAction, + Consumer editAction, Consumer removeAction, + FunctionalList defaultValues) { setLayout(new VLayout(2)); JList list; - if (defVals != null) { - list = SimpleJList.buildFromList(defVals.toIterable()); + if (defaultValues != null) { + list = SimpleJList.buildFromList(defaultValues.toIterable()); } else { list = new JList<>(new DefaultListModel<>()); } @@ -76,11 +75,11 @@ public class ListParameterPanel extends JPanel { JButton removeParam = new JButton("Remove..."); addParam.addActionListener( - (ev) -> ((DefaultListModel) list.getModel()) - .addElement(addAct.get())); + (event) -> ((DefaultListModel) list.getModel()) + .addElement(addAction.get())); editParam.addActionListener( - (ev) -> editAct.accept(list.getSelectedValue())); - removeParam.addActionListener((ev) -> removeAct + (event) -> editAction.accept(list.getSelectedValue())); + removeParam.addActionListener((event) -> removeAction .accept(((DefaultListModel) list.getModel()) .remove(list.getSelectedIndex()))); -- cgit v1.2.3