Class PrivBotChatboxOverlayLayout
java.lang.Object
privbot.ui.overlay.PrivBotChatboxOverlayLayout
Shared metric layout helpers for PrivBot chatbox overlays.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne key/value row for the chatbox layouts; build withrow(...). -
Method Summary
Modifier and TypeMethodDescriptionstatic intdrawOneRow(Graphics2D g, PrivBotChatboxOverlayLayout.MetricRow row, int x, int y, int width) Draws a single metric row and returns the y position after the row.static intdrawSingleColumn(Graphics2D g, List<PrivBotChatboxOverlayLayout.MetricRow> rows, int x, int startY, int width, int maxRows) Draws up tomaxRowsrows in one column starting at baselinestartY.static intdrawTwoColumns(Graphics2D g, List<PrivBotChatboxOverlayLayout.MetricRow> leftRows, List<PrivBotChatboxOverlayLayout.MetricRow> rightRows, int x, int startY, int width, int columnGap) Draws two columns side by side, row by row; each row pair advances to the taller of the two.A one-line row with the primary text colour.A one-line row; null colour means the primary text colour.A row whose value may wrap overmaxLineslines (at least 1).
-
Method Details
-
row
A one-line row with the primary text colour. -
row
A one-line row; null colour means the primary text colour. -
row
public static PrivBotChatboxOverlayLayout.MetricRow row(String key, String value, Color color, int maxLines) A row whose value may wrap overmaxLineslines (at least 1). -
drawSingleColumn
public static int drawSingleColumn(Graphics2D g, List<PrivBotChatboxOverlayLayout.MetricRow> rows, int x, int startY, int width, int maxRows) Draws up tomaxRowsrows in one column starting at baselinestartY.- Returns:
- the baseline below the last row drawn
-
drawOneRow
public static int drawOneRow(Graphics2D g, PrivBotChatboxOverlayLayout.MetricRow row, int x, int y, int width) Draws a single metric row and returns the y position after the row. -
drawTwoColumns
public static int drawTwoColumns(Graphics2D g, List<PrivBotChatboxOverlayLayout.MetricRow> leftRows, List<PrivBotChatboxOverlayLayout.MetricRow> rightRows, int x, int startY, int width, int columnGap) Draws two columns side by side, row by row; each row pair advances to the taller of the two.- Parameters:
columnGap- pixels between the columns (at least 8)- Returns:
- the baseline below the last row drawn
-