Java 类javafx.scene.control.Accordion 实例源码

项目:SensorThingsManager    文件:EntityGuiController.java   
@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.
        }
    }
}
项目:SensorThingsManager    文件:EntityGuiController.java   
@Override
public void init(SensorThingsService service, Observation entity, GridPane gridProperties, Accordion accordionLinks, Label labelId, boolean editable) {
    this.labelId = labelId;
    this.entity = entity;
    int i = 0;
    textPhenomenonTime = addFieldTo(gridProperties, i, "PhenomenonTime", new TextField(), false, editable);
    textResultTime = addFieldTo(gridProperties, ++i, "ResultTime", new TextField(), false, editable);
    textResult = addFieldTo(gridProperties, ++i, "Result", new TextArea(), true, editable);
    textResultQuality = addFieldTo(gridProperties, ++i, "ResultQuality", new TextField(), false, editable);
    textValidTime = addFieldTo(gridProperties, ++i, "ValidTime", new TextField(), false, editable);
    textParameters = addFieldTo(gridProperties, ++i, "Parameters", new TextArea(), true, editable);

    if (accordionLinks != null) {
        try {
            accordionLinks.getPanes().add(createEditableEntityPane(entity, entity.getDatastream(), service.datastreams().query(), entity::setDatastream));
            accordionLinks.getPanes().add(createEditableEntityPane(entity, entity.getMultiDatastream(), service.multiDatastreams().query(), entity::setMultiDatastream));
            accordionLinks.getPanes().add(createEditableEntityPane(entity, entity.getFeatureOfInterest(), service.featuresOfInterest().query(), entity::setFeatureOfInterest));
        } catch (IOException | ServiceFailureException ex) {
            LOGGER.error("Failed to create panel.", ex);
        }
    }
}
项目:mokka7    文件:SessionManager.java   
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());
            }
        }
    });
}
项目:Game-Engine-Vooga    文件:EventAccoridion.java   
public EventAccoridion(EditEventable manager, String name, Button... addedButtons) {
    this.name = name;
    this.manager = manager;
    pane = new BorderPane();
    accordion = new Accordion();

    initializeButtons(addedButtons);
    pane.setBottom(buttons);
    pane.setCenter(accordion);

    tiles = new ArrayList<>();
    generateTiles(1);

    this.setText(name);
    this.setContent(pane);
    this.setClosable(false);
}
项目:openjfx-8u-dev-tests    文件:AccordionApp.java   
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;
}
项目:sem2-final-project    文件:CityAccordion.java   
public void initVars(City city,Accordion accordion) {
    this.city = city;
    this.accordion = accordion;
    factoryPanes = new HashMap<>();
    inFocus = 0;
    accordion.setOnMouseClicked(new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent event) {
            Platform.runLater(new Runnable() {
                @Override
                public void run() {
                    inFocus = accordion.getPanes().indexOf(accordion.getExpandedPane());
                }
            });
        }
    });
}
项目:ewidgetfx    文件:ConferenceTour.java   
private Accordion createConferences() {
    Accordion accordion = new Accordion();
    final TitledPane india = createConference("JavaOne India", 17.385371, 78.484268, "http://steveonjava.com/wp-content/uploads/2011/03/javaone-india.png");
    accordion.getPanes().add(india);
    accordion.getPanes().add(createConference("OSCON", 45.515008, -122.693253, "http://steveonjava.com/wp-content/uploads/2011/05/oscon.png"));
    accordion.getPanes().add(createConference("Devoxx", 51.206883, 4.44, "http://steveonjava.com/wp-content/uploads/2010/07/LogoDevoxxNeg150.png"));
    accordion.getPanes().add(createConference("J-Fall", 52.219913, 5.474253, "http://steveonjava.com/wp-content/uploads/2011/11/jfall3.png"));
    accordion.getPanes().add(createConference("JavaOne SF", 37.775057, -122.416534, "http://steveonjava.com/wp-content/uploads/2010/07/JavaOne-2010-Speaker.png"));
    accordion.getPanes().add(createConference("Jazoon", 47.382079, 8.528137, "http://steveonjava.com/wp-content/uploads/2010/04/jazoon.png"));
    accordion.getPanes().add(createConference("GeeCON", 50.064633, 19.949799, "http://steveonjava.com/wp-content/uploads/2011/03/geecon.png"));
    india.setExpanded(true);
    accordion.setExpandedPane(india);
    accordion.expandedPaneProperty().addListener((ObservableValue<? extends TitledPane> ov, TitledPane t, TitledPane t1) -> {
        if (t1 != null) {
            ((ConferencePane) t1).navigateTo();
        }
    });
    return accordion;
}
项目:marathonv5    文件:AccordionSample.java   
public AccordionSample() {
    super(150,150);
    TitledPane t1 = new TitledPane("Node 1", new Button("Button"));
    TitledPane t2 = new TitledPane("Node 2", new Text("String"));
    TitledPane t3 = new TitledPane("Node 3", new Rectangle(120,50, Color.RED));
    Accordion accordion = new Accordion();
    accordion.getPanes().add(t1);
    accordion.getPanes().add(t2);
    accordion.getPanes().add(t3);
    getChildren().add(accordion);
}
项目:marathonv5    文件:AccordionSample.java   
public AccordionSample() {
    super(150,150);
    TitledPane t1 = new TitledPane("Node 1", new Button("Button"));
    TitledPane t2 = new TitledPane("Node 2", new Text("String"));
    TitledPane t3 = new TitledPane("Node 3", new Rectangle(120,50, Color.RED));
    Accordion accordion = new Accordion();
    accordion.getPanes().add(t1);
    accordion.getPanes().add(t2);
    accordion.getPanes().add(t3);
    getChildren().add(accordion);
}
项目:marathonv5    文件:TitledPaneSample.java   
@Override public void start(Stage stage) {
    stage.setTitle("TitledPane");
    Scene scene = new Scene(new Group(), 450, 250);

    TitledPane gridTitlePane = new TitledPane();
    GridPane grid = new GridPane();
    grid.setVgap(4);
    grid.setPadding(new Insets(5, 5, 5, 5));
    grid.add(new Label("First Name: "), 0, 0);
    grid.add(new TextField(), 1, 0);
    grid.add(new Label("Last Name: "), 0, 1);
    grid.add(new TextField(), 1, 1);
    grid.add(new Label("Email: "), 0, 2);
    grid.add(new TextField(), 1, 2);        
    grid.add(new Label("Attachment: "), 0, 3);
    grid.add(label,1, 3);
    gridTitlePane.setText("Grid");
    gridTitlePane.setContent(grid);

    final Accordion accordion = new Accordion ();      

    for (int i = 0; i < imageNames.length; i++) {
        images[i] = 
            new Image(getClass().getResourceAsStream(imageNames[i]+".jpg"));
        pics[i] = new ImageView(images[i]);
        tps[i] = new TitledPane(imageNames[i],pics[i]); 
    }   
    accordion.getPanes().addAll(tps);


    accordion.expandedPaneProperty().addListener(
        (ObservableValue<? extends TitledPane> ov, TitledPane old_val, 
        TitledPane new_val) -> {
            if (new_val != null) {
                label.setText(accordion.getExpandedPane().getText()
                        + ".jpg");
            }
    });

    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(gridTitlePane, accordion);

    Group root = (Group)scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}
项目:GameAuthoringEnvironment    文件:AuthoringSideBar.java   
@Override
protected void fillAccordion (Accordion accordion) {
    myGame.getAuthorshipData().getMyCreatedSpritesMap().values().stream().forEach(c -> {
        TitledPane toAdd = createAccordionPane(c);
        accordion.getPanes().add(toAdd);
        accordion.expandedPaneProperty().set(toAdd);
    });
}
项目:SensorThingsManager    文件:EntityGuiController.java   
@Override
public void init(SensorThingsService service, Datastream 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);
    textObservationType = addFieldTo(gridProperties, ++i, "ObservationType", new TextField(), false, editable);
    textUomName = addFieldTo(gridProperties, ++i, "UoM: Name", new TextField(), false, editable);
    textUomSymbol = addFieldTo(gridProperties, ++i, "UoM: Symbol", new TextField(), false, editable);
    textUomDefinition = addFieldTo(gridProperties, ++i, "UoM: Definition", new TextField(), false, editable);
    textObservedArea = addFieldTo(gridProperties, ++i, "ObservedArea", new TextField(), false, false);
    textPhenomenonTime = addFieldTo(gridProperties, ++i, "PhenomenonTime", new TextField(), false, false);
    textResultTime = addFieldTo(gridProperties, ++i, "ResultTime", new TextField(), false, false);

    if (accordionLinks != null) {
        try {
            accordionLinks.getPanes().add(createEditableEntityPane(entity, entity.getThing(), service.things().query(), entity::setThing));
            accordionLinks.getPanes().add(createEditableEntityPane(entity, entity.getSensor(), service.sensors().query(), entity::setSensor));
            accordionLinks.getPanes().add(createEditableEntityPane(entity, entity.getObservedProperty(), service.observedProperties().query(), entity::setObservedProperty));
            accordionLinks.getPanes().add(new TitledPane("Observations", createCollectionPaneFor(entity.observations().query())));
        } catch (IOException | ServiceFailureException ex) {
            LOGGER.error("Failed to create panel.", ex);
        } catch (NullPointerException e) {
            // Happens when entity is new.
            LOGGER.trace("Failed to create panel.", e);
        }
    }
}
项目:Game-Engine-Vooga    文件:DataBaseDisplay.java   
private Node makeLists() {
    Accordion lists = new Accordion();
    TitledPane games = new TitledPane();
    games.setText(databaseProperties.getString("Games"));
    ListView<String> actualGames = new ListView<>();
    List<String> authoredGames = database.getStatsbyUser(user.getProperty(VoogaUser.USER_NAME).toString()).stream()
            .map(e -> e.getProperty(StatCell.MY_GAME).toString()).collect(Collectors.toList());
    actualGames.getItems().setAll(authoredGames);
    actualGames.setOnMouseClicked(e -> clickList(actualGames.getSelectionModel().getSelectedItem()));
    games.setContent(actualGames);
    lists.getPanes().addAll(games);
    lists.setPrefWidth(DATA_WIDTH * ACCORDION_SIZE_FACTOR);
    return lists;
}
项目:openjfx-8u-dev-tests    文件:AccordionApp.java   
@Override
public Node drawNode() {
    Accordion node = (Accordion) createObject();
    TitledPane pane = node.getPanes().get(index);
    node.setExpandedPane(pane);
    if (node.getExpandedPane() != pane) {
        reportGetterFailure("getExpandedPane()");
    }
    return node;
}
项目:sem2-final-project    文件:UniverseAccordion.java   
public void initVars(Universe universe, Country playersCountry, Controller controller, Accordion universeAccordion){

        this.universe = universe;
        this.playersCountry = playersCountry;
        this.controller = controller;
        this.universeAccordion = universeAccordion;
    }
项目:jbpm-rewards-client    文件:App.java   
@Override
public void start(Stage stage) throws Exception {
    ACCORDION_ACTIONS = new Accordion(giveReward(), tasks(),
            history());
    Label lblTitle = new Label("Rewards APP");
    lblTitle.setFont(Font.font(25));
    Scene scene = new Scene(new VBox(lblTitle, ACCORDION_ACTIONS), 700, 600);
    stage.setScene(scene);
    stage.setTitle("Rewards App!");
    stage.show();
}
项目:javafx-dpi-scaling    文件:AdjusterTest.java   
@Test
public void testAccordionControlAdjuster() {
    Adjuster adjuster = Adjuster.getAdjuster(Accordion.class);

    assertThat(adjuster, is(instanceOf(ControlAdjuster.class)));
    assertThat(adjuster.getNodeClass(), is(sameInstance(Control.class)));
}
项目:jfxvnc    文件:SessionContext.java   
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((ov, t, expandedPane) -> {
    if (expandedPane != null) {
      props.setProperty(propertyName, expandedPane.getText());
    }
  });
}
项目:GRIP    文件:ExceptionWitnessResponderButton.java   
private ExceptionPopOver(String title) {
  super();

  setTitle(title);
  stackTrace.setEditable(false);

  getStyleClass().add(STYLE_CLASS);
  setHeaderAlwaysVisible(true);
  setDetachable(false);

  GridPane.setHalignment(errorMessage, HPos.CENTER);
  GridPane.setValignment(errorMessage, VPos.CENTER);
  GridPane.setHgrow(errorMessage, Priority.ALWAYS);
  GridPane.setMargin(errorMessage, new Insets(5, 5, 5, 5));
  errorMessage.setTextAlignment(TextAlignment.CENTER);


  stackTracePane = new TitledPane("Stack Trace", stackTrace);
  stackTracePane.managedProperty().bind(stackTracePane.visibleProperty());
  stackTracePane.setTextFill(Color.GRAY);
  stackTracePane.setCollapsible(true);
  stackTracePane.setExpanded(false);
  final Accordion accordion = new Accordion(stackTracePane);

  GridPane.setVgrow(accordion, Priority.ALWAYS);
  GridPane.setHgrow(accordion, Priority.ALWAYS);

  final GridPane expContent = new GridPane();
  expContent.setVgap(10);
  expContent.setMaxWidth(Double.MAX_VALUE);
  expContent.add(errorMessage, 0, 0);
  expContent.add(accordion, 0, 1);

  setContentNode(expContent);
}
项目:netentionj-desktop    文件:NodeControlPane.java   
public Tab newOptionsTab() {
    Tab t = new Tab(/*"Options"*/);
    AwesomeDude.setIcon(t, AwesomeIcon.COGS);

    Accordion a =new Accordion();

    a.getPanes().addAll(new TitledPane("Identity", newIdentityPanel()), new TitledPane("Network", newNetworkPanel()), /*new TitledPane("Logic", newLogicPanel()),*/ new TitledPane("Database", newDatabasePanel()));

    for (TitledPane tp : a.getPanes())
        tp.setAnimated(false);

    t.setContent(a);
    return t;
}
项目:javafx-demos    文件:AccordionComponent.java   
public AccordionComponent() {
    super.setPadding(new Insets(0, 10, 10, 10));
    super.setFillWidth(true);
    super.setPrefWidth(200);
    super.setPrefHeight(450);
    this.accordion = new Accordion();   
    this.getChildren().add(this.accordion);
}
项目:kotlinfx-ensemble    文件:AccordionSample.java   
public AccordionSample() {
    super(150,150);
    TitledPane t1 = new TitledPane("Node 1", new Button("Button"));
    TitledPane t2 = new TitledPane("Node 2", new Text("String"));
    TitledPane t3 = new TitledPane("Node 3", new Rectangle(120,50, Color.RED));
    Accordion accordion = new Accordion();
    accordion.getPanes().add(t1);
    accordion.getPanes().add(t2);
    accordion.getPanes().add(t3);
    getChildren().add(accordion);
}
项目:systemdesign    文件:FXMLAllTrees.java   
public FXMLAllTrees(
        Interactions interactions, EditState edit, ContextMenus menus,
        Accordion tabs) {
    this.interactions = interactions;
    this.edit = edit;
    this.menus = menus;
    this.tabs = tabs;
    this.onChange = new SingleRunnable(edit.getExecutor(), new OnChange());
}
项目:systemdesign    文件:FXMLTree.java   
public FXMLTree(
        Interactions interactions, ContextMenus menus,
        Accordion tabs,
        TitledPane tab,
        TreeView<TreeNode> view) {
    this.interactions = interactions;
    this.menus = menus;
    this.tabs = tabs;
    this.tab = tab;
    this.view = view;
}
项目:fwm    文件:NpcTabController.java   
public Accordion getAccordion(){
    return accordion;
}
项目:fwm    文件:GodTabController.java   
public Accordion getAccordion(){
    return accordion;
}
项目:fwm    文件:EventTabController.java   
public Accordion getAccordion(){
    return accordion;
}
项目:fwm    文件:RegionTabController.java   
public Accordion getAccordion(){
    return accordion;
}
项目:GameAuthoringEnvironment    文件:PlayerSideBar.java   
@Override
protected void fillAccordion (Accordion accordion) {
    accordion.getPanes().add(createAccordionPane(getLevel().getAddableSprites()));
}
项目:GameAuthoringEnvironment    文件:SideBarDisplay.java   
private Accordion createAccordion () {
    Accordion selector = new Accordion();
    selector.setMaxSize(parseString(getString("SideBarWidth")),
                        parseString(getString("SideBarHeight")));
    return selector;
}
项目:GameAuthoringEnvironment    文件:BasicUIFactory.java   
public Accordion makeAccordion (double width) {
    Accordion item = new Accordion();
    item.setMaxWidth(width);
    return item;
}
项目:openjfx-8u-dev-tests    文件:AccordionApp.java   
@Override
public Node drawNode() {
    Accordion node = (Accordion) createObject(width, height, panes_num, content_width, content_height);
    node.setExpandedPane(node.getPanes().get(0));
    return node;
}
项目:sem2-final-project    文件:SolarSystemAccordion.java   
public void initVars(SolarSystem solarSystem,Controller controller,Accordion accordion){
    this.solarSystem = solarSystem;
    this.controller = controller;
    this.accordion = accordion;
}
项目:qupath    文件:WorkflowPanel.java   
public WorkflowPanel(final QuPathGUI qupath) {
//      this.qupath = qupath;
        this.commandLogView = new WorkflowCommandLogView(qupath);

        BorderPane topPane = new BorderPane();
        ComboBox<Wizard> comboWizard = new ComboBox<>();
        comboWizard.getItems().add(
                makeEmptyWizard(qupath));

        try {
            Wizard wizardBiomarker = makeBiomarkerScoringWizard(qupath);
            comboWizard.getItems().add(wizardBiomarker);
        } catch (ClassNotFoundException e) {
            logger.error("Could not find required class: {}", e);
        }

        comboWizard.getSelectionModel().select(0);
        topPane.setTop(comboWizard);
        comboWizard.prefWidthProperty().bind(topPane.widthProperty());
        topPane.setCenter(wizardPane);
        wizardPane.setPadding(new Insets(10, 0, 0, 0));

        TitledPane titledWizard = new TitledPane("Workflow assistant", topPane);
        topPane.setMaxHeight(Double.MAX_VALUE);
//      titledWizard.setCollapsible(false);

        comboWizard.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> updateWizardPane(n));


        TitledPane titledLog = new TitledPane("Command history", commandLogView.getPane());


//      SplitPane split = new SplitPane();
//      split.setOrientation(Orientation.VERTICAL);
//      split.getItems().addAll(titledWizard, titledLog);
//      split.setDividerPosition(0, 0.5);
//      pane.setCenter(split);

        Accordion accordion = new Accordion();
        accordion.getPanes().addAll(
                titledLog, titledWizard
                );
        accordion.setExpandedPane(titledLog);
        pane.setCenter(accordion);
    }
项目:Visual-Programming-Environment-for-Coordinating-Appliances-and-Services-in-a-Smart-House    文件:BoxList.java   
public Pane createPane() {
        int subSizeX = 30;
        // 全体パネル
        field.setPrefSize(sizeX + subSizeX, sizeY);
        field.setStyle("-fx-background-color: #E2EFFF;");

        // ボックスリストフィールドのパネル
        // addCatepane(All)って感じでする。
        final FlowPane boxListField = new FlowPane();
//        boxListField.setPrefSize(sizeX, sizeY);
        boxListField.setPrefWidth(sizeX);
        boxListField.setStyle("-fx-background-color: #E2EFFF;");
        boxListField.setVgap(10);
        boxListField.setHgap(10);

        // ファイルの読み込みとボックスの追加だよい
        this.load();

        // カテゴリに追加とかしていく
        ScrollPane scrollPane = new ScrollPane();
        scrollPane.setPrefSize(sizeX, sizeY);
        scrollPane.setStyle("-fx-background-color: #E2EFFF;");
        Accordion accordion = new Accordion();
//        accordion.setPrefHeight(20);
        scrollPane.setContent(accordion);

        field.getChildren().add(scrollPane);

        for (int i = 0; i < categoryList.size(); i++) {

            FlowPane catepane = new FlowPane();
            catepane.setPrefWidth(sizeX);
//            catepane.setMinHeight(sizeY);
            catepane.setStyle("-fx-background-color: #E2EFFF;");
            catepane.setVgap(10);
            catepane.setHgap(10);
            TitledPane t1 = new TitledPane(categoryList.get(i), catepane);
            t1.setFont(new Font(24));
            accordion.getPanes().add(t1);
            categoryPaneList.add(catepane);
        }

        // boxListFieldを閉まったり出したりするためのパネル
        // クリックすると出たり閉じたり。
        // 後でアニメーションつける!
        // 矢印もいい感じに!
        final BorderPane subBoxListField = new BorderPane();
        subBoxListField.setPrefSize(subSizeX, sizeY);
        subBoxListField.setTranslateX(sizeX);
        subBoxListField.setStyle("-fx-background-color: #E5E5E5;");

        final Text sblfText = new Text();
        sblfText.setText("<");

        subBoxListField.setOnMouseClicked(new EventHandler<MouseEvent>() {
            Boolean flag = false;

            @Override
            public void handle(MouseEvent t) {
//                System.out.println("clicked");
                if (flag) { // 出す!
                    field.setTranslateX(0);
                    sblfText.setText("<");
                    flag = false;
                } else { // しまう!
                    field.setTranslateX(-sizeX);
                    sblfText.setText(">");
                    flag = true;
                }
            }

        });

        subBoxListField.setCenter(sblfText);

        field.getChildren().add(subBoxListField);
//        field.getChildren().add(boxListField);

        return field;
    }
项目:Visual-Programming-Environment-for-Coordinating-Appliances-and-Services-in-a-Smart-House    文件:BoxList.java   
public Pane createPane() {
        int subSizeX = 30; // ボックスリストを閉じたり出したりするボタンの範囲

        // 全体パネル
        field.setPrefSize(sizeX + subSizeX, sizeY);
        field.setStyle("-fx-background-color: #E2EFFF;");

        // ボックスリストフィールドのパネル
        final FlowPane boxListField = new FlowPane();
        boxListField.setPrefWidth(sizeX);
        boxListField.setStyle("-fx-background-color: #E2EFFF;");
        boxListField.setVgap(10);
        boxListField.setHgap(10);

        // ボックス一覧ファイルの読み込みとボックスの追加
        this.load();

        // 読み込んだボックスをカテゴリに追加
        ScrollPane scrollPane = new ScrollPane();
        scrollPane.setPrefSize(sizeX, sizeY);
        scrollPane.setStyle("-fx-background-color: #E2EFFF;");
        Accordion accordion = new Accordion();
        scrollPane.setContent(accordion);

        field.getChildren().add(scrollPane);

        for (int i = 0; i < categoryList.size(); i++) {

            FlowPane catepane = new FlowPane();
            catepane.setPrefWidth(sizeX);
//            catepane.setMinHeight(sizeY);
            catepane.setStyle("-fx-background-color: #E2EFFF;");
            catepane.setVgap(10);
            catepane.setHgap(10);
            TitledPane t1 = new TitledPane(categoryList.get(i), catepane);
            t1.setFont(new Font(24));
            accordion.getPanes().add(t1);
            categoryPaneList.add(catepane);
        }

        // boxListFieldを閉まったり出したりするためのパネル
        // クリックすると出たり閉じたり。
        // 後でアニメーションつける!
        // 矢印もいい感じに!
        final BorderPane subBoxListField = new BorderPane();
        subBoxListField.setPrefSize(subSizeX, sizeY);
        subBoxListField.setTranslateX(sizeX);
        subBoxListField.setStyle("-fx-background-color: #E5E5E5;");

        final Text sblfText = new Text();
        sblfText.setText("<");

        subBoxListField.setOnMouseClicked(new EventHandler<MouseEvent>() {
            Boolean flag = false;

            @Override
            public void handle(MouseEvent t) {
//                System.out.println("clicked");
                if (flag) { // 出す!
                    field.setTranslateX(0);
                    sblfText.setText("<");
                    flag = false;
                } else { // しまう!
                    field.setTranslateX(-sizeX);
                    sblfText.setText(">");
                    flag = true;
                }
            }

        });

        subBoxListField.setCenter(sblfText);

        field.getChildren().add(subBoxListField);

        return field;
    }
项目:javafx-demos    文件:TitledPaneSample.java   
@Override
public void start(Stage stage) {
    stage.setTitle("TitledPane");
    Scene scene = new Scene(new Group(), 800, 250);
    scene.setFill(Color.GHOSTWHITE);
    // --- GridPane container
    TitledPane gridTitlePane = new TitledPane();
    GridPane grid = new GridPane();
    grid.setVgap(4);
    grid.setPadding(new Insets(5, 5, 5, 5));
    grid.add(new Label("To: "), 0, 0);
    grid.add(new TextField(), 1, 0);
    grid.add(new Label("Cc: "), 0, 1);
    grid.add(new TextField(), 1, 1);
    grid.add(new Label("Subject: "), 0, 2);
    grid.add(new TextField(), 1, 2);
    grid.add(new Label("Attachment: "), 0, 3);
    grid.add(label, 1, 3);
    gridTitlePane.setText("Grid");
    gridTitlePane.setContent(grid);

    // --- Accordion
    final Accordion accordion = new Accordion();
    for (int i = 0; i < imageNames.length; i++) {
        images[i] = new Image(getClass().getResourceAsStream(imageNames[i] + ".jpg"));
        pics[i] = new ImageView(images[i]);
        tps[i] = new TitledPane(imageNames[i], pics[i]);
    }
    accordion.getPanes().addAll(tps);

    accordion.expandedPaneProperty().addListener(new ChangeListener<TitledPane>() {

        @Override
        public void changed(ObservableValue<? extends TitledPane> arg0, TitledPane arg1, TitledPane arg2) {
            // TODO Auto-generated method stub

        }/*
        public void changed(ObservableValue<? extends TitledPane> ov, TitledPane old_val, TitledPane new_val) {
            if (new_val != null) {
                label.setText(accordion.getExpandedPane().getText() + ".jpg");
            }
        }
    */});
    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(gridTitlePane, accordion);
    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}
项目:SensorThingsManager    文件:EntityGuiController.java   
/**
 *
 * @param service The service the entity belongs to.
 * @param entity the entity.
 * @param gridProperties the grid for entity properties.
 * @param accordionLinks The accordion for navigation properties.
 * @param labelId The label that shows the entity id.
 * @param editable is the entity editable.
 */
public void init(SensorThingsService service, T entity, GridPane gridProperties, Accordion accordionLinks, Label labelId, boolean editable);
项目:GameAuthoringEnvironment    文件:SideBarDisplay.java   
protected abstract void fillAccordion (Accordion accordion);