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


Java PNode.removeAllChildren方法代码示例

本文整理汇总了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 ) );
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:20,代码来源:PlankNode.java

示例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 );
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:24,代码来源:GameOverDialog.java

示例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;
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:13,代码来源:BarChartsNode.java

示例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;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:MoleculesNode.java

示例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();
        }
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:9,代码来源:MoleculesNode.java

示例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 );
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:MoleculeSeparationPane.java


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