diff --git a/pom.xml b/pom.xml index e9bcf3f1..502c3418 100644 --- a/pom.xml +++ b/pom.xml @@ -4,9 +4,17 @@ eva2 EvA2 jar - 1.0-SNAPSHOT + 3.0-rc1 EvA2 http://www.ra.cs.uni-tuebingen.de/software/EvA2/ + EvA2 (an Evolutionary Algorithms framework, revised version 2) is a comprehensive heuristic optimization framework with emphasis on Evolutionary Algorithms implemented in Java. It is a revised version of the JavaEvA optimization toolbox, which has been developed as a resumption of the former EvA software package. + + + scm:svn:https://rarepos.cs.uni-tuebingen.de/svn-path/JE2Base/trunk + scm:svn:https://rarepos.cs.uni-tuebingen.de/svn-path/JE2Base/trunk + https://rarepos.cs.uni-tuebingen.de/svn-path/JE2Base/trunk + + junit @@ -18,8 +26,15 @@ javax.help javahelp 2.0.05 - + + + org.apache.commons + commons-math3 + 3.0 + + + ${project.basedir}/build ${project.build.directory}/classes @@ -32,6 +47,7 @@ + org.apache.maven.plugins maven-jar-plugin @@ -47,6 +63,21 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + - + + + + + + UTF-8 + diff --git a/resources/META-INF/EvA2.props b/resources/META-INF/EvA2.props index 0d9ae934..3ca2afd4 100644 --- a/resources/META-INF/EvA2.props +++ b/resources/META-INF/EvA2.props @@ -18,4 +18,4 @@ ModulePackage = eva2.server.modules ModuleFilterClass = eva2.server.modules.AbstractModuleAdapter # Full EvA2 version number -EvA2Version = 2.050 \ No newline at end of file +EvA2Version = 3.0-rc1 \ No newline at end of file diff --git a/src/eva2/EvAInfo.java b/src/eva2/EvAInfo.java index bc8c1976..d830edf0 100644 --- a/src/eva2/EvAInfo.java +++ b/src/eva2/EvAInfo.java @@ -11,7 +11,6 @@ import java.util.Properties; public class EvAInfo { public static final String productName = "EvA2"; public static final String productLongName = "Evolutionary Algorithms Workbench 2"; - // 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 = "META-INF/EvA2.props"; @@ -22,8 +21,8 @@ public class EvAInfo { public static final String splashLocation = "images/EvASplashScreen.png"; public static final String infoTitle = productName+" Information"; public static final String copyrightYear = "2010-2012"; - - public static final String defaultLogger = "EvA2"; + + public static final String defaultLogger = "EvA2"; ////////////// Property handling... diff --git a/src/eva2/client/EvAClient.java b/src/eva2/client/EvAClient.java index 546a6665..5d59d1cb 100644 --- a/src/eva2/client/EvAClient.java +++ b/src/eva2/client/EvAClient.java @@ -39,6 +39,7 @@ import java.util.logging.Logger; import javax.help.*; import javax.swing.*; import javax.swing.border.TitledBorder; +import javax.swing.plaf.SeparatorUI; /** @@ -458,14 +459,30 @@ public class EvAClient extends JFrame implements RemoteStateListener { add(horizontalSplit, gbConstraints); /* StatusBar of the main frame */ - statusBar = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - statusBar.add(new JLabel("Progress")); + statusBar = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + JPanel statusBarControls = new JPanel(); + statusBarControls.setLayout(new BoxLayout(statusBarControls, BoxLayout.LINE_AXIS)); + + statusBarControls.add(Box.createHorizontalGlue()); + /* Logging settings drop down */ + LoggingLevelLabel loggingOption = new LoggingLevelLabel(LOGGER); + + statusBarControls.add(loggingOption); + + statusBarControls.add(Box.createHorizontalStrut(5)); + statusBarControls.add(new JSeparator(JSeparator.VERTICAL)); + statusBarControls.add(Box.createHorizontalStrut(5)); /* Create ProgressBar and add it to the status bar */ - progressBar = new JProgressBar(); - progressBar.setValue(0); + statusBarControls.add(new JLabel("Progress")); + statusBarControls.add(Box.createHorizontalStrut(5)); + + progressBar = new JProgressBar(); + progressBar.setValue(0); progressBar.setStringPainted(true); - statusBar.add(progressBar); + statusBarControls.add(progressBar); + + statusBar.add(statusBarControls); gbConstraints.gridx = 0; gbConstraints.gridy = 2; diff --git a/src/eva2/gui/LoggingLevelLabel.java b/src/eva2/gui/LoggingLevelLabel.java new file mode 100644 index 00000000..534c4bbb --- /dev/null +++ b/src/eva2/gui/LoggingLevelLabel.java @@ -0,0 +1,109 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eva2.gui; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JLabel; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.JSeparator; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; + +/** + * + * @author becker + */ +public final class LoggingLevelLabel extends JLabel { + private JPopupMenu menu; + private String[] options; + private String selected; + private Logger logger; + + public LoggingLevelLabel(Logger logger) { + options = new String[]{"Info", "Warning", "Severe", "Fine", "Finer", "Finest", "All"}; + + this.logger = logger; + createPopupMenu(); + updateText(); + } + + private void createPopupMenu() { + this.menu = new JPopupMenu(); + addMouseListener(new MouseListener() { + + @Override + public void mouseClicked(final MouseEvent ev) { + menu.show(ev.getComponent(), ev.getX(), ev.getY()); + } + + @Override + public void mousePressed(MouseEvent e) { + } + + @Override + public void mouseReleased(MouseEvent e) { + } + + @Override + public void mouseEntered(MouseEvent e) { + } + + @Override + public void mouseExited(MouseEvent e) { + } + }); + + for (String option : options) { + JMenuItem menuItem = new JMenuItem(option); + menuItem.addActionListener(new MenuActionListener()); + menu.add(menuItem); + } + } + + private void updateText() { + /* Get the current logging Level */ + Level lvl = logger.getLevel(); + /* Level could be null, fetch parent level */ + if (lvl == null) { + lvl = logger.getParent().getLevel(); + } + /* Show the updated text */ + setText("Level: " + lvl.getName()); + } + + private void setLoggerLevel(Level level) { + logger.setLevel(level); + logger.log(Level.INFO, "Logging Level changed to {0}", level.getName()); + } + + /** + * + */ + class MenuActionListener implements ActionListener { + + @Override + public void actionPerformed(final ActionEvent ev) { + JMenuItem menuItem = (JMenuItem) ev.getSource(); + String levelName = menuItem.getText(); + + try { + Level level = Level.parse(levelName.toUpperCase()); + LoggingLevelLabel.this.setLoggerLevel(level); + } catch (IllegalArgumentException ex) { + logger.log(Level.INFO, "Could not determine new logging level!", ex); + } + + LoggingLevelLabel.this.updateText(); + } + + } + +}