本文整理汇总了Java中edu.umd.cs.piccolo.PNode.removeAllChildren方法的典型用法代码示例。如果您正苦于以下问题:Java PNode.removeAllChildren方法的具体用法?Java PNode.removeAllChildren怎么用?Java PNode.removeAllChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.umd.cs.piccolo.PNode
的用法示例。
在下文中一共展示了PNode.removeAllChildren方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateTickMarks
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
private void updateTickMarks( PNode tickMarkLayer, Plank plank, ModelViewTransform mvt ) {
// Update the tick marks by removing them and redrawing them.
tickMarkLayer.removeAllChildren();
for ( int i = 0; i < plank.getTickMarks().size(); i++ ) {
Stroke tickMarkStroke = NORMAL_TICK_MARK_STROKE;
Stroke highlightStroke = NORMAL_HIGHLIGHT_STROKE;
if ( i % 2 == 0 ) {
// Make some marks bold for easier placement of masses.
// The 'if' clause can be tweaked to put marks in
// different places.
tickMarkStroke = BOLD_TICK_MARK_STROKE;
highlightStroke = BOLD_HIGHLIGHT_STROKE;
}
if ( plank.isTickMarkOccupied( plank.getTickMarks().get( i ) ) ) {
tickMarkLayer.addChild( new PhetPPath( mvt.modelToView( plank.getTickMarks().get( i ) ), highlightStroke, HIGHLIGHT_COLOR ) );
}
tickMarkLayer.addChild( new PhetPPath( mvt.modelToView( plank.getTickMarks().get( i ) ), tickMarkStroke, Color.BLACK ) );
}
}
示例2: createGameOverDialog
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
public static UpdateNode createGameOverDialog( final MatchingGameModel model ) {
return new UpdateNode(
new Effect<PNode>() {
@Override public void e( final PNode parent ) {
parent.removeAllChildren();
if ( model.mode.get() == Mode.SHOWING_GAME_OVER_SCREEN ) {
final MatchingGameState state = model.state.get();
final int maxPoints = 12;
parent.addChild( new GameOverNode( state.info.level, state.info.score, maxPoints, new DecimalFormat( "0" ), state.info.time, state.info.bestTime, state.info.time >= state.info.bestTime, state.info.timerVisible ) {{
scale( 1.5 );
centerFullBoundsOnPoint( STAGE_SIZE.getWidth() / 2, STAGE_SIZE.getHeight() / 2 );
addGameOverListener( new GameOverListener() {
public void newGamePressed() {
//Refresh the level so the next time the user comes back they can play it again instead of seeing the "game over" dialog
model.startNewGame();
}
} );
}} );
}
}
}, model.mode );
}
示例3: updateChart
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
private void updateChart( PNode parent, boolean isReactants ) {
parent.removeAllChildren();
double x = 0;
ArrayList<AtomCount> atomCounts = equation.getAtomCounts();
for ( AtomCount atomCount : atomCounts ) {
int count = ( isReactants ? atomCount.getReactantsCount() : atomCount.getProductsCount() );
BarNode barNode = new BarNode( atomCount.getElement(), count );
barNode.setOffset( x, 0 );
parent.addChild( barNode );
x = barNode.getFullBoundsReference().getMaxX() + 90;
}
}
示例4: deleteAllMolecules
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
private void deleteAllMolecules() {
for ( int i = 0; i < getChildrenCount(); i++ ) {
PNode node = getChild( i );
if ( node instanceof MoleculeParentNode ) {
node.removeAllChildren();
}
}
countHA = countA = countH3O = countOH = countH2O = 0;
}
示例5: deleteAllMolecules
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
private void deleteAllMolecules() {
for ( int i = 0; i < getChildrenCount(); i++ ) {
PNode node = getChild( i );
if ( node instanceof MoleculeImageParentNode ) {
node.removeAllChildren();
}
}
}
示例6: addMoleculeGraphic
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
private void addMoleculeGraphic( PNode node, AbstractMolecule element, boolean top ) {
node.removeAllChildren();
if( element != null ) {
EnergyMoleculeGraphic graphic = new EnergyMoleculeGraphic( element.getFullMolecule(), module.getMRModel().getEnergyProfile() );
graphic.translate( midPoint.getX(), top ? yMin : yMax );
node.addChild( graphic );
}
}