Permalink
Browse files

Forces the compilation/execution to Java 1.8

Signed-off-by: AlexisDrogoul <alexis.drogoul@gmail.com>
  • Loading branch information...
1 parent 0f3c1d7 commit 8408eca8b09eb2d7f4ad743def2a982f18a2e58a @AlexisDrogoul AlexisDrogoul committed Sep 28, 2016
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gaml">
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry excluding="irit/gaml/extensions/database/skills/XmlaTest.java|irit/gaml/extensions/database/skills/MondrianApp.java|irit/gaml/extensions/database/skills/MondrianXmlaApp.java|irit/gaml/extensions/database/skills/MyAPP.java|irit/gaml/extensions/database/skills/MDXApp.java|irit/gaml/extensions/database/skills/QueryLab.java" kind="src" path="src"/>
<classpathentry kind="src" path="gaml"/>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gaml">
@@ -13,21 +13,36 @@
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
-import java.util.*;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
import java.util.logging.Logger;
+
import com.vividsolutions.jts.geom.Envelope;
-import msi.gama.metamodel.shape.*;
-import msi.gama.runtime.*;
+
+import msi.gama.metamodel.shape.GamaPoint;
+import msi.gama.metamodel.shape.ILocation;
+import msi.gama.metamodel.shape.IShape;
+import msi.gama.runtime.GAMA;
+import msi.gama.runtime.IScope;
import msi.gama.runtime.exceptions.GamaRuntimeException;
-import msi.gama.util.graph.*;
-import msi.gaml.operators.fastmaths.*;
-import prefuse.*;
+import msi.gama.util.graph.GamaGraph;
+import msi.gama.util.graph.GraphUtilsPrefuse;
+import msi.gaml.operators.fastmaths.CmnFastMath;
+import msi.gaml.operators.fastmaths.FastMath;
+import prefuse.Display;
+import prefuse.Visualization;
import prefuse.action.ActionList;
import prefuse.action.layout.Layout;
import prefuse.activity.Activity;
import prefuse.data.Graph;
import prefuse.render.DefaultRendererFactory;
-import prefuse.visual.*;
+import prefuse.visual.VisualItem;
+import prefuse.visual.VisualTable;
public abstract class PrefuseStaticLayoutAbstract implements IStaticLayout {
@@ -42,8 +57,11 @@
private void resetThermometer(final int nbtuples) {
lastNode2measures = null;
- count_measures = CmnFastMath.min(FastMath.max(nbtuples / 20, // ideal: measure 5% of nodes
- 10 // measure at least 10, even if the network is small !
+ count_measures = CmnFastMath.min(FastMath.max(nbtuples / 20, // ideal:
+ // measure
+ // 5% of
+ // nodes
+ 10 // measure at least 10, even if the network is small !
), nbtuples - 1 // but don't try to measure more than existing..;
);
}
@@ -52,31 +70,32 @@ private Double insertThermometer(final Visualization viz) {
try {
- if ( lastNode2measures == null ) {
+ if (lastNode2measures == null) {
- VisualTable tuples = (VisualTable) viz.getVisualGroup(PREFUSE_GRAPH + ".nodes");
- int nbtuples = tuples.getTupleCount();
+ final VisualTable tuples = (VisualTable) viz.getVisualGroup(PREFUSE_GRAPH + ".nodes");
+ final int nbtuples = tuples.getTupleCount();
lastNode2measures = new HashMap<VisualItem, Double>(count_measures);
// let's select n random nodes that will be used for measurement
while (lastNode2measures.size() < count_measures) {
- VisualItem i = tuples.getItem(random.nextInt(nbtuples));
+ final VisualItem i = tuples.getItem(random.nextInt(nbtuples));
lastNode2measures.put(i, i.getX() + i.getY());
}
- // no previous reference, the difference (and temperature) is infinite !
+ // no previous reference, the difference (and temperature) is
+ // infinite !
return Double.POSITIVE_INFINITY;
} else {
- Map<VisualItem, Double> newMeasures = new HashMap<VisualItem, Double>(count_measures);
+ final Map<VisualItem, Double> newMeasures = new HashMap<VisualItem, Double>(count_measures);
double temperature = 0.0;
- for ( VisualItem i : lastNode2measures.keySet() ) {
- double prev = lastNode2measures.get(i);
- double novel = i.getX() + i.getY();
+ for (final VisualItem i : lastNode2measures.keySet()) {
+ final double prev = lastNode2measures.get(i);
+ final double novel = i.getX() + i.getY();
newMeasures.put(i, novel);
temperature += FastMath.pow(prev - novel, 2);
}
@@ -87,21 +106,23 @@ private Double insertThermometer(final Visualization viz) {
return temperature;
}
- } catch (RuntimeException e) {
- return Double.POSITIVE_INFINITY; // in case of error, we just have no measure...
+ } catch (final RuntimeException e) {
+ return Double.POSITIVE_INFINITY; // in case of error, we just have
+ // no measure...
}
}
/**
- * Takes a prefuse graph and applies a prefuse layout, with a max time for execution; the layout is bounded
- * according to parameters.
+ * Takes a prefuse graph and applies a prefuse layout, with a max time for
+ * execution; the layout is bounded according to parameters.
+ *
* @param prefuseGraph
* @param prefuseLayout
* @param bounds
* @param maxtime
*/
private void renderLayout(final Graph prefuseGraph, final Layout prefuseLayout, final Rectangle2D bounds,
- final long maxtime) {
+ final long maxtime) {
// configure the layout
prefuseLayout.setGroup(PREFUSE_GRAPH);
@@ -111,29 +132,32 @@ private void renderLayout(final Graph prefuseGraph, final Layout prefuseLayout,
prefuseLayout.setStepTime(0);
// create the visualization required to drive a layout
- Visualization viz = new Visualization();
+ final Visualization viz = new Visualization();
viz.addGraph(PREFUSE_GRAPH, prefuseGraph);
viz.setVisible(PREFUSE_GRAPH, null, true);
- // viz.setInteractive(PREFUSE_GRAPH, null, false); // no interactivity there
+ // viz.setInteractive(PREFUSE_GRAPH, null, false); // no interactivity
+ // there
- ActionList actionsLayout = new ActionList(Activity.INFINITY);
+ final ActionList actionsLayout = new ActionList(Activity.INFINITY);
actionsLayout.add(prefuseLayout);
viz.putAction("layout", actionsLayout);
viz.setRendererFactory(new DefaultRendererFactory());
- Display display = new Display(viz);
- display.setSize((int) FastMath.ceil(bounds.getWidth()), (int) FastMath.ceil(bounds.getHeight())); // set display size
+ final Display display = new Display(viz);
+ display.setSize((int) FastMath.ceil(bounds.getWidth()), (int) FastMath.ceil(bounds.getHeight())); // set
+ // display
+ // size
// init positions
Iterator itPrefuseNodes = viz.getVisualGroup(PREFUSE_GRAPH + ".nodes").tuples();
while (itPrefuseNodes.hasNext()) {
- VisualItem prefuseNode = (VisualItem) itPrefuseNodes.next();
- Object pn = prefuseNode.get(GraphUtilsPrefuse.PREFUSE_ATTRIBUTE_GAMA_OBJECT);
- if ( pn instanceof IShape ) {
- IShape gamaNode = (IShape) pn;
+ final VisualItem prefuseNode = (VisualItem) itPrefuseNodes.next();
+ final Object pn = prefuseNode.get(GraphUtilsPrefuse.PREFUSE_ATTRIBUTE_GAMA_OBJECT);
+ if (pn instanceof IShape) {
+ final IShape gamaNode = (IShape) pn;
prefuseNode.setX(gamaNode.getLocation().getX());
prefuseNode.setY(gamaNode.getLocation().getY());
}
@@ -142,8 +166,8 @@ private void renderLayout(final Graph prefuseGraph, final Layout prefuseLayout,
// actually run layout
viz.run("layout");
resetThermometer(prefuseGraph.getNodeCount());
- long timeBegin = System.currentTimeMillis();
- long sleepTime = 20;
+ final long timeBegin = System.currentTimeMillis();
+ final long sleepTime = 20;
System.err.println("layout !");
Double temperature = Double.POSITIVE_INFINITY;
while (System.currentTimeMillis() - timeBegin < maxtime && temperature > 0.1) {
@@ -153,7 +177,7 @@ private void renderLayout(final Graph prefuseGraph, final Layout prefuseLayout,
try {
Thread.sleep(sleepTime);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@@ -171,11 +195,11 @@ private void renderLayout(final Graph prefuseGraph, final Layout prefuseLayout,
itPrefuseNodes = viz.getVisualGroup(PREFUSE_GRAPH + ".nodes").tuples();
while (itPrefuseNodes.hasNext()) {
- VisualItem prefuseNode = (VisualItem) itPrefuseNodes.next();
- Object pn = prefuseNode.get(GraphUtilsPrefuse.PREFUSE_ATTRIBUTE_GAMA_OBJECT);
- if ( pn instanceof IShape ) {
- IShape gamaNode = (IShape) pn;
- ILocation newloc = new GamaPoint(prefuseNode.getX(), prefuseNode.getY());
+ final VisualItem prefuseNode = (VisualItem) itPrefuseNodes.next();
+ final Object pn = prefuseNode.get(GraphUtilsPrefuse.PREFUSE_ATTRIBUTE_GAMA_OBJECT);
+ if (pn instanceof IShape) {
+ final IShape gamaNode = (IShape) pn;
+ final ILocation newloc = new GamaPoint(prefuseNode.getX(), prefuseNode.getY());
gamaNode.setLocation(newloc);
}
@@ -189,28 +213,32 @@ private void renderLayout(final Graph prefuseGraph, final Layout prefuseLayout,
}
/**
- * Takes a prefuse graph and applies a prefuse layout, with a max time for execution.
- * Layout will use the space defined by the world agent found through the gama scope.
+ * Takes a prefuse graph and applies a prefuse layout, with a max time for
+ * execution. Layout will use the space defined by the world agent found
+ * through the gama scope.
+ *
* @param prefuseGraph
* @param prefuseLayout
* @param scope
* @param maxtime
*/
private void renderLayout(final Graph prefuseGraph, final Layout prefuseLayout, final IScope scope,
- final long maxtime) {
+ final long maxtime) {
- Envelope envelope = scope.getSimulation().getEnvelope();
+ final Envelope envelope = scope.getSimulation().getEnvelope();
- Rectangle bounds =
- new Rectangle((int) FastMath.floor(envelope.getMinX()), (int) FastMath.floor(envelope.getMinY()),
- (int) FastMath.ceil(envelope.getWidth()), (int) FastMath.ceil(envelope.getHeight()));
+ final Rectangle bounds = new Rectangle((int) Math.floor(envelope.getMinX()),
+ (int) Math.floor(envelope.getMinY()), (int) Math.ceil(envelope.getWidth()),
+ (int) Math.ceil(envelope.getHeight()));
renderLayout(prefuseGraph, prefuseLayout, bounds, maxtime);
}
/**
- * The actual creation of the prefuse layout to be used by the layout process.
+ * The actual creation of the prefuse layout to be used by the layout
+ * process.
+ *
* @param timeout
* @param options
* @return
@@ -219,12 +247,14 @@ private void renderLayout(final Graph prefuseGraph, final Layout prefuseLayout,
/**
* Returns a concise name for this layout
+ *
* @return
*/
protected abstract String getLayoutName();
/**
* returns the name of options that could be accepted by the layout
+ *
* @return
*/
protected abstract Collection<String> getLayoutOptions();
@@ -236,16 +266,16 @@ protected Logger getLayoutLogger() {
@Override
public void doLayoutOneShot(final IScope scope, final GamaGraph<?, ?> graph, final long timeout,
- final Map<String, Object> options) {
+ final Map<String, Object> options) {
renderLayout(GraphUtilsPrefuse.getPrefuseGraphFromGamaGraphForVisu(graph), createLayout(timeout, options),
- scope, timeout);
+ scope, timeout);
// warn the user of the options that were provided but not used
- Set<String> uselessOptions = new HashSet<String>(options.keySet());
+ final Set<String> uselessOptions = new HashSet<String>(options.keySet());
uselessOptions.removeAll(getLayoutOptions());
- if ( !uselessOptions.isEmpty() ) {
- StringBuffer sb = new StringBuffer();
+ if (!uselessOptions.isEmpty()) {
+ final StringBuffer sb = new StringBuffer();
sb.append("layout: ").append(getLayoutName());
sb.append(" ignored some of the options that were provided: ");
sb.append(uselessOptions);
@@ -147,7 +147,7 @@
<classpathentry exported="true" kind="lib" path="osmosis.0.45/woodstox-core-5.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="osmosis.0.45/xercesImpl-2.9.1.jar"/>
<classpathentry exported="true" kind="lib" path="jtds 1.3.1/jars/jtds-1.3.1.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib" path="commons-math3-3.6.1/jars/commons-math3-3.6.1.jar" sourcepath="commons-math3-3.6.1/commons-math3-3.6.1-src.zip"/>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry excluding="msi/gama/headless/core/HeadLessExperiment.java" kind="src" path="src"/>
<classpathentry kind="src" path="gaml">
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gaml">
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry excluding="ummisco/gama/network/tcp/SocketSkill.java" kind="src" path="src"/>
<classpathentry kind="src" path="gaml">
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src">
<attributes>

0 comments on commit 8408eca

Please sign in to comment.