Search in sources :

Example 1 with CheckMenuItem

use of javafx.scene.control.CheckMenuItem in project FXGL by AlmasB.

the class DeveloperMenuBarController method onShowBBox.

public void onShowBBox(ActionEvent event) {
    CheckMenuItem item = (CheckMenuItem) event.getSource();
    FXGL.setProperty("dev.showbbox", item.isSelected());
    app.getGameWorld().getEntitiesByComponent(ViewComponent.class).forEach(e -> {
        e.getComponent(ViewComponent.class).turnOnDebugBBox(item.isSelected());
    });
}
Also used : CheckMenuItem(javafx.scene.control.CheckMenuItem) ViewComponent(com.almasb.fxgl.entity.component.ViewComponent)

Example 2 with CheckMenuItem

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

the class BamStage method makeFlagPredicate.

/**
 * build a Predicate for filtering on SAM FLAG using the checkboxes
 */
private Predicate<SAMRecord> makeFlagPredicate() {
    java.util.function.Predicate<SAMRecord> recFilter = x -> true;
    for (final SAMFlag flag : this.flag2filterInMenuItem.keySet()) {
        CheckMenuItem cbox = this.flag2filterInMenuItem.get(flag);
        if (!cbox.isSelected())
            continue;
        recFilter = recFilter.and(R -> flag.isSet(R.getFlags()));
    }
    for (final SAMFlag flag : this.flag2filterOutMenuItem.keySet()) {
        CheckMenuItem cbox = this.flag2filterOutMenuItem.get(flag);
        if (!cbox.isSelected())
            continue;
        recFilter = recFilter.and(R -> !flag.isSet(R.getFlags()));
    }
    return recFilter;
}
Also used : Arrays(java.util.Arrays) VCFHeader(htsjdk.variant.vcf.VCFHeader) CigarOperator(htsjdk.samtools.CigarOperator) ChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.ChartFactory) VariantContextChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.VariantContextChartFactory) ScrollPane(javafx.scene.control.ScrollPane) TabPane(javafx.scene.control.TabPane) Map(java.util.Map) Hershey(com.github.lindenb.jvarkit.util.Hershey) CigarOpPerPositionChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.CigarOpPerPositionChartFactory) ScriptException(javax.script.ScriptException) CloserUtil(htsjdk.samtools.util.CloserUtil) Rectangle2D(javafx.geometry.Rectangle2D) SplitPane(javafx.scene.control.SplitPane) SAMTagUtil(htsjdk.samtools.SAMTagUtil) GraphicsContext(javafx.scene.canvas.GraphicsContext) SAMRecordIterator(htsjdk.samtools.SAMRecordIterator) Event(javafx.event.Event) Set(java.util.Set) SAMFileWriter(htsjdk.samtools.SAMFileWriter) Screen(javafx.stage.Screen) SAMTagAndValue(htsjdk.samtools.SAMRecord.SAMTagAndValue) FastqRecord(htsjdk.samtools.fastq.FastqRecord) Platform(javafx.application.Platform) Separator(javafx.scene.control.Separator) Stream(java.util.stream.Stream) SAMReadGroupRecord(htsjdk.samtools.SAMReadGroupRecord) FlowPane(javafx.scene.layout.FlowPane) SAMFlag(htsjdk.samtools.SAMFlag) BorderPane(javafx.scene.layout.BorderPane) SamFlagsChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.SamFlagsChartFactory) CloseableIterator(htsjdk.samtools.util.CloseableIterator) FXCollections(javafx.collections.FXCollections) LogCloseableIterator(com.github.lindenb.jvarkit.tools.vcfviewgui.NgsStage.LogCloseableIterator) TextFlow(javafx.scene.text.TextFlow) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) Color(javafx.scene.paint.Color) SAMFileWriterFactory(htsjdk.samtools.SAMFileWriterFactory) StringWriter(java.io.StringWriter) CheckBox(javafx.scene.control.CheckBox) IOException(java.io.IOException) File(java.io.File) Menu(javafx.scene.control.Menu) FileChooser(javafx.stage.FileChooser) SamInputResource(htsjdk.samtools.SamInputResource) TreeMap(java.util.TreeMap) Tab(javafx.scene.control.Tab) CompiledScript(javax.script.CompiledScript) ObservableValue(javafx.beans.value.ObservableValue) EventHandler(javafx.event.EventHandler) Button(javafx.scene.control.Button) CigarElement(htsjdk.samtools.CigarElement) CheckMenuItem(javafx.scene.control.CheckMenuItem) OverrunStyle(javafx.scene.control.OverrunStyle) VBox(javafx.scene.layout.VBox) SAMFileHeader(htsjdk.samtools.SAMFileHeader) BasesPerPositionChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.BasesPerPositionChartFactory) ComboBox(javafx.scene.control.ComboBox) AlertType(javafx.scene.control.Alert.AlertType) ContextMenu(javafx.scene.control.ContextMenu) WindowEvent(javafx.stage.WindowEvent) TableView(javafx.scene.control.TableView) ReadLengthChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.ReadLengthChartFactory) Orientation(javafx.geometry.Orientation) Alert(javafx.scene.control.Alert) MenuItem(javafx.scene.control.MenuItem) Predicate(java.util.function.Predicate) Logger(com.github.lindenb.jvarkit.util.log.Logger) Font(javafx.scene.text.Font) Chart(javafx.scene.chart.Chart) Collectors(java.util.stream.Collectors) SAMRecord(htsjdk.samtools.SAMRecord) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) Text(javafx.scene.text.Text) SimpleBindings(javax.script.SimpleBindings) QualityPerPositionChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.QualityPerPositionChartFactory) List(java.util.List) SAMProgramRecord(htsjdk.samtools.SAMProgramRecord) Optional(java.util.Optional) VariantContext(htsjdk.variant.variantcontext.VariantContext) Pattern(java.util.regex.Pattern) SamReaderFactory(htsjdk.samtools.SamReaderFactory) FastqReader(htsjdk.samtools.fastq.FastqReader) ReadQualityChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.ReadQualityChartFactory) Cigar(htsjdk.samtools.Cigar) Scene(javafx.scene.Scene) SequenceUtil(htsjdk.samtools.util.SequenceUtil) SAMUtils(htsjdk.samtools.SAMUtils) TextArea(javafx.scene.control.TextArea) ButtonType(javafx.scene.control.ButtonType) HashMap(java.util.HashMap) GCPercentChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.GCPercentChartFactory) MapqChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.MapqChartFactory) Function(java.util.function.Function) ValidationStringency(htsjdk.samtools.ValidationStringency) SAMTextHeaderCodec(htsjdk.samtools.SAMTextHeaderCodec) TableColumn(javafx.scene.control.TableColumn) HashSet(java.util.HashSet) Interval(htsjdk.samtools.util.Interval) TableCell(javafx.scene.control.TableCell) Insets(javafx.geometry.Insets) Tooltip(javafx.scene.control.Tooltip) Locatable(htsjdk.samtools.util.Locatable) Label(javafx.scene.control.Label) MenuBar(javafx.scene.control.MenuBar) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) ReadChartFactory(com.github.lindenb.jvarkit.tools.vcfviewgui.chart.ReadChartFactory) SamReader(htsjdk.samtools.SamReader) ScrollEvent(javafx.scene.input.ScrollEvent) ActionEvent(javafx.event.ActionEvent) Stage(javafx.stage.Stage) SpinnerValueFactory(javafx.scene.control.SpinnerValueFactory) ChangeListener(javafx.beans.value.ChangeListener) ExtensionFilter(javafx.stage.FileChooser.ExtensionFilter) Collections(java.util.Collections) ScrollBar(javafx.scene.control.ScrollBar) CheckMenuItem(javafx.scene.control.CheckMenuItem) SAMFlag(htsjdk.samtools.SAMFlag) SAMRecord(htsjdk.samtools.SAMRecord)

Aggregations

ViewComponent (com.almasb.fxgl.entity.component.ViewComponent)1 LogCloseableIterator (com.github.lindenb.jvarkit.tools.vcfviewgui.NgsStage.LogCloseableIterator)1 BasesPerPositionChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.BasesPerPositionChartFactory)1 ChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.ChartFactory)1 CigarOpPerPositionChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.CigarOpPerPositionChartFactory)1 GCPercentChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.GCPercentChartFactory)1 MapqChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.MapqChartFactory)1 QualityPerPositionChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.QualityPerPositionChartFactory)1 ReadChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.ReadChartFactory)1 ReadLengthChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.ReadLengthChartFactory)1 ReadQualityChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.ReadQualityChartFactory)1 SamFlagsChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.SamFlagsChartFactory)1 VariantContextChartFactory (com.github.lindenb.jvarkit.tools.vcfviewgui.chart.VariantContextChartFactory)1 Hershey (com.github.lindenb.jvarkit.util.Hershey)1 Logger (com.github.lindenb.jvarkit.util.log.Logger)1 Cigar (htsjdk.samtools.Cigar)1 CigarElement (htsjdk.samtools.CigarElement)1 CigarOperator (htsjdk.samtools.CigarOperator)1 SAMFileHeader (htsjdk.samtools.SAMFileHeader)1 SAMFileWriter (htsjdk.samtools.SAMFileWriter)1