当前位置: 首页>>代码示例>>Java>>正文


Java Position类代码示例

本文整理汇总了Java中gov.nasa.worldwind.geom.Position的典型用法代码示例。如果您正苦于以下问题:Java Position类的具体用法?Java Position怎么用?Java Position使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Position类属于gov.nasa.worldwind.geom包,在下文中一共展示了Position类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterShow

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
/**
 * @see org.leo.traceroute.ui.AbstractRoutePanel#afterShow()
 */
@Override
public void afterShow(final Mode mode) {
	super.afterShow(mode);
	SwingUtilities.invokeLater(() -> {
		_container.invalidate();
		_container.revalidate();
		final GeoPoint localGeo = _services.getGeo().getLocalIpGeoLocation();
		final Position p = new Position(Angle.fromDegrees(localGeo.getLat()), Angle.fromDegrees(localGeo.getLon()), 2000);
		((OrbitView) _controller.getWWd().getView()).setCenterPosition(p);
		if (mode == Mode.TRACE_ROUTE) {
			_route.renotifyRoute();
		} else if (mode == Mode.SNIFFER) {
			_sniffer.renotifyPackets();
		} else {
			_whois.renotifyWhoIs();
		}
	});

}
 
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:23,代码来源:WWJPanel.java

示例2: startCapture

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
/**
 * @see org.leo.traceroute.core.sniffer.IPacketListener#startCapture(boolean)
 */
@Override
public void startCapture() {
	_mode = Mode.SNIFFER;
	reinit();
	_packetDestCoordToPath.clear();
	final GeoPoint localGeo = _services.getGeo().getLocalIpGeoLocation();
	_sourcePos = new Position(Position.fromDegrees(localGeo.getLat(), localGeo.getLon()), 1e4);
	localGeo.setTown(youAreHere);
	localGeo.setCountry(youAreHere);
	pointAdded(localGeo, false);
	_sourcePoint = _toAvoidDuplicatedLabels.get(localGeo.getCoordKey());
	final AnnotationAttributes attrs = _sourcePoint.getRight().getAttributes();
	final Color color = SOURCE_COLOR;
	attrs.setTextColor(color);
	attrs.setBackgroundColor(new Color(1f, 1f, 1f, 1f));
	attrs.setBorderColor(color);
}
 
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:21,代码来源:WWJPanel.java

示例3: doZoom

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
public void doZoom(Point2D p, double factor) {
	LatLon dest = new LatLon(Angle.fromDegrees(p.getY()), Angle.fromDegrees(p.getX()));
	double wwzoom = 2785 * Math.pow(factor, -.8311) * 10000;

	final OrbitView view = (OrbitView) wwd.getView();

	FlyToOrbitViewAnimator fto = 
		FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(
			view,
			view.getCenterPosition(), new Position(dest, 0),
			view.getHeading(), Angle.fromDegrees(0),
			view.getPitch(), Angle.fromDegrees(0),
			view.getZoom(), wwzoom,
			5000, WorldWind.CONSTANT); //was true

	view.addAnimator(fto);

	SwingUtilities.invokeLater(new Runnable() {
		public void run() {
			((MapApp)getApp()).getFrame().toFront();
			view.firePropertyChange(AVKey.VIEW,  null, view);
		}
	});
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:25,代码来源:WWMap.java

示例4: updateLayer

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
protected void updateLayer() {
	iconLayer.disposeSubLayer(0);

	for (Earthquake eq : all) {
		DetailedIcon icon = new DetailedIcon(ICON_PATH, Position.fromDegrees(eq.lat, eq.lon, 0));

		icon.setSize(new Dimension(ICON_SIZE, ICON_SIZE));
		icon.setHighlightScale(2);
		icon.setVisible(false);
		icon.setIconElevation((int) eq.depth);
		icon.setIconColor(Color.GREEN);

		iconLayer.addItem(
				new SceneItemIcon(icon, iconRenderer));

		icons.add(icon);
	}
	processVisibility();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:20,代码来源:WWFocalMechanismSolutionDB.java

示例5: mouseMoved

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
public void mouseMoved(MouseEvent e) {
	super.mouseMoved(e);

	iconLayer.removeIcon(icon);
	
	int cdpN = cdpAt( e.getX() );
	if (cdpN == -1) {
		layerSet.firePropertyChange(AVKey.LAYER, null, layerSet);
		return;
	}

	Point2D p = line.pointAtCDP( cdpN );
	icon.setPosition(Position.fromDegrees(p.getY(), p.getX(), 0));

	iconLayer.addIcon(icon);
	layerSet.firePropertyChange(AVKey.LAYER, null, layerSet);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:18,代码来源:WWXMCS.java

示例6: atMaxLevel

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
private boolean atMaxLevel(DrawContext dc)
{
	Position vpc = dc.getViewportCenterPosition();
	if (dc.getView() == null || this.getLevels() == null || vpc == null)
		return false;

	if (!this.getLevels().getSector().contains(vpc.getLatitude(), vpc.getLongitude()))
		return true;

	Level nextToLast = this.getLevels().getNextToLastLevel();
	if (nextToLast == null)
		return true;

	Sector centerSector = nextToLast.computeSectorForPosition(vpc.getLatitude(), vpc.getLongitude(),
		this.levels.getTileOrigin());
	//return this.needToSplit(dc, centerSector);
	 return this.needToSplit(dc, centerSector, nextToLast);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:19,代码来源:ScalingTiledImageLayer.java

示例7: computeReferencePoint

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
private Vec4 computeReferencePoint(DrawContext dc)
{
	if (dc.getViewportCenterPosition() != null)
		return dc.getGlobe().computePointFromPosition(dc.getViewportCenterPosition());

	java.awt.geom.Rectangle2D viewport = dc.getView().getViewport();
	int x = (int) viewport.getWidth() / 2;
	for (int y = (int) (0.5 * viewport.getHeight()); y >= 0; y--)
	{
		Position pos = dc.getView().computePositionFromScreenPoint(x, y);
		if (pos == null)
			continue;

		return dc.getGlobe().computePointFromPosition(pos.getLatitude(), pos.getLongitude(), 0d);
	}

	return null;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:19,代码来源:ScalingTiledImageLayer.java

示例8: atMaxLevel

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
protected boolean atMaxLevel(DrawContext dc)
{
    Position vpc = dc.getViewportCenterPosition();
    if (dc.getView() == null || this.getLevels() == null || vpc == null)
        return false;

    if (!this.getLevels().getSector().contains(vpc.getLatitude(), vpc.getLongitude()))
        return true;

    Level nextToLast = this.getLevels().getNextToLastLevel();
    if (nextToLast == null)
        return true;

    Sector centerSector = nextToLast.computeSectorForPosition(vpc.getLatitude(), vpc.getLongitude(),
        this.levels.getTileOrigin());
    return this.needToSplit(dc, centerSector);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:18,代码来源:DynamicImageTileLayer.java

示例9: computeReferencePoint

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
protected Vec4 computeReferencePoint(DrawContext dc)
{
    if (dc.getViewportCenterPosition() != null)
        return dc.getGlobe().computePointFromPosition(dc.getViewportCenterPosition());

    java.awt.geom.Rectangle2D viewport = dc.getView().getViewport();
    int x = (int) viewport.getWidth() / 2;
    for (int y = (int) (0.5 * viewport.getHeight()); y >= 0; y--)
    {
        Position pos = dc.getView().computePositionFromScreenPoint(x, y);
        if (pos == null)
            continue;

        return dc.getGlobe().computePointFromPosition(pos.getLatitude(), pos.getLongitude(), 0d);
    }

    return null;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:19,代码来源:DynamicImageTileLayer.java

示例10: getSamples

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
private LatLon[] getSamples(DrawContext dc) {
	Rectangle rec = dc.getView().getViewport();
	Position upperLeft = scanForPosition(dc,0,0);
	Position upperRight = scanForPosition(dc,rec.width,0);
	Position lowerLeft = scanForPosition(dc,0,rec.height);
	Position lowerRight = scanForPosition(dc,rec.width,rec.height);
	Position middleTop = scanForPosition(dc,rec.width/2,0);
	Position middleBottom = scanForPosition(dc,rec.width/2,rec.height);
	Position middleUpThird = scanForPosition(dc,rec.width/2,rec.height/3);
	Position middle = scanForPosition(dc,rec.width/2,rec.height/2-1);
	
	return new LatLon[]{
		upperLeft,
		upperRight,
		lowerLeft,
		lowerRight,
		middleTop,
		middleBottom,
		middleUpThird,
		middle
	};
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:23,代码来源:WWSceneGraph.java

示例11: createPlace

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
@Override
protected MapPlace createPlace(MapPlace root, String text, double x,
		double y, double zoom) {
	WorldWindowGLCanvas wwd = ((WWMap) map).wwd;
	OrbitView view = (OrbitView) wwd.getView();

	zoom = ((WWMap) map).getGMAZoom();
	Position pos = view.getCenterPosition();
	double pitch = view.getPitch().degrees;
	double heading = view.getHeading().degrees;
	double zoom2 = view.getZoom();
	double ve = wwd.getSceneController().getVerticalExaggeration();

	return new WWMapPlace( 
			root,
			text, 
			pos.getLongitude().degrees,
			pos.getLatitude().degrees,
			zoom,
			pitch,
			heading,
			zoom2,
			ve);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:25,代码来源:WWMapPlaces.java

示例12: createContent

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
protected ContentAnnotation createContent(Marker marker)
{
	Position position = marker.getPosition();
	
	if(marker instanceof TridasMarker)
	{
		return createTridasAnnotation(this, position, "Title", ((TridasMarker) marker).getEntity());
	}
	else if (marker instanceof ITRDBMarker)
	{
		return createITRDBAnnotation(this, position, "Title", ((ITRDBMarker) marker));
	}
	
	return null;
    
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:17,代码来源:WWJPanel.java

示例13: moveToLocation

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
public static void moveToLocation(WorldWindow wwd, Sector sector, Double altitude)
{
    OrbitView view = (OrbitView) wwd.getView();

    Globe globe = wwd.getModel().getGlobe();

    if (altitude == null || altitude == 0)
    {
    	double t = sector.getDeltaLonRadians() > sector.getDeltaLonRadians()
    		? sector.getDeltaLonRadians() : sector.getDeltaLonRadians();
    	double w = 0.5 * t * 6378137.0;
    	altitude = w / wwd.getView().getFieldOfView().tanHalfAngle();
    }

    if (globe != null && view != null)
    {
        wwd.getView().goTo(new Position(sector.getCentroid(), 0), altitude);
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:20,代码来源:TellervoGazetteerPanel.java

示例14: addMarkerForTridasEntity

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
private boolean addMarkerForTridasEntity(TridasLocationGeometry geom, ITridas entity)
{
	if(geom.isSetPoint())
	{
		
		GMLPointSRSHandler tph = new GMLPointSRSHandler(geom.getPoint());
		
		if(tph.hasPointData())
		{
			markers.add(new TridasMarker(Position.fromDegrees(tph.getWGS84LatCoord(), tph.getWGS84LongCoord()), 
					getMarkerAttributesForEntity(entity.getClass()), entity));
			return true;
		}
		
	}
	return false;
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:18,代码来源:TridasMarkerLayerBuilder.java

示例15: goToDefaultView

import gov.nasa.worldwind.geom.Position; //导入依赖的package包/类
/**
 * Go to a view of a list of positions. This method computes a view looking straight down from
 * an altitude that brings all of the positions into view.
 * 
 * @param positions
 *            List of positions to bring into view
 */
public void goToDefaultView(final List<? extends Position> positions) {

	final View view = this.wwd.getView();
	final Globe globe = view.getGlobe();

	if (globe == null) {

		/*
		 * this happenes when a tour is selected and the 3d map is not yet opened but is being
		 * opened with an action button
		 */
		StatusUtil.logInfo("globe == null"); //$NON-NLS-1$

		// try again
		Display.getCurrent().timerExec(200, new Runnable() {
			public void run() {
				gotoView(positions);
			}
		});

		return;
	}

	gotoView(positions);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:33,代码来源:Map3ViewController.java


注:本文中的gov.nasa.worldwind.geom.Position类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。