Code cleanup and fixing a regression that was introduced while refactoring. Optimization now rusn again as expected.

This commit is contained in:
2012-06-20 08:42:05 +00:00
parent 83b44f1d1a
commit 8582b79590
3 changed files with 1877 additions and 1672 deletions

View File

@@ -260,8 +260,8 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
* @param valueClass The class of the array values
*/
public EditorListCellRenderer(Class editorClass, Class valueClass) {
editorClass = editorClass;
valueClass = valueClass;
this.editorClass = editorClass;
this.valueClass = valueClass;
}
/**
@@ -282,12 +282,12 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
try {
final PropertyEditor e = (PropertyEditor) editorClass.newInstance();
if (e instanceof GenericObjectEditor) {
// ((GenericObjectEditor) e).setDisplayOnly(true);
((GenericObjectEditor) e).setClassType(valueClass);
}
e.setValue(value);
JPanel cellPanel = new JPanel() {
@Override
public void paintComponent(Graphics g) {
Insets i = this.getInsets();
Rectangle box = new Rectangle(i.left, i.top,
@@ -299,6 +299,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
e.paintValue(g, box);
}
@Override
public Dimension getPreferredSize() {
Font f = this.getFont();
FontMetrics fm = this.getFontMetrics(f);
@@ -364,7 +365,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
// Create the ListModel and populate it
listModel = new DefaultListModel();
elementClass = elementClass;
this.elementClass = elementClass;
for (int i = 0; i < Array.getLength(arrayInstance); i++) {
listModel.addElement(Array.get(arrayInstance, i));
}

File diff suppressed because it is too large Load Diff

View File

@@ -43,7 +43,7 @@ import javax.swing.JOptionPane;
*/
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 InterfaceStatistics m_Statistics;
private InterfaceGOParameters goParams;
@@ -56,7 +56,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
private boolean userAborted = false;
public void addListener(RemoteStateListener module) {
logger.log(
LOGGER.log(
Level.FINEST,
"Processor: setting module as listener: " + ((module == null)
? "null" : module.toString()));
@@ -107,7 +107,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
public void startOpt() {
m_createInitialPopulations = true;
if (isOptRunning()) {
logger.log(Level.SEVERE, "Processor is already running.");
LOGGER.log(Level.SEVERE, "Processor is already running.");
return;
}
resPop = null;
@@ -132,7 +132,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
public void restartOpt() {
m_createInitialPopulations = false;
if (isOptRunning()) {
logger.log(Level.SEVERE, "Processor is already running.");
LOGGER.log(Level.SEVERE, "Processor is already running.");
return;
}
userAborted = false;
@@ -183,13 +183,12 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
errMsg = "check console output for error messages.";
}
errMsg = "Exception in Processor: " + errMsg;
System.err.println(errMsg);
e.printStackTrace();
LOGGER.log(Level.SEVERE, e.getMessage(), e);
try {
JOptionPane.showMessageDialog(null, StringTools.wrapLine(errMsg, 60, 0.2), "Error in Optimization", JOptionPane.ERROR_MESSAGE);
} catch (Exception ex) {
} catch (Error er) {
};
} catch (Error error) {
}
//m_Statistics.stopOptPerformed(false);
setOptRunning(false); // normal finish
if (m_ListenerModule != null) {