本文整理汇总了Java中com.sun.javafx.scene.control.skin.LabeledText类的典型用法代码示例。如果您正苦于以下问题:Java LabeledText类的具体用法?Java LabeledText怎么用?Java LabeledText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LabeledText类属于com.sun.javafx.scene.control.skin包,在下文中一共展示了LabeledText类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ToggleSwitchSkin
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
/**
* Constructor for all SkinBase instances.
*
* @param control The control for which this Skin should attach to.
*/
protected ToggleSwitchSkin(ToggleSwitch control) {
super(control);
thumb = new StackPane();
thumbArea = new StackPane();
label = new LabeledText(control);
labelContainer = new StackPane();
updateLabel(control);
getChildren().addAll(labelContainer, thumbArea, thumb);
labelContainer.getChildren().addAll(label);
StackPane.setAlignment(label, Pos.CENTER_LEFT);
thumb.getStyleClass().setAll("thumb");
thumbArea.getStyleClass().setAll("thumb-area");
thumbArea.setOnMouseReleased(event -> mousePressedOnToggleSwitch(control));
thumb.setOnMouseReleased(event -> mousePressedOnToggleSwitch(control));
control.selectedProperty().addListener((observable, oldValue, newValue) -> {
if (newValue.booleanValue() != oldValue.booleanValue())
selectedStateChanged();
});
}
开发者ID:thane98,项目名称:FEFEditor,代码行数:29,代码来源:ToggleSwitchSkin.java
示例2: navigateToPage
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
protected void navigateToPage(int pageIndex, NavigationWay nav) {
int direction;
while ((direction = checkDirectionForSearch(pageIndex)) != 0) {
if (direction == 1) {
navigateToRight(nav);
}
if (direction == -1) {
navigateToLeft(nav);
}
}
Wrap<? extends LabeledText>[] array = getSortedPageIndeces();
for (int i = 0; i < array.length; i++) {
if (Integer.parseInt(array[i].getControl().getText()) == pageIndex) {
array[i].mouse().click();
return;
}
}
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:19,代码来源:TestBase.java
示例3: checkDirectionForSearch
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
/**
* @param itemToFind - page index.
* @return +1 to press right; -1 to press left; 0, if we can click item and
* it is visible. can throw exception.
*/
private int checkDirectionForSearch(int itemToFind) {
checkRightPageIndecesOrderAndContinuousOrder();
Wrap<? extends LabeledText>[] array = getSortedPageIndeces();
int len = array.length;
for (int i = 0; i < len; i++) {
if (Integer.parseInt(array[i].getControl().getText()) == itemToFind) {
return 0;
}
}
if (Integer.parseInt(array[0].getControl().getText()) > itemToFind) {
return -1;
}
if (Integer.parseInt(array[len - 1].getControl().getText()) < itemToFind) {
return +1;
}
throw new IllegalStateException("Can't find direction for search because of unknown issue. " + array.toString());
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:26,代码来源:TestBase.java
示例4: getSortedPageIndeces
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
private Wrap<? extends LabeledText>[] getSortedPageIndeces() {
Lookup<LabeledText> visiblePageIndeces = findVisiblePageIndeces();
ArrayList<Wrap<? extends LabeledText>> list = new ArrayList<Wrap<? extends LabeledText>>();
for (int i = 0; i < visiblePageIndeces.size(); i++) {
list.add(visiblePageIndeces.wrap(i));
}
Wrap<? extends LabeledText>[] array = list.toArray(new Wrap[0]);
Arrays.sort(array, new Comparator<Wrap<? extends LabeledText>>() {
public int compare(Wrap<? extends LabeledText> t, Wrap<? extends LabeledText> t1) {
String s1 = t.getControl().getText();
String s2 = t1.getControl().getText();
int int1 = Integer.parseInt("".equals(s1) ? "-1" : s1);
int int2 = Integer.parseInt("".equals(s2) ? "-1" : s2);
return int1 - int2;
}
});
return array;
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:23,代码来源:TestBase.java
示例5: DateCellDescription
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
public DateCellDescription(Wrap<? extends DateCell> dateCellWrap) {
Lookup lookup = dateCellWrap.as(Parent.class, Node.class).lookup();
if (lookup.lookup(LabeledText.class).size() > 0) {
final Wrap<? extends LabeledText> mainText = lookup.lookup(LabeledText.class).wrap();
mainDate = Integer.parseInt(getText(mainText));
} else {
mainDate = -1;
}
if (lookup.lookup(Text.class, new ByStyleClass("secondary-text")).size() > 0) {
final Wrap<? extends Text> secondaryText = lookup.lookup(Text.class, new ByStyleClass("secondary-text")).wrap();
secondaryDate = Integer.parseInt(getText(secondaryText));
} else {
secondaryDate = -1;
}
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:17,代码来源:TestBase.java
示例6: searchText
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
private static String searchText(Node node) {
if (node instanceof LabeledText) {
return (((LabeledText) node).getText());
}
if (node instanceof Parent) {
Parent parent = (Parent) node;
ObservableList<Node> list = parent.getChildrenUnmodifiable();
String temp = null;
for (Node n : list) {
temp = searchText(n);
if (temp != null) {
return temp;
}
}
}
return null;
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:18,代码来源:LabeledsBase.java
示例7: testEllipsisSize
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
private void testEllipsisSize() {
org.jemmy.interfaces.Parent p = getScene().as(org.jemmy.interfaces.Parent.class, Node.class);
final Wrap<? extends Labeled> node = p.lookup(new ByID<Labeled>(LabeledsPages.setEllipsisString.name() + LabeledsAbstactApp.CONTROL)).wrap();
final Wrap<? extends Labeled> goldennode = p.lookup(new ByID<Labeled>(LabeledsPages.setEllipsisString.name() + LabeledsAbstactApp.GOLDEN)).wrap();
new Waiter(Wrap.WAIT_STATE_TIMEOUT).waitState(new State() {
@Override
public Object reached() {
return (node.getControl().getChildrenUnmodifiable().size() > 0) ? true : null;
}
});
LabeledText targetText = searchLabeledText(node.getControl());
Bounds targetTextBounds = targetText.getBoundsInParent();
Bounds controlBounds = node.getControl().getBoundsInLocal();
Bounds goldenControlBounds = goldennode.getControl().getBoundsInLocal();
Assert.assertTrue(controlBounds.contains(targetTextBounds));
Assert.assertEquals(goldenControlBounds.getWidth(), controlBounds.getWidth());
Assert.assertEquals(goldenControlBounds.getHeight(), controlBounds.getHeight());
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:22,代码来源:LabeledsBase.java
示例8: searchLabeledText
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
private static LabeledText searchLabeledText(Node node) {
if (node instanceof LabeledText) {
return (LabeledText) node;
}
if (node instanceof Parent) {
Parent parent = (Parent) node;
ObservableList<Node> list = parent.getChildrenUnmodifiable();
LabeledText temp = null;
for (Node n : list) {
temp = searchLabeledText(n);
if (temp != null) {
return temp;
}
}
}
return null;
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:19,代码来源:LabeledsBase.java
示例9: layoutChildren
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
@Override
protected void layoutChildren(final double x, final double y, final double w, final double h)
{
if(this.invalid)
{
if(((JFXButton)this.getSkinnable()).getRipplerFill() == null)
{
for(int i = this.getChildren().size() - 1; i >= 1; i--)
if(this.getChildren().get(i) instanceof LabeledText)
{
this.buttonRippler.setRipplerFill(((LabeledText)this.getChildren().get(i)).getFill());
((LabeledText)this.getChildren().get(i)).fillProperty().addListener((o, oldVal, newVal) -> this.buttonRippler.setRipplerFill(newVal));
break;
}
else if(this.getChildren().get(i) instanceof Label)
{
this.buttonRippler.setRipplerFill(((Label)this.getChildren().get(i)).getTextFill());
((Label)this.getChildren().get(i)).textFillProperty().addListener((o, oldVal, newVal) -> this.buttonRippler.setRipplerFill(newVal));
break;
}
}
else
this.buttonRippler.setRipplerFill(((JFXButton)this.getSkinnable()).getRipplerFill());
this.invalid = false;
}
double shift = 1;
this.buttonContainer.resizeRelocate(this.getSkinnable().getLayoutBounds().getMinX() - shift, this.getSkinnable().getLayoutBounds().getMinY() - shift, this.getSkinnable().getWidth() + 2 * shift, this.getSkinnable().getHeight() + 2 * shift);
this.layoutLabelInArea(x, y, w, h);
}
开发者ID:Leviathan-Studio,项目名称:MineIDE-UI,代码行数:30,代码来源:MDRoundButtonSkin.java
示例10: checkValueChangingByShowing
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
protected void checkValueChangingByShowing(final String expectedValue, CellType cellType) {
if (!cellType.equals(CellType.CheckBox)) {
final int size = testedControl.as(Parent.class, Node.class).lookup(new LookupCriteria<Node>() {
public boolean check(Node cntrl) {
return (cntrl instanceof LabeledText)
&& ((LabeledText) cntrl).getText().equals(expectedValue)
&& cntrl.isVisible();
}
}).lookup().size();
assertEquals("Failed to lookup visible labeled with text [" + expectedValue + "]", size, 1, 0);
}
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:13,代码来源:CellsTestBase.java
示例11: checkRangeOfPageIndecesVisibility
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
protected void checkRangeOfPageIndecesVisibility(int expectedStart, int expectedEnd) {
checkNumberOfVisiblePageIndeces(expectedEnd - expectedStart + 1);
Wrap<? extends LabeledText>[] array = getSortedPageIndeces();
int len = array.length;
assertEquals(Integer.parseInt(array[0].getControl().getText()), expectedStart, 0);
assertEquals(Integer.parseInt(array[len - 1].getControl().getText()), expectedEnd, 0);
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:9,代码来源:TestBase.java
示例12: layoutChildren
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
@Override
protected void layoutChildren(final double x, final double y, final double w, final double h) {
if (invalid) {
if (((JFXButton) getSkinnable()).getRipplerFill() == null) {
// change rippler fill according to the last LabeledText/Label child
for (int i = getChildren().size() - 1; i >= 1; i--) {
if (getChildren().get(i) instanceof LabeledText) {
buttonRippler.setRipplerFill(((LabeledText) getChildren().get(i)).getFill());
((LabeledText) getChildren().get(i)).fillProperty()
.addListener((o, oldVal, newVal) -> buttonRippler.setRipplerFill(
newVal));
break;
} else if (getChildren().get(i) instanceof Label) {
buttonRippler.setRipplerFill(((Label) getChildren().get(i)).getTextFill());
((Label) getChildren().get(i)).textFillProperty()
.addListener((o, oldVal, newVal) -> buttonRippler.setRipplerFill(
newVal));
break;
}
}
} else {
buttonRippler.setRipplerFill(((JFXButton) getSkinnable()).getRipplerFill());
}
invalid = false;
}
buttonRippler.resizeRelocate(
getSkinnable().getLayoutBounds().getMinX(),
getSkinnable().getLayoutBounds().getMinY(),
getSkinnable().getWidth(), getSkinnable().getHeight());
layoutLabelInArea(x, y, w, h);
}
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:32,代码来源:JFXButtonSkin.java
示例13: RibbonGroupSkin
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
/**
* Constructor for all SkinBase instances.
*
* @param control The control for which this Skin should attach to.
*/
public RibbonGroupSkin(RibbonGroup control) {
super(control);
content = new HBox();
content.setMinHeight(CONTENT_HEIGHT);
content.setAlignment(Pos.CENTER);
content.setSpacing(DEFAULT_SPACING);
Separator separator = new Separator(Orientation.VERTICAL);
container = new HBox();
title = new LabeledText(control);
StackPane stackPane = new StackPane();
stackPane.getChildren().add(title);
title.textProperty().bind(control.titleProperty());
title.getStyleClass().setAll("title");
control.getNodes().addListener(new ListChangeListener<Node>() {
@Override
public void onChanged(Change<? extends Node> changed) {
buttonsChanged(changed);
}
});
updateAddedButtons(control.getNodes());
VBox vBox = new VBox();
vBox.getChildren().addAll(content, stackPane);
container.getChildren().addAll(vBox, separator);
getChildren().add(container);
content.getStyleClass().setAll("ribbon-group-content");
}
开发者ID:DJVUpp,项目名称:Desktop,代码行数:42,代码来源:RibbonGroupSkin.java
示例14: getTitleWrap
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
final public Wrap<? extends LabeledText> getTitleWrap() {
return controlAsParent.lookup(LabeledText.class, new ByStyleClass(LABELED_TEXT_STYLE_CLASS)).wrap();
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:4,代码来源:AxisDescriptionProvider.java
示例15: checkNumberOfVisiblePageIndeces
import com.sun.javafx.scene.control.skin.LabeledText; //导入依赖的package包/类
protected void checkNumberOfVisiblePageIndeces(int expectedIndeces) {
checkRightPageIndecesOrderAndContinuousOrder();
Wrap<? extends LabeledText>[] array = getSortedPageIndeces();
int len = array.length;
assertEquals(len, expectedIndeces, 0);
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:7,代码来源:TestBase.java
注:本文中的com.sun.javafx.scene.control.skin.LabeledText类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论