Hide problem in optimizers

refs #13
This commit is contained in:
Fabian Becker 2014-10-28 18:16:15 +01:00
parent f752f2bcc6
commit 90f006a239
3 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package eva2.gui; package eva2.gui;
import eva2.gui.editor.GenericObjectEditor; import eva2.gui.editor.GenericObjectEditor;
import eva2.optimization.strategies.InterfaceOptimizer;
import eva2.tools.EVAHELP; import eva2.tools.EVAHELP;
import eva2.util.annotation.Description; import eva2.util.annotation.Description;
@ -241,7 +242,6 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
// Look for a globalInfo method that returns a string // Look for a globalInfo method that returns a string
// describing the target // describing the target
int methsFound = 0; // dont loop too long, so count until all found int methsFound = 0; // dont loop too long, so count until all found
// @ToDo: Replace hideHideable method with annotation
for (MethodDescriptor methodDescriptor : methodDescriptors) { for (MethodDescriptor methodDescriptor : methodDescriptors) {
String name = methodDescriptor.getDisplayName(); String name = methodDescriptor.getDisplayName();
Method meth = methodDescriptor.getMethod(); Method meth = methodDescriptor.getMethod();
@ -265,7 +265,7 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
// values, views and editors... // values, views and editors...
propertyEditors = new PropertyEditor[propertyDescriptors.length]; propertyEditors = new PropertyEditor[propertyDescriptors.length];
// collect property values if possible // collect property values if possible
objectValues = getValues(targetObject, propertyDescriptors, true, false, true); objectValues = getValues(targetObject, propertyDescriptors, true, true, true);
views = new JComponent[propertyDescriptors.length]; views = new JComponent[propertyDescriptors.length];
viewWrappers = new JComponent[propertyDescriptors.length]; viewWrappers = new JComponent[propertyDescriptors.length];
propertyLabels = new JLabel[propertyDescriptors.length]; propertyLabels = new JLabel[propertyDescriptors.length];
@ -753,6 +753,7 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
views[i].repaint(); views[i].repaint();
revalidate(); revalidate();
} }
return true; return true;
} }

View File

@ -325,7 +325,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
/** /**
* Updates the type of object being edited, so attempts to find an appropriate propertyeditor. * Updates the type of object being edited, so attempts to find an appropriate propertyeditor.
* *
* @param o a value of type 'Object' * @param obj a value of type 'Object'
*/ */
private void updateEditorType(Object obj) { private void updateEditorType(Object obj) {
@ -639,7 +639,6 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
* Create a menu item with given title and listener, add it to the menu and return it. It may be * Create a menu item with given title and listener, add it to the menu and return it. It may be
* enabled or disabled. * enabled or disabled.
* *
* @param menu
* @param title * @param title
* @param aListener * @param aListener
* @param enabled * @param enabled

View File

@ -1,5 +1,6 @@
package eva2.optimization.strategies; package eva2.optimization.strategies;
import eva2.gui.editor.GenericObjectEditor;
import eva2.optimization.go.InterfacePopulationChangedEventListener; import eva2.optimization.go.InterfacePopulationChangedEventListener;
import eva2.optimization.population.Population; import eva2.optimization.population.Population;
import eva2.problems.F1Problem; import eva2.problems.F1Problem;
@ -68,6 +69,7 @@ public abstract class AbstractOptimizer implements InterfaceOptimizer {
@Override @Override
public void setProblem(InterfaceOptimizationProblem problem) { public void setProblem(InterfaceOptimizationProblem problem) {
this.optimizationProblem = problem; this.optimizationProblem = problem;
GenericObjectEditor.setShowProperty(this.getClass(), "problem", false);
} }
@Override @Override