widgetitem: associate Widget with WidgetItem

This commit is contained in:
Adam
2019-04-19 14:27:49 -04:00
parent a45ab3c887
commit 8bfc0f2b21
3 changed files with 16 additions and 36 deletions

View File

@@ -26,6 +26,7 @@ package net.runelite.api.widgets;
import java.awt.Rectangle;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
import net.runelite.api.Point;
@@ -34,55 +35,34 @@ import net.runelite.api.Point;
*/
@AllArgsConstructor
@ToString
@Getter
public class WidgetItem
{
private final int id;
private final int quantity;
private final int index;
private final Rectangle canvasBounds;
/**
* Gets the ID of the item represented.
* The ID of the item represented.
*
* @return the items ID
* @see net.runelite.api.ItemID
*/
public int getId()
{
return id;
}
private final int id;
/**
* Gets the quantity of the represented item.
*
* @return the items quantity
* The quantity of the represented item.
*/
public int getQuantity()
{
return quantity;
}
private final int quantity;
/**
* Gets the index position of this WidgetItem inside its parents
* The index position of this WidgetItem inside its parents
* WidgetItem array.
*
* @return the index in the parent widget
* @see Widget#getWidgetItems()
*/
public int getIndex()
{
return index;
}
private final int index;
/**
* Gets the area where the widget is drawn on the canvas.
*
* @return the occupied area of the widget
* The area where the widget is drawn on the canvas.
*/
public Rectangle getCanvasBounds()
{
return canvasBounds;
}
private final Rectangle canvasBounds;
/**
* The widget which contains this item.
*/
private final Widget widget;
/**
* Gets the upper-left coordinate of where the widget is being drawn