Class AreaOwner<Parent,​Owner>


  • public class AreaOwner<Parent,​Owner>
    extends Object
    When we draw something in HopGui PipelinePainter or WorkflowPainter we keep a list of all the things we draw and the object that's behind it. That should make it a lot easier to track what was drawn, setting tooltips, etc.
    • Method Detail

      • contains

        public boolean contains​(int x,
                                int y)
        Validate if a certain coordinate is contained in the area
        Parameters:
        x - x-coordinate
        y - y-coordinate
        Returns:
        true if the specified coordinate is contained in the area
      • getCentreX

        public int getCentreX()
      • getCentreY

        public int getCentreY()
      • distanceTo

        public double distanceTo​(AreaOwner o)
        Calculate the distance between the centres of the areas.
        Parameters:
        o - The other area owner to calcualte the distance to
        Returns:
        The distance.
      • getVisibleAreaOwner

        public static <Owner,​Parent> AreaOwner<Owner,​Parent> getVisibleAreaOwner​(List<AreaOwner<Owner,​Parent>> areaOwners,
                                                                                             int x,
                                                                                             int y)
        Find the last area owner, the one drawn last, for the given coordinate. In other words, this searches the provided list back-to-front.
        Parameters:
        areaOwners - The list of area owners
        x - The x coordinate
        y - The y coordinate
        Returns:
        The area owner or null if nothing could be found
      • getArea

        public Rectangle getArea()
        Returns:
        the area
      • setArea

        public void setArea​(Rectangle area)
        Parameters:
        area - the area to set
      • getOwner

        public Owner getOwner()
        Returns:
        the owner
      • setOwner

        public void setOwner​(Owner owner)
        Parameters:
        owner - the owner to set
      • getParent

        public Parent getParent()
        Returns:
        the parent
      • setParent

        public void setParent​(Parent parent)
        Parameters:
        parent - the parent to set
      • setAreaType

        public void setAreaType​(AreaOwner.AreaType areaType)
        Parameters:
        areaType - the areaType to set