Package de.freaklamarsch.systarest
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
-
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
object
java.lang.Object objectThe object stored in this node (e.g., a rectangle, circle, or text element). -
minX
int minXThe x-coordinate of the top-left corner of the node's bounding box. -
maxX
int maxXThe x-coordinate of the bottom-right corner of the node's bounding box. -
minY
int minYThe y-coordinate of the top-left corner of the node's bounding box. -
maxY
int maxYThe y-coordinate of the bottom-right corner of the node's bounding box. -
foregroundColor
java.awt.Color foregroundColorThe color of the foreground elements in this node. -
backgroundColor
java.awt.Color backgroundColorThe color of the background elements in this node. -
parent
RTreeNode parentThe parent node of this node. -
children
java.util.List<RTreeNode> childrenThe 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 nodeminX
- the x-coordinate of the top-left corner of the bounding boxminY
- the y-coordinate of the top-left corner of the bounding boxmaxX
- the x-coordinate of the bottom-right corner of the bounding boxmaxY
- the y-coordinate of the bottom-right corner of the bounding boxforegroundColor
- the foreground colorbackgroundColor
- the background colorobject
- the object stored in the node
-
-
Method Details
-
contains
-
contains
public boolean contains(int x, int y) -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-