Some Java 8 code cleanup
This commit is contained in:
parent
dedfb39eb4
commit
cc09ce9381
@ -100,15 +100,11 @@ public class DoubleArrayEditor extends JPanel implements PropertyEditor {
|
||||
this.normalizeButton.addActionListener(this.normalizeAction);
|
||||
this.okButton = new JButton("OK");
|
||||
this.okButton.setEnabled(true);
|
||||
this.okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
//backupObject = copyObject(object);
|
||||
this.okButton.addActionListener(e -> {
|
||||
if ((customEditor.getTopLevelAncestor() != null) && (customEditor.getTopLevelAncestor() instanceof Window)) {
|
||||
Window w = (Window) customEditor.getTopLevelAncestor();
|
||||
w.dispose();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.buttonPanel.add(this.addButton);
|
||||
this.buttonPanel.add(this.deleteButton);
|
||||
@ -124,7 +120,7 @@ public class DoubleArrayEditor extends JPanel implements PropertyEditor {
|
||||
ActionListener addAction = new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
doubleArray.addRowCopy(lastFocussedRow); // copy the last focussed row
|
||||
doubleArray.addRowCopy(lastFocussedRow); // copy the last focused row
|
||||
updateEditor();
|
||||
}
|
||||
};
|
||||
@ -145,7 +141,7 @@ public class DoubleArrayEditor extends JPanel implements PropertyEditor {
|
||||
};
|
||||
|
||||
/**
|
||||
* This action listener nomalizes each columng of the values of the DoubleArray.
|
||||
* This action listener normalizes each column of the values of the DoubleArray.
|
||||
*/
|
||||
ActionListener normalizeAction = new ActionListener() {
|
||||
@Override
|
||||
@ -183,7 +179,6 @@ public class DoubleArrayEditor extends JPanel implements PropertyEditor {
|
||||
}
|
||||
|
||||
doubleArray.setDoubleArray(tmpDD);
|
||||
//updateEditor();
|
||||
}
|
||||
};
|
||||
|
||||
@ -223,9 +218,7 @@ public class DoubleArrayEditor extends JPanel implements PropertyEditor {
|
||||
}
|
||||
|
||||
public void notifyFocusID(int id) {
|
||||
// notification of which column has the focus
|
||||
lastFocussedRow = id;
|
||||
// System.out.println("Focus now on " + id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,7 +4,6 @@ import eva2.gui.PropertyIntArray;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
@ -55,15 +54,11 @@ public class IntArrayEditor extends JPanel implements PropertyEditor {
|
||||
this.buttonPanel = new JPanel();
|
||||
this.okButton = new JButton("OK");
|
||||
this.okButton.setEnabled(true);
|
||||
this.okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
//backupObject = copyObject(object);
|
||||
this.okButton.addActionListener(e -> {
|
||||
if ((customEditor.getTopLevelAncestor() != null) && (customEditor.getTopLevelAncestor() instanceof Window)) {
|
||||
Window w = (Window) customEditor.getTopLevelAncestor();
|
||||
w.dispose();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.buttonPanel.add(this.okButton);
|
||||
this.customEditor.add(this.buttonPanel, BorderLayout.SOUTH);
|
||||
|
@ -12,10 +12,6 @@ public class MultiLineString {
|
||||
public MultiLineString() {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
MultiLineString multiLineString1 = new MultiLineString();
|
||||
}
|
||||
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user