本文整理汇总了Java中javafx.geometry.Side.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Side.equals方法的具体用法?Java Side.equals怎么用?Java Side.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.geometry.Side
的用法示例。
在下文中一共展示了Side.equals方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConnectorPosition
import javafx.geometry.Side; //导入方法依赖的package包/类
@Override
public Point2D getConnectorPosition(final GConnectorSkin connectorSkin) {
final Node connectorRoot = connectorSkin.getRoot();
final Side side = DefaultConnectorTypes.getSide(connectorSkin.getConnector().getType());
// The following logic is required because the connectors are offset slightly from the node edges.
final double x, y;
if (side.equals(Side.LEFT)) {
x = 0;
y = connectorRoot.getLayoutY() + connectorSkin.getHeight() / 2;
} else if (side.equals(Side.RIGHT)) {
x = getRoot().getWidth();
y = connectorRoot.getLayoutY() + connectorSkin.getHeight() / 2;
} else if (side.equals(Side.TOP)) {
x = connectorRoot.getLayoutX() + connectorSkin.getWidth() / 2;
y = 0;
} else {
x = connectorRoot.getLayoutX() + connectorSkin.getWidth() / 2;
y = getRoot().getHeight();
}
return new Point2D(x, y);
}
示例2: countConnectors
import javafx.geometry.Side; //导入方法依赖的package包/类
/**
* Counts the number of connectors the given node currently has of the given type.
*
* @param node a {@link GNode} instance
* @param side the {@link Side} the connector is on
* @return the number of connectors this node has on the given side
*/
private int countConnectors(final GNode node, final Side side) {
int count = 0;
for (final GConnector connector : node.getConnectors()) {
if (side.equals(DefaultConnectorTypes.getSide(connector.getType()))) {
count++;
}
}
return count;
}
示例3: updateHeaderClip
import javafx.geometry.Side; //导入方法依赖的package包/类
private void updateHeaderClip() {
Side tabPosition = getSkinnable().getSide();
double x = 0;
double y = 0;
double clipWidth = 0;
double clipHeight = 0;
double maxWidth = 0;
double shadowRadius = 0;
double clipOffset = firstTabIndent();
double controlButtonPrefWidth = snapSize(controlButtons.prefWidth(-1));
measureClosingTabs = true;
double headersPrefWidth = snapSize(headersRegion.prefWidth(-1));
measureClosingTabs = false;
double headersPrefHeight = snapSize(headersRegion.prefHeight(-1));
// Add the spacer if isShowTabsMenu is true.
if (controlButtonPrefWidth > 0) {
controlButtonPrefWidth = controlButtonPrefWidth + SPACER;
}
if (headersRegion.getEffect() instanceof DropShadow) {
DropShadow shadow = (DropShadow) headersRegion.getEffect();
shadowRadius = shadow.getRadius();
}
maxWidth = snapSize(getWidth()) - controlButtonPrefWidth - clipOffset;
if (tabPosition.equals(Side.LEFT) || tabPosition.equals(Side.BOTTOM)) {
if (headersPrefWidth < maxWidth) {
clipWidth = headersPrefWidth + shadowRadius;
} else {
x = headersPrefWidth - maxWidth;
clipWidth = maxWidth + shadowRadius;
}
clipHeight = headersPrefHeight;
} else {
// If x = 0 the header region's drop shadow is clipped.
x = -shadowRadius;
clipWidth = (headersPrefWidth < maxWidth ? headersPrefWidth : maxWidth) + shadowRadius;
clipHeight = headersPrefHeight;
}
headerClip.setX(x);
headerClip.setY(y);
headerClip.setWidth(clipWidth);
headerClip.setHeight(clipHeight);
}
示例4: layoutChildren
import javafx.geometry.Side; //导入方法依赖的package包/类
@Override
protected void layoutChildren() {
final double leftInset = snappedLeftInset();
final double rightInset = snappedRightInset();
final double topInset = snappedTopInset();
final double bottomInset = snappedBottomInset();
double w = snapSize(getWidth()) - (isHorizontal() ? leftInset + rightInset : topInset + bottomInset);
double h = snapSize(getHeight()) - (isHorizontal() ? topInset + bottomInset : leftInset + rightInset);
double tabBackgroundHeight = snapSize(prefHeight(-1));
double headersPrefWidth = snapSize(headersRegion.prefWidth(-1));
double headersPrefHeight = snapSize(headersRegion.prefHeight(-1));
controlButtons.showTabsMenu(!tabsFit());
updateHeaderClip();
headersRegion.requestLayout();
// RESIZE CONTROL BUTTONS
double btnWidth = snapSize(controlButtons.prefWidth(-1));
final double btnHeight = controlButtons.prefHeight(btnWidth);
controlButtons.resize(btnWidth, btnHeight);
// POSITION TABS
headersRegion.resize(headersPrefWidth, headersPrefHeight);
if (isFloatingStyleClass()) {
headerBackground.setVisible(false);
} else {
headerBackground.resize(snapSize(getWidth()), snapSize(getHeight()));
headerBackground.setVisible(true);
}
double startX = 0;
double startY = 0;
double controlStartX = 0;
double controlStartY = 0;
Side tabPosition = getSkinnable().getSide();
if (tabPosition.equals(Side.TOP)) {
startX = leftInset;
startY = tabBackgroundHeight - headersPrefHeight - bottomInset;
controlStartX = w - btnWidth + leftInset;
controlStartY = snapSize(getHeight()) - btnHeight - bottomInset;
} else if (tabPosition.equals(Side.RIGHT)) {
startX = topInset;
startY = tabBackgroundHeight - headersPrefHeight - leftInset;
controlStartX = w - btnWidth + topInset;
controlStartY = snapSize(getHeight()) - btnHeight - leftInset;
} else if (tabPosition.equals(Side.BOTTOM)) {
startX = snapSize(getWidth()) - headersPrefWidth - leftInset;
startY = tabBackgroundHeight - headersPrefHeight - topInset;
controlStartX = rightInset;
controlStartY = snapSize(getHeight()) - btnHeight - topInset;
} else if (tabPosition.equals(Side.LEFT)) {
startX = snapSize(getWidth()) - headersPrefWidth - topInset;
startY = tabBackgroundHeight - headersPrefHeight - rightInset;
controlStartX = leftInset;
controlStartY = snapSize(getHeight()) - btnHeight - rightInset;
}
if (headerBackground.isVisible()) {
positionInArea(headerBackground, 0, 0, snapSize(getWidth()), snapSize(getHeight()), /*baseline ignored*/0, HPos.CENTER,
VPos.CENTER);
}
positionInArea(headersRegion, startX, startY, w, h, /*baseline ignored*/0, HPos.LEFT, VPos.CENTER);
positionInArea(controlButtons, controlStartX, controlStartY, btnWidth, btnHeight, /*baseline ignored*/0, HPos.CENTER,
VPos.CENTER);
}
示例5: commonComponentsRenderingCorrectnessTest
import javafx.geometry.Side; //导入方法依赖的package包/类
private void commonComponentsRenderingCorrectnessTest() throws Throwable {
Side tSide = null;
Side lSide = null;
Boolean lVisible = null;
Double prefWH = null;
for (Side titleSide : Side.values()) {
for (Side legendSide : Side.values()) {
for (Boolean legendVisible : new Boolean[]{Boolean.TRUE, Boolean.FALSE}) {
for (Double prefWidthHeight : new Double[]{400 - 50.0, 400 + 50.0}) {
//Batch of checkers for speedup.
if (!titleSide.equals(tSide)) {
setPropertyByChoiceBox(SettingType.UNIDIRECTIONAL, titleSide, ChartProperties.titleSide);
tSide = titleSide;
}
if (!legendSide.equals(lSide)) {
setPropertyByChoiceBox(SettingType.UNIDIRECTIONAL, legendSide, ChartProperties.legendSide);
lSide = legendSide;
}
if (!legendVisible.equals(lVisible)) {
setPropertyByToggleClick(SettingType.UNIDIRECTIONAL, ChartProperties.legendVisible, legendVisible);
lVisible = legendVisible;
}
if (!prefWidthHeight.equals(prefWH)) {
setPropertyBySlider(SettingType.UNIDIRECTIONAL, ChartProperties.prefWidth, prefWidthHeight);
setPropertyBySlider(SettingType.UNIDIRECTIONAL, ChartProperties.prefHeight, prefWidthHeight);
prefWH = prefWidthHeight;
}
try {
checkChartAppearanceInvariant();
checkChartPrefSizeAffectance(prefWidthHeight, prefWidthHeight);
} catch (Throwable ex) {
System.err.println("TitleSide : <" + titleSide + "> legendSide : <" + legendSide + "> legendVisible : <" + legendVisible + "> prefWidth and prefHeight : <" + prefWidthHeight + ">.");
throw ex;
}
}
}
}
}
}
示例6: createPath
import javafx.geometry.Side; //导入方法依赖的package包/类
/**
* Creates a rectangular path from the start to the end positions.
*
* <p>
* Tries to travel outwards from the start and end nodes by at least a minimum amount.
* </p>
*
* @param startPosition the start position
* @param endPosition the end position
* @param startSide the side of the node the path starts from
* @param endSide the side of the node the path travels to
* @return a list of points specifying the path
*/
public static List<Point2D> createPath(final Point2D startPosition, final Point2D endPosition,
final Side startSide, final Side endSide) {
if (startSide.equals(Side.LEFT) && endSide.equals(Side.LEFT)) {
return connectLeftToLeft(startPosition, endPosition);
} else if (startSide.equals(Side.LEFT) && endSide.equals(Side.RIGHT)) {
return connectLeftToRight(startPosition, endPosition);
} else if (startSide.equals(Side.LEFT) && endSide.equals(Side.TOP)) {
return connectLeftToTop(startPosition, endPosition);
} else if (startSide.equals(Side.LEFT) && endSide.equals(Side.BOTTOM)) {
return connectLeftToBottom(startPosition, endPosition);
} else if (startSide.equals(Side.RIGHT) && endSide.equals(Side.LEFT)) {
return reverse(connectLeftToRight(endPosition, startPosition));
} else if (startSide.equals(Side.RIGHT) && endSide.equals(Side.RIGHT)) {
return connectRightToRight(startPosition, endPosition);
} else if (startSide.equals(Side.RIGHT) && endSide.equals(Side.TOP)) {
return connectRightToTop(startPosition, endPosition);
} else if (startSide.equals(Side.RIGHT) && endSide.equals(Side.BOTTOM)) {
return connectRightToBottom(startPosition, endPosition);
} else if (startSide.equals(Side.TOP) && endSide.equals(Side.LEFT)) {
return reverse(connectLeftToTop(endPosition, startPosition));
} else if (startSide.equals(Side.TOP) && endSide.equals(Side.RIGHT)) {
return reverse(connectRightToTop(endPosition, startPosition));
} else if (startSide.equals(Side.TOP) && endSide.equals(Side.TOP)) {
return connectTopToTop(startPosition, endPosition);
} else if (startSide.equals(Side.TOP) && endSide.equals(Side.BOTTOM)) {
return connectTopToBottom(startPosition, endPosition);
} else if (startSide.equals(Side.BOTTOM) && endSide.equals(Side.LEFT)) {
return reverse(connectLeftToBottom(endPosition, startPosition));
} else if (startSide.equals(Side.BOTTOM) && endSide.equals(Side.RIGHT)) {
return reverse(connectRightToBottom(endPosition, startPosition));
} else if (startSide.equals(Side.BOTTOM) && endSide.equals(Side.TOP)) {
return reverse(connectTopToBottom(endPosition, startPosition));
} else {
return connectBottomToBottom(startPosition, endPosition);
}
}