当前位置: 首页>>代码示例>>Java>>正文


Java TitledPane类代码示例

本文整理汇总了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));
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:RFXTitledPaneTest.java

示例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());
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:23,代码来源:SelectSpriteSFV.java

示例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.
        }
    }
}
 
开发者ID:hylkevds,项目名称:SensorThingsManager,代码行数:20,代码来源:EntityGuiController.java

示例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());
            }
        }
    });
}
 
开发者ID:comtel2000,项目名称:mokka7,代码行数:19,代码来源:SessionManager.java

示例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")){
                   	
                   }
               }
         });
}
 
开发者ID:coco35700,项目名称:uPMT,代码行数:27,代码来源:NewInterviewDialogController.java

示例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;
}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:20,代码来源:FilterableTreeItemDemo.java

示例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;
}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:17,代码来源:FilterableTreeItemDemo.java

示例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));
    }
}
 
开发者ID:ztan5,项目名称:TechnicalAnalysisTool,代码行数:24,代码来源:TatMain.java

示例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());
	}
}
 
开发者ID:sjain28,项目名称:Game-Engine-Vooga,代码行数:19,代码来源:EventAccoridion.java

示例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);
}
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:18,代码来源:DailySectionContentPresenter.java

示例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;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:18,代码来源:TitledPaneApp.java

示例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;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:17,代码来源:TitledPaneApp.java

示例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;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:19,代码来源:AccordionApp.java

示例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);
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:25,代码来源:DragDropWithControlsBase.java

示例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();
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:19,代码来源:AccordionTest.java


注:本文中的javafx.scene.control.TitledPane类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。