private void applyText(Graphics2D graphics2D) { graphics2D.setFont(requestedFont); graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); int availableWidthForTextContainer = boundedTextContainerWidth(graphics2D); setupFontWidth(graphics2D, availableWidthForTextContainer); int availableHeightForTextContainer = boundedTextContainerHeight(graphics2D); setupFontHeight(graphics2D, availableWidthForTextContainer, availableHeightForTextContainer); int startingX = calculateTextContainerStartingPointX(availableWidthForTextContainer); int startingY = calculateTextContainerStartingPointY(baseRectangle, availableHeightForTextContainer, rectangleTextPosition); Rectangle textContainer = new Rectangle(startingX, startingY, availableWidthForTextContainer, availableHeightForTextContainer); drawOutliningRectangle(graphics2D, textContainer, cognitiveJColourPalette.getBackground()); applyTextOver(graphics2D, textContainer); }