Remove not needed parent point and minimap orb

- Remove not needed parent point parameter in RenderableEntity, it's
usage has been replaced with getBounds().getLocation()
- Remove unused class minimap orb

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-03-23 17:27:27 +01:00
parent a05650cd31
commit f2e1ab5bfe
68 changed files with 124 additions and 420 deletions

View File

@@ -58,7 +58,7 @@ public class AgilityOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
LocalPoint playerLocation = client.getLocalPlayer().getLocalLocation();
Point mousePosition = client.getMouseCanvasPosition();

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.attackindicator;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import javax.inject.Inject;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayPosition;
@@ -48,7 +47,7 @@ public class AttackIndicatorOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
final String attackStyleString = plugin.getAttackStyle().getName();
@@ -56,6 +55,6 @@ public class AttackIndicatorOverlay extends Overlay
panelComponent.setTitle(attackStyleString);
panelComponent.setWidth(COMPONENT_WIDTH);
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -26,7 +26,6 @@ package net.runelite.client.plugins.barbarianassault;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import javax.inject.Inject;
import lombok.Getter;
@@ -60,7 +59,7 @@ public class BarbarianAssaultOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (client.getGameState() != GameState.LOGGED_IN || currentRound == null)
{

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.barrows;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.util.List;
import javax.inject.Inject;
import net.runelite.api.Client;
@@ -61,7 +60,7 @@ class BarrowsOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
Player local = client.getLocalPlayer();

View File

@@ -26,7 +26,6 @@ package net.runelite.client.plugins.blastfurnace;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import javax.inject.Inject;
import net.runelite.api.Client;
import static net.runelite.api.Varbits.BLAST_FURNACE_COFFER;
@@ -52,7 +51,7 @@ class BlastFurnaceCofferOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (plugin.getConveyorBelt() == null)
{
@@ -72,6 +71,6 @@ class BlastFurnaceCofferOverlay extends Overlay
StackFormatter.quantityToStackSize(client.getSetting(BLAST_FURNACE_COFFER)) + " gp"
));
}
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -26,7 +26,6 @@ package net.runelite.client.plugins.blastfurnace;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.image.BufferedImage;
import javax.inject.Inject;
import net.runelite.api.Client;
@@ -53,7 +52,7 @@ class BlastFurnaceOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (plugin.getConveyorBelt() == null)
{
@@ -74,7 +73,7 @@ class BlastFurnaceOverlay extends Overlay
imagePanelComponent.getImages().add(getImage(varbit.getItemID(), amount));
}
return imagePanelComponent.render(graphics, parent);
return imagePanelComponent.render(graphics);
}
private BufferedImage getImage(int itemID, int amount)

View File

@@ -54,7 +54,7 @@ class ConveyorBeltOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!config.showConveyorBelt() || plugin.getConveyorBelt() == null)
{

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.boosts;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.time.Duration;
import java.time.Instant;
import javax.inject.Inject;
@@ -69,7 +68,7 @@ class BoostsOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
panelComponent = new PanelComponent();
boolean overlayActive = false;
@@ -153,7 +152,7 @@ class BoostsOverlay extends Overlay
}
}
return panelComponent.getLines().isEmpty() ? null : panelComponent.render(graphics, parent);
return panelComponent.getLines().isEmpty() ? null : panelComponent.render(graphics);
}
private Color getTextColor(int boost)

View File

@@ -60,7 +60,7 @@ class CannonOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!plugin.isCannonPlaced() || plugin.getCannonPosition() == null)
{
@@ -88,7 +88,7 @@ class CannonOverlay extends Overlay
textComponent.setText(String.valueOf(plugin.getCballsLeft()));
textComponent.setPosition(new java.awt.Point(cannonLoc.getX(), cannonLoc.getY()));
textComponent.setColor(plugin.getStateColor());
textComponent.render(graphics, parent);
textComponent.render(graphics);
}
if (config.showDoubleHitSpot())

View File

@@ -62,7 +62,7 @@ public class CannonSpotOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!config.showCannonSpots() || plugin.isCannonPlaced())
{

View File

@@ -28,7 +28,6 @@ package net.runelite.client.plugins.cluescrolls;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.time.Duration;
import java.time.Instant;
import javax.inject.Inject;
@@ -56,7 +55,7 @@ public class ClueScrollOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (clue == null)
{
@@ -90,6 +89,6 @@ public class ClueScrollOverlay extends Overlay
}
}
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -30,7 +30,6 @@ import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
@@ -92,7 +91,7 @@ public class DevToolsOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
Font font = plugin.getFont();
if (font != null)

View File

@@ -49,7 +49,7 @@ public class LocationOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!plugin.isToggleLocation())
{
@@ -76,6 +76,6 @@ public class LocationOverlay extends Overlay
}
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -36,7 +36,6 @@ import javax.inject.Inject;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.IOException;
@@ -61,7 +60,7 @@ public class FightCaveOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
JadAttack attack = plugin.getAttack();
if (attack == null)
@@ -76,7 +75,7 @@ public class FightCaveOverlay extends Overlay
{
imagePanelComponent.setBackgroundColor(NOT_ACTIVATED_BACKGROUND_COLOR);
}
return imagePanelComponent.render(graphics, parent);
return imagePanelComponent.render(graphics);
}
private BufferedImage getPrayerImage(JadAttack attack)

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.fishing;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.time.Duration;
import java.time.Instant;
import javax.inject.Inject;
@@ -60,7 +59,7 @@ class FishingOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
FishingSession session = plugin.getSession();
@@ -107,6 +106,6 @@ class FishingOverlay extends Overlay
}
}
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.fishing;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import javax.inject.Inject;
import net.runelite.api.GraphicID;
import net.runelite.api.NPC;
@@ -49,7 +48,7 @@ class FishingSpotMinimapOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
NPC[] fishingSpots = plugin.getFishingSpots();
if (fishingSpots == null)

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.fishing;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.image.BufferedImage;
import javax.inject.Inject;
import net.runelite.api.GraphicID;
@@ -56,7 +55,7 @@ class FishingSpotOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
NPC[] fishingSpots = plugin.getFishingSpots();
if (fishingSpots == null)

View File

@@ -107,7 +107,7 @@ public class GroundItemsOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
Region region = client.getRegion();
Tile[][][] tiles = region.getTiles();

View File

@@ -54,7 +54,7 @@ class HerbiboarOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!plugin.isInHerbiboarArea())
{

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.hunter;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.util.Iterator;
import java.util.Map;
import javax.inject.Inject;
@@ -71,7 +70,7 @@ public class TrapOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
drawTraps(graphics);
return null;

View File

@@ -71,7 +71,7 @@ public class ImplingsOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
NPCQuery implingQuery = new NPCQuery().idEquals(Ints.toArray(ids.keySet()));
NPC[] implings = queryRunner.runQuery(implingQuery);

View File

@@ -185,7 +185,7 @@ class InstanceMapOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!showMap)
{
@@ -302,7 +302,7 @@ class InstanceMapOverlay extends Overlay
backgroundComponent.setFill(false);
backgroundComponent.setRectangle(new Rectangle(0, 0, mapOverlaySize.width, mapOverlaySize.height));
backgroundComponent.render(graphics, new java.awt.Point());
backgroundComponent.render(graphics);
//These loops are seperated on purpose to prevent layering issues. This is how it's written in the client
//Draw the base colors first

View File

@@ -26,7 +26,6 @@ package net.runelite.client.plugins.itemprices;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.text.NumberFormat;
import javax.inject.Inject;
import net.runelite.api.Client;
@@ -76,7 +75,7 @@ class ItemPricesOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point point)
public Dimension render(Graphics2D graphics)
{
if (client.isMenuOpen())
{

View File

@@ -54,7 +54,7 @@ public class ItemStatOverlay extends Overlay
private ItemStatConfig config;
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (client.isMenuOpen() || (!config.relative() && !config.absolute() && !config.theoretical()))
{

View File

@@ -57,7 +57,7 @@ class JewelleryCountOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
graphics.setFont(FontManager.getRunescapeSmallFont());
@@ -74,7 +74,7 @@ class JewelleryCountOverlay extends Overlay
final TextComponent textComponent = new TextComponent();
textComponent.setPosition(new Point(bounds.x, bounds.y + 16));
textComponent.setText(String.valueOf(charges.getCharges()));
textComponent.render(graphics, parent);
textComponent.render(graphics);
}
return null;

View File

@@ -69,7 +69,7 @@ public class KourendLibraryOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D g, java.awt.Point parent)
public Dimension render(Graphics2D g)
{
Player player = client.getLocalPlayer();
if (player == null)

View File

@@ -28,7 +28,6 @@ import com.google.common.collect.Sets;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.time.Duration;
import java.time.Instant;
import java.util.Set;
@@ -72,7 +71,7 @@ class MotherlodeOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
MotherlodeSession session = plugin.getSession();
@@ -114,6 +113,6 @@ class MotherlodeOverlay extends Overlay
: ""
));
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -68,7 +68,7 @@ class MotherlodeRocksOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!config.showRocks())
{

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.motherlode;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.Varbits;
@@ -52,7 +51,7 @@ class MotherlodeSackOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
Widget sack = client.getWidget(WidgetInfo.MOTHERLODE_MINE);
@@ -71,6 +70,6 @@ class MotherlodeSackOverlay extends Overlay
}
}
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.mousehighlight;
import com.google.common.base.Strings;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.MenuEntry;
@@ -50,7 +49,7 @@ class MouseHighlightOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point point)
public Dimension render(Graphics2D graphics)
{
if (client.isMenuOpen())
{

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.nightmarezone;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.ItemID;
@@ -70,7 +69,7 @@ class NightmareZoneOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (!plugin.isInNightmareZone() || !config.moveOverlay())
{
@@ -104,7 +103,7 @@ class NightmareZoneOverlay extends Overlay
Color.WHITE
));
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
private void renderAbsorptionCounter()

View File

@@ -29,7 +29,6 @@ import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Polygon;
import java.util.Map;
import javax.inject.Inject;
@@ -58,7 +57,7 @@ public class NpcClickboxOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
Map<NPC, String> npcMap = plugin.getHighlightedNpcs();
for (NPC npc : npcMap.keySet())

View File

@@ -28,7 +28,6 @@ package net.runelite.client.plugins.npchighlight;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.util.Map;
import javax.inject.Inject;
import net.runelite.api.NPC;
@@ -52,7 +51,7 @@ public class NpcMinimapOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
Map<NPC, String> npcMap = plugin.getHighlightedNpcs();
for (NPC npc : npcMap.keySet())

View File

@@ -94,7 +94,7 @@ class OpponentInfoOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
Actor opponent = getOpponent();
@@ -157,7 +157,7 @@ class OpponentInfoOverlay extends Overlay
final BackgroundComponent backgroundComponent = new BackgroundComponent();
backgroundComponent.setRectangle(new Rectangle(0, 0, WIDTH, height));
backgroundComponent.render(graphics, parent);
backgroundComponent.render(graphics);
int y = TOP_BORDER + fm.getHeight();
@@ -166,7 +166,7 @@ class OpponentInfoOverlay extends Overlay
final TextComponent textComponent = new TextComponent();
textComponent.setPosition(new Point(x, y));
textComponent.setText(opponentName);
textComponent.render(graphics, parent);
textComponent.render(graphics);
y += 3;
}
@@ -199,7 +199,7 @@ class OpponentInfoOverlay extends Overlay
final TextComponent textComponent1 = new TextComponent();
textComponent1.setText(str);
textComponent1.setPosition(new Point((WIDTH - fm.stringWidth(str)) / 2, y));
textComponent1.render(graphics, parent);
textComponent1.render(graphics);
y += 3;
}
@@ -212,7 +212,7 @@ class OpponentInfoOverlay extends Overlay
final TextComponent textComponent = new TextComponent();
textComponent.setPosition(new Point(x, y));
textComponent.setText(opponentsOpponentName);
textComponent.render(graphics, parent);
textComponent.render(graphics);
}
return new Dimension(WIDTH, height);

View File

@@ -34,7 +34,6 @@ import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.Rectangle2D;
import java.util.Arrays;
import javax.inject.Inject;
@@ -71,7 +70,7 @@ public class PestControlOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point point)
public Dimension render(Graphics2D graphics)
{
// See if we are in a game or not
if (client.getWidget(WidgetInfo.PESTCONTROL_BLUE_SHIELD) == null)

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.playerindicators;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.Player;
@@ -54,7 +53,7 @@ public class PlayerIndicatorsMinimapOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
playerIndicatorsService.forEachPlayer((player, color) -> renderPlayerOverlay(graphics, player, color));
return null;

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.playerindicators;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Polygon;
import javax.inject.Inject;
import javax.inject.Singleton;
@@ -53,7 +52,7 @@ public class PlayerIndicatorsOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
playerIndicatorsService.forEachPlayer((player, color) -> renderPlayerOverlay(graphics, player, color));
return null;

View File

@@ -58,7 +58,7 @@ public class BurnerOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!config.showBurner())
{
@@ -71,18 +71,18 @@ public class BurnerOverlay extends Overlay
{
if (BURNER_UNLIT.contains(object.getId()))
{
drawBurner(graphics, "Unlit", object, Color.RED, parent);
drawBurner(graphics, "Unlit", object, Color.RED);
}
else if (BURNER_LIT.contains(object.getId()))
{
drawBurner(graphics, "Lit", object, Color.GREEN, parent);
drawBurner(graphics, "Lit", object, Color.GREEN);
}
}
});
return null;
}
private void drawBurner(Graphics2D graphics, String text, TileObject tileObject, Color color, java.awt.Point parent)
private void drawBurner(Graphics2D graphics, String text, TileObject tileObject, Color color)
{
Point canvasText = Perspective.getCanvasTextLocation(client, graphics, tileObject.getLocalLocation(), text, 200);
@@ -94,7 +94,7 @@ public class BurnerOverlay extends Overlay
textComponent.setText(text);
textComponent.setPosition(new java.awt.Point(canvasText.getX(), canvasText.getY()));
textComponent.setColor(color);
textComponent.render(graphics, parent);
textComponent.render(graphics);
//render tile
OverlayUtil.renderPolygon(graphics, tileObject.getCanvasTilePoly(), color);

View File

@@ -67,7 +67,7 @@ public class PohOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
LocalPoint localLocation = client.getLocalPlayer().getLocalLocation();
plugin.getPohObjects().forEach((object, tile) ->

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.prayflick;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.Rectangle2D;
import java.time.Duration;
import java.time.Instant;
@@ -61,7 +60,7 @@ public class PrayerFlickOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point point)
public Dimension render(Graphics2D graphics)
{
if (!prayersActive) //If there are no prayers active we don't need to be flicking
{

View File

@@ -100,7 +100,7 @@ public class PuzzleSolverOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if ((!config.displaySolution() && !config.displayRemainingMoves())
|| client.getGameState() != GameState.LOGGED_IN)
@@ -323,7 +323,7 @@ public class PuzzleSolverOverlay extends Overlay
BackgroundComponent backgroundComponent = new BackgroundComponent();
backgroundComponent.setRectangle(new Rectangle(x, y, INFO_BOX_WIDTH, height));
backgroundComponent.render(graphics, parent);
backgroundComponent.render(graphics);
int textOffsetX = (INFO_BOX_WIDTH - fm.stringWidth(infoString)) / 2;
int textOffsetY = fm.getHeight();
@@ -331,7 +331,7 @@ public class PuzzleSolverOverlay extends Overlay
TextComponent textComponent = new TextComponent();
textComponent.setPosition(new Point(x + textOffsetX, y + textOffsetY));
textComponent.setText(infoString);
textComponent.render(graphics, parent);
textComponent.render(graphics);
}
// Solve the puzzle if we don't have an up to date solution

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.pyramidplunder;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.Varbits;
@@ -52,7 +51,7 @@ public class PyramidPlunderOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
Widget pyramidPlunderInfo = client.getWidget(WidgetInfo.PYRAMID_PLUNDER_DATA);
@@ -79,7 +78,7 @@ public class PyramidPlunderOverlay extends Overlay
"Room: ", String.valueOf(client.getSetting(Varbits.PYRAMID_PLUNDER_ROOM)) + "/8"
));
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
public void showWidget()

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.raids;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import javax.inject.Inject;
import lombok.Setter;
import net.runelite.client.plugins.raids.solver.Room;
@@ -55,7 +54,7 @@ public class RaidsOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (plugin.isInRaidChambers())
{
@@ -73,7 +72,7 @@ public class RaidsOverlay extends Overlay
{
panelComponent.setTitleColor(Color.RED);
panelComponent.setTitle("Unable to scout this raid!");
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
panelComponent.setTitleColor(Color.WHITE);
@@ -147,6 +146,6 @@ public class RaidsOverlay extends Overlay
}
}
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -28,7 +28,6 @@ import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Stroke;
@@ -68,7 +67,7 @@ public class RegenMeterOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D g, Point point)
public Dimension render(Graphics2D g)
{
g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);

View File

@@ -54,7 +54,7 @@ public class RoguesDenOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!plugin.isHasGem())
{

View File

@@ -83,7 +83,7 @@ class AbyssOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
if (!config.showRifts())
{

View File

@@ -63,7 +63,7 @@ public class BindNeckOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (!config.showBindNeck())
{
@@ -82,7 +82,7 @@ public class BindNeckOverlay extends Overlay
textComponent.setPosition(new Point(bounds.x, bounds.y + 16));
textComponent.setText(text);
textComponent.setColor(color);
textComponent.render(graphics, parent);
textComponent.render(graphics);
}
return null;

View File

@@ -64,7 +64,7 @@ public class RunecraftOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (!config.showPouch())
{
@@ -104,7 +104,7 @@ public class RunecraftOverlay extends Overlay
final TextComponent textComponent = new TextComponent();
textComponent.setPosition(new Point(bounds.x, bounds.y + 16));
textComponent.setText(String.valueOf(client.getSetting(varbits)));
textComponent.render(graphics, parent);
textComponent.render(graphics);
}
return null;

View File

@@ -79,7 +79,7 @@ public class RunepouchOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point point)
public Dimension render(Graphics2D graphics)
{
Query query = new InventoryWidgetItemQuery().idEquals(ItemID.RUNE_POUCH);
WidgetItem[] items = queryRunner.runQuery(query);

View File

@@ -91,7 +91,7 @@ class SlayerOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
if (!config.showItemOverlay())
{
@@ -122,7 +122,7 @@ class SlayerOverlay extends Overlay
textComponent.setPosition(new Point(bounds.x, bounds.y + (slayerJewelry.contains(itemId)
? bounds.height
: graphics.getFontMetrics().getHeight())));
textComponent.render(graphics, parent);
textComponent.render(graphics);
}
return null;

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.teamcapes;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.util.Map;
import javax.inject.Inject;
import net.runelite.client.ui.overlay.Overlay;
@@ -51,7 +50,7 @@ public class TeamCapesOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
Map<Integer, Integer> teams = plugin.getTeams();
if (teams.isEmpty())
@@ -72,6 +71,6 @@ public class TeamCapesOverlay extends Overlay
));
}
}
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -51,7 +51,7 @@ public class TileIndicatorsOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point parent)
public Dimension render(Graphics2D graphics)
{
LocalPoint dest = client.getLocalDestinationLocation();
if (dest == null)

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.woodcutting;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.time.Duration;
import java.time.Instant;
import java.util.stream.IntStream;
@@ -74,7 +73,7 @@ class WoodcuttingOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
WoodcuttingSession session = plugin.getSession();
@@ -121,6 +120,6 @@ class WoodcuttingOverlay extends Overlay
}
}
return panelComponent.render(graphics, parent);
return panelComponent.render(graphics);
}
}

View File

@@ -78,7 +78,7 @@ public class XpGlobesOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, java.awt.Point point)
public Dimension render(Graphics2D graphics)
{
//if this is null there is no reason to draw e.g. switching between resizable and fixed
Widget viewportWidget = client.getViewportWidget();
@@ -118,7 +118,7 @@ public class XpGlobesOverlay extends Overlay
for (XpGlobe xpGlobe : xpChangedQueue)
{
renderProgressCircle(graphics, point, xpGlobe, startDrawX, DEFAULT_START_Y);
renderProgressCircle(graphics, xpGlobe, startDrawX, DEFAULT_START_Y);
startDrawX += MINIMUM_STEP + config.xpOrbSize();
}
plugin.removeExpiredXpGlobes();
@@ -126,7 +126,7 @@ public class XpGlobesOverlay extends Overlay
return null;
}
private void renderProgressCircle(Graphics2D graphics, java.awt.Point parent, XpGlobe skillToDraw, int x, int y)
private void renderProgressCircle(Graphics2D graphics, XpGlobe skillToDraw, int x, int y)
{
double radiusCurrentXp = skillToDraw.getSkillProgressRadius();
double radiusToGoalXp = 360; //draw a circle
@@ -158,7 +158,7 @@ public class XpGlobesOverlay extends Overlay
if (config.enableTooltips())
{
drawTooltipIfMouseover(graphics, parent, skillToDraw, backgroundCircle);
drawTooltipIfMouseover(graphics, skillToDraw, backgroundCircle);
}
}
@@ -201,7 +201,7 @@ public class XpGlobesOverlay extends Overlay
);
}
private void drawTooltipIfMouseover(Graphics2D graphics, java.awt.Point parent, XpGlobe mouseOverSkill, Ellipse2D drawnGlobe)
private void drawTooltipIfMouseover(Graphics2D graphics, XpGlobe mouseOverSkill, Ellipse2D drawnGlobe)
{
Point mouse = client.getMouseCanvasPosition();
int mouseX = mouse.getX();
@@ -243,6 +243,6 @@ public class XpGlobesOverlay extends Overlay
xpTooltip.setProgressBar(progressBar);
}
xpTooltip.render(graphics, parent);
xpTooltip.render(graphics);
}
}

View File

@@ -490,7 +490,7 @@ public class OverlayRenderer extends MouseListener implements KeyListener
{
final Graphics2D subGraphics = (Graphics2D) graphics.create();
subGraphics.translate(point.x, point.y);
final Dimension dimension = MoreObjects.firstNonNull(overlay.render(subGraphics, point), new Dimension());
final Dimension dimension = MoreObjects.firstNonNull(overlay.render(subGraphics), new Dimension());
subGraphics.dispose();
overlay.setBounds(new Rectangle(point, dimension));
}

View File

@@ -26,9 +26,8 @@ package net.runelite.client.ui.overlay;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
public interface RenderableEntity
{
Dimension render(Graphics2D graphics, Point parent);
Dimension render(Graphics2D graphics);
}

View File

@@ -27,7 +27,6 @@ package net.runelite.client.ui.overlay.components;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
@@ -62,7 +61,7 @@ public class BackgroundComponent implements RenderableEntity
private boolean fill = true;
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
Color outsideStrokeColor = new Color(
Math.max(0, backgroundColor.getRed() - OUTSIDE_STROKE_RED_OFFSET),

View File

@@ -63,7 +63,7 @@ public class ImagePanelComponent implements RenderableEntity
private Point position = new Point();
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
final Dimension dimension = new Dimension();
final FontMetrics metrics = graphics.getFontMetrics();
@@ -101,7 +101,7 @@ public class ImagePanelComponent implements RenderableEntity
final BackgroundComponent backgroundComponent = new BackgroundComponent();
backgroundComponent.setBackgroundColor(backgroundColor);
backgroundComponent.setRectangle(new Rectangle(position.x, position.y, dimension.width, dimension.height));
backgroundComponent.render(graphics, parent);
backgroundComponent.render(graphics);
// Render title
if (!Strings.isNullOrEmpty(title))
@@ -110,12 +110,12 @@ public class ImagePanelComponent implements RenderableEntity
titleComponent.setText(title);
titleComponent.setColor(titleColor);
titleComponent.setPosition(new Point(position.x + (width - metrics.stringWidth(title)) / 2, y));
titleComponent.render(graphics, parent);
titleComponent.render(graphics);
y += SEPARATOR;
}
// Render all images
int imageOffsetX = ((width - imageWidth) / 2) - (SEPARATOR / 2);
int imageOffsetX = ((width - imageWidth) / 2);
for (final BufferedImage image : images)
{
graphics.drawImage(image, imageOffsetX + ((imageWidth / images.size()) - image.getWidth()) / 2, y, null);

View File

@@ -58,14 +58,14 @@ public class InfoBoxComponent implements RenderableEntity
private BufferedImage image;
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
final FontMetrics metrics = graphics.getFontMetrics();
final Rectangle bounds = new Rectangle(position.x, position.y, BOX_SIZE, BOX_SIZE);
final BackgroundComponent backgroundComponent = new BackgroundComponent();
backgroundComponent.setBackgroundColor(backgroundColor);
backgroundComponent.setRectangle(bounds);
backgroundComponent.render(graphics, parent);
backgroundComponent.render(graphics);
if (Objects.nonNull(image))
{
@@ -80,7 +80,7 @@ public class InfoBoxComponent implements RenderableEntity
textComponent.setPosition(new Point(
position.x + ((BOX_SIZE - metrics.stringWidth(text)) / 2),
BOX_SIZE - SEPARATOR));
textComponent.render(graphics, parent);
textComponent.render(graphics);
return new Dimension(BOX_SIZE, BOX_SIZE);
}
}

View File

@@ -1,264 +0,0 @@
/*
* Copyright (c) 2018 Abex
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.ui.overlay.components;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.RadialGradientPaint;
import java.awt.Shape;
import java.awt.geom.Point2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;
import lombok.Getter;
import lombok.Setter;
import net.runelite.client.ui.FontManager;
import net.runelite.client.ui.overlay.RenderableEntity;
public class MinimapOrb implements RenderableEntity
{
private static final int ORB_X = 26;
private static final int ORB_Y = 2;
private static final int ORB_W = 29;
private static final Color BACKGROUND_COLOR = new Color(20, 20, 20);
private static final Color HIGHLIGHT_COLOR = new Color(255, 255, 255, 50);
// Frame
private static final BufferedImage FRAME;
static
{
try
{
synchronized (ImageIO.class)
{
FRAME = ImageIO.read(MinimapOrb.class.getResourceAsStream("minimap_orb_background.png"));
}
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
// black background
private static final BufferedImage BACKGROUND = createOval(BACKGROUND_COLOR);
// Highlight for recharge
private static final BufferedImage HIGHLIGHT = createOval(HIGHLIGHT_COLOR);
private static BufferedImage createOval(Color color)
{
BufferedImage img = new BufferedImage(ORB_W, ORB_W, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(color);
g.fillOval(0, 0, ORB_W, ORB_W);
// fillOval seems to be slightly different than the circle in the orb
// so we just draw part of the frame ontop so it doesn't overdraw when we don't draw the
// frame in the normal render (for hitpoints, etc.)
g.drawImage(FRAME, -ORB_X, -ORB_Y, null);
return img;
}
// Color and reflection highlight
private final BufferedImage fill;
// Shadow for when enabled
private final BufferedImage fillEnabled;
/**
* icon to draw ontop
*/
@Getter
@Setter
private BufferedImage overlay;
/**
* how far filled the orb should be
*/
@Getter
@Setter
private double percentFilled;
/**
* how far through the recharge this stat is
*/
@Getter
@Setter
private double rechargePercentFilled;
/**
* number to display on the orb
*/
@Getter
@Setter
private int amount;
/**
* should it look like it pressed down
*/
@Getter
@Setter
private boolean enabled;
/**
* Creates a minimap orb like the prayer/HP/run orbs including a background and frame
*/
public MinimapOrb(Color color, Color enabledColor, BufferedImage overlay)
{
this.fill = createFill(color, false);
this.fillEnabled = createFill(enabledColor, true);
this.overlay = overlay;
}
/**
* Creates a minimap orb like the prayer/HP/run orbs without the background, frame, etc.
* The only part that is rendered is the icon and the recharge
*/
public MinimapOrb(BufferedImage overlay)
{
this.fill = null;
this.fillEnabled = null;
this.overlay = overlay;
}
private static BufferedImage createFill(Color color, boolean enabled)
{
BufferedImage bufferedImage = new BufferedImage(ORB_W, ORB_W, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = bufferedImage.createGraphics();
float[] dist = {0.2f, 1f};
int r = color.getRed();
int g = color.getGreen();
int b = color.getBlue();
int a = color.getAlpha();
float darkenMultiplier = 0.4f;
Point2D center = new Point2D.Float(ORB_W / 2.7f, ORB_W / 2.7f);
if (enabled)
{
// Darken and move center to make it look like the orb is pressed down
darkenMultiplier = 0.20f;
center = new Point2D.Float((ORB_W / 1.8f), (ORB_W / 1.8f));
dist = new float[]{0.7f, 1f};
}
// Darken the base color to create a shadow effect on the edges of the orb
r *= darkenMultiplier;
g *= darkenMultiplier;
b *= darkenMultiplier;
Color[] colors = {color, new Color(r, g, b, a)};
// Divided by 2.7f for a gradient in the top left of the orb
graphics.setPaint(new RadialGradientPaint(center, ORB_W / 2.0f, dist, colors));
graphics.fillOval(0, 0, ORB_W, ORB_W);
return bufferedImage;
}
/**
* Draws a minimap orb like the prayer/HP/run orbs.
*
* @param graphics graphics to draw to
* @param pos top left position of the orb
*/
@Override
public Dimension render(Graphics2D graphics, Point pos)
{
int orbX = pos.x + ORB_X;
int orbY = pos.y + ORB_Y;
percentFilled = Math.max(Math.min(percentFilled, 1), 0);
rechargePercentFilled = Math.max(Math.min(rechargePercentFilled, 1), 0);
if (fill != null)
{
graphics.drawImage(BACKGROUND, orbX, orbY, null);
}
Shape clip = graphics.getClip();
if (fill != null)
{
int height = (int) (percentFilled * ORB_W);
graphics.setClip(orbX, orbY + (ORB_W - height), ORB_W, height);
graphics.drawImage(enabled ? fillEnabled : fill, orbX, orbY, null);
}
{
int height = (int) (rechargePercentFilled * ORB_W);
graphics.setClip(orbX, orbY + (ORB_W - height), ORB_W, height);
graphics.drawImage(HIGHLIGHT, orbX, orbY, null);
}
graphics.setClip(clip);
if (fill != null)
{
graphics.drawImage(FRAME, pos.x, pos.y, null);
}
graphics.drawImage(
overlay,
orbX + (1 + ORB_W - overlay.getWidth()) / 2,
orbY + (1 + ORB_W - overlay.getHeight()) / 2,
null
);
if (fill != null)
{
Font font = FontManager.getRunescapeSmallFont();
graphics.setFont(font);
FontMetrics fm = graphics.getFontMetrics();
String numberString = Integer.toString(amount);
int textX = pos.x + (ORB_X - fm.stringWidth(numberString)) / 2;
int textY = pos.y + 27;
graphics.setColor(Color.black);
graphics.drawString(numberString, textX + 1, textY + 1);
Color textColor = Color.getHSBColor((float) percentFilled * (120.f / 360.f), 1, 1);
graphics.setColor(textColor);
graphics.drawString(numberString, textX, textY);
}
return new Dimension(BACKGROUND.getWidth(), BACKGROUND.getHeight());
}
}

View File

@@ -82,7 +82,7 @@ public class PanelComponent implements RenderableEntity
private int width = 129;
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
final Dimension dimension = new Dimension();
final int elementNumber = (Strings.isNullOrEmpty(title) ? 0 : 1) + lines.size() + (Objects.isNull(progressBar) ? 0 : 1);
@@ -106,7 +106,7 @@ public class PanelComponent implements RenderableEntity
final BackgroundComponent backgroundComponent = new BackgroundComponent();
backgroundComponent.setBackgroundColor(backgroundColor);
backgroundComponent.setRectangle(new Rectangle(position.x, position.y, dimension.width, dimension.height));
backgroundComponent.render(graphics, parent);
backgroundComponent.render(graphics);
// Render title
if (!Strings.isNullOrEmpty(title))
@@ -115,7 +115,7 @@ public class PanelComponent implements RenderableEntity
titleComponent.setText(title);
titleComponent.setColor(titleColor);
titleComponent.setPosition(new Point(position.x + (width - metrics.stringWidth(title)) / 2, y));
titleComponent.render(graphics, parent);
titleComponent.render(graphics);
y += metrics.getHeight() + SEPARATOR;
}
@@ -126,13 +126,13 @@ public class PanelComponent implements RenderableEntity
leftLineComponent.setPosition(new Point(position.x + LEFT_BORDER, y));
leftLineComponent.setText(line.getLeft());
leftLineComponent.setColor(line.getLeftColor());
leftLineComponent.render(graphics, parent);
leftLineComponent.render(graphics);
final TextComponent rightLineComponent = new TextComponent();
rightLineComponent.setPosition(new Point(position.x + width - RIGHT_BORDER - metrics.stringWidth(TextComponent.textWithoutColTags(line.getRight())), y));
rightLineComponent.setText(line.getRight());
rightLineComponent.setColor(line.getRightColor());
rightLineComponent.render(graphics, parent);
rightLineComponent.render(graphics);
y += metrics.getHeight() + SEPARATOR;
}
@@ -141,7 +141,7 @@ public class PanelComponent implements RenderableEntity
{
progressBar.setWidth(width - LEFT_BORDER - RIGHT_BORDER);
progressBar.setPosition(new Point(position.x + LEFT_BORDER, y - (metrics.getHeight() / 2)));
progressBar.render(graphics, parent);
progressBar.render(graphics);
}
return dimension;

View File

@@ -62,7 +62,7 @@ public class ProgressBarComponent
@Setter
private int height = 16;
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
FontMetrics metrics = graphics.getFontMetrics();
@@ -95,7 +95,7 @@ public class ProgressBarComponent
textComponent.setPosition(new Point(progressTextX, progressTextY));
textComponent.setColor(fontColor);
textComponent.setText(textToWrite);
textComponent.render(graphics, parent);
textComponent.render(graphics);
return new Dimension(width, height);
}

View File

@@ -54,7 +54,7 @@ public class TextComponent implements RenderableEntity
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
final FontMetrics fontMetrics = graphics.getFontMetrics();

View File

@@ -55,7 +55,7 @@ public class TooltipComponent implements RenderableEntity
private IndexedSprite[] modIcons;
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
graphics.setFont(FontManager.getRunescapeSmallFont());
@@ -101,7 +101,7 @@ public class TooltipComponent implements RenderableEntity
final BackgroundComponent backgroundComponent = new BackgroundComponent();
backgroundComponent.setBackgroundColor(backgroundColor);
backgroundComponent.setRectangle(tooltipBackground);
backgroundComponent.render(graphics, parent);
backgroundComponent.render(graphics);
graphics.setColor(Color.WHITE);
// Render tooltip - text - line by line
@@ -125,7 +125,7 @@ public class TooltipComponent implements RenderableEntity
String text = line.substring(begin, j);
textComponent.setText(text);
textComponent.setPosition(new Point(lineX, textY + (i + 1) * textHeight - textDescent));
textComponent.render(graphics, parent);
textComponent.render(graphics);
lineX += metrics.stringWidth(text);
@@ -162,7 +162,7 @@ public class TooltipComponent implements RenderableEntity
String text = line.substring(begin, j + 1);
textComponent.setText(text);
textComponent.setPosition(new Point(lineX, textY + (i + 1) * textHeight - textDescent));
textComponent.render(graphics, parent);
textComponent.render(graphics);
lineX += metrics.stringWidth(text);
}
@@ -176,7 +176,7 @@ public class TooltipComponent implements RenderableEntity
textComponent.setColor(nextColor);
textComponent.setText(line.substring(begin, line.length()));
textComponent.setPosition(new Point(lineX, textY + (i + 1) * textHeight - textDescent));
textComponent.render(graphics, parent);
textComponent.render(graphics);
}
return new Dimension(tooltipWidth + OFFSET * 2, tooltipHeight + OFFSET * 2);

View File

@@ -60,7 +60,7 @@ public class InfoBoxOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
List<InfoBox> infoBoxes = infoboxManager.getInfoBoxes();
@@ -85,12 +85,12 @@ public class InfoBoxOverlay extends Overlay
infoBoxComponent.setImage(box.getImage());
infoBoxComponent.setText(box.getText());
infoBoxComponent.setPosition(new Point(x, 0));
final Dimension infoBoxBounds = infoBoxComponent.render(graphics, parent);
final Dimension infoBoxBounds = infoBoxComponent.render(graphics);
if (!Strings.isNullOrEmpty(box.getTooltip()))
{
final Rectangle intersectionRectangle = new Rectangle(infoBoxBounds);
intersectionRectangle.setLocation(parent);
intersectionRectangle.setLocation(getBounds().getLocation());
intersectionRectangle.translate(x, 0);
final Point transformed = OverlayUtil.transformPosition(getPosition(), intersectionRectangle.getSize());
intersectionRectangle.translate(transformed.x, transformed.y);

View File

@@ -55,7 +55,7 @@ public class TooltipOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
final List<Tooltip> tooltips = tooltipManager.getTooltips();
@@ -97,7 +97,7 @@ public class TooltipOverlay extends Overlay
// render tooltip
tooltipComponent.setPosition(position);
final Dimension thisSize = tooltipComponent.render(graphics, parent);
final Dimension thisSize = tooltipComponent.render(graphics);
// update tooltip bounding rect
if (lastLocation == null)

View File

@@ -26,7 +26,6 @@ package net.runelite.client.ui.overlay;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.assertEquals;
@@ -41,7 +40,7 @@ class TestOverlay extends Overlay
}
@Override
public Dimension render(Graphics2D graphics, Point parent)
public Dimension render(Graphics2D graphics)
{
throw new UnsupportedOperationException("Not supported yet.");
}

View File

@@ -59,7 +59,7 @@ public class TextComponentTest
TextComponent textComponent = new TextComponent();
textComponent.setText("test");
textComponent.setColor(Color.RED);
textComponent.render(graphics, new Point(0, 0));
textComponent.render(graphics);
verify(graphics, times(2)).drawString(eq("test"), anyInt(), anyInt());
verify(graphics, atLeastOnce()).setColor(Color.RED);
}
@@ -69,7 +69,7 @@ public class TextComponentTest
{
TextComponent textComponent = new TextComponent();
textComponent.setText("<col=0000ff>test");
textComponent.render(graphics, new Point(0, 0));
textComponent.render(graphics);
verify(graphics, times(2)).drawString(eq("test"), anyInt(), anyInt());
verify(graphics, atLeastOnce()).setColor(Color.BLUE);
}
@@ -79,7 +79,7 @@ public class TextComponentTest
{
TextComponent textComponent = new TextComponent();
textComponent.setText("<col=0000ff>test<col=00ff00> test");
textComponent.render(graphics, new Point(0, 0));
textComponent.render(graphics);
verify(graphics, atLeastOnce()).drawString(eq("test"), anyInt(), anyInt());
verify(graphics, atLeastOnce()).drawString(eq(" test"), anyInt(), anyInt());
verify(graphics, atLeastOnce()).setColor(Color.BLUE);