Class AbstractAnchor

    • Constructor Detail

      • AbstractAnchor

        public AbstractAnchor​(javafx.scene.Node anchorage)
        Creates a new AbstractAnchor for the given anchorage Node.
        Parameters:
        anchorage - The anchorage Node for this AbstractAnchor.
    • Method Detail

      • anchorageProperty

        public javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.Node> anchorageProperty()
        Description copied from interface: IAnchor
        Provides a read-only property with the anchorage Node this IAnchor is bound to. The property value may be null in case this IAnchor is not bound to an anchorage Node.
        Specified by:
        anchorageProperty in interface IAnchor
        Returns:
        A read-only property storing the anchorage Node.
      • computePosition

        protected abstract Point computePosition​(AnchorKey key)
        Recomputes the position for the given attached AnchorKey by delegating to the respective IComputationStrategy.
        Parameters:
        key - The AnchorKey for which to compute an anchor position.
        Returns:
        The point for the given AnchorKey in local coordinates of the anchored Node.
      • getKeys

        protected java.util.Set<AnchorKey> getKeys()
        Returns all keys maintained by this anchor.
        Returns:
        A set containing all AnchorKeys.
      • getKeysByNode

        protected SetMultimap<javafx.scene.Node,​AnchorKey> getKeysByNode()
        Returns the Map which stores the registered AnchorKeys per Node by reference.
        Returns:
        The Map which stores the registered AnchorKeys per Node by reference.
      • getPositionsUnmodifiable

        public javafx.collections.ObservableMap<AnchorKey,​Point> getPositionsUnmodifiable()
        Description copied from interface: IAnchor
        Provides an observable read-only (map) with positions (in local coordinates of the anchored Nodes) for all attached AnchorKeys. The positions will be updated for all attached AnchorKeys if the attached Nodes or the anchorage Node, the IAnchor is bound to, or any of their ancestors changes in a way that will effect the positions (within the local coordinate space of the attached Nodes).
        Specified by:
        getPositionsUnmodifiable in interface IAnchor
        Returns:
        A read-only observable map storing positions for all attached AnchorKeys.
      • isAttached

        public boolean isAttached​(AnchorKey key)
        Description copied from interface: IAnchor
        Determines if the given AnchorKey is currently attached to this IAnchor.
        Specified by:
        isAttached in interface IAnchor
        Parameters:
        key - The AnchorKey to test.
        Returns:
        true if the given key is attached, otherwise false.
      • positionsUnmodifiableProperty

        public javafx.beans.property.ReadOnlyMapProperty<AnchorKey,​Point> positionsUnmodifiableProperty()
        Description copied from interface: IAnchor
        Provides a read-only (map) property with positions (in local coordinates of the anchored Nodes) for all attached AnchorKeys. The positions will be updated for all attached AnchorKeys if the attached Nodes or the anchorage Node, the IAnchor is bound to, or any of their ancestors changes in a way that will effect the positions (within the local coordinate space of the attached Nodes).
        Specified by:
        positionsUnmodifiableProperty in interface IAnchor
        Returns:
        A read-only (map) property storing positions for all attached AnchorKeys.
      • registerVCL

        protected void registerVCL​(javafx.scene.Node anchored)
        Registers a VisualChangeListener for the given anchored Node.
        Parameters:
        anchored - The anchored Node to register a VisualChangeListener at.
      • registerVCLs

        protected void registerVCLs()
        Registers VisualChangeListeners for all anchored Nodes, or schedules their registration if the VCL cannot be registered yet.
      • setAnchorage

        protected void setAnchorage​(javafx.scene.Node anchorage)
        Sets the anchorage of this AbstractAnchor to the given value.
        Parameters:
        anchorage - The new anchorage for this AbstractAnchor.
      • unregisterVCL

        protected void unregisterVCL​(javafx.scene.Node anchored)
        Unregisters the VisualChangeListeners for the given anchored Node.
        Parameters:
        anchored - The anchored Node to unregister a VisualChangeListener from.
      • unregisterVCLs

        protected void unregisterVCLs()
        Unregisters the VisualChangeListeners for all anchored Nodes.
      • updatePosition

        protected void updatePosition​(AnchorKey key)
        Updates the position for the given AnchorKey, i.e.
        1. Queries its current position.
        2. Computes its new position.
        3. Checks if the position changed, and fires an appropriate event by putting the new position into the positionsUnmodifiableProperty()
        Parameters:
        key - The AnchorKey for which the position is updated.
      • updatePositions

        protected void updatePositions()
        Updates the positions for all attached AnchorKeys.