本文整理汇总了Java中edu.umd.cs.piccolo.PNode.getGlobalFullBounds方法的典型用法代码示例。如果您正苦于以下问题:Java PNode.getGlobalFullBounds方法的具体用法?Java PNode.getGlobalFullBounds怎么用?Java PNode.getGlobalFullBounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.umd.cs.piccolo.PNode
的用法示例。
在下文中一共展示了PNode.getGlobalFullBounds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addWiggleMe
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
protected void addWiggleMe() {
PNode target = getBlockGraphic().getObjectGraphic();
PBounds screenBounds = target.getGlobalFullBounds();
getCamera().globalToLocal( screenBounds );
wiggleMe = new DefaultWiggleMe( this, TheRampStrings.getString( "invitation" ) );
wiggleMe.setLocation( 0, 0 );
wiggleMe.setArrowTailPosition( DefaultWiggleMe.RIGHT_CENTER );
addScreenChild( wiggleMe );
System.out.println( "wiggleMe.getRoot() = " + wiggleMe.getRoot() );
MouseAdapter wiggleMeDisappears = new MouseAdapter() {
public void mousePressed( MouseEvent e ) {
removeScreenChild( wiggleMe );
removeMouseListener( this );
System.out.println( "wiggleMe.getRoot() = " + wiggleMe.getRoot() );
}
};
addMouseListener( wiggleMeDisappears );
}
示例2: setToolTipLocation
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
public void setToolTipLocation( ToolTipNode toolTipNode, PNode associatedNode, PInputEvent event ) {
PBounds bGlobal = associatedNode.getGlobalFullBounds();
Point2D pLocal = toolTipNode.getParent().globalToLocal( new Point2D.Double( bGlobal.getX(), bGlobal.getMaxY() ) );
double xOffset = pLocal.getX() + ( associatedNode.getFullBoundsReference().getWidth() - toolTipNode.getFullBoundsReference().getWidth() ) / 2;
double yOffset = pLocal.getY() + 5;
toolTipNode.setOffset( xOffset, yOffset );
}
示例3: getNodeBounds
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
private Rectangle2D getNodeBounds( PNode node ) {
if ( _useFullBounds ) {
return node.getGlobalFullBounds();
}
else {
return node.getGlobalBounds();
}
}
示例4: zoomTo
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
/**
* Zooms the camera to the picked node of the event.
* @param event Event from which to extract the zoom target
*/
protected void zoomTo(final PInputEvent event) {
PBounds zoomToBounds;
final PNode picked = event.getPickedNode();
if (picked instanceof PCamera) {
final PCamera c = (PCamera) picked;
zoomToBounds = c.getUnionOfLayerFullBounds();
}
else {
zoomToBounds = picked.getGlobalFullBounds();
}
event.getCamera().animateViewToCenterBounds(zoomToBounds, true, ZOOM_SPEED);
}