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

项目: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    文件:SimpleWebServer.java   
@Override public void start(Stage primaryStage) throws Exception {
    primaryStage.setTitle("Simple Web Server");
    BorderPane root = new BorderPane();
    TextArea area = new TextArea();
    root.setCenter(area);
    ToolBar bar = new ToolBar();
    Button openInBrowser = FXUIUtils.createButton("open-in-browser", "Open in External Browser", true);
    openInBrowser.setOnAction((event) -> {
        try {
            Desktop.getDesktop().browse(URI.create(webRoot));
        } catch (IOException e) {
            e.printStackTrace();
        }
    });
    Button changeRoot = FXUIUtils.createButton("fldr_closed", "Change Web Root", true);
    changeRoot.setOnAction((event) -> {
        DirectoryChooser chooser = new DirectoryChooser();
        File showDialog = chooser.showDialog(primaryStage);
        if (showDialog != null)
            server.setRoot(showDialog);
    });
    bar.getItems().add(openInBrowser);
    bar.getItems().add(changeRoot);
    root.setTop(bar);
    System.setOut(new PrintStream(new Console(area)));
    System.setErr(new PrintStream(new Console(area)));
    area.setEditable(false);
    primaryStage.setScene(new Scene(root));
    primaryStage.setOnShown((e) -> startServer(getParameters().getRaw()));
    primaryStage.show();
}
项目:marathonv5    文件:MarathonCheckListStage.java   
private void initCheckList() {
    ToolBar toolBar = new ToolBar();
    toolBar.getItems().add(new Text("Check Lists"));
    toolBar.setMinWidth(Region.USE_PREF_SIZE);
    leftPane.setTop(toolBar);
    checkListElements = checkListInfo.getCheckListElements();
    checkListView = new ListView<CheckListForm.CheckListElement>(checkListElements);
    checkListView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
        CheckListElement selectedItem = checkListView.getSelectionModel().getSelectedItem();
        if (selectedItem == null) {
            doneButton.setDisable(true);
            return;
        }
        Node checkListForm = getChecklistFormNode(selectedItem, Mode.DISPLAY);
        if (checkListForm == null) {
            doneButton.setDisable(true);
            return;
        }
        doneButton.setDisable(false);
        ScrollPane sp = new ScrollPane(checkListForm);
        sp.setFitToWidth(true);
        sp.setPadding(new Insets(0, 0, 0, 10));
        rightPane.setCenter(sp);
    });
    leftPane.setCenter(checkListView);
}
项目:qgu    文件:GanttChart.java   
public GanttChart() {
    timelineView = new TimelineView();

    timelineViewToolBar = new ToolBar();
    initTimelineViewToolBar();

    taskView = new TaskTableView(TASK_DATE_FORMAT);
    taskView.addTaskListener(this);

    taskViewToolBar = new ToolBar();
    initTaskViewToolBar();

    metadata = new GanttData();
    metadata.ganttNameProperty().bind(projectName.baseTextProperty());
    metadata.chartStartDateProperty().bind(dpStart.valueProperty());
    metadata.chartEndDateProperty().bind(dpEnd.valueProperty());
    metadata.setRoot(getGanttRoot());

    saved = false;
}
项目:Game-Engine-Vooga    文件:DesignBoard.java   
/**
 * Initializes the container which contains all the contents of the design board.
 */
private void initializeContainers () {
    this.setText(designboardProperties.getString("DesignBoardName"));
    this.setClosable(false);

    contentPane = new StackPane();
    contentPane.setMinSize(width, height);
    scroller = new ScrollPane();
    scroller.setContent(contentPane);

    zoomBar = new ToolBar();

    container = new VBox(zoomBar, scroller);
    this.setContent(container);

    y_offset = width * RESIZE_FACTOR;
    x_offset = height * RESIZE_FACTOR;
}
项目:openjfx-8u-dev-tests    文件:DragDropWithControlsBase.java   
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);
}
项目:openjfx-8u-dev-tests    文件:HorizontalToolBarTest.java   
@Before
@Override
public void setUp() {
    super.setUp();
    Orientation orientation = new GetAction<Orientation>() {

        @Override
        public void run(Object... os) throws Exception {
            setResult(((ToolBar) os[0]).getOrientation());
        }
    }.dispatch(Root.ROOT.getEnvironment(), toolBar.getControl());
    if (orientation == Orientation.VERTICAL) {
        verticalBtn.mouse().click();
        toolBar.waitProperty(ToolBarWrap.VERTICAL_PROP_NAME, false);
    }
}
项目:FxDock    文件:FxDockPane.java   
/** override to create your own toolbar, possibly with custom icons and buttons */
protected Node createToolBar(boolean tabMode)
{
    if(tabMode)
    {
        return null;
    }
    else
    {
        Button b = new Button("x");
        FX.style(b, FxDockStyles.TOOLBAR_CLOSE_BUTTON);
        closeAction.attach(b);

        ToolBar t = new ToolBar();
        FX.style(t, FxDockStyles.TOOLBAR);
        t.getItems().addAll(titleField, b);
        return t;
    }
}
项目:bunkr    文件:HtmlTab.java   
private void initControls()
{
    this.setText(this.subject.getAbsolutePath());
    ToolBar actionBar = new ToolBar();
    this.saveButton = Icons.buildIconButton("Save", Icons.ICON_SAVE);
    this.saveButton.getStyleClass().add("small-button");
    this.switchModeButton = new Button("View");
    this.switchModeButton.getStyleClass().add("small-button");
    this.resetButton = Icons.buildIconButton("Reload", Icons.ICON_RELOAD);
    this.resetButton.getStyleClass().add("small-button");
    actionBar.getItems().addAll(this.saveButton, this.resetButton, this.switchModeButton);
    VBox.setVgrow(actionBar, Priority.NEVER);

    this.editorArea = new TextArea();
    this.editorArea.getStyleClass().add("editor-area-monospaced");
    VBox.setVgrow(this.editorArea, Priority.ALWAYS);

    this.formattedView = new WebView();
    VBox.setVgrow(this.formattedView, Priority.ALWAYS);

    this.layout = new VBox();
    this.layout.getChildren().addAll(actionBar);
    this.setContent(this.layout);

    this.getStyleClass().add("open-file-tab");
}
项目:mars-sim    文件:FlyoutDemo.java   
@Override
public void start(Stage primaryStage) throws Exception {
    BorderPane pane = new BorderPane();

    ToolBar  toolBar = new ToolBar();

    Label fileLabel = new Label("File");

    flyout = createFlyout();

    // Could be TOP, LEFT, RIGHT too!
    flyout.setFlyoutSide(Flyout.Side.BOTTOM);

    toolBar.getItems().addAll(
        fileLabel,
        new Separator(),
        flyout
    );

    pane.setTop(toolBar);

    Scene scene = new Scene(pane, 600, 200);
    primaryStage.setScene(scene);
    primaryStage.show();
}
项目:LifeTiles    文件:ZoombarTest.java   
@Test
public void clickOnPlus() {
    // Hack because javafx toolkit need to be initialized
    JFXPanel panel = new JFXPanel();
    panel.contains(0, 0);
    Zoombar toolbar = new Zoombar(5, 10);

    ToolBar javafxBar = toolbar.getToolBar();
    int initZoom = toolbar.getZoomlevel().intValue();

    Button plus = (Button) javafxBar.getItems().get(0);

    Event.fireEvent(plus, new MouseEvent(MouseEvent.MOUSE_CLICKED, 0, 0, 0,
            0, MouseButton.PRIMARY, 1, true, true, true, true, true, true,
            true, true, true, true, null));

    assertEquals(initZoom + 1, toolbar.getZoomlevel().intValue(), 1e-10);
}
项目:LifeTiles    文件:ZoombarTest.java   
@Test
public void clickOnMinus() {
    // Hack because javafx toolkit need to be initialized
    JFXPanel panel = new JFXPanel();
    panel.contains(0, 0);
    Zoombar toolbar = new Zoombar(5, 10);

    ToolBar javafxBar = toolbar.getToolBar();
    int initZoom = toolbar.getZoomlevel().intValue();

    Button minus = (Button) javafxBar.getItems().get(2);

    Event.fireEvent(minus, new MouseEvent(MouseEvent.MOUSE_CLICKED, 0, 0,
            0, 0, MouseButton.PRIMARY, 1, true, true, true, true, true,
            true, true, true, true, true, null));

    assertEquals(initZoom - 1, toolbar.getZoomlevel().intValue(), 1e-10);
}
项目:LifeTiles    文件:ZoombarTest.java   
@Test
public void scrolloneUpSlider() {
    // Hack because javafx toolkit need to be initialized
    JFXPanel panel = new JFXPanel();
    panel.contains(0, 0);
    Zoombar toolbar = new Zoombar(5, 10);

    ToolBar javafxBar = toolbar.getToolBar();
    int initZoom = toolbar.getZoomlevel().intValue();

    Slider slider = (Slider) javafxBar.getItems().get(1);

    slider.valueProperty().set(slider.valueProperty().get() + 1);

    assertEquals(initZoom + 1, toolbar.getZoomlevel().intValue(), 1e-10);
}
项目:tidbit    文件:FlyoutDemo.java   
@Override
public void start(Stage primaryStage) throws Exception {
    BorderPane pane = new BorderPane();

    ToolBar  toolBar = new ToolBar();

    Label fileLabel = new Label("File");

    flyout = createFlyout();

    // Could be TOP, LEFT, RIGHT too!
    flyout.setFlyoutSide(Flyout.Side.BOTTOM);

    toolBar.getItems().addAll(
        fileLabel,
        new Separator(),
        flyout
    );

    pane.setTop(toolBar);

    Scene scene = new Scene(pane, 600, 200);
    primaryStage.setScene(scene);
    primaryStage.show();
}
项目:jfx-torrent    文件:ApplicationWindow.java   
private void showCompactToolbar(final BorderPane mainPane, final BorderPane centerPane,
                                final ToolBar toolbar, final boolean showCompact) {
    final boolean isToolbarHidden = !showToolbarMenuItem.isSelected();
    mainPane.setTop(showCompact || isToolbarHidden? null : toolbar);
    centerPane.setTop(!showCompact || isToolbarHidden? null : toolbar);
    toolbar.setId(showCompact? centerPane.getId() : mainPane.getId());

    final Button pauseButton = toolbarButtonsMap.get(ImageUtils.PAUSE_ICON_LOCATION);
    final Button rssButton = toolbarButtonsMap.get(ImageUtils.RSS_ICON_LOCATION);
    final ObservableList<Node> toolbarButtons = toolbar.getItems();

    if(showCompact) {
        toolbarButtons.removeAll(pauseButton, rssButton);
    }
    else if(!isExpandedToolbar(toolbar)) {
        //Add Pause button after Start Torrent and RSS button after Add from URL button respectively
        final int rssButtonIndex = toolbarButtons.indexOf(toolbarButtonsMap.get(ImageUtils.LINK_ICON_LOCATION));
        toolbarButtons.add(rssButtonIndex + 1, rssButton);

        final int downloadButtonIndex = toolbarButtons.indexOf(toolbarButtonsMap.get(ImageUtils.DOWNLOAD_ICON_LOCATION));
        toolbarButtons.add(downloadButtonIndex + 1, pauseButton);
    }
}
项目: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);
  }
项目:VOOGASalad    文件:HomeGUI.java   
public Group initialize(GameEngine gameEngine){
    myRoot = new Group();
    //Add behavior for menu buttons later

    ToolBar toolBar = new ToolBar();
    Button newGameButton= new Button("New Game");
    Button loadGameButton = new Button("Load Game");
    Button helpButton = new Button("Help");

    Image background = new Image("../LevelImages/overworld_bg.png");
    ImageView bg = new ImageView(background);
    myRoot.getChildren().add(bg);

    toolBar.getItems().addAll(newGameButton, loadGameButton, helpButton);
    myRoot.getChildren().add(toolBar);                                                          
    return myRoot;
}
项目:javafx-widgets    文件:HorizontalSpaceTest.java   
@Override
public void start(Stage primaryStage) throws Exception {
  final VBox root = new VBox();
  final ToolBar toolbar = new ToolBar();
  toolbar.getItems().add(new Button("button 1"));
  toolbar.getItems().add(new Button("button 2"));
  toolbar.getItems().add(new HorizontalSpace());
  toolbar.getItems().add(new Button("button 3"));
  toolbar.getItems().add(new HorizontalSpace(100));
  toolbar.getItems().add(new Button("button 4"));
  toolbar.getItems().add(new Button("button 5"));

  root.getChildren().add(toolbar);
  primaryStage.setTitle("HorizontalSpace Sample");
  primaryStage.setScene(new Scene(root, 550, 100));
  primaryStage.show();
}
项目:javafx-widgets    文件:VerticalSpaceTest.java   
@Override
public void start(Stage primaryStage) throws Exception {
  final HBox root = new HBox();
  final ToolBar toolbar = new ToolBar();
  toolbar.setOrientation(Orientation.VERTICAL);
  toolbar.getItems().add(new Button("button 1"));
  toolbar.getItems().add(new Button("button 2"));
  toolbar.getItems().add(new VerticalSpace());
  toolbar.getItems().add(new Button("button 3"));
  toolbar.getItems().add(new VerticalSpace(100));
  toolbar.getItems().add(new Button("button 4"));
  toolbar.getItems().add(new Button("button 5"));

  root.getChildren().add(toolbar);
  primaryStage.setTitle("VerticalSpace Sample");
  primaryStage.setScene(new Scene(root, 300, 300));
  primaryStage.show();
}
项目:PhysLayout    文件:Example.java   
/**
 * Super-constructor for all examples.
 */
public Example() {
    root = new BorderPane();
    menu = new ToolBar();
    canvas = new Pane();
    layout = new PhysLayout(canvas);
    root.setCenter(canvas);
    root.setTop(menu);

    reset = new Button("Reset");
    startStop = new Button("Start");
    step = new Button("Step");
    Button exit = new Button("Exit");
    menu.getItems().addAll(startStop, step, reset, exit);
    startStop.setMinWidth(startStop.getWidth() + 50);

    exit.setOnAction((event) -> {
        primaryStage.close();
    });

    setSimulation(new Box2DSpringSimulation(layout));
}
项目:jeotag    文件:TaggingPane.java   
private void createComponents() {
    tvLocations = new TableView<>(DataHolder.getInstance().getLocations());
    tvPhotos = new TableView<>(DataHolder.getInstance().getPhotos());
    laLocations = new Label("Locations");
    laPhotos = new Label("Photos");
    laLocations.setFont(Font.font(20));
    laPhotos.setFont(Font.font(20));
    btLoadKML = new Button("Load location history file(s)");
    btLoadPhotos = new Button("Load image file(s)");
    btLoadPhotoDirectory = new Button("Load directory");
    btGeotag = new Button("Start Geotagging");
    fileChooser = new FileChooser();
    directoryChooser = new DirectoryChooser();
    progressToolBar = new ToolBar();
    progressBar = new ProgressBar();
}
项目:stupidwarriors    文件:SceneBuilder.java   
public static ToolBar createGameToolBar(ToolBar toolbar){

    Region spacer = new Region();
    spacer.getStyleClass().setAll("spacer");

    HBox buttonBar = new HBox();
    buttonBar.getStyleClass().setAll("segmented-button-bar");
    Button sampleButton = new Button("Tasks");
    sampleButton.getStyleClass().addAll("first");
    Button sampleButton2 = new Button("Administrator");
    Button sampleButton3 = new Button("Search");
    Button sampleButton4 = new Button("Line");
    Button sampleButton5 = new Button("Process");
    sampleButton5.getStyleClass().addAll("last", "capsule");
    buttonBar.getChildren().addAll(sampleButton, sampleButton2, sampleButton3, sampleButton4, sampleButton5);
    toolbar.getItems().addAll(spacer, buttonBar);
    return toolbar;
}
项目:titanium    文件:MainPane.java   
private ToolBar getToolBar() {
    ToolBar result = new ToolBar();

    Button add = new Button("", AssetsLoader.getIcon("new_icon.png"));
    Button remove = new Button("", AssetsLoader.getIcon("delete_icon.png"));

    add.setTooltip(new Tooltip("Add a server."));
    remove.setTooltip(new Tooltip("Remove current server."));

    Button connect = new Button("", AssetsLoader.getIcon("connect.png"));
    Button disconnect = new Button("", AssetsLoader.getIcon("disconnect.png"));

    connect.setTooltip(new Tooltip("Connect all."));
    disconnect.setTooltip(new Tooltip("Disconnect all."));

    Button orgManager = new Button("", AssetsLoader.getIcon("wsp_icon.png"));

    orgManager.setTooltip(new Tooltip("Open organization manager."));

    result.getItems().addAll(add, remove, new Separator());
    result.getItems().addAll(connect, disconnect, new Separator());
    result.getItems().addAll(orgManager);

    add.setOnAction(this::addServerAction);
    remove.setOnAction(this::removeServerAction);
    connect.setOnAction(this::connectToAllAction);
    disconnect.setOnAction(this::disconnectFromAll);
    orgManager.setOnAction(this::organizationManagerAction);

    cam.getNotConnectedRequiredButtons().add(remove);
    cam.getWspConnectionRequiredButtons().add(orgManager);


    return result;
}
项目:marathonv5    文件:ToolBarSample.java   
public ToolBarSample() {
    super(200,100);
    ToolBar toolbar = new ToolBar();
    toolbar.getItems().add(new Button("Home"));
    toolbar.getItems().add(new Button("Options"));
    toolbar.getItems().add(new Button("Help"));
    getChildren().add(toolbar);
}
项目:marathonv5    文件:ToolBarSample.java   
public ToolBarSample() {
    super(200,100);
    ToolBar toolbar = new ToolBar();
    toolbar.getItems().add(new Button("Home"));
    toolbar.getItems().add(new Button("Options"));
    toolbar.getItems().add(new Button("Help"));
    getChildren().add(toolbar);
}
项目:MineIDE    文件:GuiToolBar.java   
@Override
public void init()
{
    final ToolBar toolBar = new ToolBar();
    final ToolManagement toolManagement = new ToolManagement(toolBar);

    toolManagement.addButton("/mineIDE/img/addIcon.png");
    toolManagement.addButton("/mineIDE/img/color.png");

    this.addElement(toolBar);
}
项目:dragdropfx    文件:DragDropFX.java   
@Override
public Void call(Object p) {
    if(isIgnored(p)){return null;}
    ToolBar c = (ToolBar) p;
    DnDPrepare.toolBar(c);
    return null;
}
项目:dolphin-platform-webhook-example    文件:ToDoView.java   
public ToDoView(ClientContext clientContext) {
    super(clientContext, Constants.TODO_CONTROLLER_NAME);

    //Define the layout
    todoList = new ListView<>();
    resetButton = new Button("reset");
    removeButton = new Button("remove");
    ToolBar toolBar = new ToolBar(removeButton, resetButton);
    pane = new BorderPane();
    pane.setCenter(todoList);
    pane.setTop(toolBar);
}
项目:GoMint    文件:ToolbarElement.java   
public ToolbarElement() {
    this.toolBar = new ToolBar(
            new Button( "Open" ),
            new Separator(  ),
            new Label( "Currently open performance report: " ),
            this.reportName = new Label( "None" )
    );
}
项目:openjfx-8u-dev-tests    文件:ToolBarBase.java   
@BeforeClass
public static void setUpClass() throws Exception {
    ToolBarApp.main(null);

    scene = Root.ROOT.lookup().wrap();
    parent = scene.as(Parent.class, Node.class);
    toolBar = (ToolBarWrap<? extends ToolBar>) parent.lookup(ToolBar.class).wrap();
    contentPane = parent.lookup(new ByID<Node>(ToolBarApp.TEST_PANE_ID)).wrap();
    toolBarAsSelectable = toolBar.as(Selectable.class, Node.class);
    clearBtn = parent.lookup(new ByText(ToolBarApp.CLEAR_BTN_ID)).wrap();
    resetBtn = parent.lookup(new ByText(ToolBarApp.RESET_BTN_ID)).wrap();
    shrinkBtn = parent.lookup(new ByText(ToolBarApp.SHRINK_BTN_ID)).wrap();
    verticalBtn = parent.lookup(new ByText(ToolBarApp.VERTICAL_BTN_ID)).wrap();
    lastPressedLbl = (Wrap<? extends Label>) parent.lookup(new ByID(ToolBarApp.LAST_PRESSED_LBL_ID)).wrap();
}
项目:openjfx-8u-dev-tests    文件:EnsembleTestBase.java   
protected static void initBase() {
    mainScene = new SceneDock(new ByWindowType(Stage.class));
    sceneAsParent = mainScene.asParent();
    mainToolbar = new ToolBarDock(sceneAsParent, new ByID<ToolBar>("mainToolBar"));
    samplesTree = new TreeViewDock(sceneAsParent, new ByID<TreeView>("page-tree"));
    pageTreeToolbar = new ToolBarDock(sceneAsParent, new ByID<ToolBar>("page-tree-toolbar"));
}
项目:Lipi    文件:MarkdownEditorControl.java   
private void customize() {
    //TODO Customize HTMLEDITOR later.

    ToolBar topBar = (ToolBar) this.lookup(".top-toolbar");
    ToolBar bottomBar = (ToolBar) this.lookup(".bottom-toolbar");

    setupBanglaModeToggle();
    setupImageInsertButton();

    topBar.getItems().add(banglaModeToggle);
    bottomBar.getItems().add(imageInsertButton);

    setMdText("Hello, this is where you write :)");
}
项目:qupath    文件:CountingPanelCommand.java   
private ToolBar makeToolbarButtons() {
    if (qupath == null)
        return null;

    ToolBar toolbar = new ToolBar();
    toolbar.getItems().addAll(
            qupath.getActionToggleButton(GUIActions.MOVE_TOOL, true),
            qupath.getActionToggleButton(GUIActions.POINTS_TOOL, true),
            new Separator(Orientation.VERTICAL),
            qupath.getActionToggleButton(GUIActions.SHOW_ANNOTATIONS, true),
            qupath.getActionToggleButton(GUIActions.FILL_OBJECTS, true),
            qupath.getActionToggleButton(GUIActions.SHOW_GRID, true));
    return toolbar;
}
项目:HTMLEditor    文件:LinkViewPane.java   
/**
 * Creates a link view pane to display in the main editor.
 * Sets the initial links and mode according to user selections.
 * 
 * @param editor         The open HTMLEditor, used to find the open buffer.
 * @param isAlphabetical True if alphabetical mode is enabled.
 *                       ALPHABETICAL and IN_ORDER are provided as constants
 *                       in order to make the code more readable.
 */
public LinkViewPane( HTMLEditor editor, boolean isAlphabetical ){
    // Set up data structures for the display
    this.analyzer = new HTMLAnalyzer();
    this.pane = new BorderPane();
    this.editor = editor;
    this.links = new LinkedList<String>();
    this.alphabeticalLinks = new HashMap<String, Integer>();
    this.mode = isAlphabetical;
    this.scroll = new ScrollPane();
    updateLinks( editor.getBuffer() );

    view = new VBox();
    view.setLayoutX(10);
    view.setSpacing(10);
    update();

    this.toolbar = new ToolBar();
    addToolBarElements();

    scroll.setContent( view );

    pane.setMaxHeight( 200 );        
    pane.setTop( toolbar );
    pane.setCenter( scroll );
    pane.setVisible( true );
}
项目:bunkr    文件:TextTab.java   
private void initControls()
{
    this.setText(this.subject.getAbsolutePath());
    ToolBar actionBar = new ToolBar();
    this.saveButton = Icons.buildIconButton("Save", Icons.ICON_SAVE);
    this.saveButton.getStyleClass().add("small-button");
    this.resetButton = Icons.buildIconButton("Reload", Icons.ICON_RELOAD);
    this.resetButton.getStyleClass().add("small-button");
    this.wordWrapCheckBox = new CheckBox("Word Wrap");
    this.wordWrapCheckBox.getStyleClass().add("small-button");
    this.wordWrapCheckBox.selectedProperty().set(true);
    actionBar.getItems().addAll(this.saveButton, this.resetButton, new HExpander(), this.wordWrapCheckBox);
    VBox.setVgrow(actionBar, Priority.NEVER);

    this.editorArea = new CodeArea();
    this.editorArea.setWrapText(true);
    this.editorArea.setParagraphGraphicFactory(LineNumberFactory.get(this.editorArea));
    this.editorArea.getStyleClass().add("editor-area-monospaced");
    VBox.setVgrow(this.editorArea, Priority.ALWAYS);

    VBox layout = new VBox();
    layout.getChildren().addAll(actionBar);
    layout.getChildren().add(this.editorArea);
    this.setContent(layout);

    this.getStyleClass().add("open-file-tab");
}
项目:JavaFX-Skeleton-DEPRECATED    文件:BaseWorkbench.java   
private VBox createTopBarsContainer(IPerspective perspective){
    MenuBar menuBar = perspective.getMenuBar();
    ToolBar toolBar = perspective.getToolBar();
    VBox container = new VBox();
    if(menuBar!= null && menuBar.getMenus().size()>0){
        container.getChildren().add(menuBar);
    }
    if(toolBar != null && toolBar.getItems().size()>0){
        container.getChildren().add(toolBar);
    }
    return container;


}
项目:polTool    文件:VisualizationView.java   
private Node createStatsButtonBar() {
    weightedCheckbox = new CheckBox("gewichtet");
    showTeamButton = new Button("Team");
    showTeamButton.setDisable(true);
    showTeamButton.setOnAction(value -> new GraphView(new TeamGraphModel(
            teamFilter.getValue(), setTable.getItems(),
            fromDate.getValue(), toDate.getValue(), weightedCheckbox
                    .isSelected()), primaryStage));

    showTeamPlayerButton = new Button("Teamspieler");
    showTeamPlayerButton.setDisable(true);
    showTeamPlayerButton.setOnAction(value -> new GraphView(
            new TeampPlayerGraphModel(setTable.getItems(), teamFilter
                    .getValue(), fromDate.getValue(), toDate.getValue(),
                    weightedCheckbox.isSelected()), primaryStage));
    statisics = new Text();
    showPlayerButton = new Button("Einzelspieler");
    showPlayerButton.setDisable(true);
    showPlayerButton.setOnAction(value -> new GraphView(
            new PlayerGraphModel(setTable.getItems(), playerFilter
                    .getValue(), fromDate.getValue(), toDate.getValue(),
                    weightedCheckbox.isSelected()), primaryStage));
    showPlayerPosButton = new Button("Spielerpositionen");
    showPlayerPosButton.setDisable(true);
    showPlayerPosButton.setOnAction(value -> new GraphView(
            new PlayerPosGraphModel(setTable.getItems(), playerFilter
                    .getValue(), fromDate.getValue(), toDate.getValue()),
            primaryStage));

    ToolBar bar = new ToolBar(new Label("Statisiken:  "), statisics,
            showTeamButton, showTeamPlayerButton, showPlayerButton,
            showPlayerPosButton, weightedCheckbox);
    bar.setBackground(Background.EMPTY);

    return bar;
}
项目:VocabHunter    文件:SearchHandler.java   
public SearchHandler(
    final GuiTaskHandler guiTaskHandler, final SessionModel model, final WordListHandler wordListHandler, final ToolBar barSearch, final CustomTextField fieldSearch,
    final Label labelMatches, final Button buttonCloseSearch, final Button buttonSearchUp, final Button buttonSearchDown) {
    this.guiTaskHandler = guiTaskHandler;
    this.model = model;
    this.wordListHandler = wordListHandler;
    this.barSearch = barSearch;
    this.fieldSearch = fieldSearch;
    this.labelMatches = labelMatches;
    this.buttonCloseSearch = buttonCloseSearch;
    this.buttonSearchUp = buttonSearchUp;
    this.buttonSearchDown = buttonSearchDown;
}
项目:LifeTiles    文件:Zoombar.java   
/**
 * Create a new Toolbar.
 *
 * @param currentZoom
 *            the current starting zoom level.
 * @param maxZoom
 *            the maximal value of the zoom.
 */
public Zoombar(final int currentZoom, final int maxZoom) {
    maxzoom = maxZoom;
    zoomLevel = new SimpleIntegerProperty();

    zoomLevel.set(currentZoom);
    slider = createSlider();

    slider.getStyleClass().add("slider");
    slider.valueProperty().addListener(
            (obserVal, oldVal, newVal) -> {
                if (oldVal.intValue() != newVal.intValue()
                        && newVal.intValue() <= maxzoom) {
                    zoomLevel.set(newVal.intValue());
                }
            });

    Button plus = new Button("+");
    plus.getStyleClass().add("plusButton");
    plus.setOnMouseClicked((event) -> {
        slider.setValue(slider.getValue() - slider.getMajorTickUnit());
    });

    Button minus = new Button("-");
    minus.getStyleClass().add("minusButton");
    minus.setOnMouseClicked((event) -> {
        slider.setValue(slider.getValue() + slider.getMajorTickUnit());
    });

    toolbar = new ToolBar();
    toolbar.getStyleClass().add("toolbar");

    toolbar.getItems().addAll(minus, slider, plus);
    toolbar.setOrientation(Orientation.VERTICAL);
}
项目:LifeTiles    文件:ZoombarTest.java   
@Test
public void scrolloneDownSlider() {
    // Hack because javafx toolkit need to be initialized
    JFXPanel panel = new JFXPanel();
    panel.contains(0, 0);
    Zoombar toolbar = new Zoombar(5, 10);

    ToolBar javafxBar = toolbar.getToolBar();
    int initZoom = toolbar.getZoomlevel().intValue();

    Slider slider = (Slider) javafxBar.getItems().get(1);
    slider.valueProperty().set(slider.valueProperty().get() - 1);

    assertEquals(initZoom - 1, toolbar.getZoomlevel().intValue(), 1e-10);
}