本文整理汇总了Java中javafx.scene.control.TitledPane类的典型用法代码示例。如果您正苦于以下问题:Java TitledPane类的具体用法?Java TitledPane怎么用?Java TitledPane使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TitledPane类属于javafx.scene.control包,在下文中一共展示了TitledPane类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getText
import javafx.scene.control.TitledPane; //导入依赖的package包/类
@Test public void getText() {
TitledPane titledPane = (TitledPane) getPrimaryStage().getScene().getRoot().lookup(".titled-pane");
LoggingRecorder lr = new LoggingRecorder();
List<String> text = new ArrayList<>();
Platform.runLater(() -> {
RFXTitledPane rfxTitledPane = new RFXTitledPane(titledPane, null, null, lr);
titledPane.setExpanded(true);
rfxTitledPane.mouseButton1Pressed(null);
text.add(rfxTitledPane.getAttribute("text"));
});
new Wait("Waiting for titled pane text.") {
@Override public boolean until() {
return text.size() > 0;
}
};
AssertJUnit.assertEquals("Node 1", text.get(0));
}
示例2: initView
import javafx.scene.control.TitledPane; //导入依赖的package包/类
@Override
protected void initView () {
myAccordion = getMyUIFactory().makeAccordion(300);
for (IDefinitionCollection<SpriteDefinition> def : mySprites) {
MultiChoiceEntryView<SpriteDefinition> myView =
new MultiChoiceEntryView<>(getMyLabels().getString(def.getTitleKey()),
def.getItems(), 300, 400,
AuthoringView.DEFAULT_ENTRYVIEW);
myView.getListView()
.setCellFactory(c -> new DraggableAddCell<SpriteDefinition>(mySelected
.getListView()));
myViews.add(myView);
TitledPane tp =
new TitledPane(getMyLabels().getString(def.getTitleKey()),
myView.getListView());
myAccordion.getPanes().add(tp);
}
mySelected.getListView()
.setCellFactory(c -> new DraggableRemoveCell<SpriteDefinition>(myAccordion));
mySelected.getListView().setPlaceholder(new Label("Drag Sprites Here"));
myContainer = getMyUIFactory().makeHBox(10, Pos.CENTER, myAccordion, mySelected.draw());
}
示例3: init
import javafx.scene.control.TitledPane; //导入依赖的package包/类
@Override
public void init(SensorThingsService service, FeatureOfInterest entity, GridPane gridProperties, Accordion accordionLinks, Label labelId, boolean editable) {
this.labelId = labelId;
this.entity = entity;
int i = 0;
textName = addFieldTo(gridProperties, i, "Name", new TextField(), false, editable);
textDescription = addFieldTo(gridProperties, ++i, "Description", new TextArea(), true, editable);
textEncodingType = addFieldTo(gridProperties, ++i, "EncodingType", new TextField(), false, editable);
textFeature = addFieldTo(gridProperties, ++i, "Feature", new TextArea(), false, editable);
if (accordionLinks != null) {
try {
TitledPane tp = new TitledPane("Observations", createCollectionPaneFor(entity.observations().query()));
accordionLinks.getPanes().add(tp);
} catch (NullPointerException e) {
// Happens when entity is new.
}
}
}
示例4: bind
import javafx.scene.control.TitledPane; //导入依赖的package包/类
public void bind(final Accordion accordion, final String propertyName) {
Object selectedPane = props.getProperty(propertyName);
for (TitledPane tp : accordion.getPanes()) {
if (tp.getText() != null && tp.getText().equals(selectedPane)) {
accordion.setExpandedPane(tp);
break;
}
}
accordion.expandedPaneProperty().addListener(new ChangeListener<TitledPane>() {
@Override
public void changed(ObservableValue<? extends TitledPane> ov, TitledPane t, TitledPane expandedPane) {
if (expandedPane != null) {
props.setProperty(propertyName, expandedPane.getText());
}
}
});
}
示例5: initialize
import javafx.scene.control.TitledPane; //导入依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
// TODO Auto-generated method stub
this.btnValider.disableProperty().bind(canCreate);
current_step = collapse_step1;
collapse_step1.getContent().requestFocus();
accordion.expandedPaneProperty().addListener(
(ObservableValue<? extends TitledPane> ov, TitledPane old_val,
TitledPane new_val) -> {
if (new_val != null) {
current_step = new_val;
String id = new_val.getId();
if(id.equals("collapse_step1")){
nomEntretien.requestFocus();
}else if(id.equals("collapse_step2")){
participantEntretien.requestFocus();
}else if(id.equals("collapse_step3")){
dateEntretien.requestFocus();
}else if(id.equals("collapse_step4")){
}else if(id.equals("collapse_step5")){
}
}
});
}
示例6: createAddItemPane
import javafx.scene.control.TitledPane; //导入依赖的package包/类
private Node createAddItemPane() {
HBox box = new HBox(6);
TextField firstname = new TextField();
firstname.setPromptText("Enter first name ...");
TextField lastname = new TextField();
lastname.setPromptText("Enter last name ...");
Button addBtn = new Button("Add new actor to \"Folder 1\"");
addBtn.setOnAction(event -> {
FilterableTreeItem<Actor> treeItem = new FilterableTreeItem<>(new Actor(firstname.getText(), lastname.getText()));
folder1.getInternalChildren().add(treeItem);
});
addBtn.disableProperty().bind(Bindings.isEmpty(lastname.textProperty()));
box.getChildren().addAll(firstname, lastname, addBtn);
TitledPane pane = new TitledPane("Add new element", box);
pane.setCollapsible(false);
return pane;
}
示例7: createFilteredTree
import javafx.scene.control.TitledPane; //导入依赖的package包/类
private Node createFilteredTree() {
FilterableTreeItem<Actor> root = getTreeModel();
root.predicateProperty().bind(Bindings.createObjectBinding(() -> {
if (filterField.getText() == null || filterField.getText().isEmpty())
return null;
return TreeItemPredicate.create(actor -> actor.toString().contains(filterField.getText()));
}, filterField.textProperty()));
TreeView<Actor> treeView = new TreeView<>(root);
treeView.setShowRoot(false);
TitledPane pane = new TitledPane("Filtered TreeView", treeView);
pane.setCollapsible(false);
pane.setMaxHeight(Double.MAX_VALUE);
return pane;
}
示例8: onSelectChartTab
import javafx.scene.control.TitledPane; //导入依赖的package包/类
/**
* When chart tab is changed, we reload indicators for the new chart
* @param category - selected category
* @param market - selected market
* @param code - selected code
*/
public void onSelectChartTab(String category, String market, String code){
String strTitle = "Indicator Setting";
TatAccordion indicatorAccordion = new TatAccordion();
if (leftBottomTabPane.hasTab(strTitle)){
leftBottomTabPane.removeTab(strTitle);
}
String strKey = category + "-" + market + "-" + code;
if (indicatorSettingPaneMap.get(strKey)!= null && indicatorSettingPaneMap.get(strKey).size() > 0){
leftBottomTabPane.addTab(strTitle, indicatorAccordion);
ArrayList<TitledPane> settings = indicatorSettingPaneMap.get(strKey);
Iterator<TitledPane> it = settings.iterator();
while(it.hasNext()){
indicatorAccordion.getPanes().addAll(it.next());
}
indicatorAccordion.setExpandedPane(indicatorSettingPaneMap.get(strKey).get(indicatorSettingPaneMap.get(strKey).size() - 1));
}
}
示例9: createTile
import javafx.scene.control.TitledPane; //导入依赖的package包/类
private TitledPane createTile() throws VoogaException {
if (name == null) {
return null;
}
String className = VoogaBundles.backendToGUIProperties.getString(name);
Class<?> c = null;
try {
c = Class.forName(className);
EventTitledPane titledPane;
Object o = c.getConstructor(EditEventable.class).newInstance(manager);
titledPane = (EventTitledPane) o;
return titledPane;
} catch (Exception e) {
throw new VoogaException(e.getMessage());
}
}
示例10: onActionAddProjectToDailySection
import javafx.scene.control.TitledPane; //导入依赖的package包/类
private void onActionAddProjectToDailySection(ProjectModel model) {
LoggerFacade.INSTANCE.debug(this.getClass(), "On action add Project to DailySection"); // NOI18N
final TitledPane titledPane = new TitledPane();
titledPane.setText("(1) " + model.getTitle()); // NOI18N
titledPane.setUserData(model);
titledPane.setExpanded(false);
final ProjectContentView view = new ProjectContentView();
final ProjectContentPresenter presenter = view.getRealPresenter();
presenter.configure(model);
titledPane.setContent(view.getView());
vbDailySectionContent.getChildren().add(0, titledPane);
this.onActionEnsureTitledPaneIsVisible(titledPane);
}
示例11: drawNode
import javafx.scene.control.TitledPane; //导入依赖的package包/类
@Override
public Node drawNode() {
String title = "TitledPane";
Label content = new Label("Content");
TitledPane titledPane = new TitledPane(title, content);
if (titledPane.getText() != title) {
reportGetterFailure("getTitle()");
}
if (titledPane.getContent() != content) {
reportGetterFailure("getTitle()");
}
titledPane.setMinSize(SLOT_WIDTH, SLOT_HEIGHT);
titledPane.setMaxSize(SLOT_WIDTH, SLOT_HEIGHT);
titledPane.setPrefSize(SLOT_WIDTH, SLOT_HEIGHT);
titledPane.setStyle("-fx-border-color: darkgray;");
return titledPane;
}
示例12: createObject
import javafx.scene.control.TitledPane; //导入依赖的package包/类
protected Object createObject(double width, double height, Double tab_width, Double tab_height) {
Label content = new Label("Content");
if (tab_width != null && tab_height != null) {
content.setMinSize(tab_width, tab_height);
content.setMaxSize(tab_width, tab_height);
content.setPrefSize(tab_width, tab_height);
}
TitledPane titled_pane = new TitledPane();
titled_pane.setText("Title");
titled_pane.setContent(content);
titled_pane.setMinSize(width, height);
titled_pane.setMaxSize(width, height);
titled_pane.setPrefSize(width, height);
titled_pane.setStyle("-fx-border-color: darkgray;");
return titled_pane;
}
示例13: createObject
import javafx.scene.control.TitledPane; //导入依赖的package包/类
protected Object createObject(double width, double height, int panes_num, Double content_width, Double content_height) {
Accordion accordion = new Accordion();
for (int i = 0; i < panes_num; i++) {
Label label = new Label("Pane " + i + " Content");
label.setAlignment(Pos.TOP_LEFT);
if (content_width != null && content_height != null) {
label.setPrefSize(content_width, content_height);
label.setMinSize(content_width, content_height);
label.setMaxSize(content_width, content_height);
}
TitledPane titled_pane = new TitledPane("Pane " + i, label);
accordion.getPanes().add(titled_pane);
}
accordion.setMaxSize(width, height);
accordion.setPrefSize(width, height);
accordion.setStyle("-fx-border-color: darkgray;");
return accordion;
}
示例14: dnd
import javafx.scene.control.TitledPane; //导入依赖的package包/类
protected void dnd() throws InterruptedException {
sceneSource.mouse().click(1, new Point(0, 0));
Wrap from = Lookups.byID(sceneSource, ID_DRAG_SOURCE, Node.class);
Wrap to = Lookups.byID(sceneTarget, ID_DRAG_TARGET, Node.class);
Point fromPoint = from.getClickPoint();
Point toPoint = to.getClickPoint();
final Object fromControl = from.getControl();
if (fromControl instanceof MenuBar || fromControl instanceof ToolBar
|| fromControl instanceof ScrollPane || fromControl instanceof Pagination) {
fromPoint = new Point(2, 2);
}
if (fromControl instanceof TitledPane) {
fromPoint = new Point(5, 30);
}
final Object toControl = to.getControl();
if (toControl instanceof MenuBar || toControl instanceof ToolBar
|| toControl instanceof ScrollPane || toControl instanceof Pagination) {
toPoint = new Point(2, 2);
}
if (toControl instanceof TitledPane) {
toPoint = new Point(30, 30);
}
dnd(from, fromPoint, to, toPoint);
}
示例15: userInputTest
import javafx.scene.control.TitledPane; //导入依赖的package包/类
/**
* Test for Accordion user input
*/
@ScreenshotCheck
@Test(timeout = 300000)
public void userInputTest() throws Throwable {
openPage(Pages.InputTest.name());
//screenshotError = null;
Parent<Node> parent = getScene().as(Parent.class, Node.class);
for (int i = 0; i < AccordionApp.PANES_NUM; i++) {
Wrap wrap = parent.lookup(TitledPane.class).wrap(i);
wrap.mouse().click();
Thread.sleep(ANIMATION_DELAY);
ScreenshotUtils.checkPageContentScreenshot("AccordionTest-open-" + i);
}
ScreenshotUtils.throwScreenshotErrors();
}