Skip to content

Commit

Permalink
Removes some warnings (about deprecated extensions and unused private
Browse files Browse the repository at this point in the history
members)
  • Loading branch information
AlexisDrogoul committed Jan 15, 2016
1 parent 50f562c commit 96c9dd1
Show file tree
Hide file tree
Showing 30 changed files with 441 additions and 508 deletions.
5 changes: 1 addition & 4 deletions idees.gama.weka/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<?eclipse version="3.4"?>
<plugin>
<extension
point="gaml.grammar.addition">
<path
name="gaml">
</path>
point="gaml.extension">
</extension>

</plugin>
5 changes: 1 addition & 4 deletions irit.gaml.extensions.database/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<?eclipse version="3.4"?>
<plugin>
<extension
point="gaml.grammar.addition">
<path
name="gaml">
</path>
point="gaml.extension">
</extension>

</plugin>
Original file line number Diff line number Diff line change
@@ -1,72 +1,74 @@
package irit.gaml.extensions.database.skills;

import org.geotools.data.DataStore;
import msi.gama.precompiler.GamlAnnotations.action;
import msi.gama.precompiler.GamlAnnotations.arg;
import msi.gama.precompiler.GamlAnnotations.doc;
import msi.gama.precompiler.GamlAnnotations.skill;
import msi.gama.database.geosql.GamaSqlConnection;
import msi.gama.precompiler.GamlAnnotations.*;
import msi.gama.runtime.IScope;
import msi.gama.runtime.exceptions.GamaRuntimeException;
import msi.gaml.skills.Skill;
import msi.gaml.types.IType;
import msi.gama.database.geosql.*;

@skill(name = "GAMASQL")
public class GamaSQLSkill extends Skill {
private static final boolean DEBUG = false; // Change DEBUG = false for release version

@action(name = "testConnection",
args = { @arg(name = "params",type = IType.MAP, optional = false, doc = @doc("Connection parameters")) })
public boolean testConnection(final IScope scope) {
// private static final boolean DEBUG = false; // Change DEBUG = false for release version

GamaSqlConnection gamaSqlConn;
gamaSqlConn = new GamaSqlConnection(scope);
DataStore dataStore;
try {
dataStore = gamaSqlConn.Connect(scope);
} catch (Exception e) {
return false;
}
gamaSqlConn.setDataStore(dataStore);
gamaSqlConn.close();
return true;
@action(name = "testConnection",
args = { @arg(name = "params", type = IType.MAP, optional = false, doc = @doc("Connection parameters") ) })
public boolean testConnection(final IScope scope) {

GamaSqlConnection gamaSqlConn;
gamaSqlConn = new GamaSqlConnection(scope);
DataStore dataStore;
try {
dataStore = gamaSqlConn.Connect(scope);
} catch (Exception e) {
return false;
}

@action(name = "read", args = {
@arg(name = "params", type = IType.MAP, optional = false, doc = @doc("Connection parameters")),
@arg(name = "table", type = IType.STRING, optional = false, doc = @doc("select string with question marks")),
gamaSqlConn.setDataStore(dataStore);
gamaSqlConn.close();
return true;
}

@action(name = "read",
args = { @arg(name = "params", type = IType.MAP, optional = false, doc = @doc("Connection parameters") ),
@arg(name = "table",
type = IType.STRING,
optional = false,
doc = @doc("select string with question marks") ),
@arg(name = "filter",
type = IType.LIST,
optional = true,
doc = @doc("List of values that are used to replace question marks"))
doc = @doc("List of values that are used to replace question marks") )
// ,@arg(name = "transform", type = IType.BOOL, optional = true, doc =
// @doc("if transform = true then geometry will be tranformed from absolute to gis otherways it will be not transformed. Default value is false "))

})
public void read(final IScope scope) throws GamaRuntimeException {
GamaSqlConnection gamaSqlConn;
gamaSqlConn = new GamaSqlConnection(scope);
DataStore dataStore;
try {
dataStore = gamaSqlConn.Connect(scope);
gamaSqlConn.setDataStore(dataStore);
gamaSqlConn.read(scope);
} catch (Exception e) {
throw GamaRuntimeException.error("GamaSqlConnection.fillBuffer; geometry could not be read");
}
gamaSqlConn.close();
})
public void read(final IScope scope) throws GamaRuntimeException {
GamaSqlConnection gamaSqlConn;
gamaSqlConn = new GamaSqlConnection(scope);
DataStore dataStore;
try {
dataStore = gamaSqlConn.Connect(scope);
gamaSqlConn.setDataStore(dataStore);
gamaSqlConn.read(scope);
} catch (Exception e) {
throw GamaRuntimeException.error("GamaSqlConnection.fillBuffer; geometry could not be read");
}
gamaSqlConn.close();

}

@action(name = "SqlObject", args = {
@arg(name = "params", type = IType.MAP, optional = false, doc = @doc("Connection parameters")),
@arg(name = "table", type = IType.STRING, optional = false, doc = @doc("select string with question marks")),
@arg(name = "filter",type = IType.STRING,optional = true, doc = @doc("Filter for select"))
})
public GamaSqlConnection SqlObject(final IScope scope) throws GamaRuntimeException {
GamaSqlConnection gamaSqlConn;
gamaSqlConn = new GamaSqlConnection(scope);
return gamaSqlConn;
@action(name = "SqlObject",
args = { @arg(name = "params", type = IType.MAP, optional = false, doc = @doc("Connection parameters") ),
@arg(name = "table",
type = IType.STRING,
optional = false,
doc = @doc("select string with question marks") ),
@arg(name = "filter", type = IType.STRING, optional = true, doc = @doc("Filter for select") ) })
public GamaSqlConnection SqlObject(final IScope scope) throws GamaRuntimeException {
GamaSqlConnection gamaSqlConn;
gamaSqlConn = new GamaSqlConnection(scope);
return gamaSqlConn;
}

}
5 changes: 1 addition & 4 deletions irit.gaml.extensions.test/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<?eclipse version="3.4"?>
<plugin>
<extension
point="gaml.grammar.addition">
<path
name="gaml">
</path>
point="gaml.extension">
</extension>

</plugin>
5 changes: 1 addition & 4 deletions irit.maelia.gaml.additions/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<?eclipse version="3.4"?>
<plugin>
<extension
point="gaml.grammar.addition">
<path
name="gaml">
</path>
point="gaml.extension">
</extension>

</plugin>
5 changes: 1 addition & 4 deletions msi.gama.application/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1843,10 +1843,7 @@
</implementation>
</extension>
<extension
point="gaml.grammar.addition">
<path
name="gaml">
</path>
point="gaml.extension">
</extension>
<extension
point="org.eclipse.ui.actionSets">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
*/
public class WorkspaceModelsManager {

private final static FileFilter noHiddenFiles = new FileFilter() {

@Override
public boolean accept(final File f) {
return f != null && f.isDirectory() && !f.isHidden() && !f.getName().startsWith(".");
}
};
// private final static FileFilter noHiddenFiles = new FileFilter() {
//
// @Override
// public boolean accept(final File f) {
// return f != null && f.isDirectory() && !f.isHidden() && !f.getName().startsWith(".");
// }
// };

public final static WorkspaceModelsManager instance = new WorkspaceModelsManager();
public static OpenDocumentEventProcessor processor;
Expand Down Expand Up @@ -494,12 +494,12 @@ static public void setValuesProjectDescription(final IProject proj, final boolea
}
}

static private IProjectDescription setProjectDescription(final File project) {
final IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName());
final IPath location = new Path(project.getAbsolutePath());
description.setLocation(location);
return description;
}
// static private IProjectDescription setProjectDescription(final File project) {
// final IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName());
// final IPath location = new Path(project.getAbsolutePath());
// description.setLocation(location);
// return description;
// }

public static void stampWorkspaceFromModels() {
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
Expand Down
46 changes: 23 additions & 23 deletions msi.gama.application/src/msi/gama/gui/swt/swing/SwingControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@ protected void firePreferredSizeChangedEvent(final Point minSize, final Point pr

// ==================== Swing Popup Management ================================

private static final boolean HIDE_SWING_POPUPS_ON_SWT_SHELL_BOUNDS_CHANGE = Platform.isWin32(); // Win32: all JDKs
// private static final boolean HIDE_SWING_POPUPS_ON_SWT_SHELL_BOUNDS_CHANGE = Platform.isWin32(); // Win32: all JDKs

// Dismiss Swing popups when the main window is moved or resized. (It would be
// better to dismiss popups whenever the titlebar or trim is clicked, but
Expand All @@ -1536,28 +1536,28 @@ protected void firePreferredSizeChangedEvent(final Point minSize, final Point pr
// This is particularly important when the Swing popup overlaps an edge of the
// containing SWT shell. If (on win32) the shell is moved, the overlapping
// popup will not move which looks very strange.
private final ControlListener shellControlListener = new ControlListener() {

@Override
public void controlMoved(final ControlEvent e) {
scheduleHide();
}

@Override
public void controlResized(final ControlEvent e) {
scheduleHide();
}

private void scheduleHide() {
EventQueue.invokeLater(new Runnable() {

@Override
public void run() {
AwtEnvironment.getInstance(display).hidePopups();
}
});
}
};
// private final ControlListener shellControlListener = new ControlListener() {
//
// @Override
// public void controlMoved(final ControlEvent e) {
// scheduleHide();
// }
//
// @Override
// public void controlResized(final ControlEvent e) {
// scheduleHide();
// }
//
// private void scheduleHide() {
// EventQueue.invokeLater(new Runnable() {
//
// @Override
// public void run() {
// AwtEnvironment.getInstance(display).hidePopups();
// }
// });
// }
// };

// ============================= SWT Popup Management =============================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ private void setParams(final IScope scope) {
setFilter(scope);
}

private void setParams(final Map<String, Object> params, final String table, final String filter) {
setConnectionParameters(params);
setTable(table);
setFilter(filter);
}
// private void setParams(final Map<String, Object> params, final String table, final String filter) {
// setConnectionParameters(params);
// setTable(table);
// setFilter(filter);
// }

private void setParams(final Map<String, Object> params) {
setConnectionParameters(params);
Expand All @@ -104,10 +104,10 @@ private void setParams(final Map<String, Object> params) {
private void setTable(final String table) {
this.table = table;
}

private void setFilter(final String filter) {
this.filter = filter;
}
//
// private void setFilter(final String filter) {
// this.filter = filter;
// }

private void setConnectionParameters(final IScope scope) {
Map<String, Object> params = (Map<String, Object>) scope.getArg("params", IType.MAP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,11 @@ public void createVariablesFor(final IScope scope, final List<? extends IAgent>
final IAgent a = agents.get(i);
try {
a.acquireLock();
inits = empty ? Collections.EMPTY_MAP : initialValues.get(i);
if ( empty ) {
inits = Collections.EMPTY_MAP;
} else {
inits = initialValues.get(i);
}
for ( final String s : orderedVarNames ) {
final IVariable var = species.getVar(s);
var.initializeWith(scope, a, empty ? null : inits.get(s));
Expand Down
24 changes: 12 additions & 12 deletions msi.gama.core/src/msi/gama/util/file/URLFile.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*********************************************************************************************
*
*
*
*
* 'GamaTextFile.java', in plugin 'msi.gama.core', is part of the source code of the
* GAMA modeling and simulation platform.
* (c) 2007-2014 UMI 209 UMMISCO IRD/UPMC & Partners
*
*
* Visit https://code.google.com/p/gama-platform/ for license information and developers contact.
*
*
*
*
**********************************************************************************************/
package msi.gama.util.file;

import java.io.*;
import java.net.*;
import com.vividsolutions.jts.geom.Envelope;
import msi.gama.precompiler.GamlAnnotations.file;
import msi.gama.runtime.IScope;
import msi.gama.runtime.exceptions.GamaRuntimeException;
import msi.gama.util.*;
import msi.gaml.types.*;
import com.vividsolutions.jts.geom.Envelope;

@file(name = "URL", extensions = { "txt" }, buffer_type = IType.LIST, buffer_content = IType.STRING)
public class URLFile extends GamaFile<IList<String>, String, Integer, String> {
Expand Down Expand Up @@ -97,7 +97,7 @@ public IList<String> getURLContent(final String u_str) {

/*
* (non-Javadoc)
*
*
* @see msi.gama.util.GamaFile#fillBuffer()
*/
@Override
Expand All @@ -109,14 +109,14 @@ protected void fillBuffer(final IScope scope) throws GamaRuntimeException {

}

private static String computeVariable(final String string) {
String[] tokens = string.split("<-");
return tokens[0];
}
// private static String computeVariable(final String string) {
// String[] tokens = string.split("<-");
// return tokens[0];
// }

/*
* (non-Javadoc)
*
*
* @see msi.gama.util.GamaFile#flushBuffer()
*/
@Override
Expand Down
Loading

0 comments on commit 96c9dd1

Please sign in to comment.