本文整理汇总了Java中javafx.scene.shape.Sphere.setTranslateZ方法的典型用法代码示例。如果您正苦于以下问题:Java Sphere.setTranslateZ方法的具体用法?Java Sphere.setTranslateZ怎么用?Java Sphere.setTranslateZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Sphere
的用法示例。
在下文中一共展示了Sphere.setTranslateZ方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setxAxisData
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
/**
* @param data the xAxisData to set
*/
public void setxAxisData(ArrayList<Double> data) {
xAxisData = data;
scatterDataGroup.getChildren().clear();
for(int i=0;i<xAxisData.size();i++) {
final Sphere dataSphere = new Sphere(scatterRadius);
// final Box dataSphere = new Box(getScatterRadius(), getScatterRadius(), getScatterRadius());
double translateY = 0.0;
double translateZ = 0.0;
if(!yAxisData.isEmpty() && yAxisData.size() > i)
translateY = yAxisData.get(i);
if(!zAxisData.isEmpty() && zAxisData.size() > i)
translateZ = zAxisData.get(i);
dataSphere.setTranslateX(xAxisData.get(i));
dataSphere.setTranslateY(translateY);
dataSphere.setTranslateZ(translateZ);
scatterDataGroup.getChildren().add(dataSphere);
}
}
示例2: setyAxisData
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
/**
* @param data the yAxisData to set
*/
public void setyAxisData(ArrayList<Double> data) {
yAxisData = data;
scatterDataGroup.getChildren().clear();
for(int i=0;i<yAxisData.size();i++) {
final Sphere dataSphere = new Sphere(scatterRadius);
// final Box dataSphere = new Box(getScatterRadius(), getScatterRadius(), getScatterRadius());
double translateX = 0.0;
double translateZ = 0.0;
if(!xAxisData.isEmpty() && xAxisData.size() > i)
translateX = xAxisData.get(i);
if(!zAxisData.isEmpty() && zAxisData.size() > i)
translateZ = zAxisData.get(i);
dataSphere.setTranslateX(translateX);
dataSphere.setTranslateY(yAxisData.get(i));
dataSphere.setTranslateZ(translateZ);
scatterDataGroup.getChildren().add(dataSphere);
}
}
示例3: setzAxisData
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
/**
* @param data the zAxisData to set
*/
public void setzAxisData(ArrayList<Double> data) {
zAxisData = data;
scatterDataGroup.getChildren().clear();
for(int i=0;i<zAxisData.size();i++) {
final Sphere dataSphere = new Sphere(scatterRadius);
// final Box dataSphere = new Box(getScatterRadius(), getScatterRadius(), getScatterRadius());
double translateX = 0.0;
double translateY = 0.0;
if(!xAxisData.isEmpty() && xAxisData.size() > i)
translateX = xAxisData.get(i);
if(!yAxisData.isEmpty() && yAxisData.size() > i)
translateY = yAxisData.get(i);
dataSphere.setTranslateX(translateX);
dataSphere.setTranslateY(translateY);
dataSphere.setTranslateZ(zAxisData.get(i));
scatterDataGroup.getChildren().add(dataSphere);
}
}
示例4: buildGroup
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private static Group buildGroup() {
Group grp = new Group();
Sphere s = new Sphere();
Box b = new Box();
s.setScaleX(SCALE);
s.setScaleY(SCALE);
s.setScaleZ(SCALE);
s.setTranslateX(-130);
b.setScaleX(SCALE);
b.setScaleY(SCALE);
b.setScaleZ(SCALE);
b.setTranslateX(130);
PhongMaterial material = new PhongMaterial();
material.setDiffuseColor(Color.LIGHTGRAY);
material.setSpecularColor(Color.rgb(30, 30, 30));
s.setMaterial(material);
b.setMaterial(material);
PointLight pl = new PointLight(Color.AQUA);
pl.setTranslateZ(-1000);
Sphere lightBalance = new Sphere();
// lightBalance.setScaleX(0.1);
// lightBalance.setScaleX(0.1);
// lightBalance.setScaleX(0.1);
lightBalance.setTranslateZ(1000);
grp.getChildren().addAll(s, b,pl,lightBalance);
return grp;
}
示例5: buildLightGroup
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private static Group buildLightGroup(VisibleLight vl) {
vl.setTranslateZ(-140);
Sphere balance = new Sphere();
// balance.setScaleX(SCALE);
// balance.setScaleY(SCALE);
// balance.setScaleZ(SCALE);
balance.setTranslateZ(140);
return new Group(vl, balance);
}
示例6: setLightType
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
public void setLightType(VisibleLight.LightType lt) {
vl = new VisibleLight(Color.ANTIQUEWHITE, lt);
vl.setTranslateZ(-140);
Sphere balance = new Sphere();
balance.setTranslateZ(140);
lightGroup.getChildren().clear();
lightGroup.getChildren().addAll(vl, balance);
}
示例7: buildAxes
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private void buildAxes() {
double length = 2d * dimModel;
double width = dimModel / 100d;
double radius = 2d * dimModel / 100d;
final PhongMaterial redMaterial = new PhongMaterial();
redMaterial.setDiffuseColor(Color.DARKRED);
redMaterial.setSpecularColor(Color.RED);
final PhongMaterial greenMaterial = new PhongMaterial();
greenMaterial.setDiffuseColor(Color.DARKGREEN);
greenMaterial.setSpecularColor(Color.GREEN);
final PhongMaterial blueMaterial = new PhongMaterial();
blueMaterial.setDiffuseColor(Color.DARKBLUE);
blueMaterial.setSpecularColor(Color.BLUE);
Sphere xSphere = new Sphere(radius);
Sphere ySphere = new Sphere(radius);
Sphere zSphere = new Sphere(radius);
xSphere.setMaterial(redMaterial);
ySphere.setMaterial(greenMaterial);
zSphere.setMaterial(blueMaterial);
xSphere.setTranslateX(dimModel);
ySphere.setTranslateY(dimModel);
zSphere.setTranslateZ(dimModel);
Box xAxis = new Box(length, width, width);
Box yAxis = new Box(width, length, width);
Box zAxis = new Box(width, width, length);
xAxis.setMaterial(redMaterial);
yAxis.setMaterial(greenMaterial);
zAxis.setMaterial(blueMaterial);
autoScalingGroup.getChildren().addAll(xAxis, yAxis, zAxis);
autoScalingGroup.getChildren().addAll(xSphere, ySphere, zSphere);
}
示例8: addAtom
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private void addAtom(LeafSubstructure<?> origin, Atom atom) {
Sphere atomShape = new Sphere(1.0);
atomShape.setMaterial(getMaterial(origin, atom));
atomShape.setTranslateX(atom.getPosition().getX());
atomShape.setTranslateY(atom.getPosition().getY());
atomShape.setTranslateZ(atom.getPosition().getZ());
// add tooltip
Tooltip tooltip = new Tooltip(atom.getElement().getName() + " (" + (atom.getAtomName()) + ":" +
atom.getAtomIdentifier() + ") of " + origin.getFamily().getThreeLetterCode() + ":" + origin.getIdentifier());
Tooltip.install(atomShape, tooltip);
moleculeGroup.getChildren().add(atomShape);
}
示例9: addSphere
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
public void addSphere(double x, double y, double z, Material material) {
Sphere sphere = new Sphere(RADIUS);
sphere.setTranslateX(x * SCALE_FACTOR);
sphere.setTranslateY(y * SCALE_FACTOR);
sphere.setTranslateZ(z * SCALE_FACTOR);
sphere.setMaterial(material);
getChildren().add(sphere);
}
示例10: createSphere
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private Sphere createSphere(Physical ball) {
Sphere sphere = new Sphere(this.radius);
ViewPoint location = ViewPoint.of(ball.getLocation());
sphere.setTranslateX(location.x);
sphere.setTranslateY(location.y);
sphere.setTranslateZ(location.z);
Material material = new PhongMaterial(this.color);
sphere.setMaterial(material);
return sphere;
}
示例11: buildAxes
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private void buildAxes() {
double length = 2d*dimModel;
double width = dimModel/100d;
double radius = 2d*dimModel/100d;
final PhongMaterial redMaterial = new PhongMaterial();
redMaterial.setDiffuseColor(Color.DARKRED);
redMaterial.setSpecularColor(Color.RED);
final PhongMaterial greenMaterial = new PhongMaterial();
greenMaterial.setDiffuseColor(Color.DARKGREEN);
greenMaterial.setSpecularColor(Color.GREEN);
final PhongMaterial blueMaterial = new PhongMaterial();
blueMaterial.setDiffuseColor(Color.DARKBLUE);
blueMaterial.setSpecularColor(Color.BLUE);
Sphere xSphere = new Sphere(radius);
Sphere ySphere = new Sphere(radius);
Sphere zSphere = new Sphere(radius);
xSphere.setMaterial(redMaterial);
ySphere.setMaterial(greenMaterial);
zSphere.setMaterial(blueMaterial);
xSphere.setTranslateX(dimModel);
ySphere.setTranslateY(dimModel);
zSphere.setTranslateZ(dimModel);
Box xAxis = new Box(length, width, width);
Box yAxis = new Box(width, length, width);
Box zAxis = new Box(width, width, length);
xAxis.setMaterial(redMaterial);
yAxis.setMaterial(greenMaterial);
zAxis.setMaterial(blueMaterial);
autoScalingGroup.getChildren().addAll(xAxis, yAxis, zAxis);
autoScalingGroup.getChildren().addAll(xSphere, ySphere, zSphere);
}
示例12: buildMolecule
import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private void buildMolecule() {
final PhongMaterial redMaterial = new PhongMaterial();
redMaterial.setDiffuseColor(Color.DARKRED);
redMaterial.setSpecularColor(Color.RED);
final PhongMaterial whiteMaterial = new PhongMaterial();
whiteMaterial.setDiffuseColor(Color.WHITE);
whiteMaterial.setSpecularColor(Color.LIGHTBLUE);
final PhongMaterial greyMaterial = new PhongMaterial();
greyMaterial.setDiffuseColor(Color.DARKGREY);
greyMaterial.setSpecularColor(Color.GREY);
// Molecule Hierarchy
// [*] moleculeXform
// [*] oxygenXform
// [*] oxygenSphere
// [*] hydrogen1SideXform
// [*] hydrogen1Xform
// [*] hydrogen1Sphere
// [*] bond1Cylinder
// [*] hydrogen2SideXform
// [*] hydrogen2Xform
// [*] hydrogen2Sphere
// [*] bond2Cylinder
Xform moleculeXform = new Xform();
Xform oxygenXform = new Xform();
Xform hydrogen1SideXform = new Xform();
Xform hydrogen1Xform = new Xform();
Xform hydrogen2SideXform = new Xform();
Xform hydrogen2Xform = new Xform();
Sphere oxygenSphere = new Sphere(40.0);
oxygenSphere.setMaterial(redMaterial);
Sphere hydrogen1Sphere = new Sphere(30.0);
hydrogen1Sphere.setMaterial(whiteMaterial);
hydrogen1Sphere.setTranslateX(0.0);
Sphere hydrogen2Sphere = new Sphere(30.0);
hydrogen2Sphere.setMaterial(whiteMaterial);
hydrogen2Sphere.setTranslateZ(0.0);
Cylinder bond1Cylinder = new Cylinder(5, 100);
bond1Cylinder.setMaterial(greyMaterial);
bond1Cylinder.setTranslateX(50.0);
bond1Cylinder.setRotationAxis(Rotate.Z_AXIS);
bond1Cylinder.setRotate(90.0);
Cylinder bond2Cylinder = new Cylinder(5, 100);
bond2Cylinder.setMaterial(greyMaterial);
bond2Cylinder.setTranslateX(50.0);
bond2Cylinder.setRotationAxis(Rotate.Z_AXIS);
bond2Cylinder.setRotate(90.0);
moleculeXform.getChildren().add(oxygenXform);
moleculeXform.getChildren().add(hydrogen1SideXform);
moleculeXform.getChildren().add(hydrogen2SideXform);
oxygenXform.getChildren().add(oxygenSphere);
hydrogen1SideXform.getChildren().add(hydrogen1Xform);
hydrogen2SideXform.getChildren().add(hydrogen2Xform);
hydrogen1Xform.getChildren().add(hydrogen1Sphere);
hydrogen2Xform.getChildren().add(hydrogen2Sphere);
hydrogen1SideXform.getChildren().add(bond1Cylinder);
hydrogen2SideXform.getChildren().add(bond2Cylinder);
hydrogen1Xform.setTx(100.0);
hydrogen2Xform.setTx(100.0);
hydrogen2SideXform.setRotateY(104.5);
moleculeGroup.getChildren().add(moleculeXform);
world.getChildren().addAll(moleculeGroup);
}