Class RTreeNode

java.lang.Object
de.freaklamarsch.systarest.RTreeNode

public class RTreeNode
extends java.lang.Object
Represents a node in an R-Tree, which stores geometric objects such as rectangles, circles, and text elements.
  • Field Summary

    Fields
    Modifier and Type Field Description
    (package private) java.awt.Color backgroundColor
    The color of the background elements in this node.
    (package private) java.util.List<RTreeNode> children
    The list of child nodes.
    (package private) java.awt.Color foregroundColor
    The color of the foreground elements in this node.
    (package private) int maxX
    The x-coordinate of the bottom-right corner of the node's bounding box.
    (package private) int maxY
    The y-coordinate of the bottom-right corner of the node's bounding box.
    (package private) int minX
    The x-coordinate of the top-left corner of the node's bounding box.
    (package private) int minY
    The y-coordinate of the top-left corner of the node's bounding box.
    (package private) java.lang.Object object
    The object stored in this node (e.g., a rectangle, circle, or text element).
    (package private) RTreeNode parent
    The parent node of this node.
  • Constructor Summary

    Constructors
    Constructor Description
    RTreeNode​(java.lang.Object object, int minX, int minY, int maxX, int maxY, java.awt.Color foregroundColor, java.awt.Color backgroundColor, RTreeNode parent)
    Constructs an RTreeNode with the specified properties.
  • Method Summary

    Modifier and Type Method Description
    boolean contains​(int x, int y)  
    boolean contains​(RTreeNode otherNode)  
    boolean equals​(java.lang.Object obj)  
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • object

      java.lang.Object object
      The object stored in this node (e.g., a rectangle, circle, or text element).
    • minX

      int minX
      The x-coordinate of the top-left corner of the node's bounding box.
    • maxX

      int maxX
      The x-coordinate of the bottom-right corner of the node's bounding box.
    • minY

      int minY
      The y-coordinate of the top-left corner of the node's bounding box.
    • maxY

      int maxY
      The y-coordinate of the bottom-right corner of the node's bounding box.
    • foregroundColor

      java.awt.Color foregroundColor
      The color of the foreground elements in this node.
    • backgroundColor

      java.awt.Color backgroundColor
      The color of the background elements in this node.
    • parent

      RTreeNode parent
      The parent node of this node.
    • children

      java.util.List<RTreeNode> children
      The list of child nodes.
  • Constructor Details

    • RTreeNode

      public RTreeNode​(java.lang.Object object, int minX, int minY, int maxX, int maxY, java.awt.Color foregroundColor, java.awt.Color backgroundColor, RTreeNode parent)
      Constructs an RTreeNode with the specified properties.
      Parameters:
      parent - the parent node
      minX - the x-coordinate of the top-left corner of the bounding box
      minY - the y-coordinate of the top-left corner of the bounding box
      maxX - the x-coordinate of the bottom-right corner of the bounding box
      maxY - the y-coordinate of the bottom-right corner of the bounding box
      foregroundColor - the foreground color
      backgroundColor - the background color
      object - the object stored in the node
  • Method Details

    • contains

      public boolean contains​(RTreeNode otherNode)
    • contains

      public boolean contains​(int x, int y)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object