public JMEModule( Frame parentFrame, Function1<Frame, PhetJMEApplication> applicationFactory ) {
super( JMECanvasFactory.createCanvas( parentFrame, applicationFactory ) );
// gets what we created in the super-call
canvas = (Canvas) getContent();
// stores the created application statically, so we need to retrieve this
app = JMEUtils.getApplication();
addListener( new Listener() {
public void activated() {
app.startCanvas();
}
public void deactivated() {
}
} );
// listen to resize events on our canvas, so that we can update our layout
canvas.addComponentListener( new ComponentAdapter() {
@Override public void componentResized( ComponentEvent e ) {
app.onResize( canvas.getSize() );
}
} );
}
JMEModule.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:PhET
作者:
评论列表
文章目录