diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 00000000..caf225f4 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,94 @@ +--- Changelog --- + +2.05: Added ScatterSearch (real-valued), BinaryScatterSearch, and the Bayesian Optimization Algorithm (thanks + to Alexander Seitz) to the base package. Added JobList and some statistical measures. Requires to put + the JSC package on the class path for Mann-Whitney test. + +2.046: Adaptions to the MatlabInterface: explicit data types are used now, added integer problem support. + Additional Integer operators: segment-wise mutation and crossover. Added an abstraction over individual + initialization methods. Added the ERPStarter class which is an example for running a csv-configured + optimization. Some bug-fixes and clean-ups. + +2.045: Added MOOCMAES (de Paly); compatibility with Java 1.5 (Draeger); Revision of the statistics class + with improved pipelining of data (InterfaceAdditionalPopulationInformer); improved FunctionArea + concerning history, labels, legend and graph coloring; improved StringSelection; restructured + Terminators, additional ParetoMetricTerminator. Further bugfixes and clean-ups. + +2.043: Added proper Population equality predicate. + +2.042: Some bugfixes. Removing dependency on sun.beans.editors, replaced non-free jpeg-codec. There should + be no more problems on OpenJDK. Added a simple initialization range, especially for use from Matlab. + Some restructurings (RNG and Mathematics is now in eva2.tools.math). Some cleanup. + +2.040: Several updates: The clustering interface has been changed for easier implementation of adaptive clustering + methods. The GradientDescentAlgorithm has been updated and some benchmark problems been made derivable. + The ClusterBasedNiching algorithm has been slightly restructured updated according to the new clustering. + An additional clustering method is included: nearest-best clustering with dynamic adaption of niche radius. + Some changes to (text) statistics: they are now printed regarding the full solution set instead of the + last population. The Population field "size" is now termed "targetSize" to avoid misunderstandigs. Populations + can be initialized using a Random Latin Hypercube sampling. Some basic console options are recognized: + EvA2 can be started without splash screen and even without GUI. If configuration file is given which was + earlier saved from the GUI, the thus defined optimization run is then processed automatically by EvA2. + +2.036: New graph selection mode for statistic plots: every property may be selected independently. + A simple plot legend is produced in the graph window, which can be deactivated. + +2.035: Reactivated some of the model-based functionality within the GO framework. Minor bugfixes. + +2.034: Adding a generic parameter control method for optimizers, currently used by PSO to adapt inertness depending + on EvaluationTerminator or GenerationTerminator instances defining the number of function evaluations. + The new package is eva2.server.go.operators.paramcontrol. + A Population may now be ordered by a specific fitness criterion, employed, e.g., by Nelder-Mead-Simplex. + +2.033: There was an interesting problem with the Matlab-Interface, which just hung up after extensive optimization + loops, yet only if Matlab was started without X-forwarding (which is necessary for qsub, e.g.). + Debugging was tedious, since the debugging using System.out. itself caused threading deadlocks. The + problem showed up to be with System.out itself. Whatever Matlab does with that stream, it does it differently + depending on the X-forwarding option. More specifically, the text written to System.out when X-forwarding + is not available seems to never show up (as opposed to being printed to the console when X-forwarding is on) + and silently fill up the JVM-memory. I havent the faintest idea why there havnt been OutOfMemory exceptions + earlier or whether and how the deadlocks have to do with it. + The ingenious solution was: dont print anything to System.out, which is now done at verbosity 0. + +2.032: Some cosmetics, e.g. to AbstractEAIndividualComparator and older MOCCO classes. + +2.031: Some updates to the OptimizerFactory. Review of the MatlabInterface with adding an own options structure. + Better access to the EvAClient, which now may have a RemoteStateListener added monitoring the optimization run. + +2.030: Added an EnumEditor to access enums easily through the GUI, which will replace SelectedTags sometimes. + IPOP-ES and RankMuCMA mutator have been added lately (wow!). + Cleaned up the IndividualInterface and reduced the usage of InterfaceESIndividual. This + means that, e.g., that DE and PSO now also work on GAIndividualDoubleData. Because this + requires much time for transcoding, however, this is not useful by itself. Yet it could be + interesting for combined individuals composed of two data types. + Cleaned up MutateXXDefault to a single MutateDefault, too. DE may now do range checking. + The "Description" button has made space for a "Show Solution" button. The Rank-Mu-CMA was improved + to use a CMAParameterSet which is associated with populations and not static any more. + Included Nelder-Mead-Simplex and CMA-ES as post processing methods. + +2.029: Tuned the 2d-graphs which now paints quicker and changes size depending on the + surrounding plot window. Added a preloader-thread to accelerate the GUI at starting time. + +2.028: Tuned the Population to sort only when necessary on calls to getBestN... Added StatisticsDummy. + Slightly tuned SimpleProblemWrapper to call initProblem of simple problems if available. + +2.027: Renamed SetData and SetDataLamarckian from individual data type interfaces to SetGenotype and SetPhenotype. + Repaired the GenericArrayEditor. Population measures can now be plotted in stats. + +2.026: Added DiversityTerminator and KnownOptimaTerminator, slightly changed InterfaceTerminator for these + and InterfaceStatistics to provide termination message to text window. + Killed redundant method getGenerations() in Population. Population.getAllSolutions now returns a + SolutionSet combining last population with a set of possibly archived solutions. + Post processing with HC may now use variable step size mutation. + +2.025: FunctionArea may now plot circles easily. The FLensProblemViewer seems to be cured. + +2.024: Cleaned up AbstractGOParams, deactivated parent logging (saving memory) + +2.023: Cleaned up the PF strategy + +2.022: Some changes to the SimpleProblemWrapper, not of great interest. However, simple problems may now access a plot +quite easily. + + +--- End Changelog --- diff --git a/Manifest.txt b/Manifest.txt deleted file mode 100644 index 66158fb8..00000000 --- a/Manifest.txt +++ /dev/null @@ -1 +0,0 @@ -Class-Path: lib/activation.jar lib/j2ssh-common.jar lib/jmatlink.jar lib/mail.jar lib/commons-logging.jar lib/j2ssh-core.jar lib/libJMatLink.so pop3.jar lib/wsi2.jar lib/imap.jar lib/j2ssh-dameon.jar lib/log4j.jar lib/smtp.jar lib/xalan2.jar lib/j2ssh-ant.jar lib/jdom.jar lib/mailapi.jar lib/sshfactory.jar lib/libJMatLink.so lib/windows/JMatLink.dll lib/windows/SNNS_jkr.dll diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..e9bcf3f1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,52 @@ + + 4.0.0 + eva2 + EvA2 + jar + 1.0-SNAPSHOT + EvA2 + http://www.ra.cs.uni-tuebingen.de/software/EvA2/ + + + junit + junit + 4.10 + test + + + javax.help + javahelp + 2.0.05 + + + + ${project.basedir}/build + ${project.build.directory}/classes + ${project.artifactId}-${project.version} + ${project.basedir}/src + ${project.basedir}/test + + + ${project.basedir}/resources + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + true + false + + true + eva2.client.EvAClient + + + + + + + diff --git a/resources/EvA2.props b/resources/META-INF/EvA2.props similarity index 100% rename from resources/EvA2.props rename to resources/META-INF/EvA2.props diff --git a/resources/html/Default.html b/resources/html/Default.html new file mode 100644 index 00000000..c25cad58 --- /dev/null +++ b/resources/html/Default.html @@ -0,0 +1,15 @@ + + +Default page + + +  +

HTML description file is missing

+
+

+Unfortunately there is no additional HTML description +file to this class. Please refer to the JOptDocumentation +file or the JavaDoc for more information on this class. + + + \ No newline at end of file diff --git a/resources/html/EvolutionStrategies.html b/resources/html/EvolutionStrategies.html new file mode 100644 index 00000000..712430e0 --- /dev/null +++ b/resources/html/EvolutionStrategies.html @@ -0,0 +1,25 @@ + + +Evolution Strategy - ES + + +

Evolution Strategy - ES

+
+

+An ES works on a population of real valued solutions +by repeated use of evolutionary operators like reproduction, +recombination and mutation. +λ offspring individuals are generated from μ parents +by recombination and mutation (with μ < λ). +
+After evaluating the fitness of the λ +offspring individuals, the comma-strategy selects the μ individuals +with the best fitness as parent population for the next generation. +On the other hand, a plus-strategy selects the best μ individuals +from the aggregation of parents and offspring individuals, so in this +case the best individual is guaranteed to survive. +In general, however, the comma-strategy is more robust and can easier +escape from local optima, which is why it is usually the standard selection. +
+ + \ No newline at end of file diff --git a/resources/html/EvolutionStrategyIPOP.html b/resources/html/EvolutionStrategyIPOP.html new file mode 100644 index 00000000..eb9628b6 --- /dev/null +++ b/resources/html/EvolutionStrategyIPOP.html @@ -0,0 +1,30 @@ + + +Increasing Population Size ES - IPOP-ES + + +

Increasing Population Size ES - IPOP-ES

+
+

+

+This class implements the IPOP (increased population size) restart strategy ES, which increases +the ES population size (i.e., lambda) after phases of stagnation and then restarts the optimization +by reinitializing the individuals and operators.
+Stagnation is for this implementation defined by a FitnessConvergenceTerminator instance +which terminates if the absolute change in fitness is below a threshold (default 10e-12) for a +certain number of generations (default: 10+floor(30*n/lambda) for problem dimension n). +

+

+If the MutateESRankMuCMA mutation operator is employed, additional criteria are used for restarts, +such as numeric conditions of the covariance matrix. +Lambda is increased multiplicatively for every restart, and typical initial values are +mu=5, lambda=10, incFact=2. +The IPOP-CMA-ES won the CEC 2005 benchmark challenge. +Refer to Auger&Hansen 05 for more details. +

+
+A.Auger & N.Hansen. A Restart CMA Evolution Strategy With Increasing Population Size. CEC 2005. + + + + \ No newline at end of file diff --git a/resources/html/F13Problem.html b/resources/html/F13Problem.html new file mode 100644 index 00000000..37f85f66 --- /dev/null +++ b/resources/html/F13Problem.html @@ -0,0 +1,30 @@ + + +Schwefels's (sine root) function + + +

Schwefel's (sine root) function

+
+ +
+

+Schwefel's (sine root) function is highly multimodal and has no global basin of attraction. The optimum at a fitness of f(x*)=0 lies at x*=420.9687. Schwefel's sine root is a tough challenge for any global optimizer due to the multiple distinct optima. Especially, there is a deceptive nearly optimal solution close to x=(-420.9687)n. + +

+ +

+ + +
+Schwefels's sine root function in 2D within the co-domain -500 <= x <= 500. +

+ +


+More information about Ackley's function can be found at: +

+David. H. Ackley. A connection machine for genetic hillclimbing. Kluwer Academic Publishers, Boston, 1987. +

+Thomas Baeck. Evolutionary Algorithms in Theory and Practice. Oxford University Press, 1996. + + + diff --git a/resources/html/F1Problem.html b/resources/html/F1Problem.html new file mode 100644 index 00000000..1cfb1fe6 --- /dev/null +++ b/resources/html/F1Problem.html @@ -0,0 +1,24 @@ + + +f_1 : Sphere function + + +

The F1 hyper-parabola function

+
+ +

+The hyper-parabola function is a n-dimensional, axis-symmetric, continuously differentiable, convex function: +

+Because of its simplicity every optimization-algorithm should be able to find its global minimum at x=[0, 0, ... , 0] +

+ + + +


+More information about the F1 function can be found at: +

+ +Kenneth De Jong. An analysis of the behaviour of a class of genetic adaptive systems. Dissertation, University of Michigan, 1975. Diss. Abstr. Int. 36(10), 5140B, University Microflims No. 76-9381. + + + \ No newline at end of file diff --git a/resources/html/F2Problem.html b/resources/html/F2Problem.html new file mode 100644 index 00000000..40dfaa06 --- /dev/null +++ b/resources/html/F2Problem.html @@ -0,0 +1,36 @@ + + +Generalized Rosenbrock's function + + +

Generalized Rosenbrock's function

+
+ +
+

+This function is unimodal and continuous, but the global optimum is hard to find, because of independence through the term (x_(i+1) - x_i*x_i)^2 between contiguous parameters. +

+ +
+Rosenbrock's function within the domain -5 <= x <= 5. +

+The global optimum is located in a parabolic formed valley (among the curve x^2 = x_1^2), which has a flat ground. +
+ +
+The function close to its global optimum, which is: f(x) = f(1, 1, ... , 1) = 0. +

+Rosenbrock' function is not symmetric, not convex and not linear. + +


+More information about Rosenbrock's function can be found at: +

+Kenneth De Jong. An analysis of the behaviour of a class of genetic adaptive systems. Dissertation, University of Michigan, 1975. Diss. Abstr. Int. 36(10), 5140B, University Microflims No. 76-9381. +

+Hans Paul Schwefel. Evolution and optimum seeking. Sixth-Generation Computer Technology Series. John Wiley & Sons, INC., 1995. +

+Darrell Whitley, Soraya Rana, John Dzubera, Keith E. Mathias. Evaluating Evolutionary Algorithms. Artificial Intelligence, 85(1-2):245-276. 1996. +

+Eberhard Schoeneburg, Frank Heinzmann, Sven Feddersen. Genetische Algorithmen und Evolutionstrategien - Eine Einfuehrung in Theorie und Praxis der simulierten Evolution. Addison-Wesley, 1994. + + \ No newline at end of file diff --git a/resources/html/F3Problem.html b/resources/html/F3Problem.html new file mode 100644 index 00000000..7b187e07 --- /dev/null +++ b/resources/html/F3Problem.html @@ -0,0 +1,29 @@ + + +The step function + + +

The Step Function

+
+ +
+

+The idea of this function is the implementation of a flat plateau (slope 0)in an underlying continuous function. It's harder for optimization algortihms to find optima because minor changes of the object variables don't affect the fitness. Therefore no conclusions about the search direction can be made. +

+ +

+The step function is symmetric considering the underlying function (here: f(x,y) = f(y,x)), but between the bulk constant plateau-areas not continuously differentiable. +

+Its minimum-area is located in the intervals: f(x)=f([-5.12,-5), ... , [-5.12,-5))=0. +

+ +


+More information about the step function can be found at: +

+Thomas Baeck, Evolutionary Algorithms in Theory and Practice. Oxford University Press, 1996. +

+Darrell Whitley, Soraya Rana, John Dzubera, Keith E. Mathias. Evaluating Evolutionary Algorithms. Artificial Intelligence, 85(1-2):245-276. 1996. +

+Eberhard Schoeneburg, Frank Heinzmann, Sven Feddersen. Genetische Algorithmen und Evolutionstrategien - Eine Einfuehrung in Theorie und Praxis der simulierten Evolution. Addison-Wesley, 1994. + + \ No newline at end of file diff --git a/resources/html/F5Problem.html b/resources/html/F5Problem.html new file mode 100644 index 00000000..9697f9f7 --- /dev/null +++ b/resources/html/F5Problem.html @@ -0,0 +1,27 @@ + + +Schwefel's double sum + + +

Schwefels double sum

+
+ +
+

+Schwefel's double sum is a quadratic minimization problem. Its difficulty increases by the dimension n in O(n^2). It is used for analysis of correlating mutations. +

+It possesses specific symmetrical properties:
+ + +

+Its minimum is located at: f(x)=f([0, 0, ... , 0])=0 +

+ + +


+More information about Schwefel's double sum can be found at: +

+Hans Paul Schwefel. Evolution and optimum seeking. Sixth-Generation Computer Technology Series. John Wiley & Sons, INC., 1995. + + + \ No newline at end of file diff --git a/resources/html/F6Problem.html b/resources/html/F6Problem.html new file mode 100644 index 00000000..a5b7246a --- /dev/null +++ b/resources/html/F6Problem.html @@ -0,0 +1,42 @@ + + +Generalized Rastrigin's function + + +

Generalized Rastrigin's function

+
+ +
+

+Rastrigin's function is symmetric. It is based on the simple parabola function (called f1 in the EvA context), but it is multimodal because a modulation term on the basis of the cosine function is added. This evokes hills and valleys which are misleading local optima. +

+Values used for the following illustrations: A=10, ω=2*π, n=2. + +
+ + +
+ +Rastrigin's function within the co-domain -20>=x>=20 + +

+ +
+ +Rastrigin's function within the co-domain -5>=x>=5 + +

+ +Like Ackley's function a simple evolutionary algorithm would get stuck in a local optimum, while a broader searching algorithm would get out of the local optimum closer to the global optimum, which in this case is: f(x) = f(0, 0, ... , 0) = 0. +

+
+Rastrigin's function close to its optimum. + +


+More information about Rastrigin's function can be found at: +

+Darrell Whitley, Soraya Rana, John Dzubera, Keith E. Mathias. Evaluating Evolutionary Algorithms. Artificial Intelligence, 85(1-2):245-276. 1996. +

+Eberhard Schoeneburg, Frank Heinzmann, Sven Feddersen. Genetische Algorithmen und Evolutionstrategien - Eine Einfuehrung in Theorie und Praxis der simulierten Evolution. Addison-Wesley, 1994. + + \ No newline at end of file diff --git a/resources/html/F8Problem.html b/resources/html/F8Problem.html new file mode 100644 index 00000000..44bb50ea --- /dev/null +++ b/resources/html/F8Problem.html @@ -0,0 +1,36 @@ + + +Ackley's function + + +

Ackley's function

+
+ +
+

+Ackley's function is multimodal and symmetrical. It is based on an exponential function and modulated by a cosine function. +The outside region is almost planar as to the growing influence of the exponential function. +In the center there is a steep hole as to the influence of the cosine function.
+Its minimum is at: f(x)=f([0, 0, ... , 0])=0. +

+The difficulty for an optimization algorithm is mid-graded because a simple optimization-algorithm like hill-climbing would get stuck in a local minimum. The optimization algorithm has to search a broader environ to overcome the local minimum and get closer to the global optima. + +

+ + +
+Ackley's function within the co-domain -20 >= x >= 20, a=20, b=0.2, c=2*π, n=2. +

+ + +
+Ackley's function close to the optimum. +


+More information about Ackley's function can be found at: +

+David. H. Ackley. A connection machine for genetic hillclimbing. Kluwer Academic Publishers, Boston, 1987. +

+Thomas Baeck. Evolutionary Algorithms in Theory and Practice. Oxford University Press, 1996. + + + \ No newline at end of file diff --git a/resources/html/FitnessConvergenceTerminator.html b/resources/html/FitnessConvergenceTerminator.html new file mode 100644 index 00000000..099e963f --- /dev/null +++ b/resources/html/FitnessConvergenceTerminator.html @@ -0,0 +1,19 @@ + + +Fitness Convergence Terminator + + +

Fitness Convergence Terminator

+
+

+The fitness convergence terminator stops the optimization, when there has been hardly +any change in the best fitness in the population (within percentual or absolute distance) for a certain +time, given in generations or fitness calls. In case of multi-objective optimization, the 2-norm of +the fitness vector is +currently used.
+Be aware that, if the optimization is allowed to be non-monotonic, such as for (,)-ES strategies, +and if the optimum is close to zero, it may happen that the fitness fluctuates due to numeric +issues and does not easily converge in a relative way.
+Check the help for the PopulationMeasureTerminator for additional information. + + \ No newline at end of file diff --git a/resources/GO.html b/resources/html/GO.html similarity index 100% rename from resources/GO.html rename to resources/html/GO.html diff --git a/resources/GOParameters.html b/resources/html/GOParameters.html similarity index 100% rename from resources/GOParameters.html rename to resources/html/GOParameters.html diff --git a/resources/html/GenericConstraint.html b/resources/html/GenericConstraint.html new file mode 100644 index 00000000..179b1f43 --- /dev/null +++ b/resources/html/GenericConstraint.html @@ -0,0 +1,56 @@ + + +Generic Constraints + + +

Generic Constraints

+
+ +

To represent generic constraints on real-valued functions, this class can parse +String expressions in prefix notation of the form: +

+<expr> ::= <constant-operator> | <functional-operator> "(" <arguments> ")"
+<arguments> ::= <expr> | <expr> "," <arguments> +
+

+ +Setting the constraint string: +Constant operators have an arity of zero. Examples are:
+(pi,0) (X,0) (1.0,0)
+ +Functional operators have an arity greater zero. Examples are:
+ (sum,1) (prod,1) (abs,1) (sin,1) (pow2,1) (pow3,1) (sqrt,1) (neg,1) (cos,1) (exp,1)
+ (+,2) (-,2) (/,2) (*,2)
+ +

+Additionally, any numerical strings can also be used; they are parsed to numeric constants. The literal n +is parsed to the current number of problem dimensions.
+Notice that only the sum and prod operators may receive the literal X as input, standing +for the full solution vector. Access to single solution components is possible by writing x0...x9 +for a problem with 10 dimensions. +

+ +

+Thus you may write +(-(5,sum(X)),+sin(/(x0,pi))) +and select 'lessEqZero' as relation to require valid solutions to fulfill 5-sum(X)+sin(x0/pi)<=0.
+

+ +

+Typical relations concerning constraints allow for g(x)<=0, g(x)==0, or g(x)>=0 for +constraint g. Notice that equal-to-zero constraints are converted to g(x)==0 <=> |g(x)-epsilon|<=0 for +customizable small values of epsilon. +

+ +

+The handling method defines how EvA 2 copes with the constraint. Simplest variant is an +additive penalty which is scaled by the penalty factor and then added directly to the fitness +of an individual. This will work for any optimization strategy, but results will depend on +the selection of penalty factors. Multiplicative penalty works analogously with the difference of +being multiplied with the raw fitness.
+In the variant called specific tag, the constraint violation is stored in an extra field of any +individual and may be regarded by the optimization strategy. However, not all strategies provide +simple mechanisms of incorporating this specific tag. +

+ + + \ No newline at end of file diff --git a/resources/MutateESRankMuCMA.html b/resources/html/MutateESRankMuCMA.html similarity index 100% rename from resources/MutateESRankMuCMA.html rename to resources/html/MutateESRankMuCMA.html diff --git a/resources/ParticleSwarmOptimization.html b/resources/html/ParticleSwarmOptimization.html similarity index 100% rename from resources/ParticleSwarmOptimization.html rename to resources/html/ParticleSwarmOptimization.html diff --git a/resources/PhenotypeConvergenceTerminator.html b/resources/html/PhenotypeConvergenceTerminator.html similarity index 100% rename from resources/PhenotypeConvergenceTerminator.html rename to resources/html/PhenotypeConvergenceTerminator.html diff --git a/resources/PopulationMeasureTerminator.html b/resources/html/PopulationMeasureTerminator.html similarity index 100% rename from resources/PopulationMeasureTerminator.html rename to resources/html/PopulationMeasureTerminator.html diff --git a/resources/PostProcessParams.html b/resources/html/PostProcessParams.html similarity index 100% rename from resources/PostProcessParams.html rename to resources/html/PostProcessParams.html diff --git a/resources/StatisticsParameterImpl.html b/resources/html/StatisticsParameterImpl.html similarity index 100% rename from resources/StatisticsParameterImpl.html rename to resources/html/StatisticsParameterImpl.html diff --git a/resources/Tribes.html b/resources/html/Tribes.html similarity index 100% rename from resources/Tribes.html rename to resources/html/Tribes.html diff --git a/src/eva2/EvAInfo.java b/src/eva2/EvAInfo.java index 823d3f06..bc8c1976 100644 --- a/src/eva2/EvAInfo.java +++ b/src/eva2/EvAInfo.java @@ -14,12 +14,12 @@ public class EvAInfo { // public static final String fullVersion = "2.043"; // moved to EvA2.props! public static final String url = "http://www.cogsys.cs.uni-tuebingen.de/software/EvA2"; - public static final String propertyFile = "resources/EvA2.props"; + public static final String propertyFile = "META-INF/EvA2.props"; public static final String LGPLFile = "lgpl-3.0.txt"; public static final String GPLFile= "gpl-3.0.txt"; - public static final String iconLocation = "resources/images/icon4.gif"; + public static final String iconLocation = "images/icon4.gif"; - public static final String splashLocation = "resources/images/EvASplashScreen.png"; + public static final String splashLocation = "images/EvASplashScreen.png"; public static final String infoTitle = productName+" Information"; public static final String copyrightYear = "2010-2012"; diff --git a/src/eva2/client/AppExitAction.java b/src/eva2/client/AppExitAction.java deleted file mode 100644 index a1ad09e9..00000000 --- a/src/eva2/client/AppExitAction.java +++ /dev/null @@ -1,33 +0,0 @@ -package eva2.client; - -import eva2.gui.ExtAction; -import java.awt.event.ActionEvent; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; - -/** - * Created by IntelliJ IDEA. - * User: streiche - * Date: 12.05.2003 - * Time: 18:28:54 - * To change this template use Options | File Templates. - */ -/** - * - */ -class AppExitAction extends ExtAction implements WindowListener{ - public AppExitAction(String s, String toolTip, javax.swing.KeyStroke key) { - super(s, toolTip, key); - } - private void exit(){ - System.exit(1); - } - public void actionPerformed(ActionEvent e) { exit(); } - public void windowOpened(WindowEvent e) { } - public void windowClosed(WindowEvent e) { } - public void windowIconified(WindowEvent e) { } - public void windowDeiconified(WindowEvent e) { } - public void windowActivated(WindowEvent e) { } - public void windowDeactivated(WindowEvent e) { } - public void windowClosing(WindowEvent e) { exit(); } -} diff --git a/src/eva2/client/EvAClient.java b/src/eva2/client/EvAClient.java index f41075bd..546a6665 100644 --- a/src/eva2/client/EvAClient.java +++ b/src/eva2/client/EvAClient.java @@ -44,7 +44,7 @@ import javax.swing.border.TitledBorder; /** * */ -public class EvAClient implements RemoteStateListener { +public class EvAClient extends JFrame implements RemoteStateListener { /** * Generated serial version identifier. @@ -54,7 +54,7 @@ public class EvAClient implements RemoteStateListener { private boolean clientInited = false; private JExtDesktopPaneToolBar desktopToolBar; private JDesktopPane desktopPane; - private JFrame mainFrame; + //private JFrame mainFrame; private JPanel configurationPane; private JSplitPane horizontalSplit; private Runnable initRnbl = null; @@ -333,33 +333,6 @@ public class EvAClient implements RemoteStateListener { } } - /** - * Add a window listener to the EvA2 JFrame instance. - * - * @param l - */ - public void addWindowListener(WindowListener l) { - if (mainFrame != null) { - mainFrame.addWindowListener(l); - } else { - System.err.println("Error, no JFrame existent in " - + this.getClass().getSimpleName()); - } - } - - /** - * Remove a window listener to the EvA2 JFrame instance. - * - * @param l - */ - public void removeWindowListener(WindowListener l) { - if (mainFrame != null) { - mainFrame.removeWindowListener(l); - } else { - System.err.println("Error, no JFrame existent in " - + this.getClass().getSimpleName()); - } - } /** * Set UI Font for all controls. @@ -406,9 +379,9 @@ public class EvAClient implements RemoteStateListener { } /* Create main frame with GridBagLayout */ - mainFrame = new JFrame(EvAInfo.productName); - mainFrame.setLayout(new GridBagLayout()); - mainFrame.setMinimumSize(new Dimension(800, 600)); + setTitle(EvAInfo.productName); + setLayout(new GridBagLayout()); + setMinimumSize(new Dimension(800, 600)); /* Creates the desktopPane for Plot/Text Output */ desktopPane = new JExtDesktopPane(); @@ -432,7 +405,7 @@ public class EvAClient implements RemoteStateListener { BasicResourceLoader loader = BasicResourceLoader.instance(); byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation, true); // TODO: use setIconImages (for better support of multiple icons when changing programs etc.) - mainFrame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes)); + setIconImage(Toolkit.getDefaultToolkit().createImage(bytes)); try { Thread.sleep(200); @@ -451,7 +424,7 @@ public class EvAClient implements RemoteStateListener { } createActions(); - mainFrame.setSize(800, 600); + setSize(800, 600); /* Create a new ConfigurationPanel (left side) */ configurationPane = new JPanel(new GridBagLayout()); @@ -464,7 +437,7 @@ public class EvAClient implements RemoteStateListener { gbConstraints.fill = GridBagConstraints.VERTICAL; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.gridheight = GridBagConstraints.RELATIVE; - mainFrame.add(configurationPane, gbConstraints); + add(configurationPane, gbConstraints); /* SplitPane for desktopPanel and loggingPanel */ horizontalSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true); @@ -482,7 +455,7 @@ public class EvAClient implements RemoteStateListener { gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.gridheight = GridBagConstraints.RELATIVE; - mainFrame.add(horizontalSplit, gbConstraints); + add(horizontalSplit, gbConstraints); /* StatusBar of the main frame */ statusBar = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -500,9 +473,9 @@ public class EvAClient implements RemoteStateListener { gbConstraints.weighty = 0.0; gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.anchor = GridBagConstraints.PAGE_END; - mainFrame.add(statusBar, gbConstraints); + add(statusBar, gbConstraints); - mainFrame.setVisible(true); + setVisible(true); } if (useDefaultModule != null) { /* @@ -517,11 +490,18 @@ public class EvAClient implements RemoteStateListener { if (withGUI) { buildMenu(); - mainFrame.addWindowListener(new WindowAdapter() { + addWindowListener(new WindowAdapter() { @Override public void windowClosing(final WindowEvent event) { - EvAClient.this.close(); + int result = JOptionPane.showConfirmDialog( + EvAClient.this, + "Do you really want to exit EvA2?", + "Exit Application", + JOptionPane.YES_NO_OPTION); + if (result == JOptionPane.YES_OPTION) { + EvAClient.this.close(); + } } }); } @@ -542,13 +522,13 @@ public class EvAClient implements RemoteStateListener { configurationPane.setVisible(true); } - if (!(mainFrame.isVisible())) { + if (!(this.isVisible())) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - mainFrame.setLocation((int) ((screenSize.width - mainFrame.getWidth()) / 2), (int) ((screenSize.height - mainFrame.getHeight()) / 2.5)); - mainFrame.pack(); - mainFrame.setSize(screenSize); - mainFrame.setVisible(true); - mainFrame.setVisible(true); + this.setLocation((int) ((screenSize.width - this.getWidth()) / 2), (int) ((screenSize.height - this.getHeight()) / 2.5)); + this.pack(); + this.setSize(screenSize); + this.setVisible(true); + this.setVisible(true); } // if this message is omitted, the stupid scroll pane runs to @@ -819,7 +799,7 @@ public class EvAClient implements RemoteStateListener { @Override public void actionPerformed(final ActionEvent event) { // ToDo - String helpHS = "resources/EvA2Help/EvA2Help.hs"; + String helpHS = "EvA2Help/EvA2Help.hs"; ClassLoader cl = EvAClient.class.getClassLoader(); JHelpContentViewer helpPane; try { @@ -846,7 +826,7 @@ public class EvAClient implements RemoteStateListener { */ private void buildMenu() { menuBar = new JMenuBar(); - mainFrame.setJMenuBar(menuBar); + setJMenuBar(menuBar); menuModule = new JExtMenu("&Module"); menuModule.add(actModuleLoad); @@ -907,7 +887,7 @@ public class EvAClient implements RemoteStateListener { if (selectedModule == null) { // show a dialog and ask for a module String[] moduleNameList = comAdapter.getModuleNameList(); if (moduleNameList == null) { - JOptionPane.showMessageDialog(mainFrame, "No modules available on " + comAdapter.getHostName(), EvAInfo.infoTitle, 1); + JOptionPane.showMessageDialog(this, "No modules available on " + comAdapter.getHostName(), EvAInfo.infoTitle, 1); } else { String lastModule = null; @@ -923,7 +903,7 @@ public class EvAClient implements RemoteStateListener { LOGGER.log(Level.INFO, "Defaulting to module: {0}", lastModule); } - selectedModule = (String) JOptionPane.showInputDialog(mainFrame, + selectedModule = (String) JOptionPane.showInputDialog(this, "Which module do you want \n to load on host: " + comAdapter.getHostName() + " ?", "Load optimization module on host", JOptionPane.QUESTION_MESSAGE, @@ -1058,7 +1038,7 @@ public class EvAClient implements RemoteStateListener { gbConstraints.gridwidth = 2; gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.anchor = GridBagConstraints.PAGE_START; - mainFrame.add(frameMaker.getToolBar(), gbConstraints); + add(frameMaker.getToolBar(), gbConstraints); GridBagConstraints gbConstraints2 = new GridBagConstraints(); gbConstraints2.gridx = 0; @@ -1119,7 +1099,7 @@ public class EvAClient implements RemoteStateListener { if (hostNames == null || hostNames.length == 0) { showNoHostFoundDialog(); } else { - String hostName = (String) JOptionPane.showInputDialog(mainFrame, + String hostName = (String) JOptionPane.showInputDialog(this, "Which active host do you want to connect to?", "Host", JOptionPane.QUESTION_MESSAGE, null, hostNames, comAdapter.getHostName()); if (hostName != null) { @@ -1138,12 +1118,12 @@ public class EvAClient implements RemoteStateListener { } private void showPleaseWaitDialog() { - JOptionPane.showMessageDialog(configurationPane, "Please wait one moment.", EvAInfo.infoTitle, 1); + JOptionPane.showMessageDialog(this, "Please wait one moment.", EvAInfo.infoTitle, 1); } private void showAboutDialog() { - AboutDialog aboutDialog = new AboutDialog(mainFrame); - aboutDialog.setLocationRelativeTo(mainFrame); + AboutDialog aboutDialog = new AboutDialog(this); + aboutDialog.setLocationRelativeTo(this); aboutDialog.setVisible(true); aboutDialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); } @@ -1156,7 +1136,7 @@ public class EvAClient implements RemoteStateListener { } private void showNoHostFoundDialog() { - JOptionPane.showMessageDialog(mainFrame, "No host with running EVASERVER found. Please start one or \nadd the correct address to the properties list.", EvAInfo.infoTitle, 1); + JOptionPane.showMessageDialog(this, "No host with running EVASERVER found. Please start one or \nadd the correct address to the properties list.", EvAInfo.infoTitle, 1); } private void selectAvailableHostToKill(String[] HostNames) { @@ -1164,7 +1144,7 @@ public class EvAClient implements RemoteStateListener { showNoHostFoundDialog(); return; } - String HostName = (String) JOptionPane.showInputDialog(mainFrame, + String HostName = (String) JOptionPane.showInputDialog(this, "Which server do you want to be killed ?", "Host", JOptionPane.QUESTION_MESSAGE, null, HostNames, comAdapter.getHostName()); if (HostName == null) { diff --git a/src/eva2/gui/EvAModuleButtonPanelMaker.java b/src/eva2/gui/EvAModuleButtonPanelMaker.java index bf5b8f82..66678bf7 100644 --- a/src/eva2/gui/EvAModuleButtonPanelMaker.java +++ b/src/eva2/gui/EvAModuleButtonPanelMaker.java @@ -71,7 +71,7 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa } ////////////////////////////////////////////////////////////// - runButton = ToolBoxGui.createIconifiedButton("resources/images/Play24.gif", "Start", true); + runButton = ToolBoxGui.createIconifiedButton("images/Play24.gif", "Start", true); runButton.setToolTipText("Start the current optimization run."); runButton.addActionListener(new ActionListener() { @@ -87,7 +87,7 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa toolBar.add(runButton); - stopButton = ToolBoxGui.createIconifiedButton("resources/images/Stop24.gif", "Stop", true); + stopButton = ToolBoxGui.createIconifiedButton("images/Stop24.gif", "Stop", true); stopButton.setToolTipText("Stop the current optimization run."); //stopButton.setBorderPainted(false); stopButton.addActionListener(new ActionListener() { @@ -106,7 +106,7 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa stopButton.setEnabled(runningState); toolBar.add(stopButton); - postProcessButton = ToolBoxGui.createIconifiedButton("resources/images/History24.gif", "Post Process", true); + postProcessButton = ToolBoxGui.createIconifiedButton("images/History24.gif", "Post Process", true); postProcessButton.setToolTipText("Start post processing according to available parameters."); //postProcessButton.setBorderPainted(false); postProcessButton.addActionListener(new ActionListener() { @@ -125,7 +125,7 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa postProcessButton.setEnabled(runningState && moduleAdapter.hasPostProcessing()); toolBar.add(postProcessButton); - scheduleButton = ToolBoxGui.createIconifiedButton("resources/images/Server24.gif", "Schedule", true); + scheduleButton = ToolBoxGui.createIconifiedButton("images/Server24.gif", "Schedule", true); scheduleButton.setToolTipText("Schedule the currently configured optimization as a job."); //scheduleButton.setBorderPainted(false); scheduleButton.addActionListener(new ActionListener() { diff --git a/src/eva2/gui/GOEPanel.java b/src/eva2/gui/GOEPanel.java index 1d1ee5d5..6123aad3 100644 --- a/src/eva2/gui/GOEPanel.java +++ b/src/eva2/gui/GOEPanel.java @@ -104,7 +104,7 @@ public class GOEPanel extends JPanel implements ItemListener { propChangeSupport.firePropertyChange("", backupObject, genericObjectEditor.getValue()); } }); - openButton = makeIconButton("resources/images/Open16.gif", "Open"); + openButton = makeIconButton("images/Open16.gif", "Open"); openButton.setToolTipText("Load a configured object"); openButton.setEnabled(true); openButton.addActionListener(new ActionListener() { @@ -123,7 +123,7 @@ public class GOEPanel extends JPanel implements ItemListener { } }); - saveButton = makeIconButton("resources/images/Save16.gif", "Save"); + saveButton = makeIconButton("images/Save16.gif", "Save"); saveButton.setToolTipText("Save the current configured object"); saveButton.setEnabled(true); saveButton.addActionListener(new ActionListener() { diff --git a/src/eva2/gui/GenericOptimizationObjectivesEditor.java b/src/eva2/gui/GenericOptimizationObjectivesEditor.java index 9ef5cc39..e96bf71a 100644 --- a/src/eva2/gui/GenericOptimizationObjectivesEditor.java +++ b/src/eva2/gui/GenericOptimizationObjectivesEditor.java @@ -174,7 +174,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope gbc.fill = GridBagConstraints.REMAINDER; gbc.gridx = 1; gbc.weightx = 1; - bytes = loader.getBytesFromResourceLocation("resources/images/Sub24.gif", true); + bytes = loader.getBytesFromResourceLocation("images/Sub24.gif", true); this.m_Delete[i] = new JButton("", new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); this.m_Delete[i].addActionListener(deleteTarget); this.m_TargetList.add(this.m_Delete[i], gbc); diff --git a/src/eva2/gui/GenericOptimizationObjectivesWithParamEditor.java b/src/eva2/gui/GenericOptimizationObjectivesWithParamEditor.java index 607995c1..010e0001 100644 --- a/src/eva2/gui/GenericOptimizationObjectivesWithParamEditor.java +++ b/src/eva2/gui/GenericOptimizationObjectivesWithParamEditor.java @@ -198,7 +198,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme gbc.fill = GridBagConstraints.REMAINDER; gbc.gridx = 2; gbc.weightx = 1; - bytes = loader.getBytesFromResourceLocation("resources/images/Sub24.gif", true); + bytes = loader.getBytesFromResourceLocation("images/Sub24.gif", true); this.m_Delete[i] = new JButton("", new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); this.m_Delete[i].addActionListener(deleteTarget); this.m_TargetList.add(this.m_Delete[i], gbc); diff --git a/src/eva2/gui/GenericRemoteServersEditor.java b/src/eva2/gui/GenericRemoteServersEditor.java index b632104f..8ec1193e 100644 --- a/src/eva2/gui/GenericRemoteServersEditor.java +++ b/src/eva2/gui/GenericRemoteServersEditor.java @@ -71,27 +71,27 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor this.m_ParameterPanel.add(this.m_Password, gbc); JButton tmpB; - tmpB = makeButtonWith("resources/images/Add24.gif", "add"); + tmpB = makeButtonWith("images/Add24.gif", "add"); tmpB.addActionListener(addServer); setGBC(gbc, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, 1, 0, 1, 1); this.m_ParameterPanel.add(tmpB, gbc); - tmpB = makeButtonWith("resources/images/Export24.gif", "Load"); + tmpB = makeButtonWith("images/Export24.gif", "Load"); tmpB.addActionListener(loadServers); setGBC(gbc, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, 1, 1, 1, 1); this.m_ParameterPanel.add(tmpB, gbc); - tmpB = makeButtonWith("resources/images/Import24.gif", "Save"); + tmpB = makeButtonWith("images/Import24.gif", "Save"); tmpB.addActionListener(saveServers); setGBC(gbc, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, 1, 2, 1, 1); this.m_ParameterPanel.add(tmpB, gbc); - tmpB = makeButtonWith("resources/images/Refresh24.gif", "Update Status"); + tmpB = makeButtonWith("images/Refresh24.gif", "Update Status"); tmpB.addActionListener(updateServers); setGBC(gbc, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, 1, 3, 1, 1); this.m_ParameterPanel.add(tmpB, gbc); - tmpB = makeButtonWith("resources/images/Play24.gif", "Start Server"); + tmpB = makeButtonWith("images/Play24.gif", "Start Server"); tmpB.addActionListener(startServers); setGBC(gbc, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, 1, 4, 1, 1); this.m_ParameterPanel.add(tmpB, gbc); - tmpB = makeButtonWith("resources/images/Stop24.gif", "Stop Server"); + tmpB = makeButtonWith("images/Stop24.gif", "Stop Server"); tmpB.addActionListener(killServers); setGBC(gbc, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, 1, 5, 1, 1); this.m_ParameterPanel.add(tmpB, gbc); @@ -168,7 +168,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor this.m_ServerList.add(this.m_CPUs[i], gbc); // The delete button setGBC(gbc, GridBagConstraints.WEST, GridBagConstraints.REMAINDER, 3, 10); - bytes = BasicResourceLoader.instance().getBytesFromResourceLocation("resources/images/Sub24.gif", true); + bytes = BasicResourceLoader.instance().getBytesFromResourceLocation("images/Sub24.gif", true); this.m_Delete[i] = new JButton("", new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); this.m_Delete[i].addActionListener(deleteServer); this.m_ServerList.add(this.m_Delete[i], gbc); diff --git a/src/eva2/gui/HtmlDemo.java b/src/eva2/gui/HtmlDemo.java index 030d0def..c48b3a71 100644 --- a/src/eva2/gui/HtmlDemo.java +++ b/src/eva2/gui/HtmlDemo.java @@ -52,12 +52,12 @@ public class HtmlDemo { } public boolean resourceExists() { - URL url = ClassLoader.getSystemResource("resources/"+m_name); + URL url = ClassLoader.getSystemResource("html/"+m_name); return (url != null); } public static boolean resourceExists(String mname) { - URL url = ClassLoader.getSystemResource("resources/"+mname); + URL url = ClassLoader.getSystemResource("html/"+mname); return (url != null); } /** @@ -66,12 +66,12 @@ public class HtmlDemo { public void show() { try { URL url = null; - url = this.getClass().getClassLoader().getSystemResource("resources/"+m_name); + url = this.getClass().getClassLoader().getSystemResource("html/"+m_name); try { m_html = new JEditorPane(url); } catch (java.io.IOException ioe) { - url = this.getClass().getClassLoader().getSystemResource("resources/Default.html"); + url = this.getClass().getClassLoader().getSystemResource("html/Default.html"); m_html = new JEditorPane(url); } //m_html = new JEditorPane(htmlDescription); diff --git a/src/eva2/gui/JExtDesktopPaneToolBar.java b/src/eva2/gui/JExtDesktopPaneToolBar.java index 2f48f59e..362b1a0a 100644 --- a/src/eva2/gui/JExtDesktopPaneToolBar.java +++ b/src/eva2/gui/JExtDesktopPaneToolBar.java @@ -27,7 +27,7 @@ public class JExtDesktopPaneToolBar extends JToolBar { setFloatable(false); /* Add Buttons to tile the desktopPane */ - JButton verticalButton = ToolBoxGui.createIconifiedButton("resources/images/TileVertical16.png", "Tile vertically", false); + JButton verticalButton = ToolBoxGui.createIconifiedButton("images/TileVertical16.png", "Tile vertically", false); verticalButton.addActionListener(new ActionListener() { @Override @@ -38,7 +38,7 @@ public class JExtDesktopPaneToolBar extends JToolBar { }); add(verticalButton); - JButton horizontalButton = ToolBoxGui.createIconifiedButton("resources/images/TileHorizontal16.png", "Tile horizontally", false); + JButton horizontalButton = ToolBoxGui.createIconifiedButton("images/TileHorizontal16.png", "Tile horizontally", false); horizontalButton.addActionListener(new ActionListener() { @Override @@ -49,7 +49,7 @@ public class JExtDesktopPaneToolBar extends JToolBar { }); add(horizontalButton); - JButton cascadeButton = ToolBoxGui.createIconifiedButton("resources/images/Cascade16.png", "Cascade windows", false); + JButton cascadeButton = ToolBoxGui.createIconifiedButton("images/Cascade16.png", "Cascade windows", false); cascadeButton.addActionListener(new ActionListener() { @Override diff --git a/src/eva2/server/go/mocco/MOCCOChooseMOStrategy.java b/src/eva2/server/go/mocco/MOCCOChooseMOStrategy.java index d3e7b8a4..62ccbd15 100644 --- a/src/eva2/server/go/mocco/MOCCOChooseMOStrategy.java +++ b/src/eva2/server/go/mocco/MOCCOChooseMOStrategy.java @@ -55,7 +55,7 @@ public class MOCCOChooseMOStrategy extends MOCCOPhase implements InterfaceProces gbc.fill = GridBagConstraints.BOTH; gbc.weightx = 100; tmpB = new JButton(); - bytes = loader.getBytesFromResourceLocation("resources/MOCCO/MOCCO_MOEA.gif", true); + bytes = loader.getBytesFromResourceLocation("images/MOCCO/MOCCO_MOEA.gif", true); tmpB.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); tmpB.setBackground(Color.WHITE); gbc.gridy = 0; @@ -73,7 +73,7 @@ public class MOCCOChooseMOStrategy extends MOCCOPhase implements InterfaceProces " objectives."), gbc); tmpB = new JButton(); - bytes = loader.getBytesFromResourceLocation("resources/MOCCO/MOCCO_GDF.gif", true); + bytes = loader.getBytesFromResourceLocation("images/MOCCO/MOCCO_GDF.gif", true); tmpB.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); tmpB.setBackground(Color.WHITE); gbc.gridy = 1; @@ -89,7 +89,7 @@ public class MOCCOChooseMOStrategy extends MOCCOPhase implements InterfaceProces this.m_Mocco.m_JPanelParameters.add(tmpP, BorderLayout.CENTER); tmpB = new JButton(); - bytes = loader.getBytesFromResourceLocation("resources/MOCCO/MOCCO_STEP.gif", true); + bytes = loader.getBytesFromResourceLocation("images/MOCCO/MOCCO_STEP.gif", true); tmpB.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); tmpB.setBackground(Color.WHITE); gbc.gridy = 2; @@ -106,7 +106,7 @@ public class MOCCOChooseMOStrategy extends MOCCOPhase implements InterfaceProces " into a single objectives. The individual weights are also to be given by the DM."), gbc); tmpB = new JButton(); - bytes = loader.getBytesFromResourceLocation("resources/MOCCO/MOCCO_REFP.gif", true); + bytes = loader.getBytesFromResourceLocation("images/MOCCO/MOCCO_REFP.gif", true); tmpB.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); tmpB.setBackground(Color.WHITE); gbc.gridy = 3; @@ -123,7 +123,7 @@ public class MOCCOChooseMOStrategy extends MOCCOPhase implements InterfaceProces " same time."), gbc); tmpB = new JButton(); - bytes = loader.getBytesFromResourceLocation("resources/MOCCO/MOCCO_TBCH.gif", true); + bytes = loader.getBytesFromResourceLocation("images/MOCCO/MOCCO_TBCH.gif", true); tmpB.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); tmpB.setBackground(Color.WHITE); gbc.gridy = 4; diff --git a/src/eva2/server/go/operators/crossover/PropertyCrossoverMixerEditor.java b/src/eva2/server/go/operators/crossover/PropertyCrossoverMixerEditor.java index d07a2447..d1a00220 100644 --- a/src/eva2/server/go/operators/crossover/PropertyCrossoverMixerEditor.java +++ b/src/eva2/server/go/operators/crossover/PropertyCrossoverMixerEditor.java @@ -201,7 +201,7 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit gbc.fill = GridBagConstraints.REMAINDER; gbc.gridx = 2; gbc.weightx = 1; - bytes = loader.getBytesFromResourceLocation("resources/images/Sub24.gif", true); + bytes = loader.getBytesFromResourceLocation("images/Sub24.gif", true); this.m_Delete[i] = new JButton("", new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); this.m_Delete[i].addActionListener(deleteTarget); this.m_TargetList.add(this.m_Delete[i], gbc); diff --git a/src/eva2/server/go/operators/mutation/PropertyMutationMixerEditor.java b/src/eva2/server/go/operators/mutation/PropertyMutationMixerEditor.java index 04cd99e4..6145bcec 100644 --- a/src/eva2/server/go/operators/mutation/PropertyMutationMixerEditor.java +++ b/src/eva2/server/go/operators/mutation/PropertyMutationMixerEditor.java @@ -176,7 +176,7 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito gbc.fill = GridBagConstraints.REMAINDER; gbc.gridx = 2; gbc.weightx = 1; - bytes = loader.getBytesFromResourceLocation("resources/images/Sub24.gif", true); + bytes = loader.getBytesFromResourceLocation("images/Sub24.gif", true); this.m_Delete[i] = new JButton("", new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes))); this.m_Delete[i].addActionListener(deleteTarget); this.m_TargetList.add(this.m_Delete[i], gbc); diff --git a/src/eva2/server/go/operators/paretofrontmetrics/MetricD1ApproxParetoFront.java b/src/eva2/server/go/operators/paretofrontmetrics/MetricD1ApproxParetoFront.java index 7f95a189..31380125 100644 --- a/src/eva2/server/go/operators/paretofrontmetrics/MetricD1ApproxParetoFront.java +++ b/src/eva2/server/go/operators/paretofrontmetrics/MetricD1ApproxParetoFront.java @@ -20,7 +20,7 @@ import eva2.server.go.tools.FileTools; * To change this template use File | Settings | File Templates. */ public class MetricD1ApproxParetoFront implements eva2.server.go.operators.paretofrontmetrics.InterfaceParetoFrontMetric, java.io.Serializable { - private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("resources/MOPReference/T1_250.txt"); + private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("MOPReference/T1_250.txt"); private String[] m_Titles; private double[][] m_Reference; diff --git a/src/eva2/server/go/operators/paretofrontmetrics/MetricD1TrueParetoFront.java b/src/eva2/server/go/operators/paretofrontmetrics/MetricD1TrueParetoFront.java index a5bd447b..9bf44332 100644 --- a/src/eva2/server/go/operators/paretofrontmetrics/MetricD1TrueParetoFront.java +++ b/src/eva2/server/go/operators/paretofrontmetrics/MetricD1TrueParetoFront.java @@ -23,7 +23,7 @@ public class MetricD1TrueParetoFront implements eva2.server.go.operators.paretof // private String base = System.getProperty("user.dir"); // private String FS = System.getProperty("file.separator"); - private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("resources/MOPReference/T1_250.txt"); + private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("MOPReference/T1_250.txt"); private String[] m_Titles; private double[][] m_Reference; diff --git a/src/eva2/server/go/operators/paretofrontmetrics/MetricErrorRatio.java b/src/eva2/server/go/operators/paretofrontmetrics/MetricErrorRatio.java index b89495f1..0fab3a56 100644 --- a/src/eva2/server/go/operators/paretofrontmetrics/MetricErrorRatio.java +++ b/src/eva2/server/go/operators/paretofrontmetrics/MetricErrorRatio.java @@ -20,7 +20,7 @@ import java.util.ArrayList; * To change this template use File | Settings | File Templates. */ public class MetricErrorRatio implements eva2.server.go.operators.paretofrontmetrics.InterfaceParetoFrontMetric, java.io.Serializable { - private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("resources/MOPReference/T1_250.txt"); + private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("MOPReference/T1_250.txt"); private double m_Epsilon = 0.0001; private String[] m_Titles; private double[][] m_Reference; diff --git a/src/eva2/server/go/operators/paretofrontmetrics/MetricMaximumParetoFrontError.java b/src/eva2/server/go/operators/paretofrontmetrics/MetricMaximumParetoFrontError.java index 75385171..a800a87a 100644 --- a/src/eva2/server/go/operators/paretofrontmetrics/MetricMaximumParetoFrontError.java +++ b/src/eva2/server/go/operators/paretofrontmetrics/MetricMaximumParetoFrontError.java @@ -19,7 +19,7 @@ import eva2.server.go.tools.FileTools; * To change this template use File | Settings | File Templates. */ public class MetricMaximumParetoFrontError implements eva2.server.go.operators.paretofrontmetrics.InterfaceParetoFrontMetric, java.io.Serializable { - private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("resources/MOPReference/T1_250.txt"); + private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("MOPReference/T1_250.txt"); private String[] m_Titles; private double[][] m_Reference; diff --git a/src/eva2/server/go/operators/paretofrontmetrics/MetricSWithReference.java b/src/eva2/server/go/operators/paretofrontmetrics/MetricSWithReference.java index 46a5e3b6..794d3708 100644 --- a/src/eva2/server/go/operators/paretofrontmetrics/MetricSWithReference.java +++ b/src/eva2/server/go/operators/paretofrontmetrics/MetricSWithReference.java @@ -21,7 +21,7 @@ import eva2.server.go.tools.FileTools; */ public class MetricSWithReference implements InterfaceParetoFrontMetric, java.io.Serializable { private double[][] m_ObjectiveSpaceRange; - private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("resources/MOPReference/T1_250.txt"); + private PropertyFilePath m_InputFilePath = PropertyFilePath.getFilePathFromResource("MOPReference/T1_250.txt"); private String[] m_Titles; private double[][] m_Reference; private double m_ReferenceSMetric = -1; diff --git a/src/eva2/server/go/problems/TF1Problem.java b/src/eva2/server/go/problems/TF1Problem.java index af1942c5..1618a3bc 100644 --- a/src/eva2/server/go/problems/TF1Problem.java +++ b/src/eva2/server/go/problems/TF1Problem.java @@ -197,7 +197,7 @@ public class TF1Problem extends AbstractMultiObjectiveOptimizationProblem implem int points = 500; String base = System.getProperty("user.dir"); String FS = System.getProperty("file.separator"); - PropertyFilePath fileOutPath = PropertyFilePath.getFilePathFromResource("resources/MOPReference"+FS+"T1_"+points+".txt"); + PropertyFilePath fileOutPath = PropertyFilePath.getFilePathFromResource("MOPReference"+FS+"T1_"+points+".txt"); BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(fileOutPath.getCompleteFilePath())); diff --git a/src/eva2/tools/BasicResourceLoader.java b/src/eva2/tools/BasicResourceLoader.java index f5575a5c..8b38768a 100644 --- a/src/eva2/tools/BasicResourceLoader.java +++ b/src/eva2/tools/BasicResourceLoader.java @@ -649,7 +649,7 @@ public class BasicResourceLoader implements ResourceLoader if (slInd != -1) planBResName = resourceName.substring(slInd + 1); else planBResName = resourceName; Properties userProps = new Properties(); - File propFile = new File(File.separatorChar + "resources" + File.separatorChar + planBResName); + File propFile = new File(File.separatorChar + planBResName); if (propFile.exists()) { try { userProps.load(new FileInputStream(propFile)); diff --git a/src/eva2/tools/ReflectPackage.java b/src/eva2/tools/ReflectPackage.java index 3a07b304..52fc35a9 100644 --- a/src/eva2/tools/ReflectPackage.java +++ b/src/eva2/tools/ReflectPackage.java @@ -409,7 +409,7 @@ public class ReflectPackage { System.out.println("1: " + cld.getResource("/eva2/server")); System.out.println("2: " + cld.getResource("eva2/server")); // BasicResourceLoader rld = BasicResourceLoader.instance(); -// byte[] b = rld.getBytesFromResourceLocation("resources/images/Sub24.gif"); +// byte[] b = rld.getBytesFromResourceLocation("images/Sub24.gif"); // System.out.println((b == null) ? "null" : b.toString()); // b = rld.getBytesFromResourceLocation("src/eva2/client/EvAClient.java"); // System.out.println((b == null) ? "null" : b.toString());