Search in sources :

Example 6 with SeparatorMenuItem

use of javafx.scene.control.SeparatorMenuItem in project blue by kunstmusik.

the class UserSoundObjectLibrary method buildContextMenu.

public ContextMenu buildContextMenu(TreeView<LibraryItem<SoundObject>> treeView) {
    ContextMenu popupMenu = new ContextMenu();
    // popupMenu.getItems().add(new MenuItem("Test"));
    ObservableList<TreeItem<LibraryItem<SoundObject>>> selectedItems = treeView.getSelectionModel().getSelectedItems();
    final ScoreController.ScoreObjectBuffer scoreObjectBuffer = ScoreController.getInstance().getScoreObjectBuffer();
    // FOLDER MENU ITEMS
    List<MenuItem> folderMenuItems = new ArrayList<>();
    MenuItem addFolder = new MenuItem("Add Folder");
    addFolder.setOnAction(evt -> {
        TreeItem<LibraryItem<SoundObject>> item = selectedItems.get(0);
        item.getChildren().add(new LibraryTreeItem(new LibraryItem<>("New Folder")));
    });
    MenuItem deleteFolder = new MenuItem("Delete Folder");
    deleteFolder.setOnAction(evt -> {
        TreeItem<LibraryItem<SoundObject>> item = selectedItems.get(0);
        item.getParent().getChildren().remove(item);
    });
    MenuItem paste = new MenuItem("Paste SoundObject");
    paste.setOnAction(evt -> {
        TreeItem<LibraryItem<SoundObject>> item = selectedItems.get(0);
        SoundObject sObj = (SoundObject) scoreObjectBuffer.scoreObjects.get(0).deepCopy();
        if (!SoundObjectUtilities.isOrContainsInstance(sObj)) {
            item.getChildren().add(new LibraryTreeItem(new LibraryItem<>(sObj)));
        }
    });
    folderMenuItems.add(addFolder);
    folderMenuItems.add(deleteFolder);
    folderMenuItems.add(paste);
    // FOLDER MENU ITEMS
    List<MenuItem> sObjMenuItems = new ArrayList<>();
    MenuItem cut = new MenuItem("Cut");
    cut.setOnAction(evt -> {
        TreeItem<LibraryItem<SoundObject>> item = selectedItems.get(0);
        SoundObject sObj = item.getValue().getValue();
        if (sObj == null) {
            return;
        }
        scoreObjectBuffer.clear();
        scoreObjectBuffer.scoreObjects.add(sObj.deepCopy());
        scoreObjectBuffer.layerIndexes.add(0);
        item.getParent().getChildren().remove(item);
    });
    MenuItem copy = new MenuItem("Copy");
    copy.setOnAction(evt -> {
        TreeItem<LibraryItem<SoundObject>> item = selectedItems.get(0);
        SoundObject sObj = item.getValue().getValue();
        if (sObj == null) {
            return;
        }
        scoreObjectBuffer.clear();
        scoreObjectBuffer.scoreObjects.add(sObj.deepCopy());
        scoreObjectBuffer.layerIndexes.add(0);
    });
    MenuItem delete = new MenuItem("Delete");
    delete.setOnAction(evt -> {
        TreeItem<LibraryItem<SoundObject>> item = selectedItems.get(0);
        item.getParent().getChildren().remove(item);
    });
    sObjMenuItems.add(cut);
    sObjMenuItems.add(copy);
    sObjMenuItems.add(new SeparatorMenuItem());
    sObjMenuItems.add(delete);
    popupMenu.getItems().addAll(folderMenuItems);
    popupMenu.getItems().addAll(sObjMenuItems);
    popupMenu.setOnShowing(evt -> {
        if (selectedItems.size() == 1) {
            TreeItem<LibraryItem<SoundObject>> item = selectedItems.get(0);
            boolean isFolder = item.getValue().getValue() == null;
            deleteFolder.setDisable(item == soundObjectLibrary.getRoot());
            if (isFolder) {
                boolean isScoreObj = scoreObjectBuffer.scoreObjects.size() == 1 && scoreObjectBuffer.scoreObjects.get(0) instanceof SoundObject;
                if (isScoreObj) {
                    SoundObject sObj = (SoundObject) scoreObjectBuffer.scoreObjects.get(0);
                    paste.setDisable(SoundObjectUtilities.isOrContainsInstance(sObj));
                } else {
                    paste.setDisable(true);
                }
            }
            for (MenuItem menuItem : folderMenuItems) {
                menuItem.setVisible(isFolder);
            }
            for (MenuItem menuItem : sObjMenuItems) {
                menuItem.setVisible(!isFolder);
            }
        }
    });
    return popupMenu;
}
Also used : LibraryItem(blue.library.LibraryItem) LibraryTreeItem(blue.library.LibraryTreeItem) TreeItem(javafx.scene.control.TreeItem) LibraryTreeItem(blue.library.LibraryTreeItem) ArrayList(java.util.ArrayList) ContextMenu(javafx.scene.control.ContextMenu) MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) ScoreController(blue.ui.core.score.ScoreController) SoundObject(blue.soundObject.SoundObject)

Example 7 with SeparatorMenuItem

use of javafx.scene.control.SeparatorMenuItem in project blue by kunstmusik.

the class BSBObjectViewHolder method getContextMenu.

private static ContextMenu getContextMenu() {
    if (MENU == null) {
        MENU = new ContextMenu();
        MenuItem cut = new MenuItem("Cut");
        cut.setOnAction(e -> {
            MenuData data = (MenuData) MENU.getUserData();
            BSBEditSelection selection = data.selection;
            selection.cut();
        });
        MenuItem copy = new MenuItem("Copy");
        copy.setOnAction(e -> {
            MenuData data = (MenuData) MENU.getUserData();
            BSBEditSelection selection = data.selection;
            selection.copy();
        });
        MenuItem remove = new MenuItem("Remove");
        remove.setOnAction(e -> {
            MenuData data = (MenuData) MENU.getUserData();
            BSBEditSelection selection = data.selection;
            selection.remove();
        });
        MenuItem makeGroup = new MenuItem("Make Group");
        makeGroup.setOnAction(e -> {
            MenuData data = (MenuData) MENU.getUserData();
            BSBEditSelection selection = data.selection;
            List<BSBGroup> groupsList = data.groupsList;
            List<BSBObject> bsbObjs = selection.selection.stream().map(b -> b.deepCopy()).collect(Collectors.toList());
            int x = Integer.MAX_VALUE;
            int y = Integer.MAX_VALUE;
            for (BSBObject bsbObj : bsbObjs) {
                x = Math.min(x, bsbObj.getX());
                y = Math.min(y, bsbObj.getY());
            }
            for (BSBObject bsbObj : bsbObjs) {
                bsbObj.setX(bsbObj.getX() - x + 10);
                bsbObj.setY(bsbObj.getY() - y + 10);
            }
            selection.remove();
            BSBGroup group = new BSBGroup();
            group.interfaceItemsProperty().addAll(bsbObjs);
            group.setX(x);
            group.setY(y);
            groupsList.get(groupsList.size() - 1).addBSBObject(group);
        });
        MenuItem breakGroup = new MenuItem("Break Group");
        breakGroup.setOnAction((ActionEvent e) -> {
            MenuData data = (MenuData) MENU.getUserData();
            BSBEditSelection selection = data.selection;
            List<BSBGroup> groupsList = data.groupsList;
            BSBGroup group = (BSBGroup) selection.selection.toArray()[0];
            int x = group.getX();
            int y = group.getY();
            selection.remove();
            BSBGroup rootGroup = groupsList.get(groupsList.size() - 1);
            for (BSBObject bsbObj : group) {
                BSBObject temp = bsbObj.deepCopy();
                temp.setX(temp.getX() + x);
                temp.setY(temp.getY() + y);
                rootGroup.addBSBObject(temp);
            }
            ;
        });
        final Menu align = new Menu("Align");
        final Menu distribute = new Menu("Distribute");
        EventHandler<ActionEvent> alignListener = ae -> {
            MenuItem source = (MenuItem) ae.getSource();
            Alignment alignment = (Alignment) source.getUserData();
            MenuData data = (MenuData) MENU.getUserData();
            BSBEditSelection selection = data.selection;
            AlignmentUtils.align(selection.getSelectedNodes(), alignment);
        };
        EventHandler<ActionEvent> distributeListener = ae -> {
            MenuItem source = (MenuItem) ae.getSource();
            Alignment alignment = (Alignment) source.getUserData();
            MenuData data = (MenuData) MENU.getUserData();
            BSBEditSelection selection = data.selection;
            AlignmentUtils.distribute(selection.getSelectedNodes(), alignment);
        };
        for (Alignment alignment : Alignment.values()) {
            MenuItem a = new MenuItem(alignment.toString());
            a.setUserData(alignment);
            a.setOnAction(alignListener);
            MenuItem d = new MenuItem(alignment.toString());
            d.setUserData(alignment);
            d.setOnAction(distributeListener);
            align.getItems().add(a);
            distribute.getItems().add(d);
        }
        MENU.getItems().addAll(cut, copy, remove);
        MENU.getItems().addAll(new SeparatorMenuItem(), makeGroup, breakGroup);
        MENU.getItems().addAll(new SeparatorMenuItem(), align, distribute);
        MENU.setOnHidden(e -> MENU.setUserData(null));
        MENU.setOnShowing(e -> {
            MenuData data = (MenuData) MENU.getUserData();
            BSBEditSelection selection = data.selection;
            align.setDisable(selection.selection.size() < 2);
            distribute.setDisable(selection.selection.size() < 2);
            breakGroup.setDisable(selection.selection.size() != 1 || selection.selection.stream().noneMatch((x) -> x instanceof BSBGroup));
        });
    }
    return MENU;
}
Also used : EventHandler(javafx.event.EventHandler) Scene(javafx.scene.Scene) BooleanBinding(javafx.beans.binding.BooleanBinding) BoundingBox(javafx.geometry.BoundingBox) MouseEvent(javafx.scene.input.MouseEvent) Bindings(javafx.beans.binding.Bindings) BSBGroup(blue.orchestra.blueSynthBuilder.BSBGroup) ContextMenu(javafx.scene.control.ContextMenu) Point2D(javafx.geometry.Point2D) BSBObject(blue.orchestra.blueSynthBuilder.BSBObject) Pane(javafx.scene.layout.Pane) Color(javafx.scene.paint.Color) MenuItem(javafx.scene.control.MenuItem) GridSettings(blue.orchestra.blueSynthBuilder.GridSettings) Rectangle(javafx.scene.shape.Rectangle) Collectors(java.util.stream.Collectors) Menu(javafx.scene.control.Menu) Cursor(javafx.scene.Cursor) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) List(java.util.List) BooleanProperty(javafx.beans.property.BooleanProperty) ActionEvent(javafx.event.ActionEvent) Region(javafx.scene.layout.Region) ObservableValue(javafx.beans.value.ObservableValue) ObservableList(javafx.collections.ObservableList) ChangeListener(javafx.beans.value.ChangeListener) ActionEvent(javafx.event.ActionEvent) ContextMenu(javafx.scene.control.ContextMenu) MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) BSBObject(blue.orchestra.blueSynthBuilder.BSBObject) ContextMenu(javafx.scene.control.ContextMenu) Menu(javafx.scene.control.Menu) BSBGroup(blue.orchestra.blueSynthBuilder.BSBGroup)

Example 8 with SeparatorMenuItem

use of javafx.scene.control.SeparatorMenuItem in project blue by kunstmusik.

the class PresetPane method setPresetsMenu.

private void setPresetsMenu(PresetGroup pGroup, Menu parent) {
    for (PresetGroup subGroup : pGroup.getSubGroups()) {
        Menu menu = new Menu(subGroup.getPresetGroupName());
        setPresetsMenu(subGroup, menu);
        if (parent == null) {
            rootMenu.getItems().add(menu);
        } else {
            parent.getItems().add(menu);
        }
    }
    for (Preset preset : pGroup.getPresets()) {
        MenuItem item = new MenuItem(preset.getPresetName());
        item.setUserData(preset);
        item.setOnAction(presetSelectedAction);
        if (parent == null) {
            rootMenu.getItems().add(item);
        } else {
            parent.getItems().add(item);
        }
    }
    if (parent == null) {
        rootMenu.getItems().add(new SeparatorMenuItem());
    } else {
        parent.getItems().add(new SeparatorMenuItem());
    }
    MenuItem addFolder = new MenuItem("Add Folder");
    addFolder.setUserData(pGroup);
    addFolder.setOnAction(addFolderAction);
    MenuItem addPreset = new MenuItem("Add Preset");
    addPreset.setUserData(pGroup);
    addPreset.setOnAction(addPresetAction);
    if (parent == null) {
        MenuItem syncPresets = new MenuItem("Synchronize Presets");
        syncPresets.setOnAction(e -> {
            PresetsUtilities.synchronizePresets(getPresetGroup(), bsbInterface);
        });
        MenuItem managePresets = new MenuItem("Manage Presets");
        managePresets.setOnAction(e -> {
            PresetGroup[] retVal = new PresetGroup[1];
            CountDownLatch latch = new CountDownLatch(1);
            SwingUtilities.invokeLater(() -> {
                try {
                    if (presetsManager == null) {
                        presetsManager = new PresetsManagerDialog(WindowManager.getDefault().getMainWindow());
                    }
                    retVal[0] = presetsManager.editPresetGroup(pGroup);
                } finally {
                    latch.countDown();
                }
            });
            try {
                latch.await();
            } catch (InterruptedException ex) {
                Exceptions.printStackTrace(ex);
            }
            if (retVal[0] != null) {
                pGroup.setPresets(retVal[0].getPresets());
                pGroup.setSubGroups(retVal[0].getSubGroups());
                updatePresetMenu();
                Preset preset = pGroup.findPresetByUniqueId(pGroup.getCurrentPresetUniqueId());
                if (preset == null) {
                    pGroup.setCurrentPresetUniqueId(null);
                    pGroup.setCurrentPresetModified(false);
                }
                updateCurrentPresetUI();
            }
        });
        rootMenu.getItems().addAll(addFolder, addPreset, new SeparatorMenuItem(), syncPresets, managePresets);
    } else {
        parent.getItems().addAll(addFolder, addPreset);
    }
}
Also used : Preset(blue.orchestra.blueSynthBuilder.Preset) PresetGroup(blue.orchestra.blueSynthBuilder.PresetGroup) MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) ContextMenu(javafx.scene.control.ContextMenu) Menu(javafx.scene.control.Menu) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) CountDownLatch(java.util.concurrent.CountDownLatch) PresetsManagerDialog(blue.orchestra.editor.blueSynthBuilder.PresetsManagerDialog)

Example 9 with SeparatorMenuItem

use of javafx.scene.control.SeparatorMenuItem in project honest-profiler by jvm-profiling-tools.

the class AbstractViewController method showColumnViewMenu.

/**
 * Displays the column view context menu.
 *
 * @param event the {@link MouseEvent} which triggered the context menu display
 */
private void showColumnViewMenu(MouseEvent event) {
    ContextMenu ctxMenu = columnViewButton.getContextMenu();
    if (ctxMenu == null) {
        ctxMenu = new ContextMenu();
        columnViewButton.setContextMenu(ctxMenu);
    }
    // The +1 accounts for the separator
    if (ctxMenu.getItems().size() != columnViewItems.size() + columnViewGroupItems.size() + 1) {
        ctxMenu.getItems().clear();
        ctxMenu.getItems().addAll(columnViewGroupItems);
        ctxMenu.getItems().add(new SeparatorMenuItem());
        ctxMenu.getItems().addAll(columnViewItems);
    }
    columnViewButton.getContextMenu().show(columnViewButton, event.getScreenX(), event.getScreenY());
}
Also used : ContextMenu(javafx.scene.control.ContextMenu) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem)

Example 10 with SeparatorMenuItem

use of javafx.scene.control.SeparatorMenuItem in project jvarkit by lindenb.

the class IgvReview method start.

@Override
public void start(final Stage stage) throws Exception {
    stage.setTitle(getClass().getSimpleName());
    Predicate<VariantContext> ctxFilter;
    Map<String, String> params = super.getParameters().getNamed();
    if (params.containsKey("--filter")) {
        ctxFilter = JexlVariantPredicate.create(params.get("--filter"));
    } else {
        ctxFilter = V -> true;
    }
    final List<String> args = super.getParameters().getUnnamed();
    final File configFile;
    if (args.isEmpty()) {
        final FileChooser fc = new FileChooser();
        final String lastDirStr = preferences.get(LAST_USED_DIR_KEY, null);
        if (lastDirStr != null && !lastDirStr.isEmpty()) {
            fc.setInitialDirectory(new File(lastDirStr));
        }
        fc.getExtensionFilters().addAll(Collections.singletonList(new FileChooser.ExtensionFilter("Config file", "*.config", "*.cfg", "*.list")));
        configFile = fc.showOpenDialog(stage);
    } else if (args.size() == 1) {
        configFile = new File(args.get(0));
    } else {
        configFile = null;
    }
    if (configFile == null || !configFile.exists()) {
        JfxUtils.dialog().cause("Illegal number of arguments or file doesn't exists.").show(stage);
        Platform.exit();
        return;
    }
    if (configFile.isFile() && configFile.getParentFile() != null) {
        this.preferences.put(LAST_USED_DIR_KEY, configFile.getParentFile().getPath());
    }
    final List<String> configLines = Files.readAllLines(configFile.toPath());
    final Predicate<String> ignoreComment = (S) -> !S.startsWith("#");
    final Predicate<String> predVcf = S -> S.endsWith(".vcf") || S.endsWith(".vcf.gz");
    if (configLines.stream().filter(ignoreComment).filter(predVcf).count() != 1) {
        JfxUtils.dialog().cause("Found more than one vcf file in " + configFile).show(stage);
        Platform.exit();
        return;
    }
    final File vcfFile = configLines.stream().filter(ignoreComment).filter(predVcf).map(S -> new File(S)).findFirst().get();
    LOG.info("Opening vcf file and loading in memory");
    VCFFileReader vfr = null;
    CloseableIterator<VariantContext> iter = null;
    final Set<String> sampleNames;
    try {
        this.variants.clear();
        vfr = new VCFFileReader(vcfFile, false);
        this.vcfHeader = vfr.getFileHeader();
        sampleNames = new HashSet<>(this.vcfHeader.getSampleNamesInOrder());
        if (sampleNames.isEmpty()) {
            JfxUtils.dialog().cause("No Genotypes in " + vcfFile).show(stage);
            Platform.exit();
            return;
        }
        iter = vfr.iterator();
        this.variants.addAll(iter.stream().filter(ctxFilter).filter(CTX -> CTX.isVariant()).collect(Collectors.toList()));
    } catch (final Exception err) {
        JfxUtils.dialog().cause(err).show(stage);
        Platform.exit();
        return;
    } finally {
        CloserUtil.close(iter);
        CloserUtil.close(vfr);
    }
    if (this.variants.isEmpty()) {
        JfxUtils.dialog().cause("No Variants").show(stage);
        Platform.exit();
        return;
    }
    final SAMSequenceDictionary dict = this.vcfHeader.getSequenceDictionary();
    if (dict == null || dict.isEmpty()) {
        JfxUtils.dialog().cause(JvarkitException.VcfDictionaryMissing.getMessage(vcfFile.getPath())).show(stage);
        Platform.exit();
        return;
    }
    final SamReaderFactory srf = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.LENIENT);
    configLines.stream().filter(ignoreComment).filter(S -> S.endsWith(".bam")).map(S -> new File(S)).forEach(F -> {
        final SamReader samIn = srf.open(F);
        final SAMFileHeader header = samIn.getFileHeader();
        CloserUtil.close(samIn);
        String sample = null;
        for (final SAMReadGroupRecord rg : header.getReadGroups()) {
            String s = rg.getSample();
            if (s == null)
                continue;
            if (sample == null) {
                sample = s;
            } else if (!sample.equals(s)) {
                JfxUtils.dialog().cause("Two samples in " + F).show(stage);
                Platform.exit();
                return;
            }
        }
        if (sample == null) {
            JfxUtils.dialog().cause("No sample in " + F + ". Ignoring").show(stage);
            return;
        }
        if (!sampleNames.contains(sample)) {
            JfxUtils.dialog().cause("Not in VCF header " + sample + " / " + F + ". Ignoring").show(stage);
            return;
        }
        this.sample2bamFile.put(sample, F);
    });
    if (this.sample2bamFile.isEmpty()) {
        JfxUtils.dialog().cause("No valid bam file in " + configFile).show(stage);
        return;
    }
    sampleNames.retainAll(this.sample2bamFile.keySet());
    if (sampleNames.isEmpty()) {
        JfxUtils.dialog().cause("No Sample associated to bam").show(stage);
        return;
    }
    ObservableList<VariantAndGenotype> genotypes = FXCollections.observableArrayList(this.variants.stream().flatMap(CTX -> CTX.getGenotypes().stream().filter(G -> sampleNames.contains(G.getSampleName())).map(G -> new VariantAndGenotype(CTX, G))).collect(Collectors.toList()));
    if (genotypes.isEmpty()) {
        JfxUtils.dialog().cause("No Genotype to show").show(stage);
        return;
    }
    Menu menu = new Menu("File");
    MenuItem menuItem = new MenuItem("Save as...");
    menuItem.setOnAction(AE -> {
        saveVariantsAs(stage);
    });
    menu.getItems().add(menuItem);
    menuItem = new MenuItem("Save");
    menuItem.setOnAction(AE -> {
        if (this.saveAsFile != null) {
            saveVariants(stage, this.saveAsFile);
        } else {
            saveVariantsAs(stage);
        }
    });
    menu.getItems().add(menuItem);
    menu.getItems().add(new SeparatorMenuItem());
    menuItem = new MenuItem("Quit");
    menuItem.setOnAction(AE -> {
        Platform.exit();
    });
    menu.getItems().add(menuItem);
    MenuBar bar = new MenuBar(menu);
    this.genotypeTable = new TableView<>(genotypes);
    this.genotypeTable.getColumns().add(makeColumn("CHROM", G -> G.ctx.getContig()));
    this.genotypeTable.getColumns().add(makeColumn("POS", G -> G.ctx.getStart()));
    this.genotypeTable.getColumns().add(makeColumn("ID", G -> G.ctx.getID()));
    this.genotypeTable.getColumns().add(makeColumn("REF", G -> G.ctx.getReference().getDisplayString()));
    this.genotypeTable.getColumns().add(makeColumn("ALT", G -> G.ctx.getAlternateAlleles().stream().map(A -> A.getDisplayString()).collect(Collectors.joining(","))));
    this.genotypeTable.getColumns().add(makeColumn("Sample", G -> G.g.getSampleName()));
    this.genotypeTable.getColumns().add(makeColumn("Type", G -> G.g.getType().name()));
    this.genotypeTable.getColumns().add(makeColumn("Alleles", G -> G.g.getAlleles().stream().map(A -> A.getDisplayString()).collect(Collectors.joining(","))));
    TableColumn<VariantAndGenotype, String> reviewCol = new TableColumn<>("Review");
    reviewCol.setCellValueFactory(C -> C.getValue().getReviewProperty());
    reviewCol.setCellFactory(TextFieldTableCell.forTableColumn());
    reviewCol.setOnEditCommit((E) -> {
        int y = E.getTablePosition().getRow();
        this.genotypeTable.getItems().get(y).setReview(E.getNewValue());
    });
    reviewCol.setEditable(true);
    this.genotypeTable.getColumns().add(reviewCol);
    this.genotypeTable.getSelectionModel().cellSelectionEnabledProperty().set(true);
    this.genotypeTable.setEditable(true);
    final ContextMenu cm = new ContextMenu();
    MenuItem mi1 = new MenuItem("Menu 1");
    cm.getItems().add(mi1);
    MenuItem mi2 = new MenuItem("Menu 2");
    cm.getItems().add(mi2);
    this.genotypeTable.setOnMousePressed(event -> {
        if (event.isPrimaryButtonDown() && (event.getClickCount() == 3 || event.isShiftDown())) {
            moveIgvTo(stage, genotypeTable.getSelectionModel().getSelectedItem());
        } else if (event.isSecondaryButtonDown()) {
            cm.show(genotypeTable, event.getScreenX(), event.getScreenY());
        }
    });
    final BorderPane pane2 = new BorderPane(this.genotypeTable);
    pane2.setPadding(new Insets(10, 10, 10, 10));
    VBox vbox1 = new VBox(bar, pane2);
    final Scene scene = new Scene(vbox1, 500, 300);
    stage.setScene(scene);
    stage.show();
}
Also used : JexlVariantPredicate(com.github.lindenb.jvarkit.util.vcf.JexlVariantPredicate) VCFFileReader(htsjdk.variant.vcf.VCFFileReader) VCFHeader(htsjdk.variant.vcf.VCFHeader) VariantContextWriterBuilder(htsjdk.variant.variantcontext.writer.VariantContextWriterBuilder) VBox(javafx.scene.layout.VBox) SAMFileHeader(htsjdk.samtools.SAMFileHeader) Application(javafx.application.Application) Vector(java.util.Vector) ContextMenu(javafx.scene.control.ContextMenu) IgvConstants(com.github.lindenb.jvarkit.util.igv.IgvConstants) Map(java.util.Map) TableView(javafx.scene.control.TableView) CloserUtil(htsjdk.samtools.util.CloserUtil) PrintWriter(java.io.PrintWriter) MenuItem(javafx.scene.control.MenuItem) GenotypeBuilder(htsjdk.variant.variantcontext.GenotypeBuilder) Predicate(java.util.function.Predicate) Logger(com.github.lindenb.jvarkit.util.log.Logger) Set(java.util.Set) Collectors(java.util.stream.Collectors) JvarkitException(com.github.lindenb.jvarkit.lang.JvarkitException) Platform(javafx.application.Platform) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) List(java.util.List) SAMReadGroupRecord(htsjdk.samtools.SAMReadGroupRecord) VariantContextWriter(htsjdk.variant.variantcontext.writer.VariantContextWriter) VariantContext(htsjdk.variant.variantcontext.VariantContext) ObservableList(javafx.collections.ObservableList) BorderPane(javafx.scene.layout.BorderPane) SamReaderFactory(htsjdk.samtools.SamReaderFactory) VariantContextBuilder(htsjdk.variant.variantcontext.VariantContextBuilder) Genotype(htsjdk.variant.variantcontext.Genotype) CloseableIterator(htsjdk.samtools.util.CloseableIterator) Scene(javafx.scene.Scene) Socket(java.net.Socket) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) FXCollections(javafx.collections.FXCollections) HashMap(java.util.HashMap) BackingStoreException(java.util.prefs.BackingStoreException) TextFieldTableCell(javafx.scene.control.cell.TextFieldTableCell) Function(java.util.function.Function) ValidationStringency(htsjdk.samtools.ValidationStringency) ArrayList(java.util.ArrayList) TableColumn(javafx.scene.control.TableColumn) HashSet(java.util.HashSet) Insets(javafx.geometry.Insets) Launcher(com.github.lindenb.jvarkit.util.jcommander.Launcher) VCFHeaderLineType(htsjdk.variant.vcf.VCFHeaderLineType) MenuBar(javafx.scene.control.MenuBar) Files(java.nio.file.Files) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) IOException(java.io.IOException) SamReader(htsjdk.samtools.SamReader) InputStreamReader(java.io.InputStreamReader) File(java.io.File) Preferences(java.util.prefs.Preferences) Menu(javafx.scene.control.Menu) FileChooser(javafx.stage.FileChooser) Stage(javafx.stage.Stage) Closeable(java.io.Closeable) JfxUtils(com.github.lindenb.jvarkit.jfx.components.JfxUtils) VCFFormatHeaderLine(htsjdk.variant.vcf.VCFFormatHeaderLine) Window(javafx.stage.Window) BufferedReader(java.io.BufferedReader) Collections(java.util.Collections) BorderPane(javafx.scene.layout.BorderPane) Insets(javafx.geometry.Insets) SAMReadGroupRecord(htsjdk.samtools.SAMReadGroupRecord) VCFFileReader(htsjdk.variant.vcf.VCFFileReader) VariantContext(htsjdk.variant.variantcontext.VariantContext) MenuBar(javafx.scene.control.MenuBar) ContextMenu(javafx.scene.control.ContextMenu) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) SamReader(htsjdk.samtools.SamReader) FileChooser(javafx.stage.FileChooser) ContextMenu(javafx.scene.control.ContextMenu) Menu(javafx.scene.control.Menu) SamReaderFactory(htsjdk.samtools.SamReaderFactory) MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) Scene(javafx.scene.Scene) TableColumn(javafx.scene.control.TableColumn) JvarkitException(com.github.lindenb.jvarkit.lang.JvarkitException) BackingStoreException(java.util.prefs.BackingStoreException) IOException(java.io.IOException) SAMFileHeader(htsjdk.samtools.SAMFileHeader) File(java.io.File) VBox(javafx.scene.layout.VBox)

Aggregations

SeparatorMenuItem (javafx.scene.control.SeparatorMenuItem)26 MenuItem (javafx.scene.control.MenuItem)24 ContextMenu (javafx.scene.control.ContextMenu)15 Menu (javafx.scene.control.Menu)12 ArrayList (java.util.ArrayList)10 List (java.util.List)8 ObservableList (javafx.collections.ObservableList)8 Collectors (java.util.stream.Collectors)7 Label (javafx.scene.control.Label)7 VBox (javafx.scene.layout.VBox)7 File (java.io.File)6 Scene (javafx.scene.Scene)6 IOException (java.io.IOException)5 FXCollections (javafx.collections.FXCollections)5 Insets (javafx.geometry.Insets)5 Node (javafx.scene.Node)4 TextField (javafx.scene.control.TextField)4 Arrays (java.util.Arrays)3 Map (java.util.Map)3 Optional (java.util.Optional)3