Package org.apache.hop.core.gui
Class AreaOwner<Parent,Owner>
- java.lang.Object
-
- org.apache.hop.core.gui.AreaOwner<Parent,Owner>
-
public class AreaOwner<Parent,Owner> extends Object
When we draw something in HopGuiPipelinePainterorWorkflowPainterwe 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAreaOwner.AreaType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(int x, int y)Validate if a certain coordinate is contained in the areadoubledistanceTo(AreaOwner o)Calculate the distance between the centres of the areas.RectanglegetArea()AreaOwner.AreaTypegetAreaType()intgetCentreX()intgetCentreY()OwnergetOwner()ParentgetParent()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.voidsetArea(Rectangle area)voidsetAreaType(AreaOwner.AreaType areaType)voidsetOwner(Owner owner)voidsetParent(Parent parent)
-
-
-
Method Detail
-
contains
public boolean contains(int x, int y)Validate if a certain coordinate is contained in the area- Parameters:
x- x-coordinatey- 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 ownersx- The x coordinatey- 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
-
getAreaType
public AreaOwner.AreaType getAreaType()
- Returns:
- the areaType
-
setAreaType
public void setAreaType(AreaOwner.AreaType areaType)
- Parameters:
areaType- the areaType to set
-
-