本文整理汇总了Java中de.fhpotsdam.unfolding.data.PointFeature类的典型用法代码示例。如果您正苦于以下问题:Java PointFeature类的具体用法?Java PointFeature怎么用?Java PointFeature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PointFeature类属于de.fhpotsdam.unfolding.data包,在下文中一共展示了PointFeature类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLand
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean isLand(PointFeature earthquake) {
// 对所有的国家标记进行循环访问。
// 检查地震的PointFeature是否在For each, check if the earthquake PointFeature is in the
// country in m. 注意isInCountry的参数是PointFeature和Marker
// 如果isInCountry返回true,isLand也应返回true
for (Marker m : countryMarkers) {
// TODO: 使用isInCountry方法来完成这个方法
}
// 不在任何国家中
return false;
}
示例2: createMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
// 如果需要打印PointFeature中的所有内容,将下一行代码去掉注释
//System.out.println(feature.getProperties());
// 根据给定的PointFeature中的location来创建SimplePointMarker
SimplePointMarker marker = new SimplePointMarker(feature.getLocation());
Object magObj = feature.getProperty("magnitude");
float mag = Float.parseFloat(magObj.toString());
// 下面的示例是使用Procession的color方法来生成代表黄色的整数值
int yellow = color(255, 255, 0);
// TODO : 添加代码,根据地震级别来设计标记的大小和颜色
// 注意在上面定义的2个常量:THRESHOLD_MODERATE和 THRESHOLD_LIGHT
// 可以与这2个值进行比较来确定地震的级别
// 返回marker
return marker;
}
示例3: isLand
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
private boolean isLand(PointFeature earthquake) {
// IMPLEMENT THIS: loop over all countries to check if location is in any of them
// TODO: Implement this method using the helper method isInCountry
for (Marker country : countryMarkers)
{
if (isInCountry(earthquake, country))
{
return true;
}
}
// not inside any country
return false;
}
示例4: isLand
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
private boolean isLand(PointFeature earthquake) {
for (Marker country : countryMarkers) {
if (isInCountry(earthquake, country)) {
return true;
}
}
return false;
}
示例5: isInCountry
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
private boolean isInCountry(PointFeature earthquake, Marker country) {
// 获取地点
Location checkLoc = earthquake.getLocation();
// some countries represented it as MultiMarker
// looping over SimplePolygonMarkers which make them up to use isInsideByLoc
if (country.getClass() == MultiMarker.class) {
// looping over markers making up MultiMarker
for (Marker marker : ((MultiMarker) country).getMarkers()) {
// checking if inside
if (((AbstractShapeMarker) marker).isInsideByLocation(checkLoc)) {
earthquake.addProperty("country", country.getProperty("name"));
// return if is inside one
return true;
}
}
}
// check if inside country represented by SimplePolygonMarker
else if (((AbstractShapeMarker) country).isInsideByLocation(checkLoc)) {
earthquake.addProperty("country", country.getProperty("name"));
return true;
}
return false;
}
示例6: EarthquakeMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
public EarthquakeMarker (PointFeature feature)
{
super(feature.getLocation());
// Add a radius property and then set the properties
java.util.HashMap<String, Object> properties = feature.getProperties();
float magnitude = Float.parseFloat(properties.get("magnitude").toString());
properties.put("radius", 2*magnitude );
setProperties(properties);
this.radius = 1.75f*getMagnitude();
}
示例7: isInCountry
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean isInCountry(PointFeature earthquake, Marker country) {
// 获取地点
Location checkLoc = earthquake.getLocation();
// some countries represented it as MultiMarker
// looping over SimplePolygonMarkers which make them up to use isInsideByLoc
if(country.getClass() == MultiMarker.class) {
// looping over markers making up MultiMarker
for(Marker marker : ((MultiMarker)country).getMarkers()) {
// checking if inside
if(((AbstractShapeMarker)marker).isInsideByLocation(checkLoc)) {
earthquake.addProperty("country", country.getProperty("name"));
// return if is inside one
return true;
}
}
}
// check if inside country represented by SimplePolygonMarker
else if(((AbstractShapeMarker)country).isInsideByLocation(checkLoc)) {
earthquake.addProperty("country", country.getProperty("name"));
return true;
}
return false;
}
示例8: LandQuakeMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
public LandQuakeMarker(PointFeature quake) {
// 调用EarthquakeMarker构造方法
super(quake);
// setting field in earthquake marker
isOnLand = true;
}
示例9: EarthquakeMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
public EarthquakeMarker (PointFeature feature)
{
super(feature.getLocation());
// 添加属性radius,并将其加入properties中
java.util.HashMap<String, Object> properties = feature.getProperties();
float magnitude = Float.parseFloat(properties.get("magnitude").toString());
properties.put("radius", 2*magnitude );
setProperties(properties);
this.radius = 1.75f*getMagnitude();
}
示例10: isLand
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
private boolean isLand(PointFeature earthquake) {
for (Marker country : countryMarkers) {
if (isInCountry(earthquake, country)) {
return true;
}
}
// not inside any country
return false;
}
示例11: isInCountry
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
private boolean isInCountry(PointFeature earthquake, Marker country) {
// getting location of feature
Location checkLoc = earthquake.getLocation();
// some countries represented it as MultiMarker
// looping over SimplePolygonMarkers which make them up to use
// isInsideByLoc
if (country.getClass() == MultiMarker.class) {
// looping over markers making up MultiMarker
for (Marker marker : ((MultiMarker) country).getMarkers()) {
// checking if inside
if (((AbstractShapeMarker) marker).isInsideByLocation(checkLoc)) {
earthquake.addProperty("country",
country.getProperty("name"));
// return if is inside one
return true;
}
}
}
// check if inside country represented by SimplePolygonMarker
else if (((AbstractShapeMarker) country).isInsideByLocation(checkLoc)) {
earthquake.addProperty("country", country.getProperty("name"));
return true;
}
return false;
}
示例12: LandQuakeMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
public LandQuakeMarker(PointFeature quake) {
// calling EarthquakeMarker constructor
super(quake);
// setting field in earthquake marker
isOnLand = true;
}
示例13: isLand
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
private boolean isLand(PointFeature earthquake) {
// IMPLEMENT THIS: loop over all countries to check if location is in any of them
// If it is, add 1 to the entry in countryQuakes corresponding to this country.
for (Marker country : countryMarkers) {
if (isInCountry(earthquake, country)) {
return true;
}
}
// not inside any country
return false;
}
示例14: isInCountry
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
private boolean isInCountry(PointFeature earthquake, Marker country) {
// getting location of feature
Location checkLoc = earthquake.getLocation();
// some countries represented it as MultiMarker
// looping over SimplePolygonMarkers which make them up to use isInsideByLoc
if(country.getClass() == MultiMarker.class) {
// looping over markers making up MultiMarker
for(Marker marker : ((MultiMarker)country).getMarkers()) {
// checking if inside
if(((AbstractShapeMarker)marker).isInsideByLocation(checkLoc)) {
earthquake.addProperty("country", country.getProperty("name"));
// return if is inside one
return true;
}
}
}
// check if inside country represented by SimplePolygonMarker
else if(((AbstractShapeMarker)country).isInsideByLocation(checkLoc)) {
earthquake.addProperty("country", country.getProperty("name"));
return true;
}
return false;
}
示例15: createMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
int yellow = color(255, 255, 0);
int red = color(255, 0, 0);
int blue = color(0, 0, 255);
SimplePointMarker quake = new SimplePointMarker(feature.getLocation());
Object magObj = feature.getProperty("magnitude");
float mag = Float.parseFloat(magObj.toString());
if (mag < THRESHOLD_LIGHT)
{
quake.setColor(blue);
quake.setRadius(6.0f);
}
else if (mag < THRESHOLD_MODERATE)
{
quake.setColor(yellow);
quake.setRadius(9.0f);
}
else
{
quake.setColor(red);
quake.setRadius(12.0f);
}
return quake;
}