本文整理汇总了Java中javafx.scene.control.cell.CheckBoxTreeCell类的典型用法代码示例。如果您正苦于以下问题:Java CheckBoxTreeCell类的具体用法?Java CheckBoxTreeCell怎么用?Java CheckBoxTreeCell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CheckBoxTreeCell类属于javafx.scene.control.cell包,在下文中一共展示了CheckBoxTreeCell类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CheckBoxTreeViewSample
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
public CheckBoxTreeViewSample() {
final CheckBoxTreeItem<String> treeRoot = new CheckBoxTreeItem<String>("Root node");
treeRoot.getChildren().addAll(Arrays.asList(new CheckBoxTreeItem<String>("Child Node 1"),
new CheckBoxTreeItem<String>("Child Node 2"), new CheckBoxTreeItem<String>("Child Node 3")));
treeRoot.getChildren().get(2).getChildren()
.addAll(Arrays.asList(new CheckBoxTreeItem<String>("Child Node 4"), new CheckBoxTreeItem<String>("Child Node 5"),
new CheckBoxTreeItem<String>("Child Node 6"), new CheckBoxTreeItem<String>("Child Node 7"),
new TreeItem<String>("Child Node 8"), new CheckBoxTreeItem<String>("Child Node 9"),
new CheckBoxTreeItem<String>("Child Node 10"), new CheckBoxTreeItem<String>("Child Node 11"),
new CheckBoxTreeItem<String>("Child Node 12")));
final TreeView treeView = new TreeView();
treeView.setCellFactory(CheckBoxTreeCell.forTreeView());
treeView.setShowRoot(true);
treeView.setRoot(treeRoot);
treeRoot.setExpanded(true);
getChildren().add(treeView);
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:21,代码来源:CheckBoxTreeViewSample.java
示例2: _getValue
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
@Override public String _getValue() {
@SuppressWarnings("rawtypes")
CheckBoxTreeCell cell = (CheckBoxTreeCell) node;
@SuppressWarnings("unchecked")
ObservableValue<Boolean> call = (ObservableValue<Boolean>) cell.getSelectedStateCallback().call(cell.getTreeItem());
String cbText;
if (call != null) {
int selection = call.getValue() ? 2 : 0;
cbText = JavaFXCheckBoxElement.states[selection];
} else {
Node cb = cell.getGraphic();
RFXComponent comp = getFinder().findRawRComponent(cb, null, null);
cbText = comp._getValue();
}
return cbText;
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:RFXCheckBoxTreeCell.java
示例3: initialize
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
public void initialize(){
//Generate List of teams from db
genTeamList();
//Generate table options
genTreeItems();
//Settings for gear graph
gpmGraphX.setAutoRanging(false);
gpmGraphX.setLowerBound(1.0);
gpmGraphX.setTickUnit(1.0);
gpmGraphY.setAutoRanging(true);
//Settings for ball graph
bpmGraphX.setAutoRanging(false);
bpmGraphX.setLowerBound(1.0);
bpmGraphX.setTickUnit(1.0);
bpmGraphY.setAutoRanging(true);
//Set format for table options
tableOptionsTreeView.setCellFactory(CheckBoxTreeCell.<String>forTreeView());
}
开发者ID:X-Cats,项目名称:Scout2017,代码行数:24,代码来源:ScoutAnalyzerController.java
示例4: CheckBoxFxControlsTreeItem
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
public CheckBoxFxControlsTreeItem(CheckTreeView<Node> tv) {
this.tv = tv;
tv.setCellFactory(param -> {
CheckBoxTreeCell<Node> treeCell = new CheckBoxTreeCell<Node>();
treeCell.setConverter(new StringConverter<TreeItem<Node>>() {
@Override
public String toString(TreeItem<Node> n) {
return getName(n.getValue());
}
@Override
public TreeItem<Node> fromString(String string) {
// TODO Auto-generated method stub
return null;
}
});
return treeCell;
});
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:23,代码来源:CheckBoxFxControlsTreeItem.java
示例5: getTreeCellFactory
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
/**
* @return the cell from CheckBoxTreeCell's implementation of a TreeView factory, with
* an added context menu for the given RepoFile
*/
@Override
protected Callback<TreeView<RepoFile>, TreeCell<RepoFile>> getTreeCellFactory() {
return arg -> {
TreeCell<RepoFile> cell = CheckBoxTreeCell.<RepoFile>forTreeView().call(arg);
cell.setOnContextMenuRequested(event -> {
if(cell.getTreeItem()!= null) cell.getTreeItem().getValue().showContextMenu(cell, event.getScreenX(), event.getScreenY());
});
return cell;
};
}
开发者ID:dmusican,项目名称:Elegit,代码行数:15,代码来源:WorkingTreePanelView.java
示例6: reset
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
public static void reset() {
add(Node.class, JavaFXElement.class);
add(TextInputControl.class, JavaFXTextInputControlElement.class);
add(HTMLEditor.class, JavaFXHTMLEditor.class);
add(CheckBox.class, JavaFXCheckBoxElement.class);
add(ToggleButton.class, JavaFXToggleButtonElement.class);
add(Slider.class, JavaFXSliderElement.class);
add(Spinner.class, JavaFXSpinnerElement.class);
add(SplitPane.class, JavaFXSplitPaneElement.class);
add(ProgressBar.class, JavaFXProgressBarElement.class);
add(ChoiceBox.class, JavaFXChoiceBoxElement.class);
add(ColorPicker.class, JavaFXColorPickerElement.class);
add(ComboBox.class, JavaFXComboBoxElement.class);
add(DatePicker.class, JavaFXDatePickerElement.class);
add(TabPane.class, JavaFXTabPaneElement.class);
add(ListView.class, JavaFXListViewElement.class);
add(TreeView.class, JavaFXTreeViewElement.class);
add(TableView.class, JavaFXTableViewElement.class);
add(TreeTableView.class, JavaFXTreeTableViewElement.class);
add(CheckBoxListCell.class, JavaFXCheckBoxListCellElement.class);
add(ChoiceBoxListCell.class, JavaFXChoiceBoxListCellElement.class);
add(ComboBoxListCell.class, JavaFXComboBoxListCellElemnt.class);
add(CheckBoxTreeCell.class, JavaFXCheckBoxTreeCellElement.class);
add(ChoiceBoxTreeCell.class, JavaFXChoiceBoxTreeCellElement.class);
add(ComboBoxTreeCell.class, JavaFXComboBoxTreeCellElement.class);
add(TableCell.class, JavaFXTableViewCellElement.class);
add(CheckBoxTableCell.class, JavaFXCheckBoxTableCellElement.class);
add(ChoiceBoxTableCell.class, JavaFXChoiceBoxTableCellElement.class);
add(ComboBoxTableCell.class, JavaFXComboBoxTableCellElemnt.class);
add(TreeTableCell.class, JavaFXTreeTableCellElement.class);
add(CheckBoxTreeTableCell.class, JavaFXCheckBoxTreeTableCell.class);
add(ChoiceBoxTreeTableCell.class, JavaFXChoiceBoxTreeTableCell.class);
add(ComboBoxTreeTableCell.class, JavaFXComboBoxTreeTableCell.class);
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:35,代码来源:JavaFXElementFactory.java
示例7: _getValue
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
@Override public String _getValue() {
@SuppressWarnings("rawtypes")
CheckBoxTreeCell cell = (CheckBoxTreeCell) getComponent();
@SuppressWarnings("unchecked")
ObservableValue<Boolean> call = (ObservableValue<Boolean>) cell.getSelectedStateCallback().call(cell.getTreeItem());
int selection = call.getValue() ? 2 : 0;
String cellText = cell.getText();
if (cellText == null) {
cellText = "";
}
String text = cellText + ":" + JavaFXCheckBoxElement.states[selection];
return text;
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:14,代码来源:JavaFXCheckBoxTreeCellElement.java
示例8: TreeViewSample
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
public TreeViewSample() {
String dir = "./src";
final CheckBoxTreeItem<File> treeRoot = buildRoot(dir);
treeView = new TreeView<File>();
treeView.setCellFactory(CheckBoxTreeCell.<File> forTreeView());
treeView.setShowRoot(true);
treeView.setRoot(treeRoot);
treeRoot.setExpanded(true);
getChildren().add(treeView);
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:13,代码来源:TreeViewSample.java
示例9: generateTreeViewStructure
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
/**
* <h1>Initializes the TreeView FXML element.</h1>
* The TreeView is divided into CheckBoxTreeItems as representation of samples
* and TreeItems as representation of Taxa and information concerning those Taxa
* @param treeViewFiles
*/
private static void generateTreeViewStructure(TreeView<String> treeViewFiles) {
treeViewFiles.setRoot(new TreeItem<>("root"));
//The classic treeview only has one root item, but you can work around this by just setting it to invisible
treeViewFiles.setShowRoot(false);
treeViewFiles.setCellFactory(new Callback<TreeView<String>, TreeCell<String>>() {
@Override
public TreeCell<String> call(TreeView<String> param) {
return new CheckBoxTreeCell<String>() {
@Override
public void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
//If there is no information for the Cell, make it empty
if (empty) {
setGraphic(null);
setText(null);
//Otherwise if it's not representation as an item of the tree
//is not a CheckBoxTreeItem, remove the checkbox item
} else if (!(getTreeItem() instanceof CheckBoxTreeItem)) {
setGraphic(null);
//If the TreeItem is a CheckBoxItem (that is the case for every TreeItem representing a sample)
//add the function that the user is able to delete the entire TreeItem with all its children
} else if (getTreeItem() instanceof CheckBoxTreeItem) {
MenuItem removeSample = new MenuItem("remove");
removeSample.setOnAction(event -> {
int indexOfTreeItem = treeViewFiles.getRoot().getChildren().indexOf(getTreeItem());
removeSampleFromDatabase(getTreeItem().getValue(), treeViewFiles, indexOfTreeItem);
});
setContextMenu(new ContextMenu(removeSample));
}
}
};
}
});
}
开发者ID:jmueller95,项目名称:CORNETTO,代码行数:41,代码来源:LoadedData.java
示例10: CheckBoxTreeItemScene
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
public CheckBoxTreeItemScene() {
super(new HBox(), 800, 400);
final HBox box = (HBox) getRoot();
VBox subbox = new VBox();
treeView.setEditable(true);
treeView.setId(TREE_VIEW_ID);
treeView.setCellFactory(CheckBoxTreeCell.<String>forTreeView());
Button resetButton = new Button("Reset");
resetButton.setId(RESET_SCENE_BTN_ID);
resetButton.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent t) {
reset();
}
});
subbox.getChildren().add(treeView);
subbox.getChildren().add(resetButton);
box.getChildren().add(subbox);
reset();
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:28,代码来源:CheckBoxTreeApp.java
示例11: testGetTreeCheckBoxCellAdjuster
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
@Test
public void testGetTreeCheckBoxCellAdjuster() {
Adjuster adjuster = Adjuster.getAdjuster(CheckBoxTreeCell.class);
assertThat(adjuster, is(instanceOf(ControlAdjuster.class)));
assertThat(adjuster.getNodeClass(), is(sameInstance(Control.class)));
}
开发者ID:yumix,项目名称:javafx-dpi-scaling,代码行数:8,代码来源:AdjusterTest.java
示例12: initialize
import javafx.scene.control.cell.CheckBoxTreeCell; //导入依赖的package包/类
/**
* Initializer for OutputController. Call constructor before initializing.
* Initializes elements and loads settings.
* @param url not in use
* @param rb the given resource bundle
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
this.rb=rb;
//type.getItems().addAll("ODBC","MySQL","PostgreSQL");
for(DriverType driver : DriverType.values()) {
type.getItems().add(driver.toString());
}
CheckBoxTreeItem<String> rootItem = new CheckBoxTreeItem<>(rb.getString("key.alloutputs"));
rootItem.setExpanded(true);
outputselection.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
outputselection.setCellFactory(CheckBoxTreeCell.<String>forTreeView());
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.base")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.carboncountry")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.carbonsoil")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.fellingmatrix")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.fellingresidues")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.naturalmortality")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.thinningmatrix")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.thinningresidues")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.treecarbon")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.generalregions")));
rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.generalspecies")));
rootItem.selectedProperty().set(true);
outputselection.setRoot(rootItem);
CheckBoxTreeItem<String> rootItem2 = new CheckBoxTreeItem<>(rb.getString("key.alloutputs"));
rootItem2.setExpanded(true);
databaseTree.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
databaseTree.setCellFactory(CheckBoxTreeCell.<String>forTreeView());
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.base")));
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.carboncountry")));
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.carbonsoil")));
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.deadwood")));
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.fellingmatrix")));
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.fellingresidues")));
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.naturalmortality")));
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.thinningmatrix")));
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.thinningresidues")));
rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.treecarbon")));
rootItem2.selectedProperty().set(true);
databaseTree.setRoot(rootItem2);
rootItem.selectedProperty().set(true);
update();
chooser = new DirectoryChooser();
chooser.setTitle(rb.getString("key.outputpath"));
}
开发者ID:EuropeanForestInstitute,项目名称:efiscen,代码行数:54,代码来源:OutputController.java
注:本文中的javafx.scene.control.cell.CheckBoxTreeCell类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论