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

项目:Goliath-Overclocking-Utility-FX    文件:TabsMenu.java   
public TabsMenu(TabPane tabPane)
{
    super("Tabs");

    tabPaneToAddTo = tabPane;
    tabs = tabPane.getTabs().toArray(new Tab[tabPane.getTabs().size()]);

    handler = new MenuHandler(tabs);

    for(int i = 0; i < tabs.length; i++)
    {
        MenuItem tmp = new MenuItem(tabs[i].getText());
        tmp.setOnAction(handler);
        super.getItems().add(tmp);
    }
    tabPaneToAddTo.getTabs().remove(3, 5);
}
项目:CyberTigerScoreboard    文件:CPscorereport.java   
@Override
public void start(Stage mainWin) throws IOException {
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    DEFAULT_HEIGHT = screenSize.height - 100;
    DEFAULT_WIDTH = screenSize.width - 100;

    teamTabs = new TabPane(); // Initialize the pane with for the tabs
    setUpHelp = new GUIHelper(this); // Initialize the GUI helper class
    info = setUpHelp.createTextBox("Server not configured!"); // Initialize the textbox
    menuBar = setUpHelp.getMenu(info); // Initialize the menubar and the menus
    elementSect = new StackPane(); // Initialize the element stackpane
    elementSect.getChildren().add(teamTabs); // Add the tabs from teamtabs there
    borderPane = new BorderPane(); // Add the border pane
    borderPane.setTop(menuBar); // Add stuff to the borders
    borderPane.setCenter(elementSect); // But the elementSect in the middle
    borderPane.setBottom(info); // Put the textpane in the bottom
    Scene scene = new Scene(borderPane, DEFAULT_WIDTH, DEFAULT_HEIGHT); // Create the scene for the height
    mainWin.getIcons().add(new Image(ICON_LOC)); // Set the icon as the CyberTiger icon
    mainWin.setTitle("CyberTiger Scoreboard"); // Get the window name
    mainWin.setScene(scene); // Set the window
    mainWin.show(); // Show the window

    refreshData(); // Refresh the data since this creates the rest of teh GUI

    Timeline scoreboardRefresh = new Timeline(new KeyFrame(Duration.seconds(REFRESH_TIMEOUT), (ActionEvent event) -> {
        try {
            refreshData(); // Put the refresh method in this method to autorefresh every minute
        } catch (IOException ex) { // Catch the exception from the database conn
            info.setText("Error refreshing scores! " + ex); // Show the errors
        }
    }));
    scoreboardRefresh.setCycleCount(Timeline.INDEFINITE); // Set the number of times to run
    scoreboardRefresh.play(); // Run the timer
}
项目:fwm    文件:StatBlockController.java   
public void start(Stage primaryStage, TabPane rootLayout){
    tabPane = rootLayout;
    primaryStage.setTitle("Statblock");
    Scene myScene = new Scene(rootLayout);
    App.getHotkeyController().giveGlobalHotkeys(myScene);
    App.getHotkeyController().giveStatblockHotkeys(myScene);
    primaryStage.setScene(myScene);
    primaryStage.show();           
    primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
           public void handle(WindowEvent we) {
               log.debug("Statblock Controller is closing");
               started = false;
           }
       }); 
    ourStage = primaryStage;
    startAutoUpdateTabs();
    started = true;
    log.debug("started statblock controller.");
}
项目:marathonv5    文件:ModalDialog.java   
private ObservableList<Node> getChildren(Node node) {
    if (node instanceof ButtonBar) {
        return ((ButtonBar) node).getButtons();
    }
    if (node instanceof ToolBar) {
        return ((ToolBar) node).getItems();
    }
    if (node instanceof Pane) {
        return ((Pane) node).getChildren();
    }
    if (node instanceof TabPane) {
        ObservableList<Node> contents = FXCollections.observableArrayList();
        ObservableList<Tab> tabs = ((TabPane) node).getTabs();
        for (Tab tab : tabs) {
            contents.add(tab.getContent());
        }
        return contents;
    }
    return FXCollections.observableArrayList();
}
项目:marathonv5    文件:CompositeLayout.java   
private void initComponents() {
    optionBox.setItems(model);
    optionBox.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
        if (newValue != null) {
            updateTabPane();
        }
    });
    optionBox.setCellFactory(new Callback<ListView<PlugInModelInfo>, ListCell<PlugInModelInfo>>() {
        @Override public ListCell<PlugInModelInfo> call(ListView<PlugInModelInfo> param) {
            return new LauncherCell();
        }
    });
    optionTabpane.setId("CompositeTabPane");
    optionTabpane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
    optionTabpane.getStyleClass().add(TabPane.STYLE_CLASS_FLOATING);
    VBox.setVgrow(optionTabpane, Priority.ALWAYS);
}
项目:marathonv5    文件:JavaFXTabPaneElement.java   
@Override public boolean marathon_select(String tab) {
    Matcher matcher = CLOSE_PATTERN.matcher(tab);
    boolean isCloseTab = matcher.matches();
    tab = isCloseTab ? matcher.group(1) : tab;
    TabPane tp = (TabPane) node;
    ObservableList<Tab> tabs = tp.getTabs();
    for (int index = 0; index < tabs.size(); index++) {
        String current = getTextForTab(tp, tabs.get(index));
        if (tab.equals(current)) {
            if (isCloseTab) {
                ((TabPaneSkin) tp.getSkin()).getBehavior().closeTab(tabs.get(index));
                return true;
            }
            tp.getSelectionModel().select(index);
            return true;
        }
    }
    return false;
}
项目:marathonv5    文件:TabSample.java   
public TabSample() {
    BorderPane borderPane = new BorderPane();
    final TabPane tabPane = new TabPane();
    tabPane.setPrefSize(400, 400);
    tabPane.setSide(Side.TOP);
    tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
    final Tab tab1 = new Tab();
    tab1.setText("Tab 1");
    final Tab tab2 = new Tab();
    tab2.setText("Tab 2");
    final Tab tab3 = new Tab();
    tab3.setText("Tab 3");
    final Tab tab4 = new Tab();
    tab4.setText("Tab 4");
    tabPane.getTabs().addAll(tab1, tab2, tab3, tab4);
    borderPane.setCenter(tabPane);
    getChildren().add(borderPane);
}
项目:marathonv5    文件:RFXTabPaneTest.java   
@Test public void getText() throws Throwable {
    TabPane tabPane = (TabPane) getPrimaryStage().getScene().getRoot().lookup(".tab-pane");
    LoggingRecorder lr = new LoggingRecorder();
    List<String> text = new ArrayList<>();
    Platform.runLater(new Runnable() {
        @Override public void run() {
            RFXTabPane rfxTabPane = new RFXTabPane(tabPane, null, null, lr);
            tabPane.getSelectionModel().select(1);
            rfxTabPane.mouseClicked(null);
            text.add(rfxTabPane.getAttribute("text"));
        }
    });
    new Wait("Waiting for tab pane text.") {
        @Override public boolean until() {
            return text.size() > 0;
        }
    };
    AssertJUnit.assertEquals("Tab 2", text.get(0));
}
项目:GameAuthoringEnvironment    文件:GameAuthoringInitUseCase.java   
@Override
public void init () {
    TabViewer charTabView = new CharTabViewer();
    TabViewer levelTabView = new LevelTabViewer();

    TabPane tabPane = new TabPane();

    Tab charTab = new Tab();
    Tab levelTab = new Tab();

    charTab.setContent(charTabView.draw());
    levelTab.setContent(levelTabView.draw());

    tabPane.getTabs().add(charTab);
    tabPane.getTabs().add(levelTab);

}
项目:LMSGrabber    文件:SettingsWindow.java   
public SettingsWindow(Stage parent) throws IOException {
  super(StageStyle.UNDECORATED);
  prefs = Preferences.userNodeForPackage(App.class);

  // Load root layout from fxml file.
  FXMLLoader loader = new FXMLLoader(getClass().getResource("fxml/settings_menu.fxml"));

  loader.setController(this);

  this.initModality(Modality.WINDOW_MODAL);
  this.initOwner(parent);
  this.setAlwaysOnTop(true);

  TabPane layout = loader.load();

  Scene scene2 = new Scene(layout);
  this.setScene(scene2);

  this.setTitle("LMSGrabber Settings");

  min_delay_slider.setValue(prefs.getDouble("min_delay", 1.0));
  max_delay_slider.setValue(prefs.getDouble("max_delay", 3.0));
  input_proxy.setText(prefs.get("proxy", ""));
  multithreaded_check.setSelected(prefs.getBoolean("multithreaded", true));
}
项目:MineIDE    文件:TabManagement.java   
public void addTab(final String name, final String id, final Node content)
{
    final Tab tab = TabHelper.createTabWithContextMenu(name, id, "/mineide/img/addIcon.png");
    final TabPane tabs = this.tabPanes.get(0);
    int index = tabs.getTabs().indexOf(tab);
    if (index == -1)
    {
        final BorderPane borderPane = new BorderPane();
        tab.setContent(borderPane);

        if (content != null)
            borderPane.setCenter(content);
        tabs.getTabs().add(tab);
        tabs.getSelectionModel().select(tab);
    }
    else
        tabs.getSelectionModel().select(index);
}
项目:can4eve    文件:TestHelpPages.java   
public void loopTabs(JFXTripletDisplay jfxDisplay) {
  XYTabPane xyTabPane = jfxDisplay.getXyTabPane();
  ObservableList<Tab> vtabs = xyTabPane.getvTabPane().getTabs();
  for (Tab vtab : vtabs) {
    xyTabPane.getvTabPane().getSelectionModel().select(vtab);
    TabPane hTabPane = xyTabPane.getSelectedTabPane();
    ObservableList<Tab> htabs = hTabPane.getTabs();

    if (vtab.getTooltip() != null) {
      String vTitle = vtab.getTooltip().getText();
      for (Tab htab : htabs) {
        hTabPane.getSelectionModel().select(htab);
        String title = htab.getTooltip().getText();
        System.out.println(vTitle + "_" + title);
        snapShot(jfxDisplay.getStage(),vTitle+"_"+title);
      }
    }
  }
  done=true;

}
项目:ServerBrowser    文件:FilesView.java   
/**
 * Initializes the whole view.
 */
public FilesView() {

    chatLogTextArea = new TextArea();
    chatLogTextArea.setEditable(false);

    clearLogsButton = new Button(Client.lang.getString("clear"));
    loadLogsButton = new Button(Client.lang.getString("reload"));

    final ButtonBar buttonBar = new ButtonBar();
    buttonBar.getButtons().addAll(loadLogsButton, clearLogsButton);

    final VBox chatLogsTabContent = new VBox(5.0, chatLogTextArea, buttonBar);
    VBox.setVgrow(chatLogTextArea, Priority.ALWAYS);

    chatLogsTab = new Tab(Client.lang.getString("chatlogs"), chatLogsTabContent);

    rootPane = new TabPane(chatLogsTab);
    rootPane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
}
项目:stvs    文件:SpecificationsPane.java   
/**
 * Creates an empty instance.
 */
public SpecificationsPane() {
  this.tabPane = new TabPane();
  this.addButton = new Button("+");
  ViewUtils.setupClass(this);


  AnchorPane.setTopAnchor(tabPane, 0.0);
  AnchorPane.setLeftAnchor(tabPane, 0.0);
  AnchorPane.setRightAnchor(tabPane, 0.0);
  AnchorPane.setBottomAnchor(tabPane, 0.0);
  AnchorPane.setTopAnchor(addButton, 5.0);
  AnchorPane.setRightAnchor(addButton, 5.0);

  this.getChildren().addAll(tabPane, addButton);
}
项目:Game-Engine-Vooga    文件:LoginScreen.java   
/**
 * Inializes the login Screen, assembling the necessary text boxes and buttons necessary to store all the information.
 */
public LoginScreen () {
    myHouse = new TabPane();
    VoogaScene scene = new VoogaScene(myHouse);
    Tab login = new Tab(LOG);
    VBox loginContent = new VBox();
    loginContent.getChildren().addAll(loginInput(), loginConfirm());
    login.setContent(loginContent);
    Tab user = new Tab("New User");
    VBox userContent = new VBox();
    userContent.getChildren().addAll(userInput(), imageSelect(), userConfirm());
    user.setContent(userContent);
    myHouse.getTabs().addAll(login, user);
    myHouse.setPrefSize(WIDTH, HEIGHT);
    this.setScene(scene);
}
项目:Game-Engine-Vooga    文件:ArchetypeBuilder.java   
/**
 * Initializing Builder.
 * @param editor
 */
public ArchetypeBuilder (EditElementable editor) {
    super(editor);
    this.editor = editor;

    this.setMinWidth(WIDTH);
    this.setMinHeight(HEIGHT);
    this.tabpane = new TabPane();
    this.myProperties = new HashMap<>();
    this.createTab = new Tab("Create");
    this.propertiesTab = new Tab("Properties");
    this.creation = new VBox();
    this.tabpane.getTabs().addAll(createTab, propertiesTab);
    this.archetypeName = new TextField();
    this.mass = new TextField();
    populate();
    load(this.tabpane);
}
项目:Game-Engine-Vooga    文件:EventWindow.java   
public EventWindow(EditEventable manager){
    this.manager = manager;

    ButtonMaker maker = new ButtonMaker();

    tabPane = new TabPane();
    myScene = new VoogaScene(tabPane);
    event = new VoogaEvent();
    eventFactory = new CauseAndEffectFactory();

    Button apply1 = maker.makeButton(APPLY ,e->apply());
    Button apply2= maker.makeButton(APPLY ,e->apply());
    Button cancel1 = maker.makeButton(CANCEL ,e->cancel());
    Button cancel2 = maker.makeButton(CANCEL ,e->cancel());

    causeAccoridion = new EventAccoridion(manager,"Cause",apply1,cancel1);
    effectAccoridion = new EventAccoridion(manager,"Effect",apply2,cancel2);
    tabPane.getTabs().addAll(causeAccoridion,effectAccoridion);

    this.setTitle("New Event");
    this.setWidth(SCREEN_SIZE);
    this.setHeight(SCREEN_SIZE);
    this.setScene(myScene);
}
项目:Incubator    文件:GameAreaPresenter.java   
public void onActionShowHideRightMenu() {
    DebugConsole.getDefault().debug(this.getClass(), "On action show/hide RightMenu"); // NOI18N

    if (!rightMenuIsShown) {
        // Show DebugOptions
        rightMenuIsShown = Boolean.TRUE;

        final TabPane tpRightMenu = this.onActionCreateRigthMenu();
        vbRightMenu.getChildren().add(tpRightMenu);
        vbRightMenu.setStyle("-fx-background-color: rgba(255, 255, 255, 0.7);"); // NOI18N
        VBox.setVgrow(tpRightMenu, Priority.ALWAYS);
    }
    else {
        // Hide DebugOptions
        rightMenuIsShown = Boolean.FALSE;

        vbRightMenu.getChildren().remove(1);
        vbRightMenu.setStyle("-fx-background-color: rgba(255, 255, 255, 0.0);"); // NOI18N

        this.onActionShowHideLeftMenu(false);
    }
}
项目:Gargoyle    文件:ScmCommitCompositeExam.java   
@Override
    public void start(Stage primaryStage) throws Exception {
        Properties properties = new Properties();
        properties.put(JavaSVNManager.SVN_URL, "svn://10.40.41.49");
//      properties.put(JavaSVNManager.SVN_USER_ID, "kyjun.kim");
//      properties.put(JavaSVNManager.SVN_USER_PASS, "kyjun.kim");

        FxSVNHistoryDataSupplier svnDataSupplier = new FxSVNHistoryDataSupplier(new JavaSVNManager(properties));

        SvnChagnedCodeComposite svnChagnedCodeComposite = new SvnChagnedCodeComposite(svnDataSupplier);
        ScmCommitComposite scmCommitComposite = new ScmCommitComposite(svnDataSupplier);
        TabPane tabPane = new TabPane();
        tabPane.getTabs().addAll(new Tab("Chagned Codes.", svnChagnedCodeComposite), new Tab("Commit Hist.", scmCommitComposite));
        primaryStage.setScene(new Scene(tabPane));
        primaryStage.show();
    }
项目:Gargoyle    文件:SVNTreeView.java   
/**
 * SVN Graph
 *
 * @작성자 : KYJ
 * @작성일 : 2016. 7. 21.
 * @param e
 * @throws Exception
 */
public void menuSVNGraphOnAction(ActionEvent e) {

    final int selectedIndex = getSelectionModel().getSelectedIndex();
    ObservableList<TreeItem<SVNItem>> children = getRoot().getChildren();
    TreeItem<SVNItem> selectedItem = children.get(selectedIndex);
    if (selectedItem != null) {
        SVNItem value = selectedItem.getValue();
        if (value != null && value instanceof SVNRepository) {
            SVNRepository repo = (SVNRepository) value;
            TabPane createSVNGraph = null;
            try {
                createSVNGraph = FxUtil.createSVNGraph(repo.getManager());
            } catch (Exception e1) {
                LOGGER.error(ValueUtil.toString(e1));
            }

            if (createSVNGraph != null) {
                setSvnGraphProperty(createSVNGraph);
            }
        }
    }

}
项目:standalone-app    文件:AllFilesViewerController.java   
private void openNewEditor(Tab fileTab, EditorView editor) {
    FileTabProperties properties = (FileTabProperties) fileTab.getUserData();
    TabPane filePane = (TabPane) fileTab.getContent();
    if (properties.getOpenedEditors().containsKey(editor.getDisplayName())) {
        Tab tab = properties.getOpenedEditors().get(editor.getDisplayName());
        filePane.getSelectionModel().select(tab);
        return;
    }
    Tab editorTab = new Tab(editor.getDisplayName());
    editorTab.setContent(editor.createView(properties.getFile(), properties.getPath()));
    editorTab.setOnClosed(event -> {
        properties.getOpenedEditors().remove(editor.getDisplayName());
    });
    filePane.getTabs().add(editorTab);
    filePane.getSelectionModel().select(editorTab);
    properties.getOpenedEditors().put(editor.getDisplayName(), editorTab);
}
项目:zest-writer    文件:FunctionTreeFactory.java   
public static void clearContent(ObservableList<Textual> extracts, TabPane editorList, Supplier<Void> doAfter) {

        if (extracts.isEmpty()) {
            doAfter.get();
        }

        for (Textual entry : extracts) {
            Platform.runLater(() -> {
                Tab tab = getTabFromTextual(editorList, entry);
                Event.fireEvent(tab, new Event(Tab.TAB_CLOSE_REQUEST_EVENT));
                if (editorList.getTabs().size() <= 1) {
                    extracts.clear();
                    doAfter.get();
                }
            });
        }
    }
项目:programmierpraktikum-abschlussprojekt-team-1    文件:Gui.java   
/** Erstellt ein Tabpane, das in drei Tabs ein leeres Test-, Code-, und Konsolenpane enthaelt
 * Die Tabs koennen nicht geschlossen werden.
 * @return gibt das ertellte Tabpane zurueck
 */
private TabPane create_center(){
    TabPane menue = new TabPane();
    menue.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
    code_pane = new CodePane();
    test_pane = new TestPane();
    console_pane = new ConsolePane();
    Tab code_tab = new Tab("Code");
    Tab test_tab = new Tab("Tests");
    Tab console_tab = new Tab("Konsole");
    code_tab.setContent(code_pane);
    test_tab.setContent(test_pane);
    console_tab.setContent(console_pane);
    code_tab.setContent(code_pane);
    test_tab.setContent(test_pane);
    console_tab.setContent(console_pane);
    menue.getTabs().addAll(code_tab, test_tab, console_tab);
    return menue;
}
项目:openjfx-8u-dev-tests    文件:TabPaneApp.java   
protected Object createObject(double width, double height, Double tab_width, Double tab_height) {
    TabPane tab_pane = new TabPane();
    for (int i = 0; i < TABS_NUM; i++) {
        Tab tab = new Tab("Tab " + i);
        Label label = new Label("Tab's " + i + " content");
        tab.setContent(label);
        VBox box  = new VBox();
        box.getChildren().add(createRect(tab_width, tab_height, new Color(0.0, 1.0, 0.0, 1.0)));
        box.getChildren().add(createRect(tab_width, tab_height, new Color(0.0, 0.0, 1.0, 1.0)));
        tab.setGraphic(box);
        tab_pane.getTabs().add(tab);
    }
    tab_pane.setMaxSize(width, height);
    tab_pane.setPrefSize(width, height);
    tab_pane.setStyle("-fx-border-color: darkgray;");
    return tab_pane;
}
项目:slogo    文件:View.java   
/**
 * create a TabPane that allows the user to see different windows
 * @param panel: window to display on the screen
 * @param closable: set closable
 * @return
 */
private TabPane tabify(Region panel, boolean closable) {

    TabPane tabPane = new TabPane();
    String[] split = panel.getClass().toString().split("\\.");
    String title = split[split.length - 1];
    Tab tab = new Tab(title);
    tab.setClosable(closable);
    tab.setContent(panel);

    if (closable) {
        tab.setOnClosed(e -> {
            toggleWindow(title);
        });

    }

    tabPane.getTabs().add(tab);

    return tabPane;
}
项目:slogo    文件:View.java   
/**
 * Set windows on right side of screen
 * @param windowsShowing
 */
private void setRightPanels(Map<String, Pair<Region, Boolean>> windowsShowing) {
    int numberOfPanels = 0;

    List<String> activeWindows = windowsShowing.keySet().stream().filter(s -> windowsShowing.get(s).getLast())
            .collect(Collectors.toList());

    numberOfPanels = activeWindows.size();
    System.out.println(numberOfPanels);

    for (String window : windowsShowing.keySet()) {
        if (windowsShowing.get(window).getLast()) {
            TabPane tp = tabify(windowsShowing.get(window).getFirst(), true);
            grid.addColumn(1, tp);
            GridPane.setRowSpan(tp, 24 / numberOfPanels);
        }
    }
}
项目:maf    文件:DCUI.java   
public DCUI( MemristorLibrary.Memristor_Model  memristorType, MAF parentMAF) {
    this.parentMAF = parentMAF;
    this.memristorType = memristorType;
    this.stage = new Stage();
    this.tabPane = new TabPane();
    startDCUI();
    stage.setTitle("Device Characterization: " + memristorType.title());
    //create scene with set width, height and color
    scene = new Scene(tabPane, 720, 500, Color.WHITESMOKE);
    //set scene to stage
    stage.setScene(scene);
    //center stage on screen
    stage.centerOnScreen();
    //show the stage
    stage.show();
}
项目:reduxfx    文件:TabPaneSelectionModelAccessor.java   
@SuppressWarnings("unchecked")
@Override
public void set(Consumer<Object> dispatcher, Object node, String name, VProperty vProperty) {
    if(! (node instanceof TabPane)) {
        throw new IllegalStateException("Trying to set selectionModel of node " + node);
    }

    final TabPane tabPane = (TabPane) node;

    final ReadOnlyIntegerProperty selectedIndexProperty = tabPane.getSelectionModel().selectedIndexProperty();

    clearListeners(node, selectedIndexProperty);

    if (vProperty.isValueDefined()) {
        tabPane.getSelectionModel().select((int) vProperty.getValue());
    }

    if(vProperty.getChangeListener().isDefined()) {
        setChangeListener(dispatcher, node, selectedIndexProperty, vProperty.getChangeListener().get());
    }

    if(vProperty.getInvalidationListener().isDefined()) {
        setInvalidationListener(dispatcher, node, selectedIndexProperty, vProperty.getInvalidationListener().get());
    }
}
项目:ecasta    文件:TabsViewControllerTest.java   
@Ignore
@Test
public void testHandleTestsystemChangedEvent() throws Exception {
    TabPane tabPane = prepareTabPane();
    List<Tab> tabs = prepareTabPane().getTabs();
    Testsystem ts = mock(Testsystem.class);
    TestsystemChangedEvent event = mock(TestsystemChangedEvent.class);
    UUID id = UUID.randomUUID();
    Url url = new Url("http", "test", "8080", "");
    List<Feature> features = Arrays.asList(mock(Feature.class));
    when(event.getTestsystem()).thenReturn(ts);
    when(ts.getId()).thenReturn(id);
    when(ts.getName()).thenReturn("Testsystem");
    when(ts.getUrl()).thenReturn(url);
    when(ts.getFeatures()).thenReturn(features);
    when(children.get(id)).thenReturn(current);
    // when(tabPane.getTabs()).thenReturn((ObservableList<Tab>) tabs);
    classUnderTest.setView(tabPane);
    classUnderTest.handleTestsystemChangedEvent(event);
}
项目:standalone-app    文件:AllFilesViewerController.java   
private void openNewEditor(Tab fileTab, EditorView editor) {
    FileTabProperties properties = (FileTabProperties) fileTab.getUserData();
    TabPane filePane = (TabPane) fileTab.getContent();
    if (properties.getOpenedEditors().containsKey(editor.getDisplayName())) {
        Tab tab = properties.getOpenedEditors().get(editor.getDisplayName());
        filePane.getSelectionModel().select(tab);
        return;
    }
    Tab editorTab = new Tab(editor.getDisplayName());
    editorTab.setContent(editor.createView(properties.getFile(), properties.getPath()));
    editorTab.setOnClosed(event -> {
        properties.getOpenedEditors().remove(editor.getDisplayName());
    });
    filePane.getTabs().add(editorTab);
    filePane.getSelectionModel().select(editorTab);
    properties.getOpenedEditors().put(editor.getDisplayName(), editorTab);
}
项目:theta    文件:BaseGui.java   
@Override
public void start(final Stage primaryStage) throws Exception {
    primaryStage.setMinHeight(400);
    primaryStage.setMinWidth(600);
    final BorderPane mainPane = new BorderPane();

    tabPane = new TabPane();
    tabPane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);

    controls = new GridPane();

    mainPane.setLeft(controls);
    mainPane.setCenter(tabPane);

    initializeControls(primaryStage);

    final Scene scene = new Scene(mainPane);
    primaryStage.setTitle(getTitle());
    primaryStage.setScene(scene);
    primaryStage.show();
}
项目:javafx.DndTabPane    文件:DndTabPaneFactory.java   
/**
 * Create a tab pane with a default setup for drag feedback
 * 
 * @param feedbackType
 *            the feedback type
 * @param setup
 *            consumer to set up the tab pane
 * @return a pane containing the TabPane
 */
public static Pane createDefaultDnDPane(FeedbackType feedbackType, Consumer<TabPane> setup) {
    StackPane pane = new StackPane();
    DndTabPane tabPane = new DndTabPane() {
        @Override
        protected javafx.scene.control.Skin<?> createDefaultSkin() {
            DnDTabPaneSkin skin = new DnDTabPaneSkin(this);
            setup(feedbackType, pane, skin);

            return skin;
        }
    };

    if (setup != null) {
        setup.accept(tabPane);
    }

    pane.getChildren().add(tabPane);
    return pane;
}
项目:javafx.DndTabPane    文件:DndTabPaneFactory.java   
private static void handleDropped(DroppedData data) {
    TabPane targetPane = data.targetTab.getTabPane();
    int oldIndex = data.draggedTab.getTabPane().getTabs().indexOf(data.draggedTab);
    data.draggedTab.getTabPane().getTabs().remove(data.draggedTab);
    int idx = targetPane.getTabs().indexOf(data.targetTab);
    if (data.dropType == DropType.AFTER) {
        if (idx + 1 <= targetPane.getTabs().size()) {
            targetPane.getTabs().add(idx + 1, data.draggedTab);
        } else {
            targetPane.getTabs().add(data.draggedTab);
        }
    } else {
        targetPane.getTabs().add(idx, data.draggedTab);
    }

    fireTabDraggedEvent((DndTabPane) targetPane, data.draggedTab, oldIndex, targetPane.getTabs().indexOf(data.draggedTab));

    data.draggedTab.getTabPane().getSelectionModel().select(data.draggedTab);
}
项目:FirefightersCenter    文件:FirefightersRootPane.java   
public Scene initScene() {
  Group root = new Group();
  Scene scene = new Scene(root, 550, 550, Color.WHITE);
  TabPane tabPane = new TabPane();
  BorderPane borderPane = new BorderPane();

  Tab tabAlerts = new Tab();
  tabAlerts.setClosable(false);
  tabAlerts.setText("Powiadomienia");
  tabAlerts.setContent(firefightersAlertsPane.initView());
  tabPane.getTabs().add(tabAlerts);

  GridPane reportsPane = firefightersReportsPane.initView();
  Tab tabReports = new Tab();
  tabReports.setClosable(false);
  tabReports.setText("Raporty");
  tabReports.setContent(reportsPane);
  tabPane.getTabs().add(tabReports);

  borderPane.prefHeightProperty().bind(scene.heightProperty());
  borderPane.prefWidthProperty().bind(scene.widthProperty());

  borderPane.setCenter(tabPane);
  root.getChildren().add(borderPane);
  return scene;
}
项目:bootstrapfx    文件:Sampler.java   
private DemoTab(String title, String sourceFile) throws Exception {
    super(title);
    setClosable(false);

    TabPane content = new TabPane();
    setContent(content);
    content.setSide(Side.BOTTOM);

    Tab widgets = new Tab("Widgets");
    widgets.setClosable(false);
    URL location = getClass().getResource(sourceFile);
    FXMLLoader fxmlLoader = new FXMLLoader(location);
    Node node = fxmlLoader.load();
    widgets.setContent(node);

    Tab source = new Tab("Source");
    source.setClosable(false);
    XMLEditor editor = new XMLEditor();
    editor.setEditable(false);

    String text = lines(Paths.get(getClass().getResource(sourceFile).toURI())).collect(joining("\n"));
    editor.setText(text);
    source.setContent(editor);

    content.getTabs().addAll(widgets, source);
}
项目:DraggableTabs    文件:DraggableTabInsertPane.java   
protected void registerListeners() {
    setOnDragOver(event -> {
        if (isDraggingTab(event.getDragboard())) {
            event.acceptTransferModes(TransferMode.MOVE);
            event.consume();
        }
    });

    setOnDragDropped(event -> {
        if (isDraggingTab(event.getDragboard())) {
            final DraggableTab tab = DraggableTab.draggingTab.get();
            TabPane oldTabPane = tab.getTabPane();
            oldTabPane.getTabs().remove(tab);

            DraggableTabLayoutExtender sourceDraggableTabLayoutExtender = DraggableTabFactory.getFactory().wrapTab(tab);

            addComponent(draggableTabLayoutExtender.getParent(), sourceDraggableTabLayoutExtender);

            DraggableTabUtils.cleanup(oldTabPane);

            DraggableTab.draggingTab.set(null);
            event.setDropCompleted(true);
            event.consume();
        }
    });
}
项目:Nocturne    文件:CodeTab.java   
public CodeTab(TabPane pane, String className, String displayName) {
    this.className = className;
    this.setText(CLASS_PATH_SEPARATOR_PATTERN.matcher(displayName).replaceAll("."));

    pane.getTabs().add(this);

    FXMLLoader loader = new FXMLLoader(ClassLoader.getSystemResource("fxml/CodeTab.fxml"));
    loader.setResources(Main.getResourceBundle());
    loader.setRoot(this);
    loader.setController(this);

    try {
        loader.load();
    } catch (IOException e) {
        e.printStackTrace();
    }

    CODE_TABS.put(className, this);
    getTabPane().getSelectionModel().select(this);

    this.setOnClosed(event -> CODE_TABS.remove(this.getClassName()));
}
项目:jfx-torrent    文件:TabActionHandler.java   
private void onResetTabs(final List<CheckMenuItem> checkMenuItems,
        final TabPane tabPane, final Map<String, Tab> tabMap) {
    tabPane.getTabs().clear();
    final Set<String> defaultVisibleTabNames = Arrays.stream(GuiProperties.DEFAULT_TAB_VISIBILITY.split(
            GuiProperties.COMPOSITE_PROPERTY_VALUE_SEPARATOR)).collect(Collectors.toSet());
    checkMenuItems.stream().filter(mi -> mi instanceof CheckMenuItem).forEach(cm -> {
        final CheckMenuItem tabVisibilityCheck = (CheckMenuItem)cm;
        tabVisibilityCheck.setDisable(false);
        final String tabId = tabVisibilityCheck.getId();            
        final boolean tabVisible = defaultVisibleTabNames.contains(tabId);              
        if(tabVisible) {
            tabPane.getTabs().add(tabMap.get(tabId));
        }
    });
    checkMenuItems.stream().forEach(cm -> cm.setSelected(defaultVisibleTabNames.contains(cm.getId())));     
}
项目:burstcoin-address-generator    文件:GeneratorAppView.java   
/**
   * Instantiates a new Generator app view.
   *
   * @param action the action
   */
  public GeneratorAppView(Action action)
  {
//    AeroFX.style();
//    AquaFx.style();

    tabLookup = new HashMap<>();
    this.action = action;
    ToolBar mainBar = new ToolBar();
    Label appLabel = new Label("BURST Address Generator");
    mainBar.getItems().add(appLabel);

    tabPane = new TabPane();

    ToolBar statusBar = new ToolBar();
    statusBar.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
    statusBar.getItems().add(new Label("Version: 0.2.3-SNAPSHOT"));

    setTop(mainBar);
    setCenter(tabPane);
    setBottom(statusBar);
  }
项目:netentionj-desktop    文件:NodeControlPane.java   
public NodeControlPane(Core core) {
    super();

    this.core = core;


    TabPane tab = new TabPane();      
    tab.getTabs().add(newIndexTab());                
    tab.getTabs().add(newWikiTab());
    tab.getTabs().add(newSpacetimeTab());
    tab.getTabs().add(newSpaceTab());
    tab.getTabs().add(newTimeTab());
    tab.getTabs().add(newOptionsTab());

    tab.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
    tab.autosize();

    setCenter(tab);

    FlowPane menu = new FlowPane();
    menu.getChildren().add(newAddButton());
    menu.getChildren().add(newBrowserButton());

    setBottom(menu);
}