More Refactoring of classes
Make TextOutputWindows non-closable (prevents exceptions) Change Font of output window
This commit is contained in:
parent
691f3d06d9
commit
10612f177a
@ -7,6 +7,7 @@ import eva2.tools.SelectedTag;
|
||||
import eva2.tools.StringTools;
|
||||
import eva2.tools.Tag;
|
||||
import eva2.util.annotation.Description;
|
||||
import eva2.util.annotation.Parameter;
|
||||
|
||||
import java.beans.BeanInfo;
|
||||
import java.beans.IntrospectionException;
|
||||
@ -1036,6 +1037,7 @@ public class BeanInspector {
|
||||
for (int j = 0; j < methods.length; j++) {
|
||||
String mname = methods[j].getDisplayName();
|
||||
Method meth = methods[j].getMethod();
|
||||
|
||||
if (mname.equals(tipName)) {
|
||||
if (meth.getReturnType().equals(String.class)) {
|
||||
try {
|
||||
|
@ -9,8 +9,7 @@ import eva2.EvAInfo;
|
||||
import eva2.optimization.tools.FileTools;
|
||||
import eva2.tools.BasicResourceLoader;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Point;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.io.Serializable;
|
||||
import javax.swing.*;
|
||||
@ -36,6 +35,7 @@ public class JTextoutputFrame implements JTextoutputFrameInterface, ActionListen
|
||||
public JTextoutputFrame(String title) {
|
||||
frameTitle = title;
|
||||
frame = new JEFrame(frameTitle);
|
||||
frame.setClosable(false);
|
||||
textArea = null;
|
||||
}
|
||||
|
||||
@ -83,19 +83,8 @@ public class JTextoutputFrame implements JTextoutputFrameInterface, ActionListen
|
||||
textArea.setWrapStyleWord(true);
|
||||
textArea.setEditable(false);
|
||||
textArea.setCaretPosition(0);
|
||||
textArea.setFont(new Font("Courier New", Font.PLAIN, 12));
|
||||
|
||||
BasicResourceLoader loader = BasicResourceLoader.instance();
|
||||
byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation, true);
|
||||
|
||||
frame.addInternalFrameListener(new InternalFrameAdapter() {
|
||||
|
||||
@Override
|
||||
public void internalFrameClosing(final InternalFrameEvent event) {
|
||||
super.internalFrameClosing(event);
|
||||
frame.dispose();
|
||||
frame.setEnabled(false);
|
||||
}
|
||||
});
|
||||
frame.getContentPane().setLayout(new BorderLayout());
|
||||
final JScrollPane scrollpane = new JScrollPane(textArea);
|
||||
frame.getContentPane().add(scrollpane, BorderLayout.CENTER);
|
||||
|
@ -313,7 +313,7 @@ public class Main extends JFrame implements OptimizationStateListener {
|
||||
* Sets given hostname and tries to load GOParamsters from given file if non
|
||||
* null.
|
||||
*/
|
||||
private void init(String hostName, String paramsFile, InterfaceOptimizationParameters goParams, final Window parent) {
|
||||
private void init(String hostName, String paramsFile, InterfaceOptimizationParameters optimizationParameters, final Window parent) {
|
||||
useDefaultModule = EvAInfo.propDefaultModule();
|
||||
this.parentWindow = parent;
|
||||
|
||||
@ -452,13 +452,13 @@ public class Main extends JFrame implements OptimizationStateListener {
|
||||
}
|
||||
if (useDefaultModule != null) {
|
||||
/*
|
||||
* if goParams are not defined and a params file is defined
|
||||
* if optimizationParameters are not defined and a params file is defined
|
||||
* try to load parameters from file
|
||||
*/
|
||||
if (goParams == null && (paramsFile != null && (paramsFile.length() > 0))) {
|
||||
goParams = OptimizationParameters.getInstance(paramsFile, false);
|
||||
if (optimizationParameters == null && (paramsFile != null && (paramsFile.length() > 0))) {
|
||||
optimizationParameters = OptimizationParameters.getInstance(paramsFile, false);
|
||||
}
|
||||
loadSpecificModule(useDefaultModule, goParams);//loadSpecificModule
|
||||
loadSpecificModule(useDefaultModule, optimizationParameters);//loadSpecificModule
|
||||
}
|
||||
|
||||
if (withGUI) {
|
||||
@ -534,7 +534,6 @@ public class Main extends JFrame implements OptimizationStateListener {
|
||||
* @param args command line parameters
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
/*============================COPIED FROM SYSBIO==============================*/
|
||||
// Properties for Mac OS X support.
|
||||
if ((System.getProperty("mrj.version") != null)
|
||||
|| (System.getProperty("os.name").toLowerCase().indexOf("mac") != -1)) {
|
||||
@ -552,8 +551,6 @@ public class Main extends JFrame implements OptimizationStateListener {
|
||||
System.setProperty("com.apple.mrj.application.growbox.intrudes", "false");
|
||||
System.setProperty("com.apple.mrj.application.live-resize", "true");
|
||||
}
|
||||
/*==========================================================================*/
|
||||
|
||||
|
||||
/* Available command-line parameters */
|
||||
String[] keys = new String[]{
|
||||
|
@ -189,6 +189,7 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
|
||||
targetObject = targ;
|
||||
try {
|
||||
BeanInfo bi = Introspector.getBeanInfo(targetObject.getClass());
|
||||
|
||||
propertyDescriptors = bi.getPropertyDescriptors();
|
||||
methodDescriptors = bi.getMethodDescriptors();
|
||||
} catch (IntrospectionException ex) {
|
||||
|
@ -6,7 +6,7 @@ import eva2.gui.PropertyOptimizationObjectives;
|
||||
import eva2.optimization.problems.InterfaceOptimizationObjective;
|
||||
import eva2.optimization.problems.InterfaceOptimizationTarget;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
import eva2.tools.BasicResourceLoader;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
@ -66,7 +66,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
|
||||
private JComponent[] m_Targets;
|
||||
private JButton[] m_Delete;
|
||||
private JScrollPane m_ScrollTargets;
|
||||
private GeneralGOEProperty[] m_Editors;
|
||||
private GeneralOptimizationEditorProperty[] m_Editors;
|
||||
private PropertyChangeListener m_self;
|
||||
|
||||
public GenericOptimizationObjectivesEditor() {
|
||||
@ -85,9 +85,9 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
|
||||
|
||||
// init the editors
|
||||
InterfaceOptimizationObjective[] list = this.m_OptimizationObjectives.getSelectedTargets();
|
||||
this.m_Editors = new GeneralGOEProperty[list.length];
|
||||
this.m_Editors = new GeneralOptimizationEditorProperty[list.length];
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
this.m_Editors[i] = new GeneralGOEProperty();
|
||||
this.m_Editors[i] = new GeneralOptimizationEditorProperty();
|
||||
this.m_Editors[i].m_Name = list[i].getName();
|
||||
try {
|
||||
this.m_Editors[i].m_Value = list[i];
|
||||
@ -225,13 +225,13 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
m_OptimizationObjectives.addTarget((InterfaceOptimizationObjective) m_OptimizationObjectives.getAvailableTargets()[0].clone());
|
||||
int l = m_OptimizationObjectives.getSelectedTargets().length;
|
||||
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l];
|
||||
GeneralOptimizationEditorProperty[] newEdit = new GeneralOptimizationEditorProperty[l];
|
||||
for (int i = 0; i < m_Editors.length; i++) {
|
||||
newEdit[i] = m_Editors[i];
|
||||
}
|
||||
InterfaceOptimizationObjective[] list = m_OptimizationObjectives.getSelectedTargets();
|
||||
l--;
|
||||
newEdit[l] = new GeneralGOEProperty();
|
||||
newEdit[l] = new GeneralOptimizationEditorProperty();
|
||||
newEdit[l].m_Name = list[l].getName();
|
||||
try {
|
||||
newEdit[l].m_Value = list[l];
|
||||
@ -263,7 +263,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
int l = m_OptimizationObjectives.getSelectedTargets().length, j = 0;
|
||||
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l - 1];
|
||||
GeneralOptimizationEditorProperty[] newEdit = new GeneralOptimizationEditorProperty[l - 1];
|
||||
for (int i = 0; i < m_Delete.length; i++) {
|
||||
if (event.getSource().equals(m_Delete[i])) {
|
||||
m_OptimizationObjectives.removeTarget(i);
|
||||
|
@ -5,7 +5,7 @@ import eva2.gui.PropertyEditorProvider;
|
||||
import eva2.gui.PropertyOptimizationObjectivesWithParam;
|
||||
import eva2.optimization.problems.InterfaceOptimizationObjective;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
import eva2.tools.BasicResourceLoader;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
@ -70,7 +70,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
|
||||
private JComponent[] m_Targets;
|
||||
private JButton[] m_Delete;
|
||||
private JScrollPane m_ScrollTargets;
|
||||
private GeneralGOEProperty[] m_Editors;
|
||||
private GeneralOptimizationEditorProperty[] m_Editors;
|
||||
private PropertyChangeListener m_self;
|
||||
|
||||
public GenericOptimizationObjectivesWithParamEditor() {
|
||||
@ -88,9 +88,9 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
|
||||
|
||||
// init the editors
|
||||
InterfaceOptimizationObjective[] list = this.m_OptimizationObjectivesWithWeights.getSelectedTargets();
|
||||
this.m_Editors = new GeneralGOEProperty[list.length];
|
||||
this.m_Editors = new GeneralOptimizationEditorProperty[list.length];
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
this.m_Editors[i] = new GeneralGOEProperty();
|
||||
this.m_Editors[i] = new GeneralOptimizationEditorProperty();
|
||||
this.m_Editors[i].m_Name = list[i].getName();
|
||||
try {
|
||||
this.m_Editors[i].m_Value = list[i];
|
||||
@ -250,13 +250,13 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
m_OptimizationObjectivesWithWeights.addTarget((InterfaceOptimizationObjective) m_OptimizationObjectivesWithWeights.getAvailableTargets()[0].clone());
|
||||
int l = m_OptimizationObjectivesWithWeights.getSelectedTargets().length;
|
||||
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l];
|
||||
GeneralOptimizationEditorProperty[] newEdit = new GeneralOptimizationEditorProperty[l];
|
||||
for (int i = 0; i < m_Editors.length; i++) {
|
||||
newEdit[i] = m_Editors[i];
|
||||
}
|
||||
InterfaceOptimizationObjective[] list = m_OptimizationObjectivesWithWeights.getSelectedTargets();
|
||||
l--;
|
||||
newEdit[l] = new GeneralGOEProperty();
|
||||
newEdit[l] = new GeneralOptimizationEditorProperty();
|
||||
newEdit[l].m_Name = list[l].getName();
|
||||
try {
|
||||
newEdit[l].m_Value = list[l];
|
||||
@ -288,7 +288,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
int l = m_OptimizationObjectivesWithWeights.getSelectedTargets().length, j = 0;
|
||||
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l - 1];
|
||||
GeneralOptimizationEditorProperty[] newEdit = new GeneralOptimizationEditorProperty[l - 1];
|
||||
for (int i = 0; i < m_Delete.length; i++) {
|
||||
if (event.getSource().equals(m_Delete[i])) {
|
||||
m_OptimizationObjectivesWithWeights.removeTarget(i);
|
||||
|
@ -1,9 +1,4 @@
|
||||
package eva2.gui.plot;
|
||||
/*
|
||||
* Title: EvA2 Description: Copyright: Copyright (c) 2003 Company: University of Tuebingen, Computer
|
||||
* Architecture @author Holger Ulmer, Felix Streichert, Hannes Planatscher @version: $Revision: 320
|
||||
* $ $Date: 2007-12-06 16:05:11 +0100 (Thu, 06 Dec 2007) $ $Author: mkron $
|
||||
*/
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
|
@ -1,18 +1,5 @@
|
||||
package eva2.gui.plot;
|
||||
|
||||
/*
|
||||
* Title: EvA2
|
||||
* Description:
|
||||
* Copyright: Copyright (c) 2003
|
||||
* Company: University of Tuebingen, Computer Architecture
|
||||
* @author Holger Ulmer, Felix Streichert, Hannes Planatscher
|
||||
* @version: $Revision: 322 $
|
||||
* $Date: 2007-12-11 17:24:07 +0100 (Tue, 11 Dec 2007) $
|
||||
* $Author: mkron $
|
||||
*/
|
||||
/*==========================================================================*
|
||||
* IMPORTS
|
||||
*==========================================================================*/
|
||||
public interface PlotInterface {
|
||||
public void setConnectedPoint(double x, double y, int GraphLabel);
|
||||
|
||||
|
@ -14,7 +14,7 @@ import eva2.optimization.problems.InterfaceOptimizationObjective;
|
||||
import eva2.optimization.strategies.GeneticAlgorithm;
|
||||
import eva2.optimization.strategies.InterfaceOptimizer;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
@ -35,7 +35,7 @@ public class MOCCOParameterizeGDF extends MOCCOPhase implements InterfaceProcess
|
||||
private JTextField[][] m_TradeOff;
|
||||
JPanel m_Choice;
|
||||
private InterfaceOptimizer m_Opt;
|
||||
private GeneralGOEProperty m_EOpt;
|
||||
private GeneralOptimizationEditorProperty m_EOpt;
|
||||
|
||||
public MOCCOParameterizeGDF(MOCCOStandalone mocco) {
|
||||
this.m_Mocco = mocco;
|
||||
@ -127,7 +127,7 @@ public class MOCCOParameterizeGDF extends MOCCOPhase implements InterfaceProcess
|
||||
|
||||
// the optimizer
|
||||
gbc.gridwidth = 1;
|
||||
this.m_EOpt = new GeneralGOEProperty();
|
||||
this.m_EOpt = new GeneralOptimizationEditorProperty();
|
||||
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;
|
||||
@ -158,7 +158,7 @@ public class MOCCOParameterizeGDF extends MOCCOPhase implements InterfaceProcess
|
||||
gbc.weightx = 1;
|
||||
this.m_Choice.add(this.m_EOpt.m_View, gbc);
|
||||
// Terminator
|
||||
GeneralGOEProperty editor = new GeneralGOEProperty();
|
||||
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
|
||||
editor.m_Name = "Terminator";
|
||||
try {
|
||||
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
|
||||
|
@ -10,7 +10,7 @@ import eva2.optimization.strategies.GeneticAlgorithm;
|
||||
import eva2.optimization.strategies.InterfaceOptimizer;
|
||||
import eva2.optimization.strategies.MultiObjectiveEA;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
@ -83,8 +83,8 @@ public class MOCCOParameterizeMO extends MOCCOPhase implements InterfaceProcessE
|
||||
gbc.anchor = GridBagConstraints.WEST;
|
||||
gbc.fill = GridBagConstraints.BOTH;
|
||||
|
||||
GeneralGOEProperty editor = new GeneralGOEProperty();
|
||||
editor = new GeneralGOEProperty();
|
||||
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
|
||||
editor = new GeneralOptimizationEditorProperty();
|
||||
editor.m_Name = "Optimizer";
|
||||
try {
|
||||
editor.m_Value = this.m_Mocco.m_State.m_Optimizer;
|
||||
@ -112,7 +112,7 @@ public class MOCCOParameterizeMO extends MOCCOPhase implements InterfaceProcessE
|
||||
gbc.weightx = 2;
|
||||
tmpP.add(editor.m_View, gbc);
|
||||
|
||||
editor = new GeneralGOEProperty();
|
||||
editor = new GeneralOptimizationEditorProperty();
|
||||
editor.m_Name = "Terminator";
|
||||
try {
|
||||
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
|
||||
|
@ -10,7 +10,7 @@ import eva2.optimization.operator.moso.MOSOLpMetric;
|
||||
import eva2.optimization.problems.AbstractMultiObjectiveOptimizationProblem;
|
||||
import eva2.optimization.strategies.IslandModelEA;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
import eva2.tools.math.RNG;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
@ -35,7 +35,7 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
|
||||
private double[] m_RefPoint;
|
||||
private MOSOLpMetric m_LpMetric;
|
||||
private IslandModelEA m_Island;
|
||||
private GeneralGOEProperty m_EMOSO, m_EIMEA;
|
||||
private GeneralOptimizationEditorProperty m_EMOSO, m_EIMEA;
|
||||
private int m_Perturbations = 4;
|
||||
private double m_Perturbation = 0.01;
|
||||
private JTextField m_NumPer, m_SizePer;
|
||||
@ -105,7 +105,7 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
|
||||
this.m_SizePer = new JTextField("" + this.m_Perturbation);
|
||||
this.m_Parameters.add(this.m_SizePer, gbc);
|
||||
// lpmetric
|
||||
this.m_EMOSO = new GeneralGOEProperty();
|
||||
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";
|
||||
@ -135,7 +135,7 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
|
||||
gbc.weightx = 1;
|
||||
this.m_Parameters.add(this.m_EMOSO.m_View, gbc);
|
||||
// IslandModelEA
|
||||
this.m_EIMEA = new GeneralGOEProperty();
|
||||
this.m_EIMEA = new GeneralOptimizationEditorProperty();
|
||||
this.m_Island = new IslandModelEA();
|
||||
this.m_Island.setHeterogenuousProblems(true);
|
||||
this.m_Island.setLocalOnly(true);
|
||||
@ -171,7 +171,7 @@ public class MOCCOParameterizeRefPoint extends MOCCOPhase implements InterfacePr
|
||||
gbc.weightx = 1;
|
||||
this.m_Parameters.add(this.m_EIMEA.m_View, gbc);
|
||||
// Terminator
|
||||
GeneralGOEProperty editor = new GeneralGOEProperty();
|
||||
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
|
||||
editor.m_Name = "Terminator";
|
||||
try {
|
||||
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
|
||||
|
@ -9,7 +9,7 @@ import eva2.optimization.strategies.GeneticAlgorithm;
|
||||
import eva2.optimization.strategies.InterfaceOptimizer;
|
||||
import eva2.optimization.strategies.MultiObjectiveEA;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.GridBagConstraints;
|
||||
@ -77,7 +77,7 @@ public class MOCCOParameterizeSO extends MOCCOPhase implements InterfaceProcessE
|
||||
gbc.anchor = GridBagConstraints.WEST;
|
||||
gbc.fill = GridBagConstraints.BOTH;
|
||||
|
||||
GeneralGOEProperty editor = new GeneralGOEProperty();
|
||||
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
|
||||
editor.m_Name = "Optimizer";
|
||||
try {
|
||||
editor.m_Value = this.m_Mocco.m_State.m_Optimizer;
|
||||
@ -105,7 +105,7 @@ public class MOCCOParameterizeSO extends MOCCOPhase implements InterfaceProcessE
|
||||
gbc.weightx = 2;
|
||||
tmpP.add(editor.m_View, gbc);
|
||||
|
||||
editor = new GeneralGOEProperty();
|
||||
editor = new GeneralOptimizationEditorProperty();
|
||||
editor.m_Name = "Terminator";
|
||||
try {
|
||||
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
|
||||
|
@ -14,7 +14,7 @@ import eva2.optimization.problems.InterfaceOptimizationObjective;
|
||||
import eva2.optimization.strategies.GeneticAlgorithm;
|
||||
import eva2.optimization.strategies.InterfaceOptimizer;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.GridBagConstraints;
|
||||
@ -43,7 +43,7 @@ public class MOCCOParameterizeSTEP extends MOCCOPhase implements InterfaceProces
|
||||
private JCheckBox[] m_Satisfied;
|
||||
JPanel m_Choice;
|
||||
private InterfaceOptimizer m_Opt;
|
||||
private GeneralGOEProperty m_EOpt;
|
||||
private GeneralOptimizationEditorProperty m_EOpt;
|
||||
|
||||
public MOCCOParameterizeSTEP(MOCCOStandalone mocco) {
|
||||
this.m_Mocco = mocco;
|
||||
@ -172,7 +172,7 @@ public class MOCCOParameterizeSTEP extends MOCCOPhase implements InterfaceProces
|
||||
|
||||
// the optimizer
|
||||
gbc.gridwidth = 1;
|
||||
this.m_EOpt = new GeneralGOEProperty();
|
||||
this.m_EOpt = new GeneralOptimizationEditorProperty();
|
||||
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;
|
||||
@ -203,7 +203,7 @@ public class MOCCOParameterizeSTEP extends MOCCOPhase implements InterfaceProces
|
||||
gbc.weightx = 1;
|
||||
this.m_Choice.add(this.m_EOpt.m_View, gbc);
|
||||
// Terminator
|
||||
GeneralGOEProperty editor = new GeneralGOEProperty();
|
||||
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
|
||||
editor.m_Name = "Terminator";
|
||||
try {
|
||||
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
|
||||
|
@ -10,7 +10,7 @@ import eva2.optimization.operator.moso.MOSOWeightedLPTchebycheff;
|
||||
import eva2.optimization.problems.AbstractMultiObjectiveOptimizationProblem;
|
||||
import eva2.optimization.strategies.IslandModelEA;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
import eva2.tools.math.RNG;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
@ -36,7 +36,7 @@ public class MOCCOParameterizeTchebycheff extends MOCCOPhase implements Interfac
|
||||
|
||||
private double[] m_RefPoint;
|
||||
private IslandModelEA m_Island;
|
||||
private GeneralGOEProperty m_EIMEA;
|
||||
private GeneralOptimizationEditorProperty m_EIMEA;
|
||||
private int m_Perturbations = 4;
|
||||
private JTextField m_NumPer;
|
||||
JPanel m_Parameters;
|
||||
@ -107,7 +107,7 @@ public class MOCCOParameterizeTchebycheff extends MOCCOPhase implements Interfac
|
||||
gbc.weightx = 2;
|
||||
this.m_Parameters.add(tmpP, gbc);
|
||||
// IslandModelEA
|
||||
this.m_EIMEA = new GeneralGOEProperty();
|
||||
this.m_EIMEA = new GeneralOptimizationEditorProperty();
|
||||
this.m_Island = new IslandModelEA();
|
||||
this.m_Island.setHeterogenuousProblems(true);
|
||||
this.m_Island.setLocalOnly(true);
|
||||
@ -143,7 +143,7 @@ public class MOCCOParameterizeTchebycheff extends MOCCOPhase implements Interfac
|
||||
gbc.weightx = 1;
|
||||
this.m_Parameters.add(this.m_EIMEA.m_View, gbc);
|
||||
// Terminator
|
||||
GeneralGOEProperty editor = new GeneralGOEProperty();
|
||||
GeneralOptimizationEditorProperty editor = new GeneralOptimizationEditorProperty();
|
||||
editor.m_Name = "Terminator";
|
||||
try {
|
||||
editor.m_Value = this.m_Mocco.m_State.m_Terminator;
|
||||
|
@ -5,7 +5,7 @@ import eva2.gui.editor.GenericObjectEditor;
|
||||
import eva2.gui.PropertyEditorProvider;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGEOFaker;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
import eva2.tools.BasicResourceLoader;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
@ -70,7 +70,7 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit
|
||||
private JComponent[] m_Targets;
|
||||
private JButton[] m_Delete;
|
||||
private JScrollPane m_ScrollTargets;
|
||||
private GeneralGOEProperty[] m_Editors;
|
||||
private GeneralOptimizationEditorProperty[] m_Editors;
|
||||
private GeneralGEOFaker m_Component;
|
||||
private PropertyChangeListener m_self;
|
||||
|
||||
@ -89,9 +89,9 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit
|
||||
|
||||
// init the editors
|
||||
InterfaceCrossover[] list = this.m_CrossoversWithWeights.getSelectedCrossers();
|
||||
this.m_Editors = new GeneralGOEProperty[list.length];
|
||||
this.m_Editors = new GeneralOptimizationEditorProperty[list.length];
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
this.m_Editors[i] = new GeneralGOEProperty();
|
||||
this.m_Editors[i] = new GeneralOptimizationEditorProperty();
|
||||
this.m_Editors[i].m_Name = list[i].getStringRepresentation();
|
||||
try {
|
||||
this.m_Editors[i].m_Value = list[i];
|
||||
@ -251,13 +251,13 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
m_CrossoversWithWeights.addCrossers((InterfaceCrossover) m_CrossoversWithWeights.getAvailableCrossers()[0].clone());
|
||||
int l = m_CrossoversWithWeights.getSelectedCrossers().length;
|
||||
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l];
|
||||
GeneralOptimizationEditorProperty[] newEdit = new GeneralOptimizationEditorProperty[l];
|
||||
for (int i = 0; i < m_Editors.length; i++) {
|
||||
newEdit[i] = m_Editors[i];
|
||||
}
|
||||
InterfaceCrossover[] list = m_CrossoversWithWeights.getSelectedCrossers();
|
||||
l--;
|
||||
newEdit[l] = new GeneralGOEProperty();
|
||||
newEdit[l] = new GeneralOptimizationEditorProperty();
|
||||
newEdit[l].m_Name = list[l].getStringRepresentation();
|
||||
try {
|
||||
newEdit[l].m_Value = list[l];
|
||||
@ -289,7 +289,7 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
int l = m_CrossoversWithWeights.getSelectedCrossers().length, j = 0;
|
||||
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l - 1];
|
||||
GeneralOptimizationEditorProperty[] newEdit = new GeneralOptimizationEditorProperty[l - 1];
|
||||
for (int i = 0; i < m_Delete.length; i++) {
|
||||
if (event.getSource().equals(m_Delete[i])) {
|
||||
m_CrossoversWithWeights.removeCrosser(i);
|
||||
|
@ -4,7 +4,7 @@ import eva2.gui.*;
|
||||
import eva2.gui.editor.GenericObjectEditor;
|
||||
import eva2.optimization.tools.AbstractObjectEditor;
|
||||
import eva2.optimization.tools.GeneralGEOFaker;
|
||||
import eva2.optimization.tools.GeneralGOEProperty;
|
||||
import eva2.optimization.tools.GeneralOptimizationEditorProperty;
|
||||
import eva2.tools.BasicResourceLoader;
|
||||
|
||||
import java.awt.*;
|
||||
@ -46,7 +46,7 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito
|
||||
private JComponent[] m_Targets;
|
||||
private JButton[] m_Delete;
|
||||
private JScrollPane m_ScrollTargets;
|
||||
private GeneralGOEProperty[] m_Editors;
|
||||
private GeneralOptimizationEditorProperty[] m_Editors;
|
||||
private GeneralGEOFaker m_Component;
|
||||
private PropertyChangeListener m_self;
|
||||
|
||||
@ -65,9 +65,9 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito
|
||||
|
||||
// init the editors
|
||||
InterfaceMutation[] list = this.m_MutatorsWithWeights.getSelectedMutators();
|
||||
this.m_Editors = new GeneralGOEProperty[list.length];
|
||||
this.m_Editors = new GeneralOptimizationEditorProperty[list.length];
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
this.m_Editors[i] = new GeneralGOEProperty();
|
||||
this.m_Editors[i] = new GeneralOptimizationEditorProperty();
|
||||
this.m_Editors[i].m_Name = list[i].getStringRepresentation();
|
||||
try {
|
||||
this.m_Editors[i].m_Value = list[i];
|
||||
@ -227,13 +227,13 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
m_MutatorsWithWeights.addMutator((InterfaceMutation) m_MutatorsWithWeights.getAvailableMutators()[0].clone());
|
||||
int l = m_MutatorsWithWeights.getSelectedMutators().length;
|
||||
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l];
|
||||
GeneralOptimizationEditorProperty[] newEdit = new GeneralOptimizationEditorProperty[l];
|
||||
for (int i = 0; i < m_Editors.length; i++) {
|
||||
newEdit[i] = m_Editors[i];
|
||||
}
|
||||
InterfaceMutation[] list = m_MutatorsWithWeights.getSelectedMutators();
|
||||
l--;
|
||||
newEdit[l] = new GeneralGOEProperty();
|
||||
newEdit[l] = new GeneralOptimizationEditorProperty();
|
||||
newEdit[l].m_Name = list[l].getStringRepresentation();
|
||||
try {
|
||||
newEdit[l].m_Value = list[l];
|
||||
@ -265,7 +265,7 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
int l = m_MutatorsWithWeights.getSelectedMutators().length, j = 0;
|
||||
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l - 1];
|
||||
GeneralOptimizationEditorProperty[] newEdit = new GeneralOptimizationEditorProperty[l - 1];
|
||||
for (int i = 0; i < m_Delete.length; i++) {
|
||||
if (event.getSource().equals(m_Delete[i])) {
|
||||
m_MutatorsWithWeights.removeMutator(i);
|
||||
|
@ -58,7 +58,7 @@ public class StatisticsWithGUI extends AbstractStatistics implements Serializabl
|
||||
*/
|
||||
public StatisticsWithGUI() {
|
||||
m_StatsParams = StatisticsParameter.getInstance(true);
|
||||
proxyPrinter = new JTextoutputFrame("TextOutput of " + hostName);
|
||||
proxyPrinter = new JTextoutputFrame("Optimization Log");
|
||||
addTextListener(proxyPrinter);
|
||||
}
|
||||
|
||||
@ -70,8 +70,6 @@ public class StatisticsWithGUI extends AbstractStatistics implements Serializabl
|
||||
super.startOptPerformed(infoString, runNumber, goParams, informerList);
|
||||
graphInfoString = infoString;
|
||||
|
||||
// m_TextCounter = m_StatisticsParameter.GetTextoutput();
|
||||
// m_PlotCounter = m_StatsParams.GetPlotoutput();
|
||||
if ((fitnessFrame != null) && (fitnessFrame[0] != null)) {
|
||||
PlotInterface p = fitnessFrame[0].getPlotter();
|
||||
if ((p != null) && p.isValid()) {
|
||||
|
@ -261,11 +261,11 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
|
||||
* @param props All properties.
|
||||
* @return PropertyEditor
|
||||
*/
|
||||
public GeneralGOEProperty getEditorFor(String prop, PropertyDescriptor[] props, MethodDescriptor[] methods, Object target) {
|
||||
GeneralGOEProperty result = null;
|
||||
public GeneralOptimizationEditorProperty getEditorFor(String prop, PropertyDescriptor[] props, MethodDescriptor[] methods, Object target) {
|
||||
GeneralOptimizationEditorProperty result = null;
|
||||
for (int i = 0; i < props.length; i++) {
|
||||
if (props[i].getName().equalsIgnoreCase(prop)) {
|
||||
result = new GeneralGOEProperty();
|
||||
result = new GeneralOptimizationEditorProperty();
|
||||
Object args[] = {};
|
||||
result.m_getMethod = props[i].getReadMethod();
|
||||
result.m_setMethod = props[i].getWriteMethod();
|
||||
@ -275,12 +275,6 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
|
||||
result.m_TipText = BeanInspector.getToolTipText(result.m_Name, methods, target);
|
||||
try {
|
||||
result.m_Value = result.m_getMethod.invoke(target, args);
|
||||
// result.m_Editor = PropertyEditorProvider.findEditor(result.m_Value.getClass());
|
||||
// if (result.m_Editor == null) result.m_Editor = PropertyEditorProvider.findEditor(result.m_PropertyType);
|
||||
// if (result.m_Editor instanceof GenericObjectEditor)
|
||||
// ((GenericObjectEditor) result.m_Editor).setClassType(result.m_PropertyType);
|
||||
// result.m_Editor.setValue(result.m_Value);
|
||||
// result.m_Editor.addPropertyChangeListener(this);
|
||||
result.m_Editor = PropertyEditorProvider.findEditor(props[i], result.m_Value);
|
||||
if (result.m_Editor == null) {
|
||||
result.m_Editor = PropertyEditorProvider.findEditor(result.m_PropertyType);
|
||||
@ -313,7 +307,7 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
|
||||
*
|
||||
* @param editor The property the select a view for.
|
||||
*/
|
||||
public static void findViewFor(GeneralGOEProperty editor) {
|
||||
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
|
||||
|
@ -5,13 +5,9 @@ import java.lang.reflect.Method;
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: streiche
|
||||
* Date: 24.08.2004
|
||||
* Time: 15:21:56
|
||||
* To change this template use File | Settings | File Templates.
|
||||
* Representation of an OptimizationEditor Property
|
||||
*/
|
||||
public class GeneralGOEProperty {
|
||||
public class GeneralOptimizationEditorProperty {
|
||||
public Method m_getMethod;
|
||||
public Method m_setMethod;
|
||||
public PropertyEditor m_Editor;
|
||||
@ -23,6 +19,6 @@ public class GeneralGOEProperty {
|
||||
public String m_Name;
|
||||
public String m_TipText;
|
||||
|
||||
public GeneralGOEProperty() {
|
||||
public GeneralOptimizationEditorProperty() {
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user