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


Java XMLControl.getChildControl方法代码示例

本文整理汇总了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;
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:23,代码来源:DrawingFrame.java

示例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;
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:17,代码来源:DrawingFrame3D.java

示例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;
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:8,代码来源:Plot2DLoader.java


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