本文整理汇总了Java中org.opensourcephysics.controls.XMLControl.getChildControl方法的典型用法代码示例。如果您正苦于以下问题:Java XMLControl.getChildControl方法的具体用法?Java XMLControl.getChildControl怎么用?Java XMLControl.getChildControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opensourcephysics.controls.XMLControl
的用法示例。
在下文中一共展示了XMLControl.getChildControl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadObject
import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
/**
* Loads the object with data from the control.
*
* @param control XMLControl
* @param obj Object
* @return Object
*/
public Object loadObject(XMLControl control, Object obj) {
DrawingFrame frame = ((DrawingFrame) obj);
DrawingPanel panel = frame.getDrawingPanel();
panel.clear();
XMLControl panelControl = control.getChildControl("drawing panel"); //$NON-NLS-1$
panelControl.loadObject(panel);
panel.repaint();
frame.setTitle(control.getString("title")); //$NON-NLS-1$
frame.setLocation(control.getInt("location x"), control.getInt("location y")); //$NON-NLS-1$ //$NON-NLS-2$
frame.setSize(control.getInt("width"), control.getInt("height")); //$NON-NLS-1$ //$NON-NLS-2$
if(control.getBoolean("showing")) { //$NON-NLS-1$
frame.setVisible(true);
}
return obj;
}
示例2: loadObject
import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public Object loadObject(XMLControl control, Object obj) {
DrawingFrame3D frame3D = ((DrawingFrame3D) obj);
javax.swing.JFrame frame = frame3D.getJFrame();
DrawingPanel3D panel = frame3D.getDrawingPanel3D();
panel.removeAllElements();
XMLControl panelControl = control.getChildControl("drawing panel"); //$NON-NLS-1$
panelControl.loadObject(panel);
panel.repaint();
frame.setTitle(control.getString("title")); //$NON-NLS-1$
frame.setLocation(control.getInt("location x"), control.getInt("location y")); //$NON-NLS-1$ //$NON-NLS-2$
frame.setSize(control.getInt("width"), control.getInt("height")); //$NON-NLS-1$ //$NON-NLS-2$
if(control.getBoolean("showing")) { //$NON-NLS-1$
frame.setVisible(true);
}
return obj;
}
示例3: loadObject
import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public Object loadObject(XMLControl control, Object obj) {
Plot2D p2d = (Plot2D) obj;
XMLControl child = control.getChildControl("grid data"); //$NON-NLS-1$
p2d.setGridData((GridData) child.loadObject(p2d.getGridData()));
p2d.update();
return p2d;
}