From 41fe4ca770875842f4d17531506c4bc74dc90501 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 10 Jun 2016 16:02:06 +0500 Subject: Geofences --- src/org/traccar/geofence/GeofencePolygon.java | 160 ++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 src/org/traccar/geofence/GeofencePolygon.java (limited to 'src/org/traccar/geofence/GeofencePolygon.java') diff --git a/src/org/traccar/geofence/GeofencePolygon.java b/src/org/traccar/geofence/GeofencePolygon.java new file mode 100644 index 000000000..08178375a --- /dev/null +++ b/src/org/traccar/geofence/GeofencePolygon.java @@ -0,0 +1,160 @@ +package org.traccar.geofence; + +import java.text.ParseException; +import java.util.ArrayList; + +public class GeofencePolygon extends GeofenceGeometry { + + public GeofencePolygon() { + super(); + } + + public GeofencePolygon(String wkt) throws ParseException { + super(); + fromWKT(wkt); + } + + private static class Coordinate { + + public static final double DEGREE360 = 360; + + private double lat; + private double lon; + + public double getLat() { + return lat; + } + + public void setLat(double lat) { + this.lat = lat; + } + + public double getLon() { + return lon; + } + + // Need not to confuse algorithm by the abrupt reset of longitude + public double getLon360() { + return lon + DEGREE360; + } + + public void setLon(double lon) { + this.lon = lon; + } + } + + private ArrayList coordinates; + + private double[] constant; + private double[] multiple; + + private void precalc() { + if (coordinates == null) { + return; + } + int polyCorners = coordinates.size(); + int i; + int j = polyCorners - 1; + + if (constant != null) { + constant = null; + } + if (multiple != null) { + multiple = null; + } + + constant = new double[polyCorners]; + multiple = new double[polyCorners]; + + + for (i = 0; i < polyCorners; j = i++) { + if (coordinates.get(j).getLon360() == coordinates.get(i).getLon360()) { + constant[i] = coordinates.get(i).getLat(); + multiple[i] = 0; + } else { + constant[i] = coordinates.get(i).getLat() + - (coordinates.get(i).getLon360() * coordinates.get(j).getLat()) + / (coordinates.get(j).getLon360() - coordinates.get(i).getLon360()) + + (coordinates.get(i).getLon360() * coordinates.get(i).getLat()) + / (coordinates.get(j).getLon360() - coordinates.get(i).getLon360()); + multiple[i] = (coordinates.get(j).getLat() - coordinates.get(i).getLat()) + / (coordinates.get(j).getLon360() - coordinates.get(i).getLon360()); + } + } + } + + @Override + public boolean containsPoint(double latitude, double longitude) { + + int polyCorners = coordinates.size(); + int i; + int j = polyCorners - 1; + double longitude360 = longitude + Coordinate.DEGREE360; + boolean oddNodes = false; + + for (i = 0; i < polyCorners; j = i++) { + if (coordinates.get(i).getLon360() < longitude360 + && coordinates.get(j).getLon360() >= longitude360 + || coordinates.get(j).getLon360() < longitude360 + && coordinates.get(i).getLon360() >= longitude360) { + oddNodes ^= longitude360 * multiple[i] + constant[i] < latitude; + } + } + return oddNodes; + } + + @Override + public String toWKT() { + StringBuffer buf = new StringBuffer(); + buf.append("POLYGON ("); + for (Coordinate coordinate : coordinates) { + buf.append(String.valueOf(coordinate.getLat())); + buf.append(" "); + buf.append(String.valueOf(coordinate.getLon())); + buf.append(", "); + } + return buf.substring(0, buf.length() - 2) + ")"; + } + + @Override + public void fromWKT(String wkt) throws ParseException { + if (coordinates == null) { + coordinates = new ArrayList(); + } else { + coordinates.clear(); + } + + if (!wkt.startsWith("POLYGON")) { + throw new ParseException("Mismatch geometry type", 0); + } + String content = wkt.substring(wkt.indexOf("(") + 1, wkt.indexOf(")")); + if (content == null || content.equals("")) { + throw new ParseException("No content", 0); + } + String[] commatokens = content.split(","); + if (commatokens.length < 3) { + throw new ParseException("Not valid content", 0); + } + + for (String commatoken : commatokens) { + String[] tokens = commatoken.trim().split("\\s"); + if (tokens.length != 2) { + throw new ParseException("Here must be two coordinates: " + commatoken, 0); + } + Coordinate coordinate = new Coordinate(); + try { + coordinate.setLat(Double.parseDouble(tokens[0])); + } catch (NumberFormatException e) { + throw new ParseException(tokens[0] + " is not a double", 0); + } + try { + coordinate.setLon(Double.parseDouble(tokens[1])); + } catch (NumberFormatException e) { + throw new ParseException(tokens[1] + " is not a double", 0); + } + coordinates.add(coordinate); + } + precalc(); + } + +} -- cgit v1.2.3 From 3b5b60dace5ad75fe92bee5adef0c7e4c61b7757 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 13 Jun 2016 16:55:01 +0500 Subject: Style fixes --- src/org/traccar/geofence/GeofenceCircle.java | 6 +++--- src/org/traccar/geofence/GeofenceGeometry.java | 4 ++-- src/org/traccar/geofence/GeofencePolygon.java | 22 +++++++++++----------- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/org/traccar/geofence/GeofencePolygon.java') diff --git a/src/org/traccar/geofence/GeofenceCircle.java b/src/org/traccar/geofence/GeofenceCircle.java index 76d5a2816..e1c8f8a02 100644 --- a/src/org/traccar/geofence/GeofenceCircle.java +++ b/src/org/traccar/geofence/GeofenceCircle.java @@ -17,7 +17,7 @@ public class GeofenceCircle extends GeofenceGeometry { public GeofenceCircle(String wkt) throws ParseException { super(); - fromWKT(wkt); + fromWkt(wkt); } public GeofenceCircle(double latitude, double longitude, double radius) { @@ -33,7 +33,7 @@ public class GeofenceCircle extends GeofenceGeometry { } @Override - public String toWKT() { + public String toWkt() { String wkt = ""; wkt = "CIRCLE ("; wkt += String.valueOf(centerLatitude); @@ -47,7 +47,7 @@ public class GeofenceCircle extends GeofenceGeometry { } @Override - public void fromWKT(String wkt) throws ParseException { + public void fromWkt(String wkt) throws ParseException { if (!wkt.startsWith("CIRCLE")) { throw new ParseException("Mismatch geometry type", 0); } diff --git a/src/org/traccar/geofence/GeofenceGeometry.java b/src/org/traccar/geofence/GeofenceGeometry.java index c8f042413..83656a029 100644 --- a/src/org/traccar/geofence/GeofenceGeometry.java +++ b/src/org/traccar/geofence/GeofenceGeometry.java @@ -6,8 +6,8 @@ public abstract class GeofenceGeometry { public abstract boolean containsPoint(double latitude, double longitude); - public abstract String toWKT(); + public abstract String toWkt(); - public abstract void fromWKT(String wkt) throws ParseException; + public abstract void fromWkt(String wkt) throws ParseException; } diff --git a/src/org/traccar/geofence/GeofencePolygon.java b/src/org/traccar/geofence/GeofencePolygon.java index 08178375a..52920b7b1 100644 --- a/src/org/traccar/geofence/GeofencePolygon.java +++ b/src/org/traccar/geofence/GeofencePolygon.java @@ -11,7 +11,7 @@ public class GeofencePolygon extends GeofenceGeometry { public GeofencePolygon(String wkt) throws ParseException { super(); - fromWKT(wkt); + fromWkt(wkt); } private static class Coordinate { @@ -94,9 +94,9 @@ public class GeofencePolygon extends GeofenceGeometry { for (i = 0; i < polyCorners; j = i++) { if (coordinates.get(i).getLon360() < longitude360 - && coordinates.get(j).getLon360() >= longitude360 - || coordinates.get(j).getLon360() < longitude360 - && coordinates.get(i).getLon360() >= longitude360) { + && coordinates.get(j).getLon360() >= longitude360 + || coordinates.get(j).getLon360() < longitude360 + && coordinates.get(i).getLon360() >= longitude360) { oddNodes ^= longitude360 * multiple[i] + constant[i] < latitude; } } @@ -104,7 +104,7 @@ public class GeofencePolygon extends GeofenceGeometry { } @Override - public String toWKT() { + public String toWkt() { StringBuffer buf = new StringBuffer(); buf.append("POLYGON ("); for (Coordinate coordinate : coordinates) { @@ -117,7 +117,7 @@ public class GeofencePolygon extends GeofenceGeometry { } @Override - public void fromWKT(String wkt) throws ParseException { + public void fromWkt(String wkt) throws ParseException { if (coordinates == null) { coordinates = new ArrayList(); } else { @@ -131,15 +131,15 @@ public class GeofencePolygon extends GeofenceGeometry { if (content == null || content.equals("")) { throw new ParseException("No content", 0); } - String[] commatokens = content.split(","); - if (commatokens.length < 3) { + String[] commaTokens = content.split(","); + if (commaTokens.length < 3) { throw new ParseException("Not valid content", 0); } - for (String commatoken : commatokens) { - String[] tokens = commatoken.trim().split("\\s"); + for (String commaToken : commaTokens) { + String[] tokens = commaToken.trim().split("\\s"); if (tokens.length != 2) { - throw new ParseException("Here must be two coordinates: " + commatoken, 0); + throw new ParseException("Here must be two coordinates: " + commaToken, 0); } Coordinate coordinate = new Coordinate(); try { -- cgit v1.2.3 From 5d56e9e452c8bebe93047497eb55f527fcc40ffc Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 16 Jun 2016 10:05:38 +0500 Subject: Fix typo and remove unnecessary super() --- src/org/traccar/BaseEventHandler.java | 4 ++-- src/org/traccar/events/CommandResultEventHandler.java | 2 +- src/org/traccar/events/GeofenceEventHandler.java | 2 +- src/org/traccar/events/MotionEventHandler.java | 2 +- src/org/traccar/events/OverspeedEventHandler.java | 2 +- src/org/traccar/geofence/GeofenceCircle.java | 2 -- src/org/traccar/geofence/GeofencePolygon.java | 2 -- 7 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src/org/traccar/geofence/GeofencePolygon.java') diff --git a/src/org/traccar/BaseEventHandler.java b/src/org/traccar/BaseEventHandler.java index 78542b33a..d5755be89 100644 --- a/src/org/traccar/BaseEventHandler.java +++ b/src/org/traccar/BaseEventHandler.java @@ -31,7 +31,7 @@ public abstract class BaseEventHandler extends BaseDataHandler { } } - Collection events = analizePosition(position); + Collection events = analyzePosition(position); if (events != null) { for (Event event : events) { Context.getNotificationManager().updateEvent(event, position); @@ -40,6 +40,6 @@ public abstract class BaseEventHandler extends BaseDataHandler { return position; } - protected abstract Collection analizePosition(Position position); + protected abstract Collection analyzePosition(Position position); } diff --git a/src/org/traccar/events/CommandResultEventHandler.java b/src/org/traccar/events/CommandResultEventHandler.java index 9dbdb4b4c..8e19e9523 100644 --- a/src/org/traccar/events/CommandResultEventHandler.java +++ b/src/org/traccar/events/CommandResultEventHandler.java @@ -10,7 +10,7 @@ import org.traccar.model.Position; public class CommandResultEventHandler extends BaseEventHandler { @Override - protected Collection analizePosition(Position position) { + protected Collection analyzePosition(Position position) { Object commandResult = position.getAttributes().get(Position.KEY_RESULT); if (commandResult != null) { Collection events = new ArrayList<>(); diff --git a/src/org/traccar/events/GeofenceEventHandler.java b/src/org/traccar/events/GeofenceEventHandler.java index 56029fced..e3598bd16 100644 --- a/src/org/traccar/events/GeofenceEventHandler.java +++ b/src/org/traccar/events/GeofenceEventHandler.java @@ -26,7 +26,7 @@ public class GeofenceEventHandler extends BaseEventHandler { } @Override - protected Collection analizePosition(Position position) { + protected Collection analyzePosition(Position position) { if (!isLastPosition() || !position.getValid()) { return null; } diff --git a/src/org/traccar/events/MotionEventHandler.java b/src/org/traccar/events/MotionEventHandler.java index 2ba5979e3..5b1020aec 100644 --- a/src/org/traccar/events/MotionEventHandler.java +++ b/src/org/traccar/events/MotionEventHandler.java @@ -21,7 +21,7 @@ public class MotionEventHandler extends BaseEventHandler { } @Override - protected Collection analizePosition(Position position) { + protected Collection analyzePosition(Position position) { Collection result = null; if (!isLastPosition()) { return null; diff --git a/src/org/traccar/events/OverspeedEventHandler.java b/src/org/traccar/events/OverspeedEventHandler.java index 152fe6f22..61089274d 100644 --- a/src/org/traccar/events/OverspeedEventHandler.java +++ b/src/org/traccar/events/OverspeedEventHandler.java @@ -22,7 +22,7 @@ public class OverspeedEventHandler extends BaseEventHandler { } @Override - protected Collection analizePosition(Position position) { + protected Collection analyzePosition(Position position) { Collection events = new ArrayList<>(); if (!isLastPosition()) { return null; diff --git a/src/org/traccar/geofence/GeofenceCircle.java b/src/org/traccar/geofence/GeofenceCircle.java index e1c8f8a02..f71497475 100644 --- a/src/org/traccar/geofence/GeofenceCircle.java +++ b/src/org/traccar/geofence/GeofenceCircle.java @@ -12,11 +12,9 @@ public class GeofenceCircle extends GeofenceGeometry { private double radius; public GeofenceCircle() { - super(); } public GeofenceCircle(String wkt) throws ParseException { - super(); fromWkt(wkt); } diff --git a/src/org/traccar/geofence/GeofencePolygon.java b/src/org/traccar/geofence/GeofencePolygon.java index 52920b7b1..970734214 100644 --- a/src/org/traccar/geofence/GeofencePolygon.java +++ b/src/org/traccar/geofence/GeofencePolygon.java @@ -6,11 +6,9 @@ import java.util.ArrayList; public class GeofencePolygon extends GeofenceGeometry { public GeofencePolygon() { - super(); } public GeofencePolygon(String wkt) throws ParseException { - super(); fromWkt(wkt); } -- cgit v1.2.3 From 3f0f6c1f6ec4665783ec62a65f8f30a33f1d2152 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 16 Jun 2016 10:20:44 +0500 Subject: Added/updated license headers --- src/org/traccar/BaseEventHandler.java | 15 +++++++++++++++ src/org/traccar/Context.java | 2 +- src/org/traccar/api/resource/DeviceGeofenceResource.java | 2 +- src/org/traccar/api/resource/DeviceResource.java | 2 +- src/org/traccar/api/resource/GeofenceResource.java | 2 +- src/org/traccar/api/resource/UserResource.java | 2 +- src/org/traccar/database/ConnectionManager.java | 2 +- src/org/traccar/database/GeofenceManager.java | 15 +++++++++++++++ src/org/traccar/database/NotificationManager.java | 15 +++++++++++++++ src/org/traccar/events/CommandResultEventHandler.java | 15 +++++++++++++++ src/org/traccar/events/GeofenceEventHandler.java | 15 +++++++++++++++ src/org/traccar/events/MotionEventHandler.java | 15 +++++++++++++++ src/org/traccar/events/OverspeedEventHandler.java | 15 +++++++++++++++ src/org/traccar/geofence/GeofenceCircle.java | 15 +++++++++++++++ src/org/traccar/geofence/GeofenceGeometry.java | 15 +++++++++++++++ src/org/traccar/geofence/GeofencePolygon.java | 15 +++++++++++++++ src/org/traccar/model/DeviceGeofence.java | 15 +++++++++++++++ src/org/traccar/model/Event.java | 15 +++++++++++++++ src/org/traccar/model/Extensible.java | 15 +++++++++++++++ src/org/traccar/model/Geofence.java | 15 +++++++++++++++ src/org/traccar/model/GeofencePermission.java | 15 +++++++++++++++ src/org/traccar/model/GroupGeofence.java | 15 +++++++++++++++ src/org/traccar/model/Message.java | 2 +- src/org/traccar/model/Position.java | 2 +- 24 files changed, 248 insertions(+), 8 deletions(-) (limited to 'src/org/traccar/geofence/GeofencePolygon.java') diff --git a/src/org/traccar/BaseEventHandler.java b/src/org/traccar/BaseEventHandler.java index d5755be89..143c2dc2b 100644 --- a/src/org/traccar/BaseEventHandler.java +++ b/src/org/traccar/BaseEventHandler.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar; import java.util.Collection; diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 6f99ff97d..f40db72e5 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/DeviceGeofenceResource.java b/src/org/traccar/api/resource/DeviceGeofenceResource.java index 99d64292b..27535617d 100644 --- a/src/org/traccar/api/resource/DeviceGeofenceResource.java +++ b/src/org/traccar/api/resource/DeviceGeofenceResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java index fcbeed97b..d6032bb1e 100644 --- a/src/org/traccar/api/resource/DeviceResource.java +++ b/src/org/traccar/api/resource/DeviceResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/GeofenceResource.java b/src/org/traccar/api/resource/GeofenceResource.java index b56e20e08..9c80e61a1 100644 --- a/src/org/traccar/api/resource/GeofenceResource.java +++ b/src/org/traccar/api/resource/GeofenceResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java index 7e503dcfb..7cc4ed09a 100644 --- a/src/org/traccar/api/resource/UserResource.java +++ b/src/org/traccar/api/resource/UserResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java index 4f12c44d4..8a1debdfa 100644 --- a/src/org/traccar/database/ConnectionManager.java +++ b/src/org/traccar/database/ConnectionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/GeofenceManager.java b/src/org/traccar/database/GeofenceManager.java index 0119a62ca..0a07e2cf3 100644 --- a/src/org/traccar/database/GeofenceManager.java +++ b/src/org/traccar/database/GeofenceManager.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.database; import java.sql.SQLException; diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index 8c8e958c8..7593367a3 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.database; import java.sql.SQLException; diff --git a/src/org/traccar/events/CommandResultEventHandler.java b/src/org/traccar/events/CommandResultEventHandler.java index 8e19e9523..3f4ff521b 100644 --- a/src/org/traccar/events/CommandResultEventHandler.java +++ b/src/org/traccar/events/CommandResultEventHandler.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.events; import java.util.ArrayList; diff --git a/src/org/traccar/events/GeofenceEventHandler.java b/src/org/traccar/events/GeofenceEventHandler.java index e3598bd16..7d24c4efe 100644 --- a/src/org/traccar/events/GeofenceEventHandler.java +++ b/src/org/traccar/events/GeofenceEventHandler.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.events; import java.sql.SQLException; diff --git a/src/org/traccar/events/MotionEventHandler.java b/src/org/traccar/events/MotionEventHandler.java index 5b1020aec..c05bd4843 100644 --- a/src/org/traccar/events/MotionEventHandler.java +++ b/src/org/traccar/events/MotionEventHandler.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.events; import java.sql.SQLException; diff --git a/src/org/traccar/events/OverspeedEventHandler.java b/src/org/traccar/events/OverspeedEventHandler.java index 61089274d..f4676b995 100644 --- a/src/org/traccar/events/OverspeedEventHandler.java +++ b/src/org/traccar/events/OverspeedEventHandler.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.events; import java.sql.SQLException; diff --git a/src/org/traccar/geofence/GeofenceCircle.java b/src/org/traccar/geofence/GeofenceCircle.java index f71497475..56230240b 100644 --- a/src/org/traccar/geofence/GeofenceCircle.java +++ b/src/org/traccar/geofence/GeofenceCircle.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.geofence; import java.text.DecimalFormat; diff --git a/src/org/traccar/geofence/GeofenceGeometry.java b/src/org/traccar/geofence/GeofenceGeometry.java index 83656a029..e717ede0b 100644 --- a/src/org/traccar/geofence/GeofenceGeometry.java +++ b/src/org/traccar/geofence/GeofenceGeometry.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.geofence; import java.text.ParseException; diff --git a/src/org/traccar/geofence/GeofencePolygon.java b/src/org/traccar/geofence/GeofencePolygon.java index 970734214..be5f971a5 100644 --- a/src/org/traccar/geofence/GeofencePolygon.java +++ b/src/org/traccar/geofence/GeofencePolygon.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.geofence; import java.text.ParseException; diff --git a/src/org/traccar/model/DeviceGeofence.java b/src/org/traccar/model/DeviceGeofence.java index f55c8ca69..05f06bb3d 100644 --- a/src/org/traccar/model/DeviceGeofence.java +++ b/src/org/traccar/model/DeviceGeofence.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.model; public class DeviceGeofence { diff --git a/src/org/traccar/model/Event.java b/src/org/traccar/model/Event.java index 863acd621..235a39f9a 100644 --- a/src/org/traccar/model/Event.java +++ b/src/org/traccar/model/Event.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.model; import java.util.Date; diff --git a/src/org/traccar/model/Extensible.java b/src/org/traccar/model/Extensible.java index b4052dbda..eceeccadf 100644 --- a/src/org/traccar/model/Extensible.java +++ b/src/org/traccar/model/Extensible.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.model; import java.util.LinkedHashMap; diff --git a/src/org/traccar/model/Geofence.java b/src/org/traccar/model/Geofence.java index 300d8fb74..9a60f784f 100644 --- a/src/org/traccar/model/Geofence.java +++ b/src/org/traccar/model/Geofence.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.model; import java.text.ParseException; diff --git a/src/org/traccar/model/GeofencePermission.java b/src/org/traccar/model/GeofencePermission.java index 38fe7b6c1..269918d66 100644 --- a/src/org/traccar/model/GeofencePermission.java +++ b/src/org/traccar/model/GeofencePermission.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.model; public class GeofencePermission { diff --git a/src/org/traccar/model/GroupGeofence.java b/src/org/traccar/model/GroupGeofence.java index a8f6bd475..0e261fd54 100644 --- a/src/org/traccar/model/GroupGeofence.java +++ b/src/org/traccar/model/GroupGeofence.java @@ -1,3 +1,18 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.model; public class GroupGeofence { diff --git a/src/org/traccar/model/Message.java b/src/org/traccar/model/Message.java index 5015b9339..55d9fd0c7 100644 --- a/src/org/traccar/model/Message.java +++ b/src/org/traccar/model/Message.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index b4079dae6..4e03b2097 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. -- cgit v1.2.3