本文整理汇总了Java中javafx.geometry.Orientation.VERTICAL属性的典型用法代码示例。如果您正苦于以下问题:Java Orientation.VERTICAL属性的具体用法?Java Orientation.VERTICAL怎么用?Java Orientation.VERTICAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.geometry.Orientation
的用法示例。
在下文中一共展示了Orientation.VERTICAL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLeftYAxis
private Axis createLeftYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(Orientation.VERTICAL, Position.LEFT);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefWidth(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setTopAnchor(axis, 0d);
AnchorPane.setBottomAnchor(axis, 25d);
AnchorPane.setLeftAnchor(axis, 0d);
return axis;
}
示例2: init
@Override public void init() {
xAxisBottom = new Axis(-20, 20, Orientation.HORIZONTAL, Position.BOTTOM);
xAxisBottom.setPrefHeight(20);
AnchorPane.setLeftAnchor(xAxisBottom, 20d);
AnchorPane.setRightAnchor(xAxisBottom, 20d);
AnchorPane.setBottomAnchor(xAxisBottom, 0d);
xAxisTop = new Axis(0, 100, Orientation.HORIZONTAL, Position.TOP);
xAxisTop.setPrefHeight(20);
AnchorPane.setLeftAnchor(xAxisTop, 20d);
AnchorPane.setRightAnchor(xAxisTop, 20d);
AnchorPane.setTopAnchor(xAxisTop, 0d);
yAxisLeft = new Axis(-20, 20, Orientation.VERTICAL, Position.LEFT);
yAxisLeft.setPrefWidth(20);
AnchorPane.setLeftAnchor(yAxisLeft, 0d);
AnchorPane.setTopAnchor(yAxisLeft, 20d);
AnchorPane.setBottomAnchor(yAxisLeft, 20d);
Converter tempConverter = new Converter(TEMPERATURE, CELSIUS); // Type Temperature with BaseUnit Celsius
double tempFahrenheitMin = tempConverter.convert(-20, FAHRENHEIT);
double tempFahrenheitMax = tempConverter.convert(20, FAHRENHEIT);
yAxisRight = new Axis(tempFahrenheitMin, tempFahrenheitMax, Orientation.VERTICAL, Position.RIGHT);
yAxisRight.setPrefWidth(20);
yAxisRight.setAutoScale(false);
AnchorPane.setRightAnchor(yAxisRight, 0d);
AnchorPane.setTopAnchor(yAxisRight, 20d);
AnchorPane.setBottomAnchor(yAxisRight, 20d);
}
示例3: dataItemAdded
@Override
protected void dataItemAdded(Series<X, Y> series, int itemIndex, Data<X, Y> item) {
String category;
if (orientation == Orientation.VERTICAL) {
category = (String) item.getXValue();
} else {
category = (String) item.getYValue();
}
Map<String, Data<X, Y>> categoryMap = seriesCategoryMap.get(series);
if (categoryMap == null) {
categoryMap = new HashMap<String, Data<X, Y>>();
seriesCategoryMap.put(series, categoryMap);
}
// check if category is already present
if (!categoryAxis.getCategories().contains(category)) {
// note: cat axis categories can be updated only when autoranging is true.
categoryAxis.getCategories().add(itemIndex, category);
} else if (categoryMap.containsKey(category)) {
// RT-21162 : replacing the previous data, first remove the node from
// scenegraph.
Data<X, Y> data = categoryMap.get(category);
getPlotChildren().remove(data.getNode());
removeDataItemFromDisplay(series, data);
requestChartLayout();
categoryMap.remove(category);
}
categoryMap.put(category, item);
Node bar = createBar(series, getData().indexOf(series), item, itemIndex);
if (shouldAnimate()) {
animateDataAdd(item, bar);
} else {
getPlotChildren().add(bar);
}
}
示例4: seriesAdded
@Override
protected void seriesAdded(Series<X, Y> series, int seriesIndex) {
// handle any data already in series
// create entry in the map
Map<String, Data<X, Y>> categoryMap = new HashMap<String, Data<X, Y>>();
for (int j = 0; j < series.getData().size(); j++) {
Data<X, Y> item = series.getData().get(j);
Node bar = createBar(series, seriesIndex, item, j);
String category;
if (orientation == Orientation.VERTICAL) {
category = (String) item.getXValue();
} else {
category = (String) item.getYValue();
}
categoryMap.put(category, item);
if (shouldAnimate()) {
animateDataAdd(item, bar);
} else {
// RT-21164 check if bar value is negative to add NEGATIVE_STYLE style class
double barVal = (orientation == Orientation.VERTICAL) ? ((Number) item.getYValue()).doubleValue()
: ((Number) item.getXValue()).doubleValue();
if (barVal < 0) {
bar.getStyleClass().add(NEGATIVE_STYLE);
}
getPlotChildren().add(bar);
}
}
if (categoryMap.size() > 0)
seriesCategoryMap.put(series, categoryMap);
}
示例5: createRightYAxis
private Axis createRightYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(MIN, MAX, Orientation.VERTICAL, AxisType.LOGARITHMIC, Position.RIGHT);
axis.setPrefWidth(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setRightAnchor(axis, 0d);
AnchorPane.setTopAnchor(axis, 0d);
AnchorPane.setBottomAnchor(axis, 25d);
return axis;
}
示例6: updateMap
private void updateMap(Series<X, Y> series, Data<X, Y> item) {
final String category = (orientation == Orientation.VERTICAL) ? (String) item.getXValue()
: (String) item.getYValue();
Map<String, Data<X, Y>> categoryMap = seriesCategoryMap.get(series);
if (categoryMap != null) {
categoryMap.remove(category);
if (categoryMap.isEmpty())
seriesCategoryMap.remove(series);
}
if (seriesCategoryMap.isEmpty() && categoryAxis.isAutoRanging())
categoryAxis.getCategories().clear();
}
示例7: createRightYAxis
private Axis createRightYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(Orientation.VERTICAL, Position.RIGHT);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefWidth(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setRightAnchor(axis, 0d);
AnchorPane.setTopAnchor(axis, 0d);
AnchorPane.setBottomAnchor(axis, 25d);
return axis;
}
示例8: createDataRemoveTimeline
private Timeline createDataRemoveTimeline(final Data<X, Y> item, final Node bar, final Series<X, Y> series) {
Timeline t = new Timeline();
if (orientation == Orientation.VERTICAL) {
// item.setYValue(getY1Axis().toRealValue(getY1Axis().getZeroPosition()));
// save data values in case the same data item gets added immediately.
XYValueMap.put(item, ((Number) item.getYValue()).doubleValue());
item.setYValue(getY1Axis().toRealValue(bottomPos));
t.getKeyFrames().addAll(
new KeyFrame(Duration.ZERO, new KeyValue(item.currentYProperty(), item.getCurrentY())),
new KeyFrame(Duration.millis(700), actionEvent -> {
processDataRemove(series, item);
XYValueMap.clear();
}, new KeyValue(item.currentYProperty(), item.getYValue(), Interpolator.EASE_BOTH)));
} else {
// save data values in case the same data item gets added immediately.
XYValueMap.put(item, ((Number) item.getXValue()).doubleValue());
item.setXValue(getXAxis().toRealValue(getXAxis().getZeroPosition()));
t.getKeyFrames().addAll(
new KeyFrame(Duration.ZERO, new KeyValue(item.currentXProperty(), item.getCurrentX())),
new KeyFrame(Duration.millis(700), actionEvent -> {
processDataRemove(series, item);
XYValueMap.clear();
}, new KeyValue(item.currentXProperty(), item.getXValue(), Interpolator.EASE_BOTH)));
}
return t;
}
示例9: buildForm
private void buildForm(Stage primaryStage) {
textAreaClassifiableText = new TextArea();
textAreaClassifiableText.setWrapText(true);
btnClassify = new Button("Classify");
btnClassify.setOnAction(new ClassifyBtnPressEvent());
lblCharacteristics = new Label("");
root = new FlowPane(Orientation.VERTICAL, 10, 10);
root.setAlignment(Pos.BASELINE_CENTER);
root.getChildren().addAll(textAreaClassifiableText, btnClassify, lblCharacteristics);
primaryStage.setScene(new Scene(root, 500, 300));
primaryStage.show();
}
示例10: zoomToArea
private void zoomToArea(final double[] BOUNDS) {
group.setTranslateX(0);
group.setTranslateY(0);
double areaWidth = BOUNDS[2] - BOUNDS[0];
double areaHeight = BOUNDS[3] - BOUNDS[1];
double areaCenterX = BOUNDS[0] + areaWidth * 0.5;
double areaCenterY = BOUNDS[1] + areaHeight * 0.5;
Orientation orientation = areaWidth < areaHeight ? Orientation.VERTICAL : Orientation.HORIZONTAL;
double sf = 1.0;
switch(orientation) {
case VERTICAL : sf = clamp(1.0, 10.0, 1 / (areaHeight / height)); break;
case HORIZONTAL: sf = clamp(1.0, 10.0, 1 / (areaWidth / width)); break;
}
/*
Rectangle bounds = new Rectangle(BOUNDS[0], BOUNDS[1], areaWidth, areaHeight);
bounds.setFill(Color.TRANSPARENT);
bounds.setStroke(Color.RED);
bounds.setStrokeWidth(0.5);
bounds.setMouseTransparent(true);
group.getChildren().add(bounds);
*/
setScaleFactor(sf);
group.setTranslateX(width * 0.5 - (areaCenterX));
group.setTranslateY(height * 0.5 - (areaCenterY));
}
示例11: init
@Override public void init() {
xAxisBottom = new Axis(0, 1000, Orientation.HORIZONTAL, AxisType.LOGARITHMIC, Position.BOTTOM);
xAxisBottom.setPrefHeight(20);
AnchorPane.setLeftAnchor(xAxisBottom, 20d);
AnchorPane.setRightAnchor(xAxisBottom, 20d);
AnchorPane.setBottomAnchor(xAxisBottom, 0d);
yAxisLeft = new Axis(0, 1000, Orientation.VERTICAL, AxisType.LOGARITHMIC, Position.LEFT);
yAxisLeft.setPrefWidth(20);
AnchorPane.setLeftAnchor(yAxisLeft, 0d);
AnchorPane.setTopAnchor(yAxisLeft, 20d);
AnchorPane.setBottomAnchor(yAxisLeft, 20d);
}
示例12: createCenterYAxis
private Axis createCenterYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(Orientation.VERTICAL, Position.CENTER);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefWidth(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setTopAnchor(axis, 0d);
AnchorPane.setBottomAnchor(axis, 25d);
AnchorPane.setLeftAnchor(axis, axis.getZeroPosition());
return axis;
}
示例13: createLeftYAxis
private Axis createLeftYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(MIN, MAX, Orientation.VERTICAL, AxisType.LOGARITHMIC, Position.LEFT);
axis.setPrefWidth(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setTopAnchor(axis, 0d);
AnchorPane.setBottomAnchor(axis, 25d);
AnchorPane.setLeftAnchor(axis, 0d);
return axis;
}
示例14: createLeftYAxis
private Axis createLeftYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE, final double AXIS_WIDTH) {
Axis axis = new Axis(Orientation.VERTICAL, Position.LEFT);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefWidth(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setTopAnchor(axis, 0d);
AnchorPane.setBottomAnchor(axis, AXIS_WIDTH);
AnchorPane.setLeftAnchor(axis, 0d);
return axis;
}
示例15: createRightYAxis
private Axis createRightYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE, final double AXIS_WIDTH) {
Axis axis = new Axis(Orientation.VERTICAL, Position.RIGHT);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefWidth(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setRightAnchor(axis, 0d);
AnchorPane.setTopAnchor(axis, 0d);
AnchorPane.setBottomAnchor(axis, AXIS_WIDTH);
return axis;
}