本文整理汇总了Java中javafx.scene.transform.Shear类的典型用法代码示例。如果您正苦于以下问题:Java Shear类的具体用法?Java Shear怎么用?Java Shear使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Shear类属于javafx.scene.transform包,在下文中一共展示了Shear类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ShearSample
import javafx.scene.transform.Shear; //导入依赖的package包/类
public ShearSample() {
super(125,160);
//create rectangle
Rectangle rect = new Rectangle(75, 75, Color.web("#ed4b00", 0.5));
rect.setTranslateY(50);
Shear shear = new Shear(0.7, 0);
rect.getTransforms().add(shear);
//show the rectangles
getChildren().addAll(rect);
// REMOVE ME
setControls(
new SimplePropertySheet.PropDesc("Shear X", shear.xProperty(), 0d, 1d),
new SimplePropertySheet.PropDesc("Shear Y", shear.yProperty(), 0d, 1d),
new SimplePropertySheet.PropDesc("Shear Pivot X", shear.pivotXProperty(), 0d, 50d),
new SimplePropertySheet.PropDesc("Shear Pivot Y", shear.pivotYProperty(), 0d, 50d)
);
// END REMOVE ME
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:24,代码来源:ShearSample.java
示例2: createIconContent
import javafx.scene.transform.Shear; //导入依赖的package包/类
public static Node createIconContent() {
final Rectangle r1 = new Rectangle (22, 0, 64, 64);
r1.setArcHeight(4);
r1.setArcWidth(4);
r1.setFill(Color.web("#ed4b00",0.5));
r1.getTransforms().add(new Shear(-0.35, 0));
Polygon polygon = createArrow();
polygon.setLayoutX(-5);
polygon.setLayoutY(-2);
polygon.setRotate(90);
Rectangle r2 = new Rectangle (0, 0, 64, 64);
r2.setArcHeight(4);
r2.setArcWidth(4);
r2.setFill(Color.web("#ed4b00", 0.25));
javafx.scene.Group g = new javafx.scene.Group(r2,r1, polygon);
return new javafx.scene.Group(g);
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:21,代码来源:ShearSample.java
示例3: shearSelectedObject
import javafx.scene.transform.Shear; //导入依赖的package包/类
public void shearSelectedObject(double x, double y) {
GUIState guiState = mainController.getGUIController().getGuiState();
FocusOutline focusOutline = guiState.getFocusOutline();
Shear shearing = new Shear();
shearing.setX(x);
shearing.setY(y);
shearing.setPivotX(focusOutline.getRotateAnchor().getCenterX());
shearing.setPivotY(focusOutline.getRotateAnchor().getCenterY());
focusOutline.getFocusRectangle().getTransforms().add(shearing);
focusOutline.getRotateAnchor().getTransforms().add(shearing);
guiState.getSelectedObject().getTransforms().add(shearing);
for (ResizeAnchor resizeAnchor : focusOutline.getResizeAnchors()) {
resizeAnchor.getTransforms().add(shearing);
}
}
开发者ID:pfolta,项目名称:Shapify,代码行数:22,代码来源:Document.java
示例4: GetTransformation
import javafx.scene.transform.Shear; //导入依赖的package包/类
private Transform GetTransformation(int width, int height)
{
double centerX = width * GetDoubleAttribute("X") / MaximumX;
double centerY = height * GetDoubleAttribute("Y") / MaximumY;
double skewX = 90 * (GetDoubleAttribute("SkewX") - MaximumX / 2.0) / MaximumX;
double skewY = 90 * (GetDoubleAttribute("SkewY") - MaximumY / 2.0) / MaximumY;
double scaleX = GetDoubleAttribute("Width");
double scaleY = GetDoubleAttribute("Height");
double rotation = (GetDoubleAttribute("Rotation") / MaximumX) * 360;
Shear skewTransform = new Shear(skewX, skewY, centerX, centerY);
Rotate rotateTransform = new Rotate(rotation, centerX, centerY);
Scale scaleTransform = new Scale(scaleX, scaleY, centerX, centerY);
return rotateTransform.createConcatenation(scaleTransform).createConcatenation(skewTransform);
}
开发者ID:andrewsarnold,项目名称:FlagMaker-2,代码行数:20,代码来源:OverlayTransformer.java
示例5: Digit
import javafx.scene.transform.Shear; //导入依赖的package包/类
public Digit(Color onColor, Color offColor, Effect onEffect, Effect offEffect) {
this.onColor = onColor;
this.offColor = offColor;
this.onEffect = onEffect;
this.offEffect = offEffect;
getChildren().addAll(polygons);
getTransforms().add(new Shear(-0.1,0));
showNumber(0);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DigitalClock.java
示例6: getTransforms
import javafx.scene.transform.Shear; //导入依赖的package包/类
public static String getTransforms(Node object) {
String transforms = "";
for (Transform transform : object.getTransforms()) {
StringBuilder currentTransform = new StringBuilder();
if (!transforms.isEmpty()) {
currentTransform.append(" ");
}
if (transform instanceof Rotate) {
Rotate rotate = (Rotate) transform;
currentTransform.append("rotate(");
currentTransform.append(rotate.getAngle());
currentTransform.append(" ");
currentTransform.append(rotate.getPivotX());
currentTransform.append(" ");
currentTransform.append(rotate.getPivotY());
currentTransform.append(")");
}
if (transform instanceof Shear) {
Shear shear = (Shear) transform;
currentTransform.append("matrix(");
currentTransform.append("1");
currentTransform.append(", ");
currentTransform.append(shear.getY());
currentTransform.append(", ");
currentTransform.append(shear.getX());
currentTransform.append(", ");
currentTransform.append("1");
currentTransform.append(", ");
currentTransform.append("0");
currentTransform.append(", ");
currentTransform.append("0");
currentTransform.append(")");
}
transforms += currentTransform.toString();
}
return transforms;
}
开发者ID:pfolta,项目名称:Shapify,代码行数:46,代码来源:ShapeUtils.java
示例7: setShear
import javafx.scene.transform.Shear; //导入依赖的package包/类
/**
* @param shear the shear to set
*/
public void setShear(Shear shear) {
this.shear = shear;
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:7,代码来源:TransformTest.java
示例8: getShear
import javafx.scene.transform.Shear; //导入依赖的package包/类
/**
* @return the shear
*/
public Shear getShear() {
return shear;
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:7,代码来源:TransformTest.java
注:本文中的javafx.scene.transform.Shear类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论