All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.cloudfarming.client.geoviewer.edit.GeoNode Maven / Gradle / Ivy

There is a newer version: 13.03-beta
Show newest version
/**
 * Copyright (C) 2008-2012 AgroSense Foundation.
 *
 * AgroSense is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * There are special exceptions to the terms and conditions of the GPLv3 as it is applied to
 * this software, see the FLOSS License Exception
 * .
 *
 * AgroSense is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AgroSense.  If not, see .
 */
package nl.cloudfarming.client.geoviewer.edit;

import com.vividsolutions.jts.geom.Coordinate;
import org.jdesktop.swingx.mapviewer.GeoPosition;

/**
 *
 * @author Timon Veenstra
 */
public class GeoNode {
    private Coordinate coordinate;
    
    public GeoNode(GeoPosition geoPosition){
        coordinate = new Coordinate(geoPosition.getLatitude(), geoPosition.getLongitude());
    }

    public GeoNode(Coordinate coordinate) {
        this.coordinate = coordinate;
    }

    public Coordinate getCoordinate() {
        return coordinate;
    }

    public void setCoordinate(Coordinate coordinate) {
        this.coordinate = coordinate;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final GeoNode other = (GeoNode) obj;
        if (this.coordinate != other.coordinate && (this.coordinate == null || !this.coordinate.equals(other.coordinate))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 29 * hash + (this.coordinate != null ? this.coordinate.hashCode() : 0);
        return hash;
    }

    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy