本文整理汇总了Java中de.fhpotsdam.unfolding.marker.Marker类的典型用法代码示例。如果您正苦于以下问题:Java Marker类的具体用法?Java Marker怎么用?Java Marker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Marker类属于de.fhpotsdam.unfolding.marker包,在下文中一共展示了Marker类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: printQuakes
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private void printQuakes() {
int totalWaterQuakes = quakeMarkers.size();
for (Marker country : countryMarkers) {
String countryName = country.getStringProperty("name");
int numQuakes = 0;
for (Marker marker : quakeMarkers)
{
EarthquakeMarker eqMarker = (EarthquakeMarker)marker;
if (eqMarker.isOnLand()) {
if (countryName.equals(eqMarker.getStringProperty("country"))) {
numQuakes++;
}
}
}
if (numQuakes > 0) {
totalWaterQuakes -= numQuakes;
System.out.println(countryName + ": " + numQuakes);
}
}
System.out.println("OCEAN QUAKES: " + totalWaterQuakes);
}
开发者ID:simontangbit,项目名称:CourseCode,代码行数:22,代码来源:EarthquakeCityMap.java
示例2: isLand
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的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;
}
开发者ID:simontangbit,项目名称:CourseCode,代码行数:18,代码来源:EarthquakeCityMap.java
示例3: printQuakes
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private void printQuakes() {
int totalWaterQuakes = quakeMarkers.size();
for (Marker country : countryMarkers) {
String countryName = country.getStringProperty("name");
int numQuakes = 0;
for (Marker marker : quakeMarkers) {
EarthquakeMarker eqMarker = (EarthquakeMarker) marker;
if (eqMarker.isOnLand()) {
if (countryName.equals(eqMarker
.getStringProperty("country"))) {
numQuakes++;
}
}
}
if (numQuakes > 0) {
totalWaterQuakes -= numQuakes;
System.out.println(countryName + ": " + numQuakes);
}
}
System.out.println("OCEAN QUAKES: " + totalWaterQuakes);
}
开发者ID:snavjivan,项目名称:Earthquake-Tracker,代码行数:22,代码来源:EarthquakeCityMap.java
示例4: shadeCountries
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private void shadeCountries() {
for (Marker marker : countryMarkers) {
// Find data for country of the current marker
String countryId = marker.getId();
System.out.println(lifeExpMap.containsKey(countryId));
if (lifeExpMap.containsKey(countryId)) {
float lifeExp = lifeExpMap.get(countryId);
// Encode value as brightness (values range: 40-90)
int colorLevel = (int) map(lifeExp, 40, 90, 10, 255);
marker.setColor(color(255-colorLevel, 100, colorLevel));
}
else {
marker.setColor(color(150,150,150));
}
}
}
开发者ID:snavjivan,项目名称:Earthquake-Tracker,代码行数:17,代码来源:LifeExpectancy.java
示例5: selectMarkerIfHover
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private void selectMarkerIfHover(List<Marker> markers)
{
// Abort if there's already a marker selected
if (lastSelected != null) {
return;
}
for (Marker m : markers)
{
CommonMarker marker = (CommonMarker)m;
if (marker.isInside(map, mouseX, mouseY)) {
lastSelected = marker;
marker.setSelected(true);
return;
}
}
}
开发者ID:imranalidigi,项目名称:UCSDUnfoldingMapsMaven,代码行数:18,代码来源:EarthquakeCityMap.java
示例6: selectMarkerIfHover
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private void selectMarkerIfHover(List<Marker> markers)
{
// Abort if there's already a marker selected
if (lastSelected != null) {
return;
}
for (Marker m : markers)
{
AirportMarker marker = (AirportMarker)m;
if (marker.isInside(map, mouseX, mouseY)) {
lastSelected = marker;
marker.setSelected(true);
return;
}
}
}
开发者ID:prachi1210,项目名称:air-travel-tracker,代码行数:18,代码来源:AirportMap.java
示例7: isLand
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的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;
}
开发者ID:PBGraff,项目名称:Coursera_Java_ObjOrientProg,代码行数:17,代码来源:EarthquakeCityMap.java
示例8: printQuakes
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private void printQuakes() {
int totalWaterQuakes = quakeMarkers.size();
for (Marker country : countryMarkers) {
String countryName = country.getStringProperty("name");
int numQuakes = 0;
for (Marker marker : quakeMarkers)
{
EarthquakeMarker eqMarker = (EarthquakeMarker)marker;
if (eqMarker.isOnLand()) {
if (countryName.equals(eqMarker.getStringProperty("country"))) {
numQuakes++;
}
}
}
if (numQuakes > 0) {
totalWaterQuakes -= numQuakes;
System.out.println(countryName + ": " + numQuakes);
}
}
System.out.println("OCEAN QUAKES: " + totalWaterQuakes);
}
开发者ID:abdulhannanali,项目名称:UCSDUnfoldingMaps,代码行数:23,代码来源:EarthquakeCityMap.java
示例9: showAndAddThreatenedCities
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private void showAndAddThreatenedCities(List<Marker> cityMarkers){
if (threatenedCityMarkers == null){
threatenedCityMarkers = new ArrayList<Marker>();
}
// threat circle in km
double threat = threatCircle();
// Looping over all the cityMarker
// Adding the cities which are threatened by the earthquake
for (Marker marker: cityMarkers){
if ((marker).getDistanceTo(this.location) > threat){
marker.setHidden(true);
}
else {
// Not hiding marker means threatenedCities are already displayed
addThreatenedCity(marker);
}
}
}
开发者ID:abdulhannanali,项目名称:UCSDUnfoldingMaps,代码行数:22,代码来源:EarthquakeMarker.java
示例10: showThreat
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
@Override
public void showThreat(List<Marker> earthquakeMarkers, List<Marker> cityMarkers){
// Hiding all the cities except this
for (Marker cityMarker: cityMarkers){
if (!this.equals(cityMarker)){
cityMarker.setHidden(true);
}
}
// Hiding the earthquakes which don't effect this cityMarker
// City not threatened by an earthquake
// if distance between earthquakeMarker and CityMarker > threatCircle()
for (Marker earthquakeMarker: earthquakeMarkers){
double threat = ((EarthquakeMarker) earthquakeMarker).threatCircle();
if (earthquakeMarker.getDistanceTo(this.getLocation()) > threat){
earthquakeMarker.setHidden(true);
}
}
}
开发者ID:abdulhannanali,项目名称:UCSDUnfoldingMaps,代码行数:20,代码来源:CityMarker.java
示例11: isLand
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private boolean isLand(PointFeature earthquake) {
for (Marker country : countryMarkers) {
if (isInCountry(earthquake, country)) {
return true;
}
}
return false;
}
开发者ID:simontangbit,项目名称:CourseCode,代码行数:11,代码来源:EarthquakeCityMap.java
示例12: isInCountry
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的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;
}
开发者ID:simontangbit,项目名称:CourseCode,代码行数:30,代码来源:EarthquakeCityMap.java
示例13: isInCountry
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的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;
}
开发者ID:simontangbit,项目名称:CourseCode,代码行数:31,代码来源:EarthquakeCityMap.java
示例14: shadeCountries
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private void shadeCountries() {
for (Marker marker : countryMarkers) {
// Find data for country of the current marker
String countryId = marker.getId();
if (lifeExpMap.containsKey(countryId)) {
float lifeExp = lifeExpMap.get(countryId);
// Encode value as brightness (values range: 40-90)
int colorLevel = (int) map(lifeExp, 40, 90, 10, 255);
marker.setColor(color(255-colorLevel, 100, colorLevel));
}
else {
marker.setColor(color(150,150,150));
}
}
}
开发者ID:snavjivan,项目名称:Earthquake-Tracker,代码行数:16,代码来源:LifeExpectancy.java
示例15: selectMarkerIfHover
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private void selectMarkerIfHover(List<Marker> markers) {
// Abort if there's already a marker selected
if (lastSelected != null) {
return;
}
for (Marker m : markers) {
CommonMarker marker = (CommonMarker) m;
if (marker.isInside(map, mouseX, mouseY)) {
lastSelected = marker;
marker.setSelected(true);
return;
}
}
}
开发者ID:snavjivan,项目名称:Earthquake-Tracker,代码行数:16,代码来源:EarthquakeCityMap.java
示例16: isLand
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的package包/类
private boolean isLand(PointFeature earthquake) {
for (Marker country : countryMarkers) {
if (isInCountry(earthquake, country)) {
return true;
}
}
// not inside any country
return false;
}
开发者ID:snavjivan,项目名称:Earthquake-Tracker,代码行数:12,代码来源:EarthquakeCityMap.java
示例17: isInCountry
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的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;
}
开发者ID:snavjivan,项目名称:Earthquake-Tracker,代码行数:32,代码来源:EarthquakeCityMap.java
示例18: isLand
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的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;
}
开发者ID:imranalidigi,项目名称:UCSDUnfoldingMapsMaven,代码行数:14,代码来源:EarthquakeCityMap.java
示例19: isInCountry
import de.fhpotsdam.unfolding.marker.Marker; //导入依赖的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;
}
开发者ID:imranalidigi,项目名称:UCSDUnfoldingMapsMaven,代码行数:30,代码来源:EarthquakeCityMap.java
注:本文中的de.fhpotsdam.unfolding.marker.Marker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论