本文整理汇总了Java中javafx.scene.control.IndexedCell类的典型用法代码示例。如果您正苦于以下问题:Java IndexedCell类的具体用法?Java IndexedCell怎么用?Java IndexedCell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IndexedCell类属于javafx.scene.control包,在下文中一共展示了IndexedCell类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: scrollToVisible
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
public void scrollToVisible(int index) {
VirtualFlow<?> flow = (VirtualFlow<?>) lookup(".virtual-flow");
IndexedCell firstCell = flow.getFirstVisibleCell();
if (firstCell == null)
return;
int first = firstCell.getIndex();
int last = flow.getLastVisibleCell().getIndex();
if (index <= first) {
while (index <= first && flow.adjustPixels((index - first) - 1) < 0) {
first = flow.getFirstVisibleCell().getIndex();
}
} else {
while (index >= last && flow.adjustPixels((index - last) + 1) > 0) {
last = flow.getLastVisibleCell().getIndex();
}
}
}
开发者ID:Yeregorix,项目名称:EpiStats,代码行数:18,代码来源:RankingView.java
示例2: getIndexedCellWrap
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
protected Wrap<? extends IndexedCell> getIndexedCellWrap(final String text) {
final String styleClass = isTreeTests ? "tree-cell" : "tree-table-cell";
Lookup<IndexedCell> lookup = testedControl.as(Parent.class, IndexedCell.class)
.lookup(IndexedCell.class, new LookupCriteria<IndexedCell>() {
public boolean check(IndexedCell cell) {
return text.equals(cell.getText()) && cell.getStyleClass().contains(styleClass);
}
});
final int size = lookup.size();
testedControl.waitState(new State<Boolean>() {
public Boolean reached() {
if (1 == size) {
return Boolean.TRUE;
} else {
return null;
}
}
});
return lookup.wrap();
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:26,代码来源:TestBase.java
示例3: check
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
@Override
public boolean check(IndexedCell control) {
if (control.isVisible() && control.getOpacity() == 1.0) {
if (isTreeViewTests) {
if (control instanceof TreeCell) {
if ((((TreeCell) control).getTreeItem() != null) && ((TreeCell) control).getTreeItem().equals(item)) {
return true;
}
}
} else {
if (control instanceof TreeTableCell) {
if ((((TreeTableCell) control).getTreeTableRow().getTreeItem() != null) && ((TreeTableCell) control).getTreeTableRow().getTreeItem().equals(item)) {
return true;
}
}
}
}
return false;
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:20,代码来源:TreeViewTest.java
示例4: setFirstVisibleId
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
/**
* Shifts the list view on display to start with the indicated index.
*/
private void setFirstVisibleId() {
ListViewSkin<?> listViewSkin = (ListViewSkin<?>) getCurrentListView().getSkin();
VirtualFlow<?> virtualFlow = (VirtualFlow<?>) listViewSkin.getChildren().get(0);
IndexedCell<?> firstVisibleCell = virtualFlow.getFirstVisibleCellWithinViewPort();
if (firstVisibleCell != null) {
firstVisibleId = firstVisibleCell.getIndex();
}
}
开发者ID:cs2103jan2016-w13-4j,项目名称:main,代码行数:12,代码来源:MainController.java
示例5: getDisclosureNode
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
protected Wrap getDisclosureNode(final Wrap<? extends IndexedCell> cellWrap) {
final IndexedCell cell = cellWrap.getControl();
final String arrowStyle = "tree-disclosure-node";
if (TreeCell.class.isAssignableFrom(cell.getClass())) {
return cellWrap.as(Parent.class, Node.class).lookup(new ByStyleClass(arrowStyle)).wrap();
} else if (TreeTableCell.class.isAssignableFrom(cell.getClass())) {
final NodeWrap<IndexedCell> nodeWrap = new NodeWrap(cellWrap.getEnvironment(), cellWrap.getControl().getParent());
Parent cellAsParent = nodeWrap.as(Parent.class, IndexedCell.class);
return cellAsParent.lookup(new ByStyleClass(arrowStyle)).wrap();
} else {
throw new IllegalStateException();
}
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:16,代码来源:TestBase.java
示例6: checkSortResult
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
boolean checkSortResult(String[][] testData) {
Boolean state = Boolean.TRUE;
for (int j = 0; j < testData[0].length; j++) {
final int fj = j;
for (int i = 0; i < testData.length; i++) {
final int fi = i;
final Wrap<? extends IndexedCell> cellWrap = getCellWrap(j, i);
final String expected = testData[i][j];
state = cellWrap.waitState(new State<Boolean>() {
public Boolean reached() {
String actual = cellWrap.getControl().getText();
if (!expected.equals(actual)) {
System.out.println("i = " + fi + " j = " + fj);
System.out.println(String.format("exp|act:%s|%s", expected, actual));
}
return expected.equals(actual) ? Boolean.TRUE : Boolean.FALSE;
}
});
}
if (Boolean.FALSE == state) {
System.out.println(String.format("Column %d ended.", j));
}
}
return state.booleanValue();
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:29,代码来源:TableViewNewTest.java
示例7: testDeselectionNearLeftBoundary
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
/**
* Deselects selected cell with SHIFT + LEFT and then pushes this
* combination once more to check that selection remains.
*/
@Smoke
@Test(timeout = 300000)
public void testDeselectionNearLeftBoundary() {
enableMultipleCellSelection();
scrollTo(0, 0);
KeyboardModifiers ctrl = CTRL_DOWN_MASK_OS;
Wrap<? extends IndexedCell> cellWrap = getCellWrap(0, 0);
cellWrap.mouse().click(1, cellWrap.getClickPoint(), Mouse.MouseButtons.BUTTON1, ctrl);
selectionHelper.click(0, 0);
checkSelection();
KeyboardButtons btn = KeyboardButtons.LEFT;
KeyboardModifiers shift = KeyboardModifiers.SHIFT_DOWN_MASK;
for (int i = 0; i < 1; i++) {
tableViewWrap.keyboard().pushKey(btn, shift);
selectionHelper.push(btn, shift);
}
checkSelection();
//Select the entire row
btn = KeyboardButtons.RIGHT;
for (int i = 0; i < DATA_FIELDS_NUM; i++) {
tableViewWrap.keyboard().pushKey(btn, shift);
selectionHelper.push(btn, shift);
}
checkSelection();
//Apply combo once more to ensure that it doesn't affect selection
tableViewWrap.keyboard().pushKey(btn, shift);
selectionHelper.push(btn, shift);
checkSelection();
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:40,代码来源:TableViewMultipleCellSelectionTest.java
示例8: getCellWrap
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
public static Wrap<? extends TableCell> getCellWrap(Wrap<? extends Control> testedControl, final int column, final int row) {
scrollTo(testedControl, column, row);
Lookup lookup = testedControl.as(Parent.class, Node.class).lookup(IndexedCell.class, new TableViewTest.ByPosition(column, row));
if (lookup.size() == 0) { // TODO: what's that?!!
scrollTo(testedControl, column, row);
lookup.size();
}
return lookup.wrap();
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:10,代码来源:TestBaseCommon.java
示例9: getRootAsWrap
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
private Wrap<? extends Node> getRootAsWrap(final String rootText) {
return parent.lookup(IndexedCell.class, new LookupCriteria<IndexedCell>() {
public boolean check(IndexedCell cell) {
// System.out.println("rootText = " + rootText);
// System.out.println("cell.getText() = " + cell.getText());
// System.out.println("cell.getStyleClass() = " + cell.getStyleClass());
// System.out.println("cell.getStyleClass().contains(TREE_TABLE_ROW_CELL) = " + cell.getStyleClass().contains(TREE_TABLE_CELL));
return rootText.equals(cell.getText()) && cell.getStyleClass().contains(TREE_TABLE_CELL);
}
}).wrap();
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:12,代码来源:TreeTableAsNewTableTest.java
示例10: shown
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
/**
* Identifies which elements are shown in the TableView currently.
*
* @return {minColumn, minRow, maxColumn, maxRow} of cells that are fully
* visible in the list.
*/
public static <CellClass extends IndexedCell> int[] shown(
Environment env,
final Wrap<? extends Control> wrap,
final Function<CellClass, Point> infoProvider,
final Class<CellClass> cellType) {
final Rectangle actuallyVisibleArea = getActuallyVisibleArea(wrap);
return shown(env, wrap, infoProvider, cellType, actuallyVisibleArea);
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:17,代码来源:TableUtils.java
示例11: constructClickableArea
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
/**
* Special for TableView, and TreeTableView, as the last column contains
* empty not clickable space.
*/
private static Rectangle constructClickableArea(Wrap<?> wrap) {
Rectangle rec = null;
final Lookup lookup = wrap.as(Parent.class, Node.class).lookup(IndexedCell.class);
for (int i = 0; i < lookup.size(); i++) {
Wrap cell = lookup.wrap(i);
if (rec == null) {
rec = cell.getScreenBounds();
} else {
rec = rec.union(cell.getScreenBounds());
}
}
return rec;
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:18,代码来源:TableUtils.java
示例12: applyTableRowColorization
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
public static <T> void applyTableRowColorization(final IndexedCell<T> tableRow) {
if(tableRow.getIndex() % 2 != 0 && ApplicationPreferences.getProperty(
GuiProperties.ALTERNATE_LIST_ROW_COLOR, false)) {
tableRow.getStyleClass().removeAll(CssProperties.ALTERNATE_LIST_ROW_EVEN);
tableRow.getStyleClass().add(CssProperties.ALTERNATE_LIST_ROW_ODD);
}
else {
tableRow.getStyleClass().removeAll(CssProperties.ALTERNATE_LIST_ROW_ODD);
tableRow.getStyleClass().add(CssProperties.ALTERNATE_LIST_ROW_EVEN);
}
}
开发者ID:veroslav,项目名称:jfx-torrent,代码行数:12,代码来源:TableUtils.java
示例13: testGetIndexedCellAdjuster
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
@Test
public void testGetIndexedCellAdjuster() {
Adjuster adjuster = Adjuster.getAdjuster(IndexedCell.class);
assertThat(adjuster, is(instanceOf(ControlAdjuster.class)));
assertThat(adjuster.getNodeClass(), is(sameInstance(Control.class)));
}
开发者ID:yumix,项目名称:javafx-dpi-scaling,代码行数:8,代码来源:AdjusterTest.java
示例14: createTotalContentHeightProperty
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
private static ReadOnlyDoubleProperty createTotalContentHeightProperty(ListView<?> listView) {
return new ReadOnlyDoublePropertyBase() {
@SuppressWarnings({ "rawtypes" })
@Override
public double get() {
VirtualFlow flow = (VirtualFlow) listView.lookup(".virtual-flow");
int nrOfItems = listView.getItems().size();
if (nrOfItems == 0) {
return 0;
}
IndexedCell cell = flow.getCell(0);
// assuming all cells have same size
double cellHeight = cell.getBoundsInLocal().getHeight();
double totalContentHeight = cellHeight * nrOfItems;
return totalContentHeight;
}
@Override
public String getName() {
return null;
}
@Override
public Object getBean() {
return null;
}
};
}
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:30,代码来源:RfxVerticalFlingScroller.java
示例15: fetchVisibleCellRange
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
/**
* Gets the visible cell range in this GridView viewport
* @return
*/
private IndexRange fetchVisibleCellRange(){
IndexRange outRange = null;
try {
final VirtualFlow vf = getVirtualFlow();
if(vf != null){
final IndexedCell firstVisibleRow = vf.getFirstVisibleCell();
final IndexedCell lastVisibleRow = vf.getLastVisibleCell();
if(firstVisibleRow != null && lastVisibleRow != null){
final ObservableList<Node> firsts = firstVisibleRow.getChildrenUnmodifiable();
final GridCell firstVisibleCell = firsts.size() > 0 ? (GridCell)firsts.get(0) : null;
final ObservableList<Node> lasts = lastVisibleRow.getChildrenUnmodifiable();
final GridCell lastVisibleCell = lasts.size() > 0 ? (GridCell)lasts.get(lasts.size()-1) : null;
outRange = new IndexRange(
firstVisibleCell != null ? firstVisibleCell.getIndex() : 0,
lastVisibleCell != null ? lastVisibleCell.getIndex() : 0);
}
}
} catch (IllegalArgumentException e) {
logger.error(e);
}
if(outRange == null){
outRange = IndexRange.Undefined;
}
return outRange;
}
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:37,代码来源:GridViewViewPort.java
示例16: createVirtualFlow
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
@Override
protected CVirtualFlow createVirtualFlow() {
CVirtualFlow<IndexedCell> cVirtualFlow = new CVirtualFlow<>();
cVirtualFlow.init((CTableView<?>) getSkinnable());
return cVirtualFlow;
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:7,代码来源:CTableViewSkin.java
示例17: branchExpandedAndCollapsedTest
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
@Test(timeout = 600000)
@Smoke
/*
* This test create a tree : Root -> item1 -> item2 and apply
* collapsing/expanding operations over it. And observe, how
* expanding/collapsing events are called for all treeItems, participating
* in a tree.
* When visible items are collapsed or expanded then mouse clicking is used
* to test that one mouse click on disclosure node or double click on the node do the job.
*/
public void branchExpandedAndCollapsedTest() throws InterruptedException {
final String ITEM_NAME = "item1";
if (!isTreeTests) {
switchToPropertiesTab(TREE_DATA_COLUMN_NAME);
setPropertyBySlider(SettingType.SETTER, Properties.prefWidth, 150);
}
addElement(ITEM_NAME, ROOT_NAME, 0, true);
addElement("item2", ITEM_NAME, 0, true);
checkExpandedCollapsedCounters(0, 0, 0, 0, 0, 0);
switchToPropertiesTab(ITEM_NAME);
setPropertyByToggleClick(SettingType.SETTER, Properties.expanded, true);
checkExpandedCollapsedCounters(1, 1, 0, 0, 0, 0);
//Expand the root by single click
final Wrap<? extends IndexedCell> wrap = parent.lookup(IndexedCell.class,
new LookupCriteria<IndexedCell>() {
public boolean check(IndexedCell cell) {
if (ROOT_NAME.equals(cell.getText())
&& cell.getStyleClass().contains("tree-cell")) {
return true;
}
if (cell.getStyleClass().contains("tree-table-row-cell")) {
Set<Node> set = cell.lookupAll(".text");
for (Node node : set) {
if (node instanceof Text) {
final String text = ((Text) node).getText();
if (text != null && text.equals(ROOT_NAME)) {
return true;
}
}
}
}
return false;
}
}).wrap();
wrap.as(Parent.class, Node.class).lookup(new ByStyleClass("tree-disclosure-node")).wrap().mouse().click();
checkExpandedCollapsedCounters(2, 1, 0, 0, 0, 0);
//Collapse the item by double ckick
getCellWrap(ITEM_NAME).mouse().click(2);
checkExpandedCollapsedCounters(2, 1, 0, 1, 1, 0);
switchToPropertiesTab(ROOT_NAME);
setPropertyByToggleClick(SettingType.SETTER, Properties.expanded, false);
checkExpandedCollapsedCounters(2, 1, 0, 2, 1, 0);
switchToPropertiesTab(ROOT_NAME);
setPropertyByToggleClick(SettingType.BIDIRECTIONAL, Properties.expanded, true);
checkExpandedCollapsedCounters(3, 1, 0, 2, 1, 0);
switchToPropertiesTab(ITEM_NAME);
setPropertyByToggleClick(SettingType.BIDIRECTIONAL, Properties.expanded, true);
checkExpandedCollapsedCounters(4, 2, 0, 2, 1, 0);
switchToPropertiesTab(ROOT_NAME);
setPropertyByToggleClick(SettingType.UNIDIRECTIONAL, Properties.expanded, false);
checkExpandedCollapsedCounters(4, 2, 0, 3, 1, 0);
switchToPropertiesTab(ITEM_NAME);
setPropertyByToggleClick(SettingType.UNIDIRECTIONAL, Properties.expanded, false);
checkExpandedCollapsedCounters(4, 2, 0, 4, 2, 0);
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:77,代码来源:TreeViewTest.java
示例18: childrenModificationImmediateRenderingTest
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
/**
* Check that the control is rendered properly when tree item children are
* modified.
*/
@Test
public void childrenModificationImmediateRenderingTest() {
if (!isTreeTests) {
switchToPropertiesTab(TREE_DATA_COLUMN_NAME);
try {
setPropertyBySlider(SettingType.SETTER, Properties.prefWidth, 90);
} catch (InterruptedException ex) {
Logger.getLogger(TreeViewTest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
}
final String PARENT_NAME = "parent";
final LookupCriteria<IndexedCell> lookupCriterion = new LookupCriteria<IndexedCell>() {
public boolean check(IndexedCell cell) {
return (cell.getStyleClass().contains("tree-table-cell") || cell.getStyleClass().contains("tree-cell"))
&& null != cell.getText()
&& cell.getText().length() > 4
&& "item".equals(cell.getText().substring(0, 4));
}
};
final State<Integer> state = new State<Integer>() {
public Integer reached() {
return Integer.valueOf(parent.lookup(IndexedCell.class, lookupCriterion).size());
}
@Override
public String toString() {
return "[Expected number of cells]";
}
};
addElement(PARENT_NAME, ROOT_NAME, 0, true);
switchToPropertiesTab(ROOT_NAME);
setPropertyByToggleClick(SettingType.SETTER, Properties.expanded, true);
switchToPropertiesTab(PARENT_NAME);
setPropertyByToggleClick(SettingType.SETTER, Properties.expanded, true);
addElement("item0", PARENT_NAME, 0);
addElement("item1", PARENT_NAME, 1);
testedControl.waitState(state, Integer.valueOf(2));
addElement("item2", PARENT_NAME, 2);
testedControl.waitState(state, Integer.valueOf(3));
removeItem("item0");
removeItem("item1");
testedControl.waitState(state, Integer.valueOf(1));
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:54,代码来源:TreeViewTest.java
示例19: getCellWrap
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
protected Wrap<? extends IndexedCell> getCellWrap(final int column, final int row) {
return TestBaseCommon.getCellWrap(testedControl, column, row);
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:4,代码来源:TestBase.java
示例20: checkVerticalScrollBar
import javafx.scene.control.IndexedCell; //导入依赖的package包/类
@Smoke
@Test(timeout = 300000)
public void checkVerticalScrollBar() {
final Lookup<TreeItem> lookup = expandAll();
tree.waitState(new State() {
public Object reached() {
int cellSize = treeAsNodeParent.lookup(cellClass).wrap(treeAsNodeParent.lookup(cellClass).size() / 2).getScreenBounds().height;
int listSize = tree.getScreenBounds().height;
int enoghToHaveScroll = (int) Math.ceil(listSize / cellSize);
MultipleSelectionHelper localSelectionHelper = new MultipleSelectionHelper(getRoot());
int currentItemsCount = localSelectionHelper.getList().size();
if (enoghToHaveScroll < currentItemsCount) {
return Boolean.TRUE;
} else {
return null;
}
}
});
Scroll scroll = treeAsNodeParent.lookup(ScrollBar.class, new ScrollBarWrap.ByOrientationScrollBar(true)).as(Scroll.class);
scroll.to(scroll.maximum());
tree.waitState(new State() {
public Object reached() {
TreeItem lastItem = lookup.get(lookup.size() - 1);
Wrap lastItemWrap = treeAsNodeParent.lookup(IndexedCell.class, new TreeItemByObjectLookup<Object>(lastItem)).wrap();
if (tree.getScreenBounds().intersects(lastItemWrap.getScreenBounds())) {
return true;
} else {
return null;
}
}
});
scroll.to(scroll.minimum());
tree.waitState(new State() {
public Object reached() {
TreeItem firstItem = lookup.get(0);
Wrap firstItemWrap = treeAsNodeParent.lookup(IndexedCell.class, new TreeItemByObjectLookup<Object>(firstItem)).wrap();
if (tree.getScreenBounds().intersects(firstItemWrap.getScreenBounds())) {
return true;
} else {
return null;
}
}
});
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:45,代码来源:TreeViewTest.java
注:本文中的javafx.scene.control.IndexedCell类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论