test_class.declarator: graphics
test_class.modifier: @Mock
  	private
test_class.original_string: @Mock
  	private Graphics2D graphics;
test_class.type: Graphics2D
test_class.var_name: graphics
test_class.file: runelite-client/src/test/java/net/runelite/client/ui/overlay/components/TextComponentTest.java
test_class.identifier: TextComponentTest
test_case.body: @Test
  	public void testRender()
  	{
  		TextComponent textComponent = new TextComponent();
  		textComponent.setText("test");
  		textComponent.setColor(Color.RED);
  		textComponent.render(graphics);
  		verify(graphics, times(2)).drawString(eq("test"), anyInt(), anyInt());
  		verify(graphics, atLeastOnce()).setColor(Color.RED);
  	}
test_case.class_method_signature: TextComponentTest.testRender()
test_case.full_signature: @Test public void testRender()
test_case.identifier: testRender
test_case.invocations: setText setColor render drawString verify times eq anyInt anyInt setColor verify atLeastOnce
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRender()
focal_class.declarator: COL_TAG_REGEX = "(<col=([0-9a-fA-F]){2,6}>)"
focal_class.modifier: private static final
focal_class.original_string: private static final String COL_TAG_REGEX = "(<col=([0-9a-fA-F]){2,6}>)";
focal_class.type: String
focal_class.var_name: COL_TAG_REGEX
focal_class.declarator: COL_TAG_PATTERN_W_LOOKAHEAD = Pattern.compile("(?=" + COL_TAG_REGEX + ")")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern COL_TAG_PATTERN_W_LOOKAHEAD = Pattern.compile("(?=" + COL_TAG_REGEX + ")");
focal_class.type: Pattern
focal_class.var_name: COL_TAG_PATTERN_W_LOOKAHEAD
focal_class.declarator: text
focal_class.modifier: private
focal_class.original_string: private String text;
focal_class.type: String
focal_class.var_name: text
focal_class.declarator: position = new Point()
focal_class.modifier: private
focal_class.original_string: private Point position = new Point();
focal_class.type: Point
focal_class.var_name: position
focal_class.declarator: color = Color.WHITE
focal_class.modifier: private
focal_class.original_string: private Color color = Color.WHITE;
focal_class.type: Color
focal_class.var_name: color
focal_class.declarator: outline
focal_class.modifier: private
focal_class.original_string: private boolean outline;
focal_class.type: boolean
focal_class.var_name: outline
focal_class.file: runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java
focal_class.identifier: TextComponent
focal_class.interfaces: implements RenderableEntity
focal_class.class_method_signature: TextComponent.render(Graphics2D graphics)
focal_class.full_signature: @Override public Dimension render(Graphics2D graphics)
focal_class.identifier: render
focal_class.modifiers: @Override public
focal_class.parameters: (Graphics2D graphics)
focal_class.return: Dimension
focal_class.signature: Dimension render(Graphics2D graphics)
focal_method.body: @Override
  	public Dimension render(Graphics2D graphics)
  	{
  		final FontMetrics fontMetrics = graphics.getFontMetrics();
  
  		if (COL_TAG_PATTERN_W_LOOKAHEAD.matcher(text).find())
  		{
  			final String[] parts = COL_TAG_PATTERN_W_LOOKAHEAD.split(text);
  			int x = position.x;
  
  			for (String textSplitOnCol : parts)
  			{
  				final String textWithoutCol = Text.removeTags(textSplitOnCol);
  				final String colColor = textSplitOnCol.substring(textSplitOnCol.indexOf("=") + 1, textSplitOnCol.indexOf(">"));
  
  				graphics.setColor(Color.BLACK);
  
  				if (outline)
  				{
  					graphics.drawString(textWithoutCol, x, position.y + 1);
  					graphics.drawString(textWithoutCol, x, position.y - 1);
  					graphics.drawString(textWithoutCol, x + 1, position.y);
  					graphics.drawString(textWithoutCol, x - 1, position.y);
  				}
  				else
  				{
  					// shadow
  					graphics.drawString(textWithoutCol, x + 1, position.y + 1);
  				}
  
  				// actual text
  				graphics.setColor(Color.decode("#" + colColor));
  				graphics.drawString(textWithoutCol, x, position.y);
  
  				x += fontMetrics.stringWidth(textWithoutCol);
  			}
  		}
  		else
  		{
  			graphics.setColor(Color.BLACK);
  
  			if (outline)
  			{
  				graphics.drawString(text, position.x, position.y + 1);
  				graphics.drawString(text, position.x, position.y - 1);
  				graphics.drawString(text, position.x + 1, position.y);
  				graphics.drawString(text, position.x - 1, position.y);
  			}
  			else
  			{
  				// shadow
  				graphics.drawString(text, position.x + 1, position.y + 1);
  			}
  
  			// actual text
  			graphics.setColor(color);
  			graphics.drawString(text, position.x, position.y);
  		}
  
  		return new Dimension(fontMetrics.stringWidth(text), fontMetrics.getHeight());
  	}
focal_method.class_method_signature: TextComponent.render(Graphics2D graphics)
focal_method.full_signature: @Override public Dimension render(Graphics2D graphics)
focal_method.identifier: render
focal_method.invocations: getFontMetrics find matcher split removeTags substring indexOf indexOf setColor drawString drawString drawString drawString drawString setColor decode drawString stringWidth setColor drawString drawString drawString drawString drawString setColor drawString stringWidth getHeight
focal_method.modifiers: @Override public
focal_method.parameters: (Graphics2D graphics)
focal_method.return: Dimension
focal_method.signature: Dimension render(Graphics2D graphics)