individuals) {
diff --git a/opt4j-core/src/main/java/org/opt4j/core/config/annotations/Citation.java b/opt4j-core/src/main/java/org/opt4j/core/config/annotations/Citation.java
new file mode 100644
index 00000000..752a196d
--- /dev/null
+++ b/opt4j-core/src/main/java/org/opt4j/core/config/annotations/Citation.java
@@ -0,0 +1,146 @@
+package org.opt4j.core.config.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.time.DateTimeException;
+import java.time.Month;
+
+import org.opt4j.core.start.Opt4JModule;
+
+/**
+ * The {@link Citation} can be used in {@link Opt4JModule}s to add citations to
+ * scientific works.
+ *
+ * Example:
+ *
+ *
+ * @Citation(title = "Opt4J: A Modular Framework for Meta-heuristic Optimization",
+ * authors = "Martin Lukasiewycz, Michael Glaß, Felix Reimann, and Jürgen Teich",
+ * journal = "Proceedings of the 13th Annual Conference on Genetic and Evolutionary Computation",
+ * pageFirst = 1723
+ * pageLast = 1730
+ * volume = 13
+ * number = 1
+ * month = PublicationMonth.JULY,
+ * year = 2011,
+ * doi = "10.1145/2001576.2001808")
+ *
+ *
+ * @author Felix Reimann
+ *
+ */
+@Retention(RUNTIME)
+@Target({ METHOD, TYPE, FIELD })
+@Documented
+public @interface Citation {
+ enum PublicationMonth {
+ UNKNOWN, JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER;
+
+ public Month toMonth() {
+ switch (this) {
+ case JANUARY:
+ return Month.JANUARY;
+ case FEBRUARY:
+ return Month.FEBRUARY;
+ case MARCH:
+ return Month.MARCH;
+ case APRIL:
+ return Month.APRIL;
+ case MAY:
+ return Month.MAY;
+ case JUNE:
+ return Month.JUNE;
+ case JULY:
+ return Month.JULY;
+ case AUGUST:
+ return Month.AUGUST;
+ case SEPTEMBER:
+ return Month.SEPTEMBER;
+ case OCTOBER:
+ return Month.OCTOBER;
+ case NOVEMBER:
+ return Month.NOVEMBER;
+ case DECEMBER:
+ return Month.DECEMBER;
+ default:
+ throw new DateTimeException("publication month is unkown");
+ }
+ }
+ }
+
+ /**
+ * The title.
+ *
+ * @return the title of the citation
+ */
+ String title();
+
+ /**
+ * The authors of the work.
+ *
+ * @return the authors
+ */
+ String authors() default "";
+
+ /**
+ * The volume of the journal.
+ *
+ * @return the volume
+ */
+ int volume() default -1;
+
+ /**
+ * The number of the journal issue.
+ *
+ * @return the number
+ */
+ int number() default -1;
+
+ /**
+ * The month, in which the paper has been published.
+ *
+ * @return the month
+ */
+ PublicationMonth month();
+
+ /**
+ * The year, in which the paper has been published.
+ *
+ * @return the year
+ */
+ int year();
+
+ /**
+ * The journal, in which the paper has been published.
+ *
+ * @return the title of the journal
+ */
+ String journal() default "";
+
+ /**
+ * The number of the page, where the paper starts.
+ *
+ * @return the first page
+ */
+ int pageFirst() default -1;
+
+ /**
+ * The number of the page, where the paper ends.
+ *
+ * @return the last page
+ */
+ int pageLast() default -1;
+
+ /**
+ * The Digital Object Identifier of the work.
+ *
+ * @return the doi
+ */
+ String doi() default "";
+}
diff --git a/opt4j-core/src/main/java/org/opt4j/core/config/visualization/DialogLayout.java b/opt4j-core/src/main/java/org/opt4j/core/config/visualization/DialogLayout.java
index 57484130..21e75232 100644
--- a/opt4j-core/src/main/java/org/opt4j/core/config/visualization/DialogLayout.java
+++ b/opt4j-core/src/main/java/org/opt4j/core/config/visualization/DialogLayout.java
@@ -8,8 +8,8 @@
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@@ -19,7 +19,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*******************************************************************************/
-
package org.opt4j.core.config.visualization;
@@ -32,10 +31,10 @@
/**
* The {@link DialogLayout} is used for label-field pair layout.
*
- * @see http://www.javafaq.nu/java-allbooks-8.html
- * @see http://www.javafaq.nu/java-bookpage-15-5.html
+ * @see http://www.javafaq.nu/java-allbooks-8.html
+ * @see http://www.javafaq.nu/java-bookpage-15-5.html
*
* @author lukasiewycz
*
@@ -141,7 +140,6 @@ public void layoutContainer(Container parent) {
int w = parent.getWidth() - insets.left - insets.right - divider;
int x = insets.left;
int y = insets.top;
-
for (int k = 1; k < parent.getComponentCount(); k += 2) {
Component comp1 = parent.getComponent(k - 1);
Component comp2 = parent.getComponent(k);
@@ -163,7 +161,7 @@ public void layoutContainer(Container parent) {
protected int getDivider(Container parent) {
Insets insets = parent.getInsets();
- int half = (parent.getWidth() - insets.left - insets.right) / 2;
+ int half = (parent.getWidth() - insets.left - insets.right) / 4;
int divider = 0;
@@ -174,7 +172,6 @@ protected int getDivider(Container parent) {
}
divider += hGap;
-
return Math.max(divider, half);
}
diff --git a/opt4j-core/src/main/java/org/opt4j/core/config/visualization/Format.java b/opt4j-core/src/main/java/org/opt4j/core/config/visualization/Format.java
index 002c11f0..601ea187 100644
--- a/opt4j-core/src/main/java/org/opt4j/core/config/visualization/Format.java
+++ b/opt4j-core/src/main/java/org/opt4j/core/config/visualization/Format.java
@@ -1,28 +1,26 @@
/*******************************************************************************
* Copyright (c) 2014 Opt4J
*
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
+ * Software.
*
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*******************************************************************************/
-
package org.opt4j.core.config.visualization;
+import static java.time.format.TextStyle.FULL;
+import static java.util.Locale.ENGLISH;
+import static org.opt4j.core.config.annotations.Citation.PublicationMonth.UNKNOWN;
+
import java.lang.reflect.Field;
import javax.swing.ImageIcon;
@@ -31,6 +29,7 @@
import org.opt4j.core.config.Property;
import org.opt4j.core.config.PropertyModule;
import org.opt4j.core.config.annotations.Category;
+import org.opt4j.core.config.annotations.Citation;
import org.opt4j.core.config.annotations.Icon;
import org.opt4j.core.config.annotations.Info;
import org.opt4j.core.config.annotations.Name;
@@ -105,6 +104,11 @@ public String getTooltip(Class> c) {
if (info != null) {
text += xmlBreak + info;
}
+
+ Citation citation = c.getAnnotation(Citation.class);
+ if (citation != null)
+ text += xmlBreak + xmlBreak + "[" + formatIEEE(citation) + "]";
+
text += "