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


Java TitledPane.getContent方法代码示例

本文整理汇总了Java中javafx.scene.control.TitledPane.getContent方法的典型用法代码示例。如果您正苦于以下问题:Java TitledPane.getContent方法的具体用法?Java TitledPane.getContent怎么用?Java TitledPane.getContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.TitledPane的用法示例。


在下文中一共展示了TitledPane.getContent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: shouldContainSimpleElements

import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
@Test public void shouldContainSimpleElements(){
   assertThat( systemUnderTest.getChildren().contains( systemUnderTest.simple() ), is( true ) );
   TitledPane pane = systemUnderTest.simple();
   assertThat( pane.getText(), is( SoundConfigurationPanel.SIMPLE_TEXT ) );
   
   Region region = ( Region ) pane.getContent();
   assertThat( region.getChildrenUnmodifiable().contains( systemUnderTest.passFailRow() ), is( true ) );
   assertThat( region.getChildrenUnmodifiable().contains( systemUnderTest.failFailRow() ), is( true ) );
   assertThat( region.getChildrenUnmodifiable().contains( systemUnderTest.failPassRow() ), is( true ) );
   assertThat( region.getChildrenUnmodifiable().contains( systemUnderTest.passPassRow() ), is( true ) );
   
   assertThat( systemUnderTest.passFailRow().getLabelText(), is( SoundConfigurationPanel.PASS_FAIL_TEXT ) );
   assertThat( systemUnderTest.passPassRow().getLabelText(), is( SoundConfigurationPanel.PASS_PASS_TEXT ) );
   assertThat( systemUnderTest.failFailRow().getLabelText(), is( SoundConfigurationPanel.FAIL_FAIL_TEXT ) );
   assertThat( systemUnderTest.failPassRow().getLabelText(), is( SoundConfigurationPanel.FAIL_PASS_TEXT ) );
   
   assertThat( systemUnderTest.passFailRow().isAssociatedWith( configuration ), is( true ) );
   assertThat( systemUnderTest.passPassRow().isAssociatedWith( configuration ), is( true ) );
   assertThat( systemUnderTest.failFailRow().isAssociatedWith( configuration ), is( true ) );
   assertThat( systemUnderTest.failPassRow().isAssociatedWith( configuration ), is( true ) );
   
   assertThat( systemUnderTest.passFailRow().isAssociatedWithType( PassFailApplier.class ), is( true ) );
   assertThat( systemUnderTest.passPassRow().isAssociatedWithType( PassPassApplier.class ), is( true ) );
   assertThat( systemUnderTest.failFailRow().isAssociatedWithType( FailFailApplier.class ), is( true ) );
   assertThat( systemUnderTest.failPassRow().isAssociatedWithType( FailPassApplier.class ), is( true ) );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:27,代码来源:SoundConfigurationPanelTest.java

示例3: shouldContainAdvancedElements

import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
@Test public void shouldContainAdvancedElements(){
   assertThat( systemUnderTest.getChildren().contains( systemUnderTest.advanced() ), is( true ) );
   TitledPane pane = systemUnderTest.advanced();
   assertThat( pane.getText(), is( SoundConfigurationPanel.ADVANCED_TEXT ) );
   
   Region region = ( Region ) pane.getContent();
   for ( BuildResultStatus from : BuildResultStatus.values() ) {
      for ( BuildResultStatus to : BuildResultStatus.values() ) {
         SoundConfigurationRow row = systemUnderTest.rowFor( from, to );
         assertThat( region.getChildrenUnmodifiable().contains( row ), is( true ) );
         assertThat( row.getLabelText(), is( from.name() + " -> " + to.name() ) );
         assertThat( row.isAssociatedWith( configuration ), is( true ) );
         assertThat( row.isAssociatedWithType( IndividualChangeApplier.class ), is( true ) );
      }
   }
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:17,代码来源:SoundConfigurationPanelTest.java

示例4: extract

import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
/**
 * Method to extract the components needed from the parent if possible.
 * @param parent the {@link BorderPane} parent to extract from.
 * @return the {@link Pair} of {@link BorderPane} parent to the system digest {@link Node}.
 * Note that this can and does return null if the digest cannot be found.
 */
private Pair< BorderPane, Node > extract( Node parent ){
   if ( parent == null || !( parent instanceof BorderPane ) ) {
      return new Pair<>( null, null );
   }
   
   BorderPane extractedParent = ( BorderPane ) parent;
   Node top = extractedParent.getTop();
   if ( top == null ) {
      return new Pair<>( null, null );
   }
   
   if ( top instanceof DigestViewer ) {
      return new Pair<>( extractedParent, top );
   }
   
   if ( !( top instanceof TitledPane ) ) {
      return new Pair<>( null, null );
   }
   
   TitledPane extractedPane = ( TitledPane ) top;
   Node content = extractedPane.getContent();
   if ( content == null || !( content instanceof DigestViewer ) ) {
      return new Pair<>( null, null );
   }
   
   return new Pair<>( extractedParent, extractedPane );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:34,代码来源:WrappedSystemDigest.java

示例5: AeroGroupBoxSkin

import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
/**
 * Takes a TitledPane, styles it as GroupBox and binds the textProperty to the title.
 * The border can be style via the CSS-class <code>group-box-border</code>
 * @param p Pane to be styled
 */
public AeroGroupBoxSkin(TitledPane p) {
    super(p);
    titleLabel = new Label("");
    titleLabel.textProperty().bind(p.textProperty());
    getChildren().add(titleLabel);
    captionBg = new Rectangle();
    p.setCollapsible(false);
    captionBg.setStyle("-fx-fill:transparent;");
    groupBoxBg = new Rectangle();
    groupBoxBg.setStyle("-fx-fill:transparent;");
    clippingRect = new Rectangle();
    getChildren().add(groupBoxBg);
    groupBoxBg.getStyleClass().add("group-box-border");
    if (p.getContent() != null)
        getChildren().add(p.getContent());
    p.setPadding(new Insets(7, 0, 0, 0));

    focusListener = new InvalidationListener() {
        @Override
        public void invalidated(Observable observable) {
            if (p.isFocused()) {
                Node content = p.getContent();
                if (content != null && content instanceof Parent) {
                    if (((Parent) content).getChildrenUnmodifiable().size() > 0)
                        ((Parent) content).getChildrenUnmodifiable().get(0).requestFocus();
                }
            }
        }
    };
    p.focusedProperty().addListener(focusListener);
}
 
开发者ID:Maddosaurus,项目名称:aerofx,代码行数:37,代码来源:AeroGroupBoxSkin.java


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