All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.datafx.flow.wysiwyg.netview.NetView Maven / Gradle / Ivy

The newest version!
package org.datafx.flow.wysiwyg.netview;

import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.control.Control;
import javafx.scene.control.Skin;
import javafx.util.Callback;

public class NetView extends Control {

    private ObjectProperty> items;

    private ObjectProperty>> connections;

    private ObjectProperty, NetCell>> cellFactory;

    private ObjectProperty, NetConnectionView>> connectionFactory;

    private ObjectProperty> netViewPositionHandler;

    public NetView() {
        netViewPositionHandler = new SimpleObjectProperty<>(new NetViewPositionHandler(this));
        items = new SimpleObjectProperty<>(FXCollections.observableArrayList());
        connections = new SimpleObjectProperty<>(FXCollections.observableArrayList());
        cellFactory = new SimpleObjectProperty<>((e) -> new NetCell<>());
        connectionFactory = new SimpleObjectProperty<>((e) -> new NetConnectionView<>());
    }

    @Override
    protected Skin createDefaultSkin() {
        return new NetViewSkin<>(this);
    }

    public NetViewPositionHandler getNetViewPositionHandler() {
        return netViewPositionHandler.get();
    }

    public ObjectProperty> netViewPositionHandlerProperty() {
        return netViewPositionHandler;
    }

    public ObservableList> getConnections() {
        return connections.get();
    }

    public ObjectProperty>> connectionsProperty() {
        return connections;
    }

    public void setConnections(ObservableList> connections) {
        this.connections.set(connections);
    }

    public void setNetViewPositionHandler(NetViewPositionHandler netViewPositionHandler) {
        this.netViewPositionHandler.set(netViewPositionHandler);
    }

    public final void setCellFactory(Callback, NetCell> value) {
        cellFactoryProperty().set(value);
    }

    public final Callback, NetCell> getCellFactory() {
        return cellFactory.get();
    }

    public final ObjectProperty, NetCell>> cellFactoryProperty() {
        return cellFactory;
    }

    public final void setConnectionFactory(Callback, NetConnectionView> value) {
        connectionFactoryProperty().set(value);
    }

    public final Callback, NetConnectionView> getConnectionFactory() {
        return connectionFactory.get();
    }

    public final ObjectProperty, NetConnectionView>> connectionFactoryProperty() {
        return connectionFactory;
    }

    public final void setItems(ObservableList value) {
        itemsProperty().set(value);
    }

    public final ObservableList getItems() {
        return items.get();
    }

    public final ObjectProperty> itemsProperty() {
        return items;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy