Removed m_ occurenced in eva2.optimization.tools

This commit is contained in:
Fabian Becker 2014-01-28 19:51:52 +01:00
parent 00253c273a
commit 22fafe185a
31 changed files with 534 additions and 624 deletions

View File

@ -161,7 +161,7 @@ public class OptimizationEditorPanel extends JPanel implements ItemListener {
@Override
public void actionPerformed(final ActionEvent event) {
if (backupObject != null) {
// TODO m_goe.setObject(m_Object);
// TODO m_goe.setObject(object);
genericObjectEditor.setValue(copyObject(backupObject));
updateClassType();
updateChooser();

View File

@ -142,7 +142,7 @@ public class PropertySelectableList<T> implements java.io.Serializable {
// m_Objects=newOs;
// m_Selection=newSs;
// }
// m_Support.firePropertyChange("PropertySelectableList", null, this);
// propertyChangeSupport.firePropertyChange("PropertySelectableList", null, this);
// }
public void addPropertyChangeListener(PropertyChangeListener l) {

View File

@ -852,8 +852,8 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
if (updateFieldView(i)) {
doRepaint = true;
}
}// end if (m_Editors[i] == editor) {
} // end for (int i = 0 ; i < m_Editors.length; i++) {
}// end if (editorTable[i] == editor) {
} // end for (int i = 0 ; i < editorTable.length; i++) {
if (doRepaint) { // some components have been hidden or reappeared
// MK this finally seems to work right, with a scroll pane, too.
Container p = this;

View File

@ -71,7 +71,7 @@ class PropertySlider extends JPanel {
*/
protected void updateUs() {
try {
//String x = m_Editor.getAsText();
//String x = editor.getAsText();
slider.setValue(((Integer) propertyEditor.getValue()).intValue());
} catch (IllegalArgumentException ex) {
}

View File

@ -47,7 +47,7 @@ public class PropertyText extends JTextField {
String x = getText();
if (!propertyEditor.getAsText().equals(x)) {
propertyEditor.setAsText(x);
// setText(m_Editor.getAsText());
// setText(editor.getAsText());
}
} catch (IllegalArgumentException ex) {
// System.err.println("Warning: Couldnt set value (PropertyText)");

View File

@ -106,7 +106,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
//backupObject = copyObject(object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
Window w = (Window) m_CustomEditor.getTopLevelAncestor();
w.dispose();

View File

@ -74,7 +74,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
//backupObject = copyObject(object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
Window w = (Window) m_CustomEditor.getTopLevelAncestor();
w.dispose();

View File

@ -74,7 +74,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
//backupObject = copyObject(object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
Window w = (Window) m_CustomEditor.getTopLevelAncestor();
w.dispose();

View File

@ -66,7 +66,7 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
//backupObject = copyObject(object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
Window w = (Window) m_CustomEditor.getTopLevelAncestor();
w.dispose();

View File

@ -71,21 +71,21 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
this.m_Editors = new GeneralOptimizationEditorProperty[list.length];
for (int i = 0; i < list.length; i++) {
this.m_Editors[i] = new GeneralOptimizationEditorProperty();
this.m_Editors[i].m_Name = list[i].getName();
this.m_Editors[i].name = list[i].getName();
try {
this.m_Editors[i].m_Value = list[i];
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(this.m_Editors[i].m_Value.getClass());
if (this.m_Editors[i].m_Editor == null) {
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
this.m_Editors[i].value = list[i];
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(this.m_Editors[i].value.getClass());
if (this.m_Editors[i].editor == null) {
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
}
if (this.m_Editors[i].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].m_Editor).setClassType(InterfaceOptimizationTarget.class);
if (this.m_Editors[i].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].editor).setClassType(InterfaceOptimizationTarget.class);
}
this.m_Editors[i].m_Editor.setValue(this.m_Editors[i].m_Value);
this.m_Editors[i].m_Editor.addPropertyChangeListener(this);
this.m_Editors[i].editor.setValue(this.m_Editors[i].value);
this.m_Editors[i].editor.addPropertyChangeListener(this);
AbstractObjectEditor.findViewFor(this.m_Editors[i]);
if (this.m_Editors[i].m_View != null) {
this.m_Editors[i].m_View.repaint();
if (this.m_Editors[i].view != null) {
this.m_Editors[i].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -166,7 +166,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
gbc.weightx = 10;
// this.m_Targets[i] = new JButton(""+list[i].getName());
// this.m_Targets[i].setEnabled(false);
this.m_Targets[i] = this.m_Editors[i].m_View;
this.m_Targets[i] = this.m_Editors[i].view;
this.m_TargetList.add(this.m_Targets[i], gbc);
// The delete button
gbc.anchor = GridBagConstraints.WEST;
@ -215,21 +215,21 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
InterfaceOptimizationObjective[] list = m_OptimizationObjectives.getSelectedTargets();
l--;
newEdit[l] = new GeneralOptimizationEditorProperty();
newEdit[l].m_Name = list[l].getName();
newEdit[l].name = list[l].getName();
try {
newEdit[l].m_Value = list[l];
newEdit[l].m_Editor = PropertyEditorProvider.findEditor(newEdit[l].m_Value.getClass());
if (newEdit[l].m_Editor == null) {
newEdit[l].m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
newEdit[l].value = list[l];
newEdit[l].editor = PropertyEditorProvider.findEditor(newEdit[l].value.getClass());
if (newEdit[l].editor == null) {
newEdit[l].editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
}
if (newEdit[l].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) newEdit[l].m_Editor).setClassType(InterfaceOptimizationTarget.class);
if (newEdit[l].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) newEdit[l].editor).setClassType(InterfaceOptimizationTarget.class);
}
newEdit[l].m_Editor.setValue(newEdit[l].m_Value);
newEdit[l].m_Editor.addPropertyChangeListener(m_self);
newEdit[l].editor.setValue(newEdit[l].value);
newEdit[l].editor.addPropertyChangeListener(m_self);
AbstractObjectEditor.findViewFor(newEdit[l]);
if (newEdit[l].m_View != null) {
newEdit[l].m_View.repaint();
if (newEdit[l].view != null) {
newEdit[l].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -435,26 +435,26 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
for (int i = 0; i < list.length; i++) {
if (oldVal.equals(list[i])) {
list[i] = (InterfaceOptimizationObjective) newVal;
this.m_Editors[i].m_Name = list[i].getName();
this.m_Editors[i].name = list[i].getName();
try {
this.m_Editors[i].m_Value = list[i];
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(this.m_Editors[i].m_Value.getClass());
if (this.m_Editors[i].m_Editor == null) {
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
this.m_Editors[i].value = list[i];
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(this.m_Editors[i].value.getClass());
if (this.m_Editors[i].editor == null) {
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
}
if (this.m_Editors[i].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].m_Editor).setClassType(InterfaceOptimizationTarget.class);
if (this.m_Editors[i].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].editor).setClassType(InterfaceOptimizationTarget.class);
}
this.m_Editors[i].m_Editor.setValue(this.m_Editors[i].m_Value);
this.m_Editors[i].m_Editor.addPropertyChangeListener(this);
this.m_Editors[i].editor.setValue(this.m_Editors[i].value);
this.m_Editors[i].editor.addPropertyChangeListener(this);
AbstractObjectEditor.findViewFor(this.m_Editors[i]);
if (this.m_Editors[i].m_View != null) {
this.m_Editors[i].m_View.repaint();
if (this.m_Editors[i].view != null) {
this.m_Editors[i].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
}
this.m_Targets[i] = this.m_Editors[i].m_View;
this.m_Targets[i] = this.m_Editors[i].view;
}
}
//this.m_OptimizationTargets.setSelectedTargets(list);

View File

@ -72,21 +72,21 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
this.m_Editors = new GeneralOptimizationEditorProperty[list.length];
for (int i = 0; i < list.length; i++) {
this.m_Editors[i] = new GeneralOptimizationEditorProperty();
this.m_Editors[i].m_Name = list[i].getName();
this.m_Editors[i].name = list[i].getName();
try {
this.m_Editors[i].m_Value = list[i];
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(this.m_Editors[i].m_Value.getClass());
if (this.m_Editors[i].m_Editor == null) {
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
this.m_Editors[i].value = list[i];
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(this.m_Editors[i].value.getClass());
if (this.m_Editors[i].editor == null) {
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
}
if (this.m_Editors[i].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].m_Editor).setClassType(InterfaceOptimizationObjective.class);
if (this.m_Editors[i].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].editor).setClassType(InterfaceOptimizationObjective.class);
}
this.m_Editors[i].m_Editor.setValue(this.m_Editors[i].m_Value);
this.m_Editors[i].m_Editor.addPropertyChangeListener(this);
this.m_Editors[i].editor.setValue(this.m_Editors[i].value);
this.m_Editors[i].editor.addPropertyChangeListener(this);
AbstractObjectEditor.findViewFor(this.m_Editors[i]);
if (this.m_Editors[i].m_View != null) {
this.m_Editors[i].m_View.repaint();
if (this.m_Editors[i].view != null) {
this.m_Editors[i].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -189,7 +189,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
gbc.fill = GridBagConstraints.BOTH;
gbc.gridx = 1;
gbc.weightx = 10;
this.m_Targets[i] = this.m_Editors[i].m_View;
this.m_Targets[i] = this.m_Editors[i].view;
this.m_TargetList.add(this.m_Targets[i], gbc);
// The delete button
gbc.anchor = GridBagConstraints.WEST;
@ -238,21 +238,21 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
InterfaceOptimizationObjective[] list = m_OptimizationObjectivesWithWeights.getSelectedTargets();
l--;
newEdit[l] = new GeneralOptimizationEditorProperty();
newEdit[l].m_Name = list[l].getName();
newEdit[l].name = list[l].getName();
try {
newEdit[l].m_Value = list[l];
newEdit[l].m_Editor = PropertyEditorProvider.findEditor(newEdit[l].m_Value.getClass());
if (newEdit[l].m_Editor == null) {
newEdit[l].m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
newEdit[l].value = list[l];
newEdit[l].editor = PropertyEditorProvider.findEditor(newEdit[l].value.getClass());
if (newEdit[l].editor == null) {
newEdit[l].editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
}
if (newEdit[l].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) newEdit[l].m_Editor).setClassType(InterfaceOptimizationObjective.class);
if (newEdit[l].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) newEdit[l].editor).setClassType(InterfaceOptimizationObjective.class);
}
newEdit[l].m_Editor.setValue(newEdit[l].m_Value);
newEdit[l].m_Editor.addPropertyChangeListener(m_self);
newEdit[l].editor.setValue(newEdit[l].value);
newEdit[l].editor.addPropertyChangeListener(m_self);
AbstractObjectEditor.findViewFor(newEdit[l]);
if (newEdit[l].m_View != null) {
newEdit[l].m_View.repaint();
if (newEdit[l].view != null) {
newEdit[l].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -507,26 +507,26 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
for (int i = 0; i < list.length; i++) {
if (oldVal.equals(list[i])) {
list[i] = (InterfaceOptimizationObjective) newVal;
this.m_Editors[i].m_Name = list[i].getName();
this.m_Editors[i].name = list[i].getName();
try {
this.m_Editors[i].m_Value = list[i];
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(this.m_Editors[i].m_Value.getClass());
if (this.m_Editors[i].m_Editor == null) {
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
this.m_Editors[i].value = list[i];
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(this.m_Editors[i].value.getClass());
if (this.m_Editors[i].editor == null) {
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(InterfaceOptimizationObjective.class);
}
if (this.m_Editors[i].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].m_Editor).setClassType(InterfaceOptimizationObjective.class);
if (this.m_Editors[i].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].editor).setClassType(InterfaceOptimizationObjective.class);
}
this.m_Editors[i].m_Editor.setValue(this.m_Editors[i].m_Value);
this.m_Editors[i].m_Editor.addPropertyChangeListener(this);
this.m_Editors[i].editor.setValue(this.m_Editors[i].value);
this.m_Editors[i].editor.addPropertyChangeListener(this);
AbstractObjectEditor.findViewFor(this.m_Editors[i]);
if (this.m_Editors[i].m_View != null) {
this.m_Editors[i].m_View.repaint();
if (this.m_Editors[i].view != null) {
this.m_Editors[i].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
}
this.m_Targets[i] = this.m_Editors[i].m_View;
this.m_Targets[i] = this.m_Editors[i].view;
}
}
//this.m_OptimizationTargets.setSelectedTargets(list);

View File

@ -74,7 +74,7 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
//backupObject = copyObject(object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
Window w = (Window) m_CustomEditor.getTopLevelAncestor();
w.dispose();

View File

@ -238,7 +238,7 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
}
// public String getIndividualName() {
// return this.m_Name;
// return this.name;
// }
/**
@ -248,14 +248,14 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
public void giveNewName() {
// I dont think this is required for now
// String name = "";
// if (this.m_Name.length() == 0) {
// this.m_Name = GONamingBox.getRandomName();
// if (this.name.length() == 0) {
// this.name = GONamingBox.getRandomName();
// } else {
// if (this.m_Name.split(" ").length > 1) {
// name = GONamingBox.getRandomName() + " " + this.m_Name.split(" ")[0] + "owitsch";
// this.m_Name = name;
// if (this.name.split(" ").length > 1) {
// name = GONamingBox.getRandomName() + " " + this.name.split(" ")[0] + "owitsch";
// this.name = name;
// } else {
// this.m_Name = GONamingBox.getRandomName() + " " + this.m_Name + "owitsch";
// this.name = GONamingBox.getRandomName() + " " + this.name + "owitsch";
// }
// }
}

View File

@ -131,20 +131,20 @@ public class MOCCOParameterizeGDF extends MOCCOPhase implements InterfaceProcess
this.m_Opt = new GeneticAlgorithm();
this.m_Opt.setProblem(this.m_Mocco.m_State.m_CurrentProblem);
this.m_Mocco.m_State.m_Optimizer = this.m_Opt;
this.m_EOpt.m_Name = "Island Model EA";
this.m_EOpt.name = "Island Model EA";
try {
this.m_EOpt.m_Value = this.m_Opt;
this.m_EOpt.m_Editor = PropertyEditorProvider.findEditor(this.m_EOpt.m_Value.getClass());
if (this.m_EOpt.m_Editor == null) {
this.m_EOpt.m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizer.class);
this.m_EOpt.value = this.m_Opt;
this.m_EOpt.editor = PropertyEditorProvider.findEditor(this.m_EOpt.value.getClass());
if (this.m_EOpt.editor == null) {
this.m_EOpt.editor = PropertyEditorProvider.findEditor(InterfaceOptimizer.class);
}
if (this.m_EOpt.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EOpt.m_Editor).setClassType(InterfaceOptimizer.class);
if (this.m_EOpt.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EOpt.editor).setClassType(InterfaceOptimizer.class);
}
this.m_EOpt.m_Editor.setValue(this.m_EOpt.m_Value);
this.m_EOpt.editor.setValue(this.m_EOpt.value);
AbstractObjectEditor.findViewFor(this.m_EOpt);
if (this.m_EOpt.m_View != null) {
this.m_EOpt.m_View.repaint();
if (this.m_EOpt.view != null) {
this.m_EOpt.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -152,27 +152,27 @@ public class MOCCOParameterizeGDF extends MOCCOPhase implements InterfaceProcess
gbc.gridx = 0;
gbc.gridy = 2;
gbc.weightx = 2;
this.m_Choice.add(new JLabel("" + this.m_EOpt.m_Name), gbc);
this.m_Choice.add(new JLabel("" + this.m_EOpt.name), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.weightx = 1;
this.m_Choice.add(this.m_EOpt.m_View, gbc);
this.m_Choice.add(this.m_EOpt.view, gbc);
// Terminator
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
editor.m_Name = "Terminator";
editor.name = "Terminator";
try {
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
editor.m_Editor = PropertyEditorProvider.findEditor(editor.m_Value.getClass());
if (editor.m_Editor == null) {
editor.m_Editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
editor.value = this.m_Mocco.m_State.m_Terminator;
editor.editor = PropertyEditorProvider.findEditor(editor.value.getClass());
if (editor.editor == null) {
editor.editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
}
if (editor.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.m_Editor).setClassType(InterfaceTerminator.class);
if (editor.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.editor).setClassType(InterfaceTerminator.class);
}
editor.m_Editor.setValue(editor.m_Value);
editor.editor.setValue(editor.value);
AbstractObjectEditor.findViewFor(editor);
if (editor.m_View != null) {
editor.m_View.repaint();
if (editor.view != null) {
editor.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -180,11 +180,11 @@ public class MOCCOParameterizeGDF extends MOCCOPhase implements InterfaceProcess
gbc.gridx = 0;
gbc.gridy = 3;
gbc.weightx = 2;
this.m_Choice.add(new JLabel("" + editor.m_Name), gbc);
this.m_Choice.add(new JLabel("" + editor.name), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.weightx = 1;
this.m_Choice.add(editor.m_View, gbc);
this.m_Choice.add(editor.view, gbc);
}

View File

@ -85,20 +85,20 @@ public class MOCCOParameterizeMO extends MOCCOPhase implements InterfaceProcessE
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
editor = new GeneralOptimizationEditorProperty();
editor.m_Name = "Optimizer";
editor.name = "Optimizer";
try {
editor.m_Value = this.m_Mocco.m_State.m_Optimizer;
editor.m_Editor = PropertyEditorProvider.findEditor(editor.m_Value.getClass());
if (editor.m_Editor == null) {
editor.m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizer.class);
editor.value = this.m_Mocco.m_State.m_Optimizer;
editor.editor = PropertyEditorProvider.findEditor(editor.value.getClass());
if (editor.editor == null) {
editor.editor = PropertyEditorProvider.findEditor(InterfaceOptimizer.class);
}
if (editor.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.m_Editor).setClassType(InterfaceOptimizer.class);
if (editor.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.editor).setClassType(InterfaceOptimizer.class);
}
editor.m_Editor.setValue(editor.m_Value);
editor.editor.setValue(editor.value);
AbstractObjectEditor.findViewFor(editor);
if (editor.m_View != null) {
editor.m_View.repaint();
if (editor.view != null) {
editor.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -106,27 +106,27 @@ public class MOCCOParameterizeMO extends MOCCOPhase implements InterfaceProcessE
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 1;
tmpP.add(new JLabel("" + editor.m_Name), gbc);
tmpP.add(new JLabel("" + editor.name), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
gbc.weightx = 2;
tmpP.add(editor.m_View, gbc);
tmpP.add(editor.view, gbc);
editor = new GeneralOptimizationEditorProperty();
editor.m_Name = "Terminator";
editor.name = "Terminator";
try {
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
editor.m_Editor = PropertyEditorProvider.findEditor(editor.m_Value.getClass());
if (editor.m_Editor == null) {
editor.m_Editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
editor.value = this.m_Mocco.m_State.m_Terminator;
editor.editor = PropertyEditorProvider.findEditor(editor.value.getClass());
if (editor.editor == null) {
editor.editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
}
if (editor.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.m_Editor).setClassType(InterfaceTerminator.class);
if (editor.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.editor).setClassType(InterfaceTerminator.class);
}
editor.m_Editor.setValue(editor.m_Value);
editor.editor.setValue(editor.value);
AbstractObjectEditor.findViewFor(editor);
if (editor.m_View != null) {
editor.m_View.repaint();
if (editor.view != null) {
editor.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -134,11 +134,11 @@ public class MOCCOParameterizeMO extends MOCCOPhase implements InterfaceProcessE
gbc.gridx = 0;
gbc.gridy = 1;
gbc.weightx = 1;
tmpP.add(new JLabel("" + editor.m_Name), gbc);
tmpP.add(new JLabel("" + editor.name), gbc);
gbc.gridx = 1;
gbc.gridy = 1;
gbc.weightx = 2;
tmpP.add(editor.m_View, gbc);
tmpP.add(editor.view, gbc);
this.m_Mocco.m_JPanelParameters.add(tmpP, BorderLayout.CENTER);
this.m_Mocco.m_JPanelParameters.add(this.makeInformationText("Multi-Objective Optimiaztion", "" +
"Please choose an appropriate multi-objecitve optimizer."), BorderLayout.NORTH);

View File

@ -103,20 +103,20 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
this.m_EMOSO = new GeneralOptimizationEditorProperty();
this.m_LpMetric = new MOSOLpMetric();
this.m_LpMetric.getReference().setDoubleArray(this.m_RefPoint);
this.m_EMOSO.m_Name = "Lp-Metric";
this.m_EMOSO.name = "Lp-Metric";
try {
this.m_EMOSO.m_Value = this.m_LpMetric;
this.m_EMOSO.m_Editor = PropertyEditorProvider.findEditor(this.m_EMOSO.m_Value.getClass());
if (this.m_EMOSO.m_Editor == null) {
this.m_EMOSO.m_Editor = PropertyEditorProvider.findEditor(MOSOLpMetric.class);
this.m_EMOSO.value = this.m_LpMetric;
this.m_EMOSO.editor = PropertyEditorProvider.findEditor(this.m_EMOSO.value.getClass());
if (this.m_EMOSO.editor == null) {
this.m_EMOSO.editor = PropertyEditorProvider.findEditor(MOSOLpMetric.class);
}
if (this.m_EMOSO.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EMOSO.m_Editor).setClassType(MOSOLpMetric.class);
if (this.m_EMOSO.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EMOSO.editor).setClassType(MOSOLpMetric.class);
}
this.m_EMOSO.m_Editor.setValue(this.m_EMOSO.m_Value);
this.m_EMOSO.editor.setValue(this.m_EMOSO.value);
AbstractObjectEditor.findViewFor(this.m_EMOSO);
if (this.m_EMOSO.m_View != null) {
this.m_EMOSO.m_View.repaint();
if (this.m_EMOSO.view != null) {
this.m_EMOSO.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -124,11 +124,11 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
gbc.gridx = 0;
gbc.gridy = 2;
gbc.weightx = 2;
this.m_Parameters.add(new JLabel("" + this.m_EMOSO.m_Name), gbc);
this.m_Parameters.add(new JLabel("" + this.m_EMOSO.name), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.weightx = 1;
this.m_Parameters.add(this.m_EMOSO.m_View, gbc);
this.m_Parameters.add(this.m_EMOSO.view, gbc);
// IslandModelEA
this.m_EIMEA = new GeneralOptimizationEditorProperty();
this.m_Island = new IslandModelEA();
@ -139,20 +139,20 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
this.m_Island.setNumberLocalCPUs(this.m_Perturbations);
this.m_Island.setProblem(this.m_Mocco.m_State.m_CurrentProblem);
this.m_Mocco.m_State.m_Optimizer = this.m_Island;
this.m_EIMEA.m_Name = "Island Model EA";
this.m_EIMEA.name = "Island Model EA";
try {
this.m_EIMEA.m_Value = this.m_Island;
this.m_EIMEA.m_Editor = PropertyEditorProvider.findEditor(this.m_EIMEA.m_Value.getClass());
if (this.m_EIMEA.m_Editor == null) {
this.m_EIMEA.m_Editor = PropertyEditorProvider.findEditor(IslandModelEA.class);
this.m_EIMEA.value = this.m_Island;
this.m_EIMEA.editor = PropertyEditorProvider.findEditor(this.m_EIMEA.value.getClass());
if (this.m_EIMEA.editor == null) {
this.m_EIMEA.editor = PropertyEditorProvider.findEditor(IslandModelEA.class);
}
if (this.m_EIMEA.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EIMEA.m_Editor).setClassType(IslandModelEA.class);
if (this.m_EIMEA.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EIMEA.editor).setClassType(IslandModelEA.class);
}
this.m_EIMEA.m_Editor.setValue(this.m_EIMEA.m_Value);
this.m_EIMEA.editor.setValue(this.m_EIMEA.value);
AbstractObjectEditor.findViewFor(this.m_EIMEA);
if (this.m_EIMEA.m_View != null) {
this.m_EIMEA.m_View.repaint();
if (this.m_EIMEA.view != null) {
this.m_EIMEA.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -160,27 +160,27 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
gbc.gridx = 0;
gbc.gridy = 3;
gbc.weightx = 2;
this.m_Parameters.add(new JLabel("" + this.m_EIMEA.m_Name), gbc);
this.m_Parameters.add(new JLabel("" + this.m_EIMEA.name), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.weightx = 1;
this.m_Parameters.add(this.m_EIMEA.m_View, gbc);
this.m_Parameters.add(this.m_EIMEA.view, gbc);
// Terminator
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
editor.m_Name = "Terminator";
editor.name = "Terminator";
try {
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
editor.m_Editor = PropertyEditorProvider.findEditor(editor.m_Value.getClass());
if (editor.m_Editor == null) {
editor.m_Editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
editor.value = this.m_Mocco.m_State.m_Terminator;
editor.editor = PropertyEditorProvider.findEditor(editor.value.getClass());
if (editor.editor == null) {
editor.editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
}
if (editor.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.m_Editor).setClassType(InterfaceTerminator.class);
if (editor.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.editor).setClassType(InterfaceTerminator.class);
}
editor.m_Editor.setValue(editor.m_Value);
editor.editor.setValue(editor.value);
AbstractObjectEditor.findViewFor(editor);
if (editor.m_View != null) {
editor.m_View.repaint();
if (editor.view != null) {
editor.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -188,11 +188,11 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
gbc.gridx = 0;
gbc.gridy = 4;
gbc.weightx = 2;
this.m_Parameters.add(new JLabel("" + editor.m_Name), gbc);
this.m_Parameters.add(new JLabel("" + editor.name), gbc);
gbc.gridx = 1;
gbc.gridy = 4;
gbc.weightx = 1;
this.m_Parameters.add(editor.m_View, gbc);
this.m_Parameters.add(editor.view, gbc);
}
/**
@ -226,13 +226,13 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
} catch (java.lang.NumberFormatException e) {
System.out.println("Can't read amount of perturbation.");
}
if (m_EIMEA.m_Value instanceof IslandModelEA) {
m_Island = (IslandModelEA) m_EIMEA.m_Value;
if (m_EIMEA.value instanceof IslandModelEA) {
m_Island = (IslandModelEA) m_EIMEA.value;
} else {
System.out.println("The selected optimizer does not allow heterogenuous multi-starts!");
}
if (m_EMOSO.m_Value instanceof MOSOLpMetric) {
m_LpMetric = (MOSOLpMetric) m_EMOSO.m_Value;
if (m_EMOSO.value instanceof MOSOLpMetric) {
m_LpMetric = (MOSOLpMetric) m_EMOSO.value;
} else {
System.out.println("The selected MOSO conversion is not suited for the reference point approach!");
}

View File

@ -73,20 +73,20 @@ public class MOCCOParameterizeSO extends MOCCOPhase implements InterfaceProcessE
gbc.fill = GridBagConstraints.BOTH;
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
editor.m_Name = "Optimizer";
editor.name = "Optimizer";
try {
editor.m_Value = this.m_Mocco.m_State.m_Optimizer;
editor.m_Editor = PropertyEditorProvider.findEditor(editor.m_Value.getClass());
if (editor.m_Editor == null) {
editor.m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizer.class);
editor.value = this.m_Mocco.m_State.m_Optimizer;
editor.editor = PropertyEditorProvider.findEditor(editor.value.getClass());
if (editor.editor == null) {
editor.editor = PropertyEditorProvider.findEditor(InterfaceOptimizer.class);
}
if (editor.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.m_Editor).setClassType(InterfaceOptimizer.class);
if (editor.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.editor).setClassType(InterfaceOptimizer.class);
}
editor.m_Editor.setValue(editor.m_Value);
editor.editor.setValue(editor.value);
AbstractObjectEditor.findViewFor(editor);
if (editor.m_View != null) {
editor.m_View.repaint();
if (editor.view != null) {
editor.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -94,27 +94,27 @@ public class MOCCOParameterizeSO extends MOCCOPhase implements InterfaceProcessE
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 1;
tmpP.add(new JLabel("" + editor.m_Name), gbc);
tmpP.add(new JLabel("" + editor.name), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
gbc.weightx = 2;
tmpP.add(editor.m_View, gbc);
tmpP.add(editor.view, gbc);
editor = new GeneralOptimizationEditorProperty();
editor.m_Name = "Terminator";
editor.name = "Terminator";
try {
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
editor.m_Editor = PropertyEditorProvider.findEditor(editor.m_Value.getClass());
if (editor.m_Editor == null) {
editor.m_Editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
editor.value = this.m_Mocco.m_State.m_Terminator;
editor.editor = PropertyEditorProvider.findEditor(editor.value.getClass());
if (editor.editor == null) {
editor.editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
}
if (editor.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.m_Editor).setClassType(InterfaceTerminator.class);
if (editor.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.editor).setClassType(InterfaceTerminator.class);
}
editor.m_Editor.setValue(editor.m_Value);
editor.editor.setValue(editor.value);
AbstractObjectEditor.findViewFor(editor);
if (editor.m_View != null) {
editor.m_View.repaint();
if (editor.view != null) {
editor.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -122,11 +122,11 @@ public class MOCCOParameterizeSO extends MOCCOPhase implements InterfaceProcessE
gbc.gridx = 0;
gbc.gridy = 1;
gbc.weightx = 1;
tmpP.add(new JLabel("" + editor.m_Name), gbc);
tmpP.add(new JLabel("" + editor.name), gbc);
gbc.gridx = 1;
gbc.gridy = 1;
gbc.weightx = 2;
tmpP.add(editor.m_View, gbc);
tmpP.add(editor.view, gbc);
this.m_Mocco.m_JPanelParameters.add(tmpP, BorderLayout.CENTER);
this.m_Mocco.m_JPanelParameters.add(this.makeInformationText("Single-Objective Optimiaztion", "" +
"Please choose an appropriate single-objecitve optimizer."), BorderLayout.NORTH);

View File

@ -169,20 +169,20 @@ public class MOCCOParameterizeSTEP extends MOCCOPhase implements InterfaceProces
this.m_Opt = new GeneticAlgorithm();
this.m_Opt.setProblem(this.m_Mocco.m_State.m_CurrentProblem);
this.m_Mocco.m_State.m_Optimizer = this.m_Opt;
this.m_EOpt.m_Name = "Island Model EA";
this.m_EOpt.name = "Island Model EA";
try {
this.m_EOpt.m_Value = this.m_Opt;
this.m_EOpt.m_Editor = PropertyEditorProvider.findEditor(this.m_EOpt.m_Value.getClass());
if (this.m_EOpt.m_Editor == null) {
this.m_EOpt.m_Editor = PropertyEditorProvider.findEditor(InterfaceOptimizer.class);
this.m_EOpt.value = this.m_Opt;
this.m_EOpt.editor = PropertyEditorProvider.findEditor(this.m_EOpt.value.getClass());
if (this.m_EOpt.editor == null) {
this.m_EOpt.editor = PropertyEditorProvider.findEditor(InterfaceOptimizer.class);
}
if (this.m_EOpt.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EOpt.m_Editor).setClassType(InterfaceOptimizer.class);
if (this.m_EOpt.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EOpt.editor).setClassType(InterfaceOptimizer.class);
}
this.m_EOpt.m_Editor.setValue(this.m_EOpt.m_Value);
this.m_EOpt.editor.setValue(this.m_EOpt.value);
AbstractObjectEditor.findViewFor(this.m_EOpt);
if (this.m_EOpt.m_View != null) {
this.m_EOpt.m_View.repaint();
if (this.m_EOpt.view != null) {
this.m_EOpt.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -190,27 +190,27 @@ public class MOCCOParameterizeSTEP extends MOCCOPhase implements InterfaceProces
gbc.gridx = 0;
gbc.gridy = 2;
gbc.weightx = 2;
this.m_Choice.add(new JLabel("" + this.m_EOpt.m_Name), gbc);
this.m_Choice.add(new JLabel("" + this.m_EOpt.name), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.weightx = 1;
this.m_Choice.add(this.m_EOpt.m_View, gbc);
this.m_Choice.add(this.m_EOpt.view, gbc);
// Terminator
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
editor.m_Name = "Terminator";
editor.name = "Terminator";
try {
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
editor.m_Editor = PropertyEditorProvider.findEditor(editor.m_Value.getClass());
if (editor.m_Editor == null) {
editor.m_Editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
editor.value = this.m_Mocco.m_State.m_Terminator;
editor.editor = PropertyEditorProvider.findEditor(editor.value.getClass());
if (editor.editor == null) {
editor.editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
}
if (editor.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.m_Editor).setClassType(InterfaceTerminator.class);
if (editor.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.editor).setClassType(InterfaceTerminator.class);
}
editor.m_Editor.setValue(editor.m_Value);
editor.editor.setValue(editor.value);
AbstractObjectEditor.findViewFor(editor);
if (editor.m_View != null) {
editor.m_View.repaint();
if (editor.view != null) {
editor.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -218,11 +218,11 @@ public class MOCCOParameterizeSTEP extends MOCCOPhase implements InterfaceProces
gbc.gridx = 0;
gbc.gridy = 3;
gbc.weightx = 2;
this.m_Choice.add(new JLabel("" + editor.m_Name), gbc);
this.m_Choice.add(new JLabel("" + editor.name), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.weightx = 1;
this.m_Choice.add(editor.m_View, gbc);
this.m_Choice.add(editor.view, gbc);
}
/**

View File

@ -109,20 +109,20 @@ public class MOCCOParameterizeTchebycheff extends MOCCOPhase implements Interfac
this.m_Island.setNumberLocalCPUs(this.m_Perturbations);
this.m_Island.setProblem(this.m_Mocco.m_State.m_CurrentProblem);
this.m_Mocco.m_State.m_Optimizer = this.m_Island;
this.m_EIMEA.m_Name = "Island Model EA";
this.m_EIMEA.name = "Island Model EA";
try {
this.m_EIMEA.m_Value = this.m_Island;
this.m_EIMEA.m_Editor = PropertyEditorProvider.findEditor(this.m_EIMEA.m_Value.getClass());
if (this.m_EIMEA.m_Editor == null) {
this.m_EIMEA.m_Editor = PropertyEditorProvider.findEditor(IslandModelEA.class);
this.m_EIMEA.value = this.m_Island;
this.m_EIMEA.editor = PropertyEditorProvider.findEditor(this.m_EIMEA.value.getClass());
if (this.m_EIMEA.editor == null) {
this.m_EIMEA.editor = PropertyEditorProvider.findEditor(IslandModelEA.class);
}
if (this.m_EIMEA.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EIMEA.m_Editor).setClassType(IslandModelEA.class);
if (this.m_EIMEA.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_EIMEA.editor).setClassType(IslandModelEA.class);
}
this.m_EIMEA.m_Editor.setValue(this.m_EIMEA.m_Value);
this.m_EIMEA.editor.setValue(this.m_EIMEA.value);
AbstractObjectEditor.findViewFor(this.m_EIMEA);
if (this.m_EIMEA.m_View != null) {
this.m_EIMEA.m_View.repaint();
if (this.m_EIMEA.view != null) {
this.m_EIMEA.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -130,27 +130,27 @@ public class MOCCOParameterizeTchebycheff extends MOCCOPhase implements Interfac
gbc.gridx = 0;
gbc.gridy = 2;
gbc.weightx = 2;
this.m_Parameters.add(new JLabel("" + this.m_EIMEA.m_Name), gbc);
this.m_Parameters.add(new JLabel("" + this.m_EIMEA.name), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.weightx = 1;
this.m_Parameters.add(this.m_EIMEA.m_View, gbc);
this.m_Parameters.add(this.m_EIMEA.view, gbc);
// Terminator
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
editor.m_Name = "Terminator";
editor.name = "Terminator";
try {
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
editor.m_Editor = PropertyEditorProvider.findEditor(editor.m_Value.getClass());
if (editor.m_Editor == null) {
editor.m_Editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
editor.value = this.m_Mocco.m_State.m_Terminator;
editor.editor = PropertyEditorProvider.findEditor(editor.value.getClass());
if (editor.editor == null) {
editor.editor = PropertyEditorProvider.findEditor(InterfaceTerminator.class);
}
if (editor.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.m_Editor).setClassType(InterfaceTerminator.class);
if (editor.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) editor.editor).setClassType(InterfaceTerminator.class);
}
editor.m_Editor.setValue(editor.m_Value);
editor.editor.setValue(editor.value);
AbstractObjectEditor.findViewFor(editor);
if (editor.m_View != null) {
editor.m_View.repaint();
if (editor.view != null) {
editor.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -158,11 +158,11 @@ public class MOCCOParameterizeTchebycheff extends MOCCOPhase implements Interfac
gbc.gridx = 0;
gbc.gridy = 3;
gbc.weightx = 2;
this.m_Parameters.add(new JLabel("" + editor.m_Name), gbc);
this.m_Parameters.add(new JLabel("" + editor.name), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.weightx = 1;
this.m_Parameters.add(editor.m_View, gbc);
this.m_Parameters.add(editor.view, gbc);
}
private JComponent makeLimits4Weigths() {
@ -230,8 +230,8 @@ public class MOCCOParameterizeTchebycheff extends MOCCOPhase implements Interfac
} catch (NumberFormatException e) {
System.out.println("Can't read k.");
}
if (m_EIMEA.m_Value instanceof IslandModelEA) {
m_Island = (IslandModelEA) m_EIMEA.m_Value;
if (m_EIMEA.value instanceof IslandModelEA) {
m_Island = (IslandModelEA) m_EIMEA.value;
} else {
System.out.println("The selected optimizer does not allow heterogenuous multi-starts!");
}

View File

@ -101,8 +101,8 @@ public class MOCCOViewer extends JPanel implements InterfaceRefSolutionListener,
// this.add(this.m_Main, BorderLayout.CENTER);
// this.m_ViewPanel = new JPanel();
// this.m_ViewPanel.setLayout(new BorderLayout());
// this.m_View = new ParetoFrontView2D(this);
// this.m_ViewPanel.add((JPanel)this.m_View, BorderLayout.CENTER);
// this.view = new ParetoFrontView2D(this);
// this.m_ViewPanel.add((JPanel)this.view, BorderLayout.CENTER);
// this.m_Parameters = new JPanel();
// this.m_Parameters.setLayout(new BorderLayout());
// this.m_Choices = new JPanel();
@ -665,7 +665,7 @@ public class MOCCOViewer extends JPanel implements InterfaceRefSolutionListener,
// for (int i = 0; i < m_JCShow.length; i++) {
// m_MOCCO.m_State.m_Show[i] = m_JCShow[i].isSelected();
// }
// m_View.updateView();
// view.updateView();
// }
// };
// ActionListener colorModeChanged = new ActionListener() {
@ -673,7 +673,7 @@ public class MOCCOViewer extends JPanel implements InterfaceRefSolutionListener,
// for (int i = 0; i < m_JColor.length; i++) {
// m_MOCCO.m_State.m_Color[i] = getColor(m_JColor[i].getSelectedIndex());
// }
// m_View.updateView();
// view.updateView();
// }
// };
//

View File

@ -73,21 +73,21 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit
this.m_Editors = new GeneralOptimizationEditorProperty[list.length];
for (int i = 0; i < list.length; i++) {
this.m_Editors[i] = new GeneralOptimizationEditorProperty();
this.m_Editors[i].m_Name = list[i].getStringRepresentation();
this.m_Editors[i].name = list[i].getStringRepresentation();
try {
this.m_Editors[i].m_Value = list[i];
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(this.m_Editors[i].m_Value.getClass());
if (this.m_Editors[i].m_Editor == null) {
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(InterfaceCrossover.class);
this.m_Editors[i].value = list[i];
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(this.m_Editors[i].value.getClass());
if (this.m_Editors[i].editor == null) {
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(InterfaceCrossover.class);
}
if (this.m_Editors[i].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].m_Editor).setClassType(InterfaceCrossover.class);
if (this.m_Editors[i].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].editor).setClassType(InterfaceCrossover.class);
}
this.m_Editors[i].m_Editor.setValue(this.m_Editors[i].m_Value);
this.m_Editors[i].m_Editor.addPropertyChangeListener(this);
this.m_Editors[i].editor.setValue(this.m_Editors[i].value);
this.m_Editors[i].editor.addPropertyChangeListener(this);
AbstractObjectEditor.findViewFor(this.m_Editors[i]);
if (this.m_Editors[i].m_View != null) {
this.m_Editors[i].m_View.repaint();
if (this.m_Editors[i].view != null) {
this.m_Editors[i].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -190,7 +190,7 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit
gbc.fill = GridBagConstraints.BOTH;
gbc.gridx = 1;
gbc.weightx = 10;
this.m_Targets[i] = this.m_Editors[i].m_View;
this.m_Targets[i] = this.m_Editors[i].view;
this.m_TargetList.add(this.m_Targets[i], gbc);
// The delete button
gbc.anchor = GridBagConstraints.WEST;
@ -239,21 +239,21 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit
InterfaceCrossover[] list = m_CrossoversWithWeights.getSelectedCrossers();
l--;
newEdit[l] = new GeneralOptimizationEditorProperty();
newEdit[l].m_Name = list[l].getStringRepresentation();
newEdit[l].name = list[l].getStringRepresentation();
try {
newEdit[l].m_Value = list[l];
newEdit[l].m_Editor = PropertyEditorProvider.findEditor(newEdit[l].m_Value.getClass());
if (newEdit[l].m_Editor == null) {
newEdit[l].m_Editor = PropertyEditorProvider.findEditor(InterfaceCrossover.class);
newEdit[l].value = list[l];
newEdit[l].editor = PropertyEditorProvider.findEditor(newEdit[l].value.getClass());
if (newEdit[l].editor == null) {
newEdit[l].editor = PropertyEditorProvider.findEditor(InterfaceCrossover.class);
}
if (newEdit[l].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) newEdit[l].m_Editor).setClassType(InterfaceCrossover.class);
if (newEdit[l].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) newEdit[l].editor).setClassType(InterfaceCrossover.class);
}
newEdit[l].m_Editor.setValue(newEdit[l].m_Value);
newEdit[l].m_Editor.addPropertyChangeListener(m_self);
newEdit[l].editor.setValue(newEdit[l].value);
newEdit[l].editor.addPropertyChangeListener(m_self);
AbstractObjectEditor.findViewFor(newEdit[l]);
if (newEdit[l].m_View != null) {
newEdit[l].m_View.repaint();
if (newEdit[l].view != null) {
newEdit[l].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -499,26 +499,26 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit
for (int i = 0; i < list.length; i++) {
if (oldVal.equals(list[i])) {
list[i] = (InterfaceCrossover) newVal;
this.m_Editors[i].m_Name = list[i].getStringRepresentation();
this.m_Editors[i].name = list[i].getStringRepresentation();
try {
this.m_Editors[i].m_Value = list[i];
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(this.m_Editors[i].m_Value.getClass());
if (this.m_Editors[i].m_Editor == null) {
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(InterfaceCrossover.class);
this.m_Editors[i].value = list[i];
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(this.m_Editors[i].value.getClass());
if (this.m_Editors[i].editor == null) {
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(InterfaceCrossover.class);
}
if (this.m_Editors[i].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].m_Editor).setClassType(InterfaceCrossover.class);
if (this.m_Editors[i].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].editor).setClassType(InterfaceCrossover.class);
}
this.m_Editors[i].m_Editor.setValue(this.m_Editors[i].m_Value);
this.m_Editors[i].m_Editor.addPropertyChangeListener(this);
this.m_Editors[i].editor.setValue(this.m_Editors[i].value);
this.m_Editors[i].editor.addPropertyChangeListener(this);
AbstractObjectEditor.findViewFor(this.m_Editors[i]);
if (this.m_Editors[i].m_View != null) {
this.m_Editors[i].m_View.repaint();
if (this.m_Editors[i].view != null) {
this.m_Editors[i].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
}
this.m_Targets[i] = this.m_Editors[i].m_View;
this.m_Targets[i] = this.m_Editors[i].view;
i = list.length;
}
}

View File

@ -71,21 +71,21 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito
this.m_Editors = new GeneralOptimizationEditorProperty[list.length];
for (int i = 0; i < list.length; i++) {
this.m_Editors[i] = new GeneralOptimizationEditorProperty();
this.m_Editors[i].m_Name = list[i].getStringRepresentation();
this.m_Editors[i].name = list[i].getStringRepresentation();
try {
this.m_Editors[i].m_Value = list[i];
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(this.m_Editors[i].m_Value.getClass());
if (this.m_Editors[i].m_Editor == null) {
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(InterfaceMutation.class);
this.m_Editors[i].value = list[i];
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(this.m_Editors[i].value.getClass());
if (this.m_Editors[i].editor == null) {
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(InterfaceMutation.class);
}
if (this.m_Editors[i].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].m_Editor).setClassType(InterfaceMutation.class);
if (this.m_Editors[i].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].editor).setClassType(InterfaceMutation.class);
}
this.m_Editors[i].m_Editor.setValue(this.m_Editors[i].m_Value);
this.m_Editors[i].m_Editor.addPropertyChangeListener(this);
this.m_Editors[i].editor.setValue(this.m_Editors[i].value);
this.m_Editors[i].editor.addPropertyChangeListener(this);
AbstractObjectEditor.findViewFor(this.m_Editors[i]);
if (this.m_Editors[i].m_View != null) {
this.m_Editors[i].m_View.repaint();
if (this.m_Editors[i].view != null) {
this.m_Editors[i].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -188,7 +188,7 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito
gbc.fill = GridBagConstraints.BOTH;
gbc.gridx = 1;
gbc.weightx = 10;
this.m_Targets[i] = this.m_Editors[i].m_View;
this.m_Targets[i] = this.m_Editors[i].view;
this.m_TargetList.add(this.m_Targets[i], gbc);
// The delete button
gbc.anchor = GridBagConstraints.WEST;
@ -237,21 +237,21 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito
InterfaceMutation[] list = m_MutatorsWithWeights.getSelectedMutators();
l--;
newEdit[l] = new GeneralOptimizationEditorProperty();
newEdit[l].m_Name = list[l].getStringRepresentation();
newEdit[l].name = list[l].getStringRepresentation();
try {
newEdit[l].m_Value = list[l];
newEdit[l].m_Editor = PropertyEditorProvider.findEditor(newEdit[l].m_Value.getClass());
if (newEdit[l].m_Editor == null) {
newEdit[l].m_Editor = PropertyEditorProvider.findEditor(InterfaceMutation.class);
newEdit[l].value = list[l];
newEdit[l].editor = PropertyEditorProvider.findEditor(newEdit[l].value.getClass());
if (newEdit[l].editor == null) {
newEdit[l].editor = PropertyEditorProvider.findEditor(InterfaceMutation.class);
}
if (newEdit[l].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) newEdit[l].m_Editor).setClassType(InterfaceMutation.class);
if (newEdit[l].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) newEdit[l].editor).setClassType(InterfaceMutation.class);
}
newEdit[l].m_Editor.setValue(newEdit[l].m_Value);
newEdit[l].m_Editor.addPropertyChangeListener(m_self);
newEdit[l].editor.setValue(newEdit[l].value);
newEdit[l].editor.addPropertyChangeListener(m_self);
AbstractObjectEditor.findViewFor(newEdit[l]);
if (newEdit[l].m_View != null) {
newEdit[l].m_View.repaint();
if (newEdit[l].view != null) {
newEdit[l].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
@ -491,26 +491,26 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito
for (int i = 0; i < list.length; i++) {
if (oldVal.equals(list[i])) {
list[i] = (InterfaceMutation) newVal;
this.m_Editors[i].m_Name = list[i].getStringRepresentation();
this.m_Editors[i].name = list[i].getStringRepresentation();
try {
this.m_Editors[i].m_Value = list[i];
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(this.m_Editors[i].m_Value.getClass());
if (this.m_Editors[i].m_Editor == null) {
this.m_Editors[i].m_Editor = PropertyEditorProvider.findEditor(InterfaceMutation.class);
this.m_Editors[i].value = list[i];
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(this.m_Editors[i].value.getClass());
if (this.m_Editors[i].editor == null) {
this.m_Editors[i].editor = PropertyEditorProvider.findEditor(InterfaceMutation.class);
}
if (this.m_Editors[i].m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].m_Editor).setClassType(InterfaceMutation.class);
if (this.m_Editors[i].editor instanceof GenericObjectEditor) {
((GenericObjectEditor) this.m_Editors[i].editor).setClassType(InterfaceMutation.class);
}
this.m_Editors[i].m_Editor.setValue(this.m_Editors[i].m_Value);
this.m_Editors[i].m_Editor.addPropertyChangeListener(this);
this.m_Editors[i].editor.setValue(this.m_Editors[i].value);
this.m_Editors[i].editor.addPropertyChangeListener(this);
AbstractObjectEditor.findViewFor(this.m_Editors[i]);
if (this.m_Editors[i].m_View != null) {
this.m_Editors[i].m_View.repaint();
if (this.m_Editors[i].view != null) {
this.m_Editors[i].view.repaint();
}
} catch (Exception e) {
System.out.println("Darn can't read the value...");
}
this.m_Targets[i] = this.m_Editors[i].m_View;
this.m_Targets[i] = this.m_Editors[i].view;
i = list.length;
}
}

View File

@ -1,11 +1,7 @@
package eva2.optimization.problems;
/**
* Created by IntelliJ IDEA.
* User: streiche
* Date: 24.03.2003
* Time: 17:58:55
* To change this template use Options | File Templates.
*
*/
public abstract class AbstractProblemDoubleOffset extends AbstractProblemDouble implements Interface2DBorderProblem {

View File

@ -18,26 +18,20 @@ import java.util.Hashtable;
/**
* TODO
* This class should be unified with GenericObjectEditor.
* <p/>
* Created by IntelliJ IDEA.
* User: streiche
* Date: 24.08.2004
* Time: 13:39:42
* To change this template use File | Settings | File Templates.
*/
public abstract class AbstractObjectEditor implements PropertyEditor, java.beans.PropertyChangeListener {
/**
* Handles property change notification
*/
public PropertyChangeSupport m_Support = new PropertyChangeSupport(this);
public PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
/**
* The Object that is to be edited
*/
public Object m_Object;
public Object m_Backup;
public Object object;
public Object backupObject;
public GeneralGenericObjectEditorPanel objectEditorPanel;
public Hashtable m_Editors = new Hashtable();
public Hashtable editorTable = new Hashtable();
/**
* ****************************** java.beans.PropertyChangeListener ************************
@ -45,18 +39,18 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) {
m_Support = new PropertyChangeSupport(this);
if (propertyChangeSupport == null) {
propertyChangeSupport = new PropertyChangeSupport(this);
}
m_Support.addPropertyChangeListener(l);
propertyChangeSupport.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) {
m_Support = new PropertyChangeSupport(this);
if (propertyChangeSupport == null) {
propertyChangeSupport = new PropertyChangeSupport(this);
}
m_Support.removePropertyChangeListener(l);
propertyChangeSupport.removePropertyChangeListener(l);
}
/**
@ -69,7 +63,7 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
public void propertyChange(PropertyChangeEvent evt) {
System.out.println("------------- here-----------------");
this.updateCenterComponent(evt); // Let our panel update before guys downstream
m_Support.firePropertyChange("", m_Backup, m_Object);
propertyChangeSupport.firePropertyChange("", backupObject, object);
}
/********************************* PropertyEditor *************************/
@ -139,7 +133,7 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
* @param n new
*/
public void firePropertyChange(String s, Object old, Object n) {
m_Support.firePropertyChange(s, old, n);
propertyChangeSupport.firePropertyChange(s, old, n);
}
/**
@ -152,7 +146,7 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
@Override
public Object getValue() {
return this.m_Object;
return this.object;
}
/**
@ -174,26 +168,26 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
GridBagLayout gbLayout = new GridBagLayout();
JPanel result = new JPanel();
JPanel centerWrapper = new JPanel();
this.m_Editors.clear();
this.editorTable.clear();
result.setLayout(new BorderLayout());
result.setVisible(true);
// Define the upper area containing the desription and the help button
String globalInfo = this.getGlobalInfo();
JTextArea jt = new JTextArea();
StringBuffer m_HelpText;
String m_ClassName;
JButton m_HelpBut;
m_ClassName = "Genetic Algorithm";
m_HelpText = new StringBuffer("NAME\n");
m_HelpText.append(m_ClassName).append("\n\n");
m_HelpText.append("SYNOPSIS\n").append(globalInfo).append("\n\n");
m_HelpBut = new JButton("Help");
m_HelpBut.setToolTipText("More information about " + m_ClassName);
m_HelpBut.addActionListener(new ActionListener() {
StringBuffer helpText;
String className;
JButton helpButton;
className = "Genetic Algorithm";
helpText = new StringBuffer("NAME\n");
helpText.append(className).append("\n\n");
helpText.append("SYNOPSIS\n").append(globalInfo).append("\n\n");
helpButton = new JButton("Help");
helpButton.setToolTipText("More information about " + className);
helpButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent a) {
HtmlDemo temp = new HtmlDemo(EVAHELP.cutClassName(m_Object.getClass().getName()) + ".html");
HtmlDemo temp = new HtmlDemo(EVAHELP.cutClassName(object.getClass().getName()) + ".html");
temp.show();
}
});
@ -212,7 +206,7 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
JPanel p2 = new JPanel();
p2.setLayout(new BorderLayout());
if (HtmlDemo.resourceExists(getHelpFileName())) {
p2.add(m_HelpBut, BorderLayout.NORTH);
p2.add(helpButton, BorderLayout.NORTH);
}
jp.add(p2, BorderLayout.EAST);
GridBagConstraints gbConstraints = new GridBagConstraints();
@ -231,7 +225,7 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
}
public String getHelpFileName() {
return EVAHELP.cutClassName(m_Object.getClass().getName()) + ".html";
return EVAHELP.cutClassName(object.getClass().getName()) + ".html";
}
/**
@ -270,28 +264,28 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
if (propertyDescriptor.getName().equalsIgnoreCase(prop)) {
result = new GeneralOptimizationEditorProperty();
Object args[] = {};
result.m_getMethod = propertyDescriptor.getReadMethod();
result.m_setMethod = propertyDescriptor.getWriteMethod();
result.m_PropertyType = propertyDescriptor.getPropertyType();
result.m_Name = propertyDescriptor.getDisplayName();
result.m_Label = new JLabel(result.m_Name, SwingConstants.RIGHT);
result.m_TipText = BeanInspector.getToolTipText(result.m_Name, methods, target);
result.getMethod = propertyDescriptor.getReadMethod();
result.setMethod = propertyDescriptor.getWriteMethod();
result.propertyType = propertyDescriptor.getPropertyType();
result.name = propertyDescriptor.getDisplayName();
result.label = new JLabel(result.name, SwingConstants.RIGHT);
result.tipText = BeanInspector.getToolTipText(result.name, methods, target);
try {
result.m_Value = result.m_getMethod.invoke(target, args);
result.m_Editor = PropertyEditorProvider.findEditor(propertyDescriptor, result.m_Value);
if (result.m_Editor == null) {
result.m_Editor = PropertyEditorProvider.findEditor(result.m_PropertyType);
result.value = result.getMethod.invoke(target, args);
result.editor = PropertyEditorProvider.findEditor(propertyDescriptor, result.value);
if (result.editor == null) {
result.editor = PropertyEditorProvider.findEditor(result.propertyType);
}
if (result.m_Editor instanceof GenericObjectEditor) {
((GenericObjectEditor) result.m_Editor).setClassType(result.m_PropertyType);
if (result.editor instanceof GenericObjectEditor) {
((GenericObjectEditor) result.editor).setClassType(result.propertyType);
}
result.m_Editor.setValue(result.m_Value);
result.m_Editor.addPropertyChangeListener(this);
result.editor.setValue(result.value);
result.editor.addPropertyChangeListener(this);
this.findViewFor(result);
if (result.m_View != null) {
result.m_View.repaint();
if (result.view != null) {
result.view.repaint();
}
} catch (Exception e) {
System.out.println("Darn cant read the value...");
@ -311,9 +305,9 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
* @param editor The property the select a view for.
*/
public static void findViewFor(GeneralOptimizationEditorProperty editor) {
editor.m_View = PropertySheetPanel.getView(editor.m_Editor);
if (editor.m_View == null) {
System.out.println("Warning: Property \"" + editor.m_Name
editor.view = PropertySheetPanel.getView(editor.editor);
if (editor.view == null) {
System.out.println("Warning: Property \"" + editor.name
+ "\" has non-displayabale editor. Skipping.");
}
}

View File

@ -11,11 +11,7 @@ import java.io.FileReader;
import java.util.ArrayList;
/**
* Created by IntelliJ IDEA.
* User: streiche
* Date: 13.09.2005
* Time: 18:51:10
* To change this template use File | Settings | File Templates.
*
*/
public class DeNovofilter {

View File

@ -8,89 +8,61 @@ import java.beans.PropertyEditor;
import java.io.*;
/**
* Created by IntelliJ IDEA.
* User: streiche
* Date: 20.04.2005
* Time: 11:41:29
* To change this template use File | Settings | File Templates.
*
*/
public class GeneralGEOFaker extends JPanel {
private JButton open, save, ok, edit;
private JFileChooser m_FileChooser;
// private Vector m_ClassesLongName;
// private SourceCodeEditor m_SourceCodeEditor;
// private PropertyDialog m_SourceCodeEditorFrame;
private PropertyEditor m_Editor;
private JPanel m_Interior;
private Class m_ClassType;
private JButton openButton, saveButton, okButton, editButton;
private JFileChooser fileChooser;
private PropertyEditor editor;
private JPanel interiorPanel;
private Class classType;
public GeneralGEOFaker(PropertyEditor e, JPanel i) {
this.m_Interior = i;
this.m_Editor = e;
this.m_ClassType = this.m_Editor.getValue().getClass();
this.interiorPanel = i;
this.editor = e;
this.classType = this.editor.getValue().getClass();
init();
}
private void init() {
this.setLayout(new BorderLayout());
open = new JButton("Open...");
open.setToolTipText("Load a configured object");
open.setEnabled(true);
open.addActionListener(new ActionListener() {
openButton = new JButton("Open...");
openButton.setToolTipText("Load a configured object");
openButton.setEnabled(true);
openButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Object object = openObject();
if (object != null) {
// setValue takes care of: Making sure obj is of right type,
// and firing property change.
m_Editor.setValue(object);
editor.setValue(object);
// Need a second setValue to get property values filled in OK.
// Not sure why.
m_Editor.setValue(object); // <- Hannes ?!?!?
editor.setValue(object); // <- Hannes ?!?!?
}
}
});
save = new JButton("Save...");
save.setToolTipText("Save the current configured object");
save.setEnabled(true);
save.addActionListener(new ActionListener() {
saveButton = new JButton("Save...");
saveButton.setToolTipText("Save the current configured object");
saveButton.setEnabled(true);
saveButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
saveObject(m_Editor.getValue());
saveObject(editor.getValue());
}
});
edit = new JButton("Edit Source");
edit.setToolTipText("Edit the Source");
edit.setEnabled(false);
// edit.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// edit.setEnabled(false);
// m_SourceCodeEditor = new SourceCodeEditor();
// String className = m_Editor.getValue().getClass().getName();
// m_SourceCodeEditor.editSource(Main.DYNAMICCLASSES_PROPERTIES.getProperty(className));
// m_SourceCodeEditorFrame = new PropertyDialog(m_SourceCodeEditor, "test", 50, 50);
// m_SourceCodeEditorFrame.pack();
// m_SourceCodeEditorFrame.addWindowListener(new WindowAdapter() {
// public void windowClosing (WindowEvent e) {
// m_SourceCodeEditor = null;
// edit.setEnabled(true);
// }
// });
// m_SourceCodeEditor.addPropertyChangeListener(new PropertyChangeListener() {
// public void propertyChange(PropertyChangeEvent evt) {
// sourceChanged();
// }
// });
// }
// });
editButton = new JButton("Edit Source");
editButton.setToolTipText("Edit the Source");
editButton.setEnabled(false);
ok = new JButton("OK");
ok.setEnabled(true);
ok.addActionListener(new ActionListener() {
okButton = new JButton("OK");
okButton.setEnabled(true);
okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if ((getTopLevelAncestor() != null) && (getTopLevelAncestor() instanceof Window)) {
@ -100,14 +72,14 @@ public class GeneralGEOFaker extends JPanel {
}
});
setLayout(new BorderLayout());
add(this.m_Interior, BorderLayout.CENTER);
add(this.interiorPanel, BorderLayout.CENTER);
JPanel okcButs = new JPanel();
okcButs.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
okcButs.setLayout(new GridLayout(1, 4, 5, 5));
okcButs.add(open);
okcButs.add(save);
okcButs.add(ok);
okcButs.add(edit);
okcButs.add(openButton);
okcButs.add(saveButton);
okcButs.add(okButton);
okcButs.add(editButton);
add(okcButs, BorderLayout.SOUTH);
}
@ -117,18 +89,18 @@ public class GeneralGEOFaker extends JPanel {
* @return the loaded object, or null if the operation was cancelled
*/
protected Object openObject() {
if (m_FileChooser == null) {
if (fileChooser == null) {
createFileChooser();
}
int returnVal = m_FileChooser.showOpenDialog(this);
int returnVal = fileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File selected = m_FileChooser.getSelectedFile();
File selected = fileChooser.getSelectedFile();
try {
ObjectInputStream oi = new ObjectInputStream(new BufferedInputStream(new FileInputStream(selected)));
Object obj = oi.readObject();
oi.close();
if (!m_ClassType.isAssignableFrom(obj.getClass())) {
throw new Exception("Object not of type: " + m_ClassType.getName());
if (!classType.isAssignableFrom(obj.getClass())) {
throw new Exception("Object not of type: " + classType.getName());
}
return obj;
} catch (Exception ex) {
@ -144,12 +116,12 @@ public class GeneralGEOFaker extends JPanel {
* @param object The object to save.
*/
protected void saveObject(Object object) {
if (m_FileChooser == null) {
if (fileChooser == null) {
createFileChooser();
}
int returnVal = m_FileChooser.showSaveDialog(this);
int returnVal = fileChooser.showSaveDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File sFile = m_FileChooser.getSelectedFile();
File sFile = fileChooser.getSelectedFile();
try {
ObjectOutputStream oo = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(sFile)));
oo.writeObject(object);
@ -161,7 +133,7 @@ public class GeneralGEOFaker extends JPanel {
}
protected void createFileChooser() {
m_FileChooser = new JFileChooser(new File("/resources"));
m_FileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
fileChooser = new JFileChooser(new File("/resources"));
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
}
}

View File

@ -25,45 +25,44 @@ import java.util.ArrayList;
public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListener {
// This is the Object Editor i belong too
private AbstractObjectEditor m_ObjectEditor;
private AbstractObjectEditor objectEditor;
/**
* The chooser component
*/
private JComboBox m_ObjectChooser;
private JComboBox objectChooser;
/**
* The component that performs classifier customization
*/
//private PropertySheetPanel m_ChildPropertySheet;
private JPanel m_PPWrapper;
private JPanel m_PropertyPanel;
private JPanel propertyPanelWrapper;
private JPanel propertyPanel;
/**
* The model containing the list of names to select from
*/
private DefaultComboBoxModel m_ObjectNames;
private DefaultComboBoxModel objectNames;
/**
* Open object from disk
*/
private JButton m_OpenBut;
private JButton openButton;
/**
* Save object to disk
*/
private JButton m_SaveBut;
private JButton saveButton;
/**
* ok button
*/
public JButton m_okBut;
public JButton okButton;
/**
* cancel button
*/
private JButton m_cancelBut;
private JButton cancelButton;
/**
* The filechooser for opening and saving object files
*/
private JFileChooser m_FileChooser;
private JFileChooser fileChooser;
/**
* Creates the GUI editor component
*/
private ArrayList<String> m_ClassesLongName;
private ArrayList<String> longClassNames;
/**
* This is the general construtor method
@ -71,78 +70,53 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
* @param oe A link to the oe;
*/
public GeneralGenericObjectEditorPanel(AbstractObjectEditor oe) {
this.m_ObjectEditor = oe;
this.objectEditor = oe;
oe.makeBackup();
m_ObjectNames = new DefaultComboBoxModel(new String[0]);
m_ObjectChooser = new JComboBox(m_ObjectNames);
m_ObjectChooser.setEditable(false);
m_PPWrapper = new JPanel();
m_PropertyPanel = this.m_ObjectEditor.getPropertyPanel();
m_PropertyPanel.addPropertyChangeListener(new PropertyChangeListener() {
objectNames = new DefaultComboBoxModel(new String[0]);
objectChooser = new JComboBox(objectNames);
objectChooser.setEditable(false);
propertyPanelWrapper = new JPanel();
propertyPanel = this.objectEditor.getPropertyPanel();
propertyPanel.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
m_ObjectEditor.firePropertyChange("", null, m_ObjectEditor.getValue());
objectEditor.firePropertyChange("", null, objectEditor.getValue());
}
});
m_OpenBut = new JButton("Open...");
m_OpenBut.setToolTipText("Load a configured object");
m_OpenBut.setEnabled(true);
m_OpenBut.addActionListener(new ActionListener() {
openButton = new JButton("Open...");
openButton.setToolTipText("Load a configured object");
openButton.setEnabled(true);
openButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Object object = openObject();
if (object != null) {
// setValue takes care of: Making sure obj is of right type,
// and firing property change.
m_ObjectEditor.setValue(object);
objectEditor.setValue(object);
// Need a second setValue to get property values filled in OK.
// Not sure why.
m_ObjectEditor.setValue(object); // <- Hannes ?!?!?
objectEditor.setValue(object); // <- Hannes ?!?!?
}
}
});
m_SaveBut = new JButton("Save...");
m_SaveBut.setToolTipText("Save the current configured object");
m_SaveBut.setEnabled(true);
m_SaveBut.addActionListener(new ActionListener() {
saveButton = new JButton("Save...");
saveButton.setToolTipText("Save the current configured object");
saveButton.setEnabled(true);
saveButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
saveObject(m_ObjectEditor.getValue());
saveObject(objectEditor.getValue());
}
});
// m_editSourceBut = new JButton("Edit Source");
// m_editSourceBut.setToolTipText("Edit the Source");
// m_editSourceBut.setEnabled(false);
// m_editSourceBut.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// m_editSourceBut.setEnabled(false);
// m_SourceCodeEditor = new SourceCodeEditor();
// String className = m_ObjectEditor.getValue().getClass().getName();
// m_SourceCodeEditor.editSource(Main.DYNAMICCLASSES_PROPERTIES.getProperty(className));
// m_SourceCodeEditorFrame = new PropertyDialog(m_SourceCodeEditor, "test", 50, 50);
// m_SourceCodeEditorFrame.pack();
// m_SourceCodeEditorFrame.addWindowListener(new WindowAdapter() {
// public void windowClosing (WindowEvent e) {
// m_SourceCodeEditor = null;
// m_editSourceBut.setEnabled(true);
// }
// });
// m_SourceCodeEditor.addPropertyChangeListener(new PropertyChangeListener() {
// public void propertyChange(PropertyChangeEvent evt) {
// sourceChanged();
// }
// });
// }
// });
m_okBut = new JButton("OK");
m_okBut.setEnabled(true);
m_okBut.addActionListener(new ActionListener() {
okButton = new JButton("OK");
okButton.setEnabled(true);
okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
m_ObjectEditor.makeBackup();
objectEditor.makeBackup();
if ((getTopLevelAncestor() != null) && (getTopLevelAncestor() instanceof Window)) {
Window w = (Window) getTopLevelAncestor();
w.dispose();
@ -150,12 +124,12 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
}
});
m_cancelBut = new JButton("Cancel");
m_cancelBut.setEnabled(false);
m_cancelBut.addActionListener(new ActionListener() {
cancelButton = new JButton("Cancel");
cancelButton.setEnabled(false);
cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
m_ObjectEditor.undoBackup();
objectEditor.undoBackup();
updateClassType();
updateChooser();
updateChildPropertySheet();
@ -167,28 +141,25 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
});
setLayout(new BorderLayout());
add(m_ObjectChooser, BorderLayout.NORTH); // important
m_PPWrapper.add(m_PropertyPanel);
add((JComponent) m_PPWrapper, BorderLayout.CENTER);
// Since we resize to the size of the property sheet, a scrollpane isn't
// typically needed
// add(new JScrollPane(m_ChildPropertySheet), BorderLayout.CENTER);
add(objectChooser, BorderLayout.NORTH); // important
propertyPanelWrapper.add(propertyPanel);
add((JComponent) propertyPanelWrapper, BorderLayout.CENTER);
JPanel okcButs = new JPanel();
okcButs.setBorder(BorderFactory.createEmptyBorder());
okcButs.setLayout(new GridLayout(1, 4, 5, 5));
okcButs.add(m_OpenBut);
okcButs.add(m_SaveBut);
okcButs.add(m_okBut);
//okcButs.add(m_cancelBut);
okcButs.add(openButton);
okcButs.add(saveButton);
okcButs.add(okButton);
//okcButs.add(cancelButton);
add(okcButs, BorderLayout.SOUTH);
if (this.m_ObjectEditor.getClassType() != null) {
if (this.objectEditor.getClassType() != null) {
updateClassType();
updateChooser();
updateChildPropertySheet();
}
m_ObjectChooser.addItemListener(this);
objectChooser.addItemListener(this);
}
/**
@ -197,19 +168,19 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
* @return the loaded object, or null if the operation was cancelled
*/
protected Object openObject() {
if (m_FileChooser == null) {
if (fileChooser == null) {
createFileChooser();
}
int returnVal = m_FileChooser.showOpenDialog(this);
int returnVal = fileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File selected = m_FileChooser.getSelectedFile();
File selected = fileChooser.getSelectedFile();
try {
ObjectInputStream oi = new ObjectInputStream(new BufferedInputStream(new FileInputStream(selected)));
Object obj = oi.readObject();
oi.close();
if (!this.m_ObjectEditor.getClassType().isAssignableFrom(obj.getClass())) {
throw new Exception("Object not of type: " + this.m_ObjectEditor.getClassType().getName());
if (!this.objectEditor.getClassType().isAssignableFrom(obj.getClass())) {
throw new Exception("Object not of type: " + this.objectEditor.getClassType().getName());
}
return obj;
} catch (Exception ex) {
@ -230,12 +201,12 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
* @param object the object to save.
*/
protected void saveObject(Object object) {
if (m_FileChooser == null) {
if (fileChooser == null) {
createFileChooser();
}
int returnVal = m_FileChooser.showSaveDialog(this);
int returnVal = fileChooser.showSaveDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File sFile = m_FileChooser.getSelectedFile();
File sFile = fileChooser.getSelectedFile();
try {
ObjectOutputStream oo = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(sFile)));
oo.writeObject(object);
@ -255,8 +226,8 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
* This method creates a file chooser
*/
protected void createFileChooser() {
m_FileChooser = new JFileChooser(new File("/resources"));
m_FileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
fileChooser = new JFileChooser(new File("/resources"));
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
}
/**
@ -265,7 +236,7 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
* @param a The action listener.
*/
public void addOkListener(ActionListener a) {
m_okBut.addActionListener(a);
okButton.addActionListener(a);
}
/**
@ -274,7 +245,7 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
* @param a The action listener.
*/
public void addCancelListener(ActionListener a) {
m_cancelBut.addActionListener(a);
cancelButton.addActionListener(a);
}
/**
@ -283,7 +254,7 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
* @param a The action listener
*/
public void removeOkListener(ActionListener a) {
m_okBut.removeActionListener(a);
okButton.removeActionListener(a);
}
/**
@ -292,35 +263,35 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
* @param a The action listener
*/
public void removeCancelListener(ActionListener a) {
m_cancelBut.removeActionListener(a);
cancelButton.removeActionListener(a);
}
/**
* This method updates the class type*
*/
protected void updateClassType() {
m_ClassesLongName = GenericObjectEditor.getClassesFromProperties(m_ObjectEditor.getClassType().getName(), null);
m_ObjectChooser.setModel(new DefaultComboBoxModel(m_ClassesLongName.toArray()));
if (m_ClassesLongName.size() > 1) {
add(m_ObjectChooser, BorderLayout.NORTH);
longClassNames = GenericObjectEditor.getClassesFromProperties(objectEditor.getClassType().getName(), null);
objectChooser.setModel(new DefaultComboBoxModel(longClassNames.toArray()));
if (longClassNames.size() > 1) {
add(objectChooser, BorderLayout.NORTH);
} else {
remove(m_ObjectChooser);
remove(objectChooser);
}
}
protected void updateChooser() {
String objectName = /*EVAHELP.cutClassName*/ (this.m_ObjectEditor.getValue().getClass().getName());
String objectName = /*EVAHELP.cutClassName*/ (this.objectEditor.getValue().getClass().getName());
boolean found = false;
for (int i = 0; i < m_ObjectNames.getSize(); i++) {
if (objectName.equals((String) m_ObjectNames.getElementAt(i))) {
for (int i = 0; i < objectNames.getSize(); i++) {
if (objectName.equals((String) objectNames.getElementAt(i))) {
found = true;
break;
}
}
if (!found) {
m_ObjectNames.addElement(objectName);
objectNames.addElement(objectName);
}
m_ObjectChooser.getModel().setSelectedItem(objectName);
objectChooser.getModel().setSelectedItem(objectName);
}
/**
@ -328,18 +299,8 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
* *what!?*
*/
public void updateChildPropertySheet() {
// Set the object as the target of the propertysheet
// PropertyEditor edit = PropertyEditorManager.findEditor(m_Object.getClass());
// if (!(edit instanceof GenericObjectEditor)) {
// System.out.println("This is my chance to change something!");
// System.out.println("Class: " + m_Object.getClass());
// if (edit != null) System.out.println("Editor: " + edit.getClass());
// else System.out.println("No editor found for class " + m_Object.getClass());
// //edit.setValue(c);
// }
this.m_PPWrapper.removeAll();
this.m_PPWrapper.add(this.m_ObjectEditor.getPropertyPanel());
// m_ChildPropertySheet.setTarget(this.m_ObjectEditor.getValue());
this.propertyPanelWrapper.removeAll();
this.propertyPanelWrapper.add(this.objectEditor.getPropertyPanel());
// Adjust size of containing window if possible
if ((getTopLevelAncestor() != null) && (getTopLevelAncestor() instanceof Window)) {
((Window) getTopLevelAncestor()).pack();
@ -354,19 +315,19 @@ public class GeneralGenericObjectEditorPanel extends JPanel implements ItemListe
*/
@Override
public void itemStateChanged(ItemEvent e) {
String className = (String) m_ObjectChooser.getSelectedItem();
String className = (String) objectChooser.getSelectedItem();
//System.out.println("Event-Quelle: " + e.getSource().toString());
if ((e.getSource() == m_ObjectChooser) && (e.getStateChange() == ItemEvent.SELECTED)) {
className = (String) m_ObjectChooser.getSelectedItem();
if ((e.getSource() == objectChooser) && (e.getStateChange() == ItemEvent.SELECTED)) {
className = (String) objectChooser.getSelectedItem();
try {
System.out.println(className);
Object n = (Object) Class.forName(className).newInstance();
this.m_ObjectEditor.setValue(n);
this.objectEditor.setValue(n);
} catch (Exception ex) {
System.out.println("Exeption in itemStateChanged" + ex.getMessage());
m_ObjectChooser.hidePopup();
m_ObjectChooser.setSelectedIndex(0);
objectChooser.hidePopup();
objectChooser.setSelectedIndex(0);
JOptionPane.showMessageDialog(this,
"Could not create an example of\n"
+ className + "\n"

View File

@ -8,16 +8,15 @@ import java.lang.reflect.Method;
* Representation of an OptimizationEditor Property
*/
public class GeneralOptimizationEditorProperty {
public Method m_getMethod;
public Method m_setMethod;
public PropertyEditor m_Editor;
public Object m_Value;
public JComponent m_View;
public JComponent m_ViewWrapper;
public JLabel m_Label;
public Class m_PropertyType;
public String m_Name;
public String m_TipText;
public Method getMethod;
public Method setMethod;
public PropertyEditor editor;
public Object value;
public JComponent view;
public JLabel label;
public Class propertyType;
public String name;
public String tipText;
public GeneralOptimizationEditorProperty() {
}

View File

@ -67,15 +67,15 @@ public class ImpactOfDimensionOnMOEAs {
public void save(double[][] log) {
String tmpS;
BufferedWriter m_OutputFile = null;
BufferedWriter outputFile = null;
try {
m_OutputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("Impact_Of_Dimension_On_MOEAs.dat")));
outputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("Impact_Of_Dimension_On_MOEAs.dat")));
} catch (FileNotFoundException e) {
System.out.println("Could not open output file! Filename: Impact_Of_Dimension_On_MOEAs.dat");
}
try {
tmpS = "Dim;P100;P200;P300;P400;P500\n";
m_OutputFile.write(tmpS);
outputFile.write(tmpS);
for (int i = 0; i < log.length; i++) {
tmpS = "" + i + ";";
for (int j = 0; j < log[i].length; j++) {
@ -85,13 +85,13 @@ public class ImpactOfDimensionOnMOEAs {
}
}
tmpS += "\n";
m_OutputFile.write(tmpS);
outputFile.write(tmpS);
}
} catch (IOException e) {
System.out.println("Problems writing to output file!");
}
try {
m_OutputFile.close();
outputFile.close();
} catch (IOException e) {
}

View File

@ -8,18 +8,14 @@ import java.io.*;
import java.util.ArrayList;
/**
* Created by IntelliJ IDEA.
* User: streiche
* Date: 06.10.2004
* Time: 14:10:37
* To change this template use File | Settings | File Templates.
*
*/
public class ParetoFrontLocalTester {
// ToDo: Have this on another frame (won't show as JInternalFrame)
private Plot m_Plot;
private Plot plot;
private int index = 0;
private BufferedWriter m_OutputFile = null;
private BufferedWriter outputFile = null;
private void show() {
double[] loss = new double[5];
@ -87,7 +83,7 @@ public class ParetoFrontLocalTester {
private void saveThisStuff(ArrayList c, ArrayList e) {
try {
this.m_OutputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("CompleteList")));
this.outputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("CompleteList")));
} catch (FileNotFoundException ex) {
System.out.println("Could not open output file!");
}
@ -101,12 +97,12 @@ public class ParetoFrontLocalTester {
this.writeToFile(line);
}
try {
this.m_OutputFile.close();
this.outputFile.close();
} catch (java.io.IOException ex) {
}
// next file
try {
this.m_OutputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("ListElements")));
this.outputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("ListElements")));
} catch (FileNotFoundException ex) {
System.out.println("Could not open output file!");
}
@ -128,7 +124,7 @@ public class ParetoFrontLocalTester {
this.writeToFile(line);
}
try {
this.m_OutputFile.close();
this.outputFile.close();
} catch (java.io.IOException ex) {
}
}
@ -140,12 +136,12 @@ public class ParetoFrontLocalTester {
*/
private void writeToFile(String line) {
String write = line + "\n";
if (this.m_OutputFile == null) {
if (this.outputFile == null) {
return;
}
try {
this.m_OutputFile.write(write, 0, write.length());
this.m_OutputFile.flush();
this.outputFile.write(write, 0, write.length());
this.outputFile.flush();
} catch (IOException e) {
System.out.println("Problems writing to output file!");
}
@ -155,12 +151,12 @@ public class ParetoFrontLocalTester {
double[] tmpD = new double[2];
tmpD[0] = 0;
tmpD[1] = 0;
this.m_Plot = new Plot("Multiobjective Optimization", "Y1", "Y2", tmpD, tmpD);
this.plot = new Plot("Multiobjective Optimization", "Y1", "Y2", tmpD, tmpD);
}
private void showLine(double[][] elm) {
GraphPointSet mySet = new GraphPointSet(this.index, this.m_Plot.getFunctionArea());
GraphPointSet mySet = new GraphPointSet(this.index, this.plot.getFunctionArea());
this.index++;
for (int i = 0; i < elm.length; i++) {
mySet.addDPoint(elm[i][1], elm[i][0]);

View File

@ -8,17 +8,13 @@ import java.io.*;
import java.util.ArrayList;
/**
* Created by IntelliJ IDEA.
* User: streiche
* Date: 23.02.2005
* Time: 19:17:38
* To change this template use File | Settings | File Templates.
*
*/
public class PortfolioFrontTester {
private Plot m_Plot;
private Plot plot;
private int index = 0;
private BufferedWriter m_OutputFile = null;
private BufferedWriter outputFile = null;
private double[] loss;
private double[][] risk;
@ -201,7 +197,7 @@ public class PortfolioFrontTester {
private void saveThisStuff(ArrayList c, ArrayList e) {
try {
this.m_OutputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("PortX_K2_Limits045_CompleteList.txt")));
this.outputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("PortX_K2_Limits045_CompleteList.txt")));
} catch (FileNotFoundException ex) {
System.out.println("Could not open output file!");
}
@ -215,12 +211,12 @@ public class PortfolioFrontTester {
this.writeToFile(line);
}
try {
this.m_OutputFile.close();
this.outputFile.close();
} catch (java.io.IOException ex) {
}
// next file
try {
this.m_OutputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("PortX_K2_Limits045_ListElements.txt")));
this.outputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("PortX_K2_Limits045_ListElements.txt")));
} catch (FileNotFoundException ex) {
System.out.println("Could not open output file!");
}
@ -242,14 +238,14 @@ public class PortfolioFrontTester {
this.writeToFile(line);
}
try {
this.m_OutputFile.close();
this.outputFile.close();
} catch (java.io.IOException ex) {
}
}
private void saveThisStuffK3(ArrayList c, ArrayList e) {
try {
this.m_OutputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("PortX_K3_Limits0283_CompleteList.txt")));
this.outputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("PortX_K3_Limits0283_CompleteList.txt")));
} catch (FileNotFoundException ex) {
System.out.println("Could not open output file!");
}
@ -263,12 +259,12 @@ public class PortfolioFrontTester {
this.writeToFile(line);
}
try {
this.m_OutputFile.close();
this.outputFile.close();
} catch (java.io.IOException ex) {
}
// next file
try {
this.m_OutputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("PortX_K3_Limits0283_ListElements.txt")));
this.outputFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("PortX_K3_Limits0283_ListElements.txt")));
} catch (FileNotFoundException ex) {
System.out.println("Could not open output file!");
}
@ -301,7 +297,7 @@ public class PortfolioFrontTester {
this.writeToFile(line);
}
try {
this.m_OutputFile.close();
this.outputFile.close();
} catch (java.io.IOException ex) {
}
}
@ -313,12 +309,12 @@ public class PortfolioFrontTester {
*/
private void writeToFile(String line) {
String write = line + "\n";
if (this.m_OutputFile == null) {
if (this.outputFile == null) {
return;
}
try {
this.m_OutputFile.write(write, 0, write.length());
this.m_OutputFile.flush();
this.outputFile.write(write, 0, write.length());
this.outputFile.flush();
} catch (IOException e) {
System.out.println("Problems writing to output file!");
}
@ -328,12 +324,12 @@ public class PortfolioFrontTester {
double[] tmpD = new double[2];
tmpD[0] = 0;
tmpD[1] = 0;
this.m_Plot = new Plot("Multiobjective Optimization", "Y1", "Y2", tmpD, tmpD);
this.plot = new Plot("Multiobjective Optimization", "Y1", "Y2", tmpD, tmpD);
}
private void showLine(double[][] elm) {
GraphPointSet mySet = new GraphPointSet(this.index, this.m_Plot.getFunctionArea());
GraphPointSet mySet = new GraphPointSet(this.index, this.plot.getFunctionArea());
mySet.setConnectedMode(false);
this.index++;
for (int i = 0; i < elm.length; i++) {