當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。