Code cleanup and fixing a regression that was introduced while refactoring. Optimization now rusn again as expected.
This commit is contained in:
@@ -260,8 +260,8 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
|
|||||||
* @param valueClass The class of the array values
|
* @param valueClass The class of the array values
|
||||||
*/
|
*/
|
||||||
public EditorListCellRenderer(Class editorClass, Class valueClass) {
|
public EditorListCellRenderer(Class editorClass, Class valueClass) {
|
||||||
editorClass = editorClass;
|
this.editorClass = editorClass;
|
||||||
valueClass = valueClass;
|
this.valueClass = valueClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -282,12 +282,12 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
|
|||||||
try {
|
try {
|
||||||
final PropertyEditor e = (PropertyEditor) editorClass.newInstance();
|
final PropertyEditor e = (PropertyEditor) editorClass.newInstance();
|
||||||
if (e instanceof GenericObjectEditor) {
|
if (e instanceof GenericObjectEditor) {
|
||||||
// ((GenericObjectEditor) e).setDisplayOnly(true);
|
|
||||||
((GenericObjectEditor) e).setClassType(valueClass);
|
((GenericObjectEditor) e).setClassType(valueClass);
|
||||||
}
|
}
|
||||||
e.setValue(value);
|
e.setValue(value);
|
||||||
JPanel cellPanel = new JPanel() {
|
JPanel cellPanel = new JPanel() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void paintComponent(Graphics g) {
|
public void paintComponent(Graphics g) {
|
||||||
Insets i = this.getInsets();
|
Insets i = this.getInsets();
|
||||||
Rectangle box = new Rectangle(i.left, i.top,
|
Rectangle box = new Rectangle(i.left, i.top,
|
||||||
@@ -299,6 +299,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
|
|||||||
e.paintValue(g, box);
|
e.paintValue(g, box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Dimension getPreferredSize() {
|
public Dimension getPreferredSize() {
|
||||||
Font f = this.getFont();
|
Font f = this.getFont();
|
||||||
FontMetrics fm = this.getFontMetrics(f);
|
FontMetrics fm = this.getFontMetrics(f);
|
||||||
@@ -364,7 +365,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
|
|||||||
|
|
||||||
// Create the ListModel and populate it
|
// Create the ListModel and populate it
|
||||||
listModel = new DefaultListModel();
|
listModel = new DefaultListModel();
|
||||||
elementClass = elementClass;
|
this.elementClass = elementClass;
|
||||||
for (int i = 0; i < Array.getLength(arrayInstance); i++) {
|
for (int i = 0; i < Array.getLength(arrayInstance); i++) {
|
||||||
listModel.addElement(Array.get(arrayInstance, i));
|
listModel.addElement(Array.get(arrayInstance, i));
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -43,7 +43,7 @@ import javax.swing.JOptionPane;
|
|||||||
*/
|
*/
|
||||||
public class Processor extends Thread implements InterfaceProcessor, InterfacePopulationChangedEventListener {
|
public class Processor extends Thread implements InterfaceProcessor, InterfacePopulationChangedEventListener {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(EvAInfo.defaultLogger);
|
private static final Logger LOGGER = Logger.getLogger(Processor.class.getName());
|
||||||
private volatile boolean m_optRunning;
|
private volatile boolean m_optRunning;
|
||||||
private InterfaceStatistics m_Statistics;
|
private InterfaceStatistics m_Statistics;
|
||||||
private InterfaceGOParameters goParams;
|
private InterfaceGOParameters goParams;
|
||||||
@@ -56,7 +56,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
private boolean userAborted = false;
|
private boolean userAborted = false;
|
||||||
|
|
||||||
public void addListener(RemoteStateListener module) {
|
public void addListener(RemoteStateListener module) {
|
||||||
logger.log(
|
LOGGER.log(
|
||||||
Level.FINEST,
|
Level.FINEST,
|
||||||
"Processor: setting module as listener: " + ((module == null)
|
"Processor: setting module as listener: " + ((module == null)
|
||||||
? "null" : module.toString()));
|
? "null" : module.toString()));
|
||||||
@@ -107,7 +107,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
public void startOpt() {
|
public void startOpt() {
|
||||||
m_createInitialPopulations = true;
|
m_createInitialPopulations = true;
|
||||||
if (isOptRunning()) {
|
if (isOptRunning()) {
|
||||||
logger.log(Level.SEVERE, "Processor is already running.");
|
LOGGER.log(Level.SEVERE, "Processor is already running.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
resPop = null;
|
resPop = null;
|
||||||
@@ -132,7 +132,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
public void restartOpt() {
|
public void restartOpt() {
|
||||||
m_createInitialPopulations = false;
|
m_createInitialPopulations = false;
|
||||||
if (isOptRunning()) {
|
if (isOptRunning()) {
|
||||||
logger.log(Level.SEVERE, "Processor is already running.");
|
LOGGER.log(Level.SEVERE, "Processor is already running.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
userAborted = false;
|
userAborted = false;
|
||||||
@@ -183,13 +183,12 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
errMsg = "check console output for error messages.";
|
errMsg = "check console output for error messages.";
|
||||||
}
|
}
|
||||||
errMsg = "Exception in Processor: " + errMsg;
|
errMsg = "Exception in Processor: " + errMsg;
|
||||||
System.err.println(errMsg);
|
LOGGER.log(Level.SEVERE, e.getMessage(), e);
|
||||||
e.printStackTrace();
|
|
||||||
try {
|
try {
|
||||||
JOptionPane.showMessageDialog(null, StringTools.wrapLine(errMsg, 60, 0.2), "Error in Optimization", JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(null, StringTools.wrapLine(errMsg, 60, 0.2), "Error in Optimization", JOptionPane.ERROR_MESSAGE);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
} catch (Error er) {
|
} catch (Error error) {
|
||||||
};
|
}
|
||||||
//m_Statistics.stopOptPerformed(false);
|
//m_Statistics.stopOptPerformed(false);
|
||||||
setOptRunning(false); // normal finish
|
setOptRunning(false); // normal finish
|
||||||
if (m_ListenerModule != null) {
|
if (m_ListenerModule != null) {
|
||||||
|
Reference in New Issue
Block a user