Alle implementierten Schnittstellen:
Styleable, EventTarget, Skinnable

public class PinBoard extends Control
A JavaFX component where items can be pinned at a position.
  • Eigenschaftsdetails

  • Konstruktordetails

    • PinBoard

      public PinBoard()
      Default constructor.
  • Methodendetails

    • setHbarPolicy

      public void setHbarPolicy(ScrollPane.ScrollBarPolicy policy)
      Sets the horizontal scrollbar policy of the PinBoardSkin's ScrollPane.
      Parameter:
      policy - the scrollbar policy to set
    • setVbarPolicy

      public void setVbarPolicy(ScrollPane.ScrollBarPolicy policy)
      Sets the vertical scrollbar policy of the PinBoardSkin's ScrollPane.
      Parameter:
      policy - the ScrollBarPolicy to set
    • scrollHValuePropertyProperty

      public DoubleProperty scrollHValuePropertyProperty()
      Returns the property representing the horizontal scroll value of the PinBoard.
      Gibt zurück:
      The DoubleProperty representing the horizontal scroll value.
    • scrollVValuePropertyProperty

      public DoubleProperty scrollVValuePropertyProperty()
      Returns the property representing the vertical scroll value of the PinBoard.
      Gibt zurück:
      The DoubleProperty representing the vertical scroll value.
    • getVisibleItems

      public List<PinBoard.Item> getVisibleItems()
      Retrieves the list of currently visible items on the PinBoard.

      The method checks whether the PinBoard is associated with a PinBoardSkin. If so, it delegates the call to the skin to retrieve the visible items. If no PinBoardSkin is associated, it returns an empty list.

      Gibt zurück:
      A list of visible items. If no skin is available, an empty list is returned.
    • clear

      public void clear()
      Clears the PinBoard by removing all items and resetting the area property. This method must be called from the JavaFX Application Thread.
    • refresh

      public void refresh()
      Refreshes the PinBoard skin.

      This method is used to refresh the visual representation of the PinBoard. It checks if the skin associated with the PinBoard is an instance of PinBoardSkin and then calls the PinBoardSkin.refresh() method to update the nodes displayed on the board.

    • dispose

      public void dispose()
      Disposes the PinBoardSkin instance. Stops the refresher and disposes the superclass.
    • createDefaultSkin

      protected Skin<PinBoard> createDefaultSkin()
      Setzt außer Kraft:
      createDefaultSkin in Klasse Control
    • areaProperty

      public ReadOnlyObjectProperty<Rectangle2D> areaProperty()
      Returns the read-only property that represents the area of the PinBoard.
      Gibt zurück:
      The read-only area property of type Rectangle2D.
      Siehe auch:
    • pannableProperty

      public BooleanProperty pannableProperty()
      Returns the pannable property of the PinBoard. The pannable property determines whether the user can pan the content within the PinBoard.
      Gibt zurück:
      The BooleanProperty representing the pannable state of the PinBoard.
    • getItems

      public ObservableList<PinBoard.Item> getItems()
      Returns an unmodifiable observable list of items.
      Gibt zurück:
      An unmodifiable observable list of items.
    • getScrollPosition

      public ScrollPosition getScrollPosition()
      Retrieves the current scroll position of the PinBoard.
      Gibt zurück:
      a Pair containing the horizontal and vertical scroll positions
    • setScrollPosition

      public void setScrollPosition(double hValue, double vValue)
      Sets the scroll position of the PinBoardSkin's ScrollPane.
      Parameter:
      hValue - the horizontal scroll value to set
      vValue - the vertical scroll value to set
    • setScrollPosition

      public void setScrollPosition(ScrollPosition scrollPosition)
      Sets the scroll position of the PinBoardSkin's ScrollPane.
      Parameter:
      scrollPosition - a Pair containing the horizontal and vertical scroll positions
    • scrollTo

      public void scrollTo(PinBoard.PositionInItem pos)
      Scrolls the PinBoard to the specified position within an item.
      Parameter:
      pos - the position within an item to scroll to
    • scrollTo

      public void scrollTo(PinBoard.PositionInItem pos, double relativeXinVP, double relativeYinVP)
      Scrolls the PinBoard to the specified position within an item.
      Parameter:
      pos - the position within an item to scroll to
      relativeXinVP - the relative position inside the viewport, a value between 0 and 1, i.e., 0 left, 1 right
      relativeYinVP - the relative position inside the viewport, a value between 0 and 1, i.e., 0 top, 1 bottom
    • scroll

      public void scroll(double deltaX, double deltaY)
      Scrolls the PinBoard the specified amount.
      Parameter:
      deltaX - the amount to scroll in horizontal direction
      deltaY - the amount to scroll in vertical direction
    • scrollHorizontal

      public void scrollHorizontal(double delta)
      Scrolls the PinBoard horizontally by the specified amount.
      Parameter:
      delta - the amount to scroll in the horizontal direction
    • scrollVertical

      public void scrollVertical(double delta)
      Scrolls the PinBoard vertically by the specified amount.
      Parameter:
      delta - the amount to scroll in the vertical direction
    • scrollIntoView

      public void scrollIntoView(PinBoard.PositionInItem pos)
      Scrolls the PinBoard the specified position into view.
      Parameter:
      pos - the position
    • scrollTo

      public void scrollTo(double x, double y)
      Scrolls the PinBoard to the specified position within an item.
      Parameter:
      x - the x-position in board coordinates to scroll to
      y - the y-position in board coordinates to scroll to
    • scrollTo

      public void scrollTo(double x, double y, double relativeXinVP, double relativeYinVP)
      Scrolls the PinBoard to the specified position within an item.

      The parameters relativeXinVP and relativeYinVP are used to determine where the point (x,y) should end up in the viewport. For example, use 0.5 for relativeXinVP to center the point horizontally in the viewport.

      Parameter:
      x - The x-coordinate in local coordinates to scroll to
      y - The y-coordinate in local coordinates to scroll to
      relativeXinVP - the relative position inside the viewport, a value between 0 and 1, i.e., 0 left, 1 right
      relativeYinVP - the relative position inside the viewport, a value between 0 and 1, i.e., 0 top, 1 bottom
    • scrollIntoView

      public void scrollIntoView(double x, double y)
      Scrolls the PinBoard the specified position into view.
      Parameter:
      x - the x-position in board coordinates to scroll to
      y - the y-position in board coordinates to scroll to
    • getItemAt

      public Optional<PinBoard.Item> getItemAt(double x, double y)
      Get Item at point.
      Parameter:
      x - x-coordinate (relative to viewport)
      y - y-coordinate (relative to viewport)
      Gibt zurück:
      Optional containing the item at (x,y)
    • getPositionInItem

      public Optional<PinBoard.PositionInItem> getPositionInItem(double x, double y)
      Get Item at point and coordinates transformed to item coordinates.
      Parameter:
      x - x-coordinate (relative to viewport)
      y - y-coordinate (relative to viewport)
      Gibt zurück:
      Optional containing the item and the transformed coordinates
    • pinBottom

      public void pinBottom(String name, Supplier<Node> nodeSupplier, Dimension2D dimension)
      Add item at the bottom, centered horizontally.
      Parameter:
      name - item name
      nodeSupplier - supplier (factory) for item node
      dimension - item dimension
    • getArea

      public Rectangle2D getArea()
      Returns the area of the PinBoard.
      Gibt zurück:
      The Rectangle2D representing the area of the PinBoard.
    • pin

      public void pin(PinBoard.Item item)
      Pins the given item or collection of items to the PinBoard.
      Parameter:
      item - The item to be pinned. Can be a single item or a collection of items to be pinned together.
    • pin

      public void pin(Collection<PinBoard.Item> itemsToPin)
      Pins the given collection of items to the PinBoard.
      Parameter:
      itemsToPin - The collection of items to be pinned.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Node