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


Java XMLControl.setValue方法代码示例

本文整理汇总了Java中org.opensourcephysics.controls.XMLControl.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java XMLControl.setValue方法的具体用法?Java XMLControl.setValue怎么用?Java XMLControl.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opensourcephysics.controls.XMLControl的用法示例。


在下文中一共展示了XMLControl.setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  InteractiveShape interactiveShape = (InteractiveShape) obj;
  control.setValue("geometry", interactiveShape.shapeClass);      //$NON-NLS-1$
  control.setValue("x", interactiveShape.x);                      //$NON-NLS-1$
  control.setValue("y", interactiveShape.y);                      //$NON-NLS-1$
  control.setValue("width", interactiveShape.width);              //$NON-NLS-1$
  control.setValue("height", interactiveShape.height);            //$NON-NLS-1$
  control.setValue("x offset", interactiveShape.xoff);            //$NON-NLS-1$
  control.setValue("y offset", interactiveShape.yoff);            //$NON-NLS-1$
  control.setValue("theta", interactiveShape.theta);              //$NON-NLS-1$
  control.setValue("pixel sized", interactiveShape.pixelSized);   //$NON-NLS-1$
  control.setValue("is enabled", interactiveShape.isEnabled());   //$NON-NLS-1$
  control.setValue("is measured", interactiveShape.isMeasured()); //$NON-NLS-1$
  control.setValue("color", interactiveShape.color);              //$NON-NLS-1$
  Shape shape = AffineTransform.getRotateInstance(-interactiveShape.theta, interactiveShape.x, interactiveShape.y).createTransformedShape(interactiveShape.shape);
  control.setValue("general path", shape); //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:18,代码来源:InteractiveShape.java

示例2: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
/**
     * Saves object data in an XMLControl.
     *
     * @param control the control to save to
     * @param obj the object to save
     */
    public void saveObject(XMLControl control, Object obj) {
      VideoClip clip = (VideoClip) obj;
      Video video = clip.getVideo();
      if(video!=null) {
        if(video instanceof ImageVideo) {
          ImageVideo vid = (ImageVideo) video;
          if(vid.isFileBased()) {
            control.setValue("video", video); //$NON-NLS-1$
          }
  	      control.setValue("video_framecount", clip.getFrameCount()); //$NON-NLS-1$
        } else {
          control.setValue("video", video);   //$NON-NLS-1$
  	      control.setValue("video_framecount", video.getFrameCount()); //$NON-NLS-1$
        }
      }
      control.setValue("startframe", clip.getStartFrameNumber()); //$NON-NLS-1$
      control.setValue("stepsize", clip.getStepSize());           //$NON-NLS-1$
      control.setValue("stepcount", clip.getStepCount());         //$NON-NLS-1$
      control.setValue("starttime", clip.startTimeIsSaved? 			  //$NON-NLS-1$
      		clip.savedStartTime: clip.getStartTime());
//      control.setValue("frameshift", clip.getFrameShift());         //$NON-NLS-1$
      control.setValue("readout", clip.readoutType);         //$NON-NLS-1$
      control.setValue("playallsteps", clip.playAllSteps);         //$NON-NLS-1$
    }
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:31,代码来源:VideoClip.java

示例3: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  super.saveObject(control, obj);
  BoundedShape boundedShape = (BoundedShape) obj;
  control.setValue("xy drag", boundedShape.isXYDrag());         //$NON-NLS-1$
  control.setValue("width drag", boundedShape.isWidthDrag());   //$NON-NLS-1$
  control.setValue("height drag", boundedShape.isHeightDrag()); //$NON-NLS-1$
  control.setValue("rotate drag", boundedShape.isRotateDrag()); //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:9,代码来源:BoundedShape.java

示例4: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  super.saveObject(control, obj);
  ElementTrail element = (ElementTrail) obj;
  control.setValue("maximum", element.getMaximumPoints()); //$NON-NLS-1$
  control.setValue("connected", element.isConnected());    //$NON-NLS-1$
  // Don't save the points since loadObject will clear the trail
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:8,代码来源:ElementTrail.java

示例5: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  Element element = (Element) obj;
  if(element.getName().length()>0) {
    control.setValue("name", element.getName()); //$NON-NLS-1$
  }
  control.setValue("x", element.getX());                           //$NON-NLS-1$
  control.setValue("y", element.getY());                           //$NON-NLS-1$
  control.setValue("z", element.getZ());                           //$NON-NLS-1$
  control.setValue("x size", element.getSizeX());                  //$NON-NLS-1$
  control.setValue("y size", element.getSizeY());                  //$NON-NLS-1$
  control.setValue("z size", element.getSizeZ());                  //$NON-NLS-1$
  control.setValue("visible", element.isVisible());                //$NON-NLS-1$
  control.setValue("style", element.getStyle());                   //$NON-NLS-1$
  control.setValue("transformation", element.getTransformation()); //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:16,代码来源:Element.java

示例6: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
/**
 * Saves data to an XMLControl.
 *
 * @param control the control to save to
 * @param obj the filter to save
 */
public void saveObject(XMLControl control, Object obj) {
  DeinterlaceFilter filter = (DeinterlaceFilter) obj;
  if(filter.isOdd()) {
    control.setValue("field", "odd");  //$NON-NLS-1$ //$NON-NLS-2$
  } else {
    control.setValue("field", "even"); //$NON-NLS-1$ //$NON-NLS-2$
  }
  if((filter.frame!=null)&&(filter.inspector!=null)&&filter.inspector.isVisible()) {
    int x = filter.inspector.getLocation().x-filter.frame.getLocation().x;
    int y = filter.inspector.getLocation().y-filter.frame.getLocation().y;
    control.setValue("inspector_x", x); //$NON-NLS-1$
    control.setValue("inspector_y", y); //$NON-NLS-1$
  }
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:21,代码来源:DeinterlaceFilter.java

示例7: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  super.saveObject(control, obj);
  ElementTetrahedron element = (ElementTetrahedron) obj;
  if(Double.isNaN(element.getTruncationHeight())) {
    control.setValue("truncation height", -1.0);                          //$NON-NLS-1$
  } else {
    control.setValue("truncation height", element.getTruncationHeight()); //$NON-NLS-1$
  }
  control.setValue("closed top", element.isClosedTop());       //$NON-NLS-1$
  control.setValue("closed bottom", element.isClosedBottom()); //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:12,代码来源:ElementTetrahedron.java

示例8: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  super.saveObject(control, obj);
  ElementCone element = (ElementCone) obj;
  if(Double.isNaN(element.getTruncationHeight())) {
    control.setValue("truncation height", -1.0);                          //$NON-NLS-1$
  } else {
    control.setValue("truncation height", element.getTruncationHeight()); //$NON-NLS-1$
  }
  control.setValue("closed top", element.isClosedTop());        //$NON-NLS-1$
  control.setValue("closed bottom", element.isClosedBottom());  //$NON-NLS-1$
  control.setValue("closed left", element.isClosedLeft());      //$NON-NLS-1$
  control.setValue("closed right", element.isClosedRight());    //$NON-NLS-1$
  control.setValue("minimum angle", element.getMinimumAngle()); //$NON-NLS-1$
  control.setValue("maximum angle", element.getMaximumAngle()); //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:16,代码来源:ElementCone.java

示例9: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  DataColumn column = (DataColumn) obj;
  double shift = column.getShift();
  if (shift!=0) {
    control.setValue("shift", shift); //$NON-NLS-1$
  	// temporarily set shift to zero
    column.shift = 0;
  }
  Dataset.getLoader().saveObject(control, column);
  column.shift = shift;
  if(column.deletable) {
    control.setValue("deletable", true); //$NON-NLS-1$
  }
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:15,代码来源:DataColumn.java

示例10: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
/**
 * Saves a DrawableShape by saving the general path.
 * @param control XMLControl
 * @param obj Object
 */
public void saveObject(XMLControl control, Object obj) {
  DrawableShape drawableShape = (DrawableShape) obj;
  control.setValue("geometry", drawableShape.shapeClass);  //$NON-NLS-1$
  control.setValue("x", drawableShape.x);                  //$NON-NLS-1$
  control.setValue("y", drawableShape.y);                  //$NON-NLS-1$
  control.setValue("theta", drawableShape.theta);          //$NON-NLS-1$
  control.setValue("fill color", drawableShape.color);     //$NON-NLS-1$
  control.setValue("edge color", drawableShape.edgeColor); //$NON-NLS-1$
  Shape shape = AffineTransform.getRotateInstance(-drawableShape.theta, drawableShape.x, drawableShape.y).createTransformedShape(drawableShape.shape);
  control.setValue("general path", shape); //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:17,代码来源:DrawableShapeLoader.java

示例11: sendHandshake

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
/**
 * Sends a handshake message.
 *
 * @param id a number to identify the data source (typically hashcode())
 */
private static boolean sendHandshake(int id) {
XMLControl control = getMessageControl(id);
control.setValue("handshake", true); //$NON-NLS-1$
control.setValue("jar_path", OSPRuntime.getLaunchJarPath()); //$NON-NLS-1$
	try {
	remoteTool.send(new LocalJob(control.toXML()), getSupportTool());
} catch (RemoteException e) {
	return false;
}
return true;
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:17,代码来源:DataTrackSupport.java

示例12: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
/**
 * Saves the Circle's data in the xml control.
 * @param control XMLControl
 * @param obj Object
 */
public void saveObject(XMLControl control, Object obj) {
  Circle circle = (Circle) obj;
  control.setValue("x", circle.x);                 //$NON-NLS-1$
  control.setValue("y", circle.y);                 //$NON-NLS-1$
  control.setValue("drawing r", circle.pixRadius); //$NON-NLS-1$
  control.setValue("color", circle.color);         //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:13,代码来源:CircleLoader.java

示例13: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  Trail trail = (Trail) obj;
  control.setValue("connected", trail.connected);      //$NON-NLS-1$
  control.setValue("color", trail.color);              //$NON-NLS-1$
  control.setValue("number of pts", trail.numpts);     //$NON-NLS-1$
  control.setValue("general path", trail.generalPath); //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:8,代码来源:Trail.java

示例14: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  super.saveObject(control, obj);
  ElementBox element = (ElementBox) obj;
  control.setValue("closed top", element.isClosedTop());       //$NON-NLS-1$
  control.setValue("closed bottom", element.isClosedBottom()); //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:7,代码来源:ElementBox.java

示例15: saveObject

import org.opensourcephysics.controls.XMLControl; //导入方法依赖的package包/类
public void saveObject(XMLControl control, Object obj) {
  super.saveObject(control, obj);
  ElementTessellation element = (ElementTessellation) obj;
  control.setValue("tiles", element.getTiles()); //$NON-NLS-1$
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:6,代码来源:ElementTessellation.java


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