当前位置: 首页>>代码示例>>Java>>正文


Java SimpleBooleanProperty.addListener方法代码示例

本文整理汇总了Java中javafx.beans.property.SimpleBooleanProperty.addListener方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleBooleanProperty.addListener方法的具体用法?Java SimpleBooleanProperty.addListener怎么用?Java SimpleBooleanProperty.addListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.beans.property.SimpleBooleanProperty的用法示例。


在下文中一共展示了SimpleBooleanProperty.addListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupListeners

import javafx.beans.property.SimpleBooleanProperty; //导入方法依赖的package包/类
private void setupListeners() {
    correlationAndPValueInRange = new SimpleBooleanProperty(true);
    frequencyInRange = new SimpleBooleanProperty(true);
    //Add listeners for the two range properties - if both are false, set hidden to true
    correlationAndPValueInRange.addListener(observable -> {
        if (correlationAndPValueInRange.get() && frequencyInRange.get()) {
            showEdge();
        } else {
            hideEdge();
        }
    });

    frequencyInRange.addListener(observable -> {
        if (correlationAndPValueInRange.get() && frequencyInRange.get()) {
            showEdge();
        } else {
            hideEdge();
        }
    });
}
 
开发者ID:jmueller95,项目名称:CORNETTO,代码行数:21,代码来源:MyEdge.java

示例2: GraphVisualizer

import javafx.beans.property.SimpleBooleanProperty; //导入方法依赖的package包/类
/**
 * Create a new {@link GraphVisualizer} instance.
 * <p>
 * The passed {@link GraphStore} is observed by this class. If the {@link GraphStore}
 * {@link org.dnacronym.hygene.parser.GfaFile} is updated, it will prompt a redraw. Changing the properties of this
 * class will also prompt a redraw if the {@link org.dnacronym.hygene.parser.GfaFile} in {@link GraphStore} is not
 * {@code null}.
 *
 * @param graphDimensionsCalculator {@link GraphDimensionsCalculator} used to calculate node positions
 * @param query                     the {@link Query} used to get the currently queried nodes
 * @param bookmarkStore             the {@link BookmarkStore} used to draw bookmark indications
 * @param graphAnnotation           the {@link GraphAnnotation} used to draw annotations
 */
@Inject
public GraphVisualizer(final GraphDimensionsCalculator graphDimensionsCalculator, final Query query,
                       final BookmarkStore bookmarkStore, final GraphAnnotation graphAnnotation,
                       final GraphStore graphStore) {
    HygeneEventBus.getInstance().register(this);
    this.graphDimensionsCalculator = graphDimensionsCalculator;
    this.query = query;
    this.bookmarkStore = bookmarkStore;
    this.colorRoulette = new ColorRoulette();
    this.graphAnnotation = graphAnnotation;
    this.graphStore = graphStore;

    selectedSegmentProperty = new SimpleObjectProperty<>();
    selectedSegmentProperty.addListener((observable, oldValue, newValue) -> draw());

    hoveredSegmentProperty = new SimpleObjectProperty<>();
    hoveredSegmentProperty.addListener((observable, oldValue, newValue) -> draw());

    genomePaths = FXCollections.observableArrayList(new HashSet<>());
    selectedGenomePaths = FXCollections.observableHashMap();
    selectedGenomePaths.addListener((MapChangeListener<String, Color>) change -> draw());

    edgeColorProperty = new SimpleObjectProperty<>(DEFAULT_EDGE_COLOR);
    nodeHeightProperty = new SimpleDoubleProperty(DEFAULT_NODE_HEIGHT);
    graphDimensionsCalculator.getNodeHeightProperty().bind(nodeHeightProperty);

    edgeColorProperty.addListener((observable, oldValue, newValue) -> draw());
    nodeHeightProperty.addListener((observable, oldValue, newValue) -> draw());
    Node.setColorScheme(BasicSettingsViewController.NODE_COLOR_SCHEMES.get(0).getValue());

    displayLaneBordersProperty = new SimpleBooleanProperty();
    displayLaneBordersProperty.addListener((observable, oldValue, newValue) -> draw());

    graphDimensionsCalculator.getGraphProperty()
            .addListener((observable, oldValue, newValue) -> setGraph(newValue));

    graphDimensionsCalculator.getObservableQueryNodes()
            .addListener((ListChangeListener<Node>) change -> draw());

    query.getQueriedNodes().addListener((ListChangeListener<Integer>) observable -> draw());

    segmentDrawingToolkit = new SegmentDrawingToolkit();
    snpDrawingToolkit = new SnpDrawingToolkit();
    edgeDrawingToolkit = new EdgeDrawingToolkit();
    graphAnnotationVisualizer = new GraphAnnotationVisualizer(graphDimensionsCalculator);
    graphAnnotation.indexBuiltProperty().addListener((observable, oldValue, newValue) -> draw());

    nodeHeightProperty.addListener((observable, oldValue, newValue) -> {
        segmentDrawingToolkit.setNodeHeight(nodeHeightProperty.get());
        snpDrawingToolkit.setNodeHeight(nodeHeightProperty.get());
        draw();
    });

    segmentDrawingToolkit.setNodeHeight(nodeHeightProperty.get());
    snpDrawingToolkit.setNodeHeight(nodeHeightProperty.get());
}
 
开发者ID:ProgrammingLife2017,项目名称:hygene,代码行数:70,代码来源:GraphVisualizer.java

示例3: initVariables

import javafx.beans.property.SimpleBooleanProperty; //导入方法依赖的package包/类
private void initVariables() {
	selectedModel = new SimpleObjectProperty<>();
	outputReady = new SimpleBooleanProperty();
	zoomValue = new SimpleIntegerProperty(5);
	showActivationGrid = new SimpleBooleanProperty();
	showChannelGrid = new SimpleBooleanProperty();
	showLayerListener = (b, o, n) -> showLayer();
	showActivationGrid.addListener(showLayerListener);
	showChannelGrid.addListener(showLayerListener);
}
 
开发者ID:jesuino,项目名称:java-ml-projects,代码行数:11,代码来源:App.java

示例4: PositiveIntegerInputField

import javafx.beans.property.SimpleBooleanProperty; //导入方法依赖的package包/类
/**
 * Creates an instances of this positive integer only field.
 */
public PositiveIntegerInputField() {
  this.textProperty().addListener(this::onInputChange);
  valid = new SimpleBooleanProperty();
  valid.addListener(this::onValidStateChange);
  this.alignmentProperty().setValue(Pos.CENTER_RIGHT);
  ViewUtils.setupClass(this);
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:11,代码来源:PositiveIntegerInputField.java


注:本文中的javafx.beans.property.SimpleBooleanProperty.addListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。