diff --git a/plugin-playground/src/main/kotlin/KondoKit/ViewConstants.kt b/plugin-playground/src/main/kotlin/KondoKit/ViewConstants.kt new file mode 100644 index 0000000..9643657 --- /dev/null +++ b/plugin-playground/src/main/kotlin/KondoKit/ViewConstants.kt @@ -0,0 +1,68 @@ +package KondoKit + +import java.awt.Color +import java.awt.Dimension +import java.awt.Font + +/** + * Shared constants for fonts, dimensions, and colors across the entire KondoKit plugin. + * This helps avoid repeated initialization of common elements and provides better consistency. + */ +object ViewConstants { + + // Common Fonts + val FONT_RUNESCAPE_SMALL_16 = Font("RuneScape Small", Font.TRUETYPE_FONT, 16) + val FONT_RUNESCAPE_SMALL_14 = Font("RuneScape Small", Font.PLAIN, 14) + val FONT_RUNESCAPE_SMALL_PLAIN_16 = Font("RuneScape Small", Font.PLAIN, 16) + val FONT_ARIAL_PLAIN_14 = Font("Arial", Font.PLAIN, 14) + val FONT_ARIAL_BOLD_12 = Font("Arial", Font.BOLD, 12) + + // Common Dimensions + val DIMENSION_SMALL_ICON = Dimension(12, 12) + val DIMENSION_LARGE_ICON = Dimension(30, 30) + val DEFAULT_WIDGET_SIZE = Dimension(220, 50) + val TOTAL_XP_WIDGET_SIZE = Dimension(220, 30) + val IMAGE_SIZE = Dimension(25, 23) + val SEARCH_FIELD_SIZE = Dimension(230, 30) + val DEFAULT_PANEL_SIZE = Dimension(230, 500) + val FILTER_PANEL_SIZE = Dimension(230, 30) + val SKILLS_PANEL_SIZE = Dimension(230, 290) + val TOTAL_COMBAT_PANEL_SIZE = Dimension(230, 30) + val SKILL_PANEL_SIZE = Dimension(76, 35) + val IMAGE_CANVAS_SIZE = Dimension(20, 20) + val SKILL_SPRITE_SIZE = Dimension(14, 14) + val NUMBER_LABEL_SIZE = Dimension(20, 20) + val PROGRESS_BAR_SIZE = Dimension(220, 16) + val TOGGLE_SWITCH_SIZE = Dimension(32, 20) + + // Common Colors + val COLOR_WHITE = Color.WHITE + val COLOR_BLACK = Color.BLACK + val COLOR_DARK_GRAY = Color.DARK_GRAY + val COLOR_RED = Color.RED + val COLOR_GRAY = Color.GRAY + + // UI Colors (already defined in plugin.kt companion object, but referenced here for consistency) + // These should match the ones in plugin.kt Companion object + val COLOR_WIDGET = Color(30, 30, 30) + val COLOR_TITLE_BAR = Color(21, 21, 21) + val COLOR_VIEW_BACKGROUND = Color(40, 40, 40) + val COLOR_PRIMARY = Color(165, 165, 165) + val COLOR_SECONDARY = Color(255, 255, 255) + val COLOR_POPUP_BACKGROUND = Color(45, 45, 45) + val COLOR_POPUP_FOREGROUND = Color(220, 220, 220) + val COLOR_TOOLTIP_BACKGROUND = Color(50, 50, 50) + val COLOR_SCROLL_BAR = Color(64, 64, 64) + val COLOR_PROGRESS_BAR_FILL = Color(61, 56, 49) + + // Skill display order + val SKILL_DISPLAY_ORDER = arrayOf(0, 3, 14, 2, 16, 13, 1, 15, 10, 4, 17, 7, 5, 12, 11, 6, 9, 8, 20, 18, 19, 22, 21, 23) + + // Sprite IDs + const val COMBAT_LVL_SPRITE = 168 + const val IRONMAN_SPRITE = 4 + const val MAG_SPRITE = 1423 + const val LVL_BAR_SPRITE = 898 + const val WRENCH_ICON = 907 + const val LOOT_ICON = 777 +} \ No newline at end of file diff --git a/plugin-playground/src/main/kotlin/KondoKit/components/ButtonPanel.kt b/plugin-playground/src/main/kotlin/KondoKit/components/ButtonPanel.kt index c364048..716ac67 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/components/ButtonPanel.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/components/ButtonPanel.kt @@ -1,5 +1,6 @@ package KondoKit.components +import KondoKit.ViewConstants import KondoKit.plugin.Companion.TITLE_BAR_COLOR import KondoKit.plugin.Companion.WIDGET_COLOR import KondoKit.plugin.Companion.secondaryColor @@ -21,7 +22,7 @@ class ButtonPanel( val button = JButton(text).apply { background = TITLE_BAR_COLOR foreground = secondaryColor - font = Font("RuneScape Small", Font.PLAIN, 14) + font = ViewConstants.FONT_RUNESCAPE_SMALL_14 addActionListener { action() } @@ -34,7 +35,7 @@ class ButtonPanel( val button = JButton(icon).apply { background = TITLE_BAR_COLOR foreground = secondaryColor - font = Font("RuneScape Small", Font.PLAIN, 14) + font = ViewConstants.FONT_RUNESCAPE_SMALL_14 addActionListener { action() } diff --git a/plugin-playground/src/main/kotlin/KondoKit/components/LabelComponent.kt b/plugin-playground/src/main/kotlin/KondoKit/components/LabelComponent.kt index cdee07d..c0a80cb 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/components/LabelComponent.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/components/LabelComponent.kt @@ -1,6 +1,7 @@ package KondoKit.components import KondoKit.Helpers.formatHtmlLabelText +import KondoKit.ViewConstants import KondoKit.plugin.Companion.primaryColor import KondoKit.plugin.Companion.secondaryColor import java.awt.Font @@ -17,7 +18,7 @@ class LabelComponent( init { this.text = text this.horizontalAlignment = alignment - this.font = Font("RuneScape Small", Font.TRUETYPE_FONT, 16) + this.font = ViewConstants.FONT_RUNESCAPE_SMALL_16 } fun updateText(plainText: String, color: Color = secondaryColor) { @@ -30,6 +31,6 @@ class LabelComponent( } fun setAsHeader() { - font = Font("RuneScape Small", Font.BOLD, 16) + font = ViewConstants.FONT_RUNESCAPE_SMALL_16.deriveFont(Font.BOLD) } } \ No newline at end of file diff --git a/plugin-playground/src/main/kotlin/KondoKit/components/PopupMenuComponent.kt b/plugin-playground/src/main/kotlin/KondoKit/components/PopupMenuComponent.kt index 45cd30c..56d543f 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/components/PopupMenuComponent.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/components/PopupMenuComponent.kt @@ -1,8 +1,8 @@ package KondoKit.components +import KondoKit.ViewConstants import KondoKit.plugin.Companion.POPUP_BACKGROUND import KondoKit.plugin.Companion.POPUP_FOREGROUND -import java.awt.Font import javax.swing.JMenuItem import javax.swing.JPopupMenu @@ -14,7 +14,7 @@ class PopupMenuComponent : JPopupMenu() { fun addMenuItem(text: String, action: () -> Unit): JMenuItem { val menuItem = JMenuItem(text).apply { - font = Font("RuneScape Small", Font.TRUETYPE_FONT, 16) + font = ViewConstants.FONT_RUNESCAPE_SMALL_16 background = POPUP_BACKGROUND foreground = POPUP_FOREGROUND addActionListener { diff --git a/plugin-playground/src/main/kotlin/KondoKit/components/ProgressBar.kt b/plugin-playground/src/main/kotlin/KondoKit/components/ProgressBar.kt index b9bb67b..0d0ab63 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/components/ProgressBar.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/components/ProgressBar.kt @@ -1,11 +1,11 @@ package KondoKit.components +import KondoKit.ViewConstants import KondoKit.plugin.Companion.PROGRESS_BAR_FILL import KondoKit.plugin.Companion.secondaryColor import java.awt.Canvas import java.awt.Color import java.awt.Dimension -import java.awt.Font import java.awt.Graphics class ProgressBar( @@ -16,7 +16,7 @@ class ProgressBar( ) : Canvas() { init { - font = Font("RuneScape Small", Font.TRUETYPE_FONT, 16) + font = ViewConstants.FONT_RUNESCAPE_SMALL_16 } override fun paint(g: Graphics) { @@ -49,11 +49,11 @@ class ProgressBar( } override fun getPreferredSize(): Dimension { - return Dimension(220, 16) // Force the height to 16px, width can be anything appropriate + return ViewConstants.PROGRESS_BAR_SIZE // Force the height to 16px, width can be anything appropriate } override fun getMinimumSize(): Dimension { - return Dimension(220, 16) // Force the minimum height to 16px, width can be smaller + return ViewConstants.PROGRESS_BAR_SIZE // Force the minimum height to 16px, width can be smaller } fun updateProgress(newProgress: Double, currentLevel: Int, nextLevel: Int, isVisible : Boolean) { diff --git a/plugin-playground/src/main/kotlin/KondoKit/components/SearchField.kt b/plugin-playground/src/main/kotlin/KondoKit/components/SearchField.kt index 992a890..85aeff1 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/components/SearchField.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/components/SearchField.kt @@ -1,6 +1,7 @@ package KondoKit.components import KondoKit.ImageCanvas +import KondoKit.ViewConstants import KondoKit.SpriteToBufferedImage import KondoKit.plugin.Companion.WIDGET_COLOR import KondoKit.plugin.Companion.secondaryColor @@ -26,7 +27,7 @@ class SearchField( private val bufferedImageSprite = SpriteToBufferedImage.getBufferedImageFromSprite(API.GetSprite(1423)) // MAG_SPRITE private val imageCanvas = bufferedImageSprite.let { ImageCanvas(it).apply { - preferredSize = Dimension(12, 12) + preferredSize = ViewConstants.DIMENSION_SMALL_ICON size = preferredSize minimumSize = preferredSize maximumSize = preferredSize diff --git a/plugin-playground/src/main/kotlin/KondoKit/components/ToggleSwitch.kt b/plugin-playground/src/main/kotlin/KondoKit/components/ToggleSwitch.kt index 7de6e67..901f45d 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/components/ToggleSwitch.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/components/ToggleSwitch.kt @@ -1,5 +1,6 @@ package KondoKit.components +import KondoKit.ViewConstants import KondoKit.plugin.Companion.PROGRESS_BAR_FILL import KondoKit.plugin.Companion.WIDGET_COLOR import KondoKit.plugin.Companion.primaryColor @@ -31,9 +32,9 @@ class ToggleSwitch : JPanel() { } }) cursor = Cursor(Cursor.HAND_CURSOR) - preferredSize = Dimension(32, 20) - maximumSize = Dimension(32, 20) - minimumSize = Dimension(32, 20) + preferredSize = ViewConstants.TOGGLE_SWITCH_SIZE + maximumSize = ViewConstants.TOGGLE_SWITCH_SIZE + minimumSize = ViewConstants.TOGGLE_SWITCH_SIZE isOpaque = false // Make the panel background transparent } diff --git a/plugin-playground/src/main/kotlin/KondoKit/plugin.kt b/plugin-playground/src/main/kotlin/KondoKit/plugin.kt index 02765ef..f0c3fad 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/plugin.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/plugin.kt @@ -288,7 +288,7 @@ class plugin : Plugin() { return false } } - val otherIcons = arrayOf(LVL_ICON, MAG_SPRITE, LOOT_ICON, WRENCH_ICON, Constants.COMBAT_LVL_SPRITE, LootTrackerView.BAG_ICON) + val otherIcons = arrayOf(LVL_ICON, MAG_SPRITE, LOOT_ICON, WRENCH_ICON, ViewConstants.COMBAT_LVL_SPRITE, LootTrackerView.BAG_ICON) for (icon in otherIcons) { if(!js5Archive8.isFileReady(icon)){ return false diff --git a/plugin-playground/src/main/kotlin/KondoKit/views/HiscoresView.kt b/plugin-playground/src/main/kotlin/KondoKit/views/HiscoresView.kt index 624a01d..0bea313 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/views/HiscoresView.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/views/HiscoresView.kt @@ -3,6 +3,7 @@ package KondoKit.views import KondoKit.Helpers.getSpriteId import KondoKit.Helpers.showToast import KondoKit.ImageCanvas +import KondoKit.ViewConstants import KondoKit.SpriteToBufferedImage.getBufferedImageFromSprite import KondoKit.components.SearchField import KondoKit.components.LabelComponent @@ -25,45 +26,13 @@ import javax.swing.* import javax.swing.border.MatteBorder import kotlin.math.floor -object Constants { - // Sprite IDs - const val COMBAT_LVL_SPRITE = 168 - const val IRONMAN_SPRITE = 4 - const val MAG_SPRITE = 1423 - const val LVL_BAR_SPRITE = 898 - - // Dimensions - val SEARCH_FIELD_DIMENSION = Dimension(230, 30) - val ICON_DIMENSION_SMALL = Dimension(12, 12) - val ICON_DIMENSION_LARGE = Dimension(30, 30) - val HISCORE_PANEL_DIMENSION = Dimension(230, 500) - val FILTER_PANEL_DIMENSION = Dimension(230, 30) - val SKILLS_PANEL_DIMENSION = Dimension(230, 290) - val TOTAL_COMBAT_PANEL_DIMENSION = Dimension(230, 30) - val SKILL_PANEL_DIMENSION = Dimension(76, 35) - val IMAGE_CANVAS_DIMENSION = Dimension(20, 20) - val SKILL_SPRITE_DIMENSION = Dimension(14, 14) - val NUMBER_LABEL_DIMENSION = Dimension(20, 20) - - // Colors - val COLOR_BACKGROUND_DARK = WIDGET_COLOR - val COLOR_BACKGROUND_MEDIUM = VIEW_BACKGROUND_COLOR - val COLOR_FOREGROUND_LIGHT = POPUP_FOREGROUND - - // Fonts - val FONT_ARIAL_PLAIN_14 = Font("Arial", Font.PLAIN, 14) - val FONT_ARIAL_PLAIN_12 = Font("RuneScape Small", Font.TRUETYPE_FONT, 16) - val FONT_ARIAL_BOLD_12 = Font("Arial", Font.BOLD, 12) - val SKILL_DISPLAY_ORDER = arrayOf(0,3,14,2,16,13,1,15,10,4,17,7,5,12,11,6,9,8,20,18,19,22,21,23) -} - object HiscoresView : View { const val VIEW_NAME = "HISCORE_SEARCH_VIEW" var hiScoreView: JPanel? = null var customSearchField: SearchField? = null override val name: String = VIEW_NAME - override val iconSpriteId: Int = Constants.MAG_SPRITE + override val iconSpriteId: Int = ViewConstants.MAG_SPRITE override val panel: JPanel get() = hiScoreView ?: JPanel() @@ -78,8 +47,8 @@ object HiscoresView : View { fun createHiscoreSearchView() { val hiscorePanel = BaseView(VIEW_NAME, addDefaultSpacing = false).apply { - background = Constants.COLOR_BACKGROUND_MEDIUM - setViewSize(Constants.HISCORE_PANEL_DIMENSION.height) + background = VIEW_BACKGROUND_COLOR + setViewSize(ViewConstants.DEFAULT_PANEL_SIZE.height) } customSearchField = SearchField( @@ -97,8 +66,8 @@ object HiscoresView : View { val searchFieldWrapper = JPanel().apply { layout = BoxLayout(this, BoxLayout.X_AXIS) - background = Constants.COLOR_BACKGROUND_MEDIUM - preferredSize = Constants.SEARCH_FIELD_DIMENSION + background = VIEW_BACKGROUND_COLOR + preferredSize = ViewConstants.SEARCH_FIELD_SIZE maximumSize = preferredSize minimumSize = preferredSize alignmentX = Component.CENTER_ALIGNMENT @@ -107,7 +76,7 @@ object HiscoresView : View { val searchPanel = JPanel().apply { layout = BoxLayout(this, BoxLayout.Y_AXIS) - background = Constants.COLOR_BACKGROUND_MEDIUM + background = VIEW_BACKGROUND_COLOR add(searchFieldWrapper) } @@ -118,7 +87,7 @@ object HiscoresView : View { val playerNamePanel = JPanel().apply { layout = GridBagLayout() // This will center the JLabel both vertically and horizontally background = TOOLTIP_BACKGROUND.darker() - preferredSize = Constants.FILTER_PANEL_DIMENSION + preferredSize = ViewConstants.FILTER_PANEL_SIZE maximumSize = preferredSize minimumSize = preferredSize name = "playerNameLabel" @@ -128,42 +97,42 @@ object HiscoresView : View { hiscorePanel.add(Box.createVerticalStrut(5)) val skillsPanel = JPanel(FlowLayout(FlowLayout.CENTER, 0, 0)).apply { - background = Constants.COLOR_BACKGROUND_MEDIUM - preferredSize = Constants.SKILLS_PANEL_DIMENSION + background = VIEW_BACKGROUND_COLOR + preferredSize = ViewConstants.SKILLS_PANEL_SIZE maximumSize = preferredSize minimumSize = preferredSize } - for (i in Constants.SKILL_DISPLAY_ORDER) { + for (i in ViewConstants.SKILL_DISPLAY_ORDER) { val skillPanel = JPanel().apply { layout = BorderLayout() - background = Constants.COLOR_BACKGROUND_DARK - preferredSize = Constants.SKILL_PANEL_DIMENSION + background = WIDGET_COLOR + preferredSize = ViewConstants.SKILL_PANEL_SIZE maximumSize = preferredSize minimumSize = preferredSize - border = MatteBorder(5, 0, 0, 0, Constants.COLOR_BACKGROUND_DARK) + border = MatteBorder(5, 0, 0, 0, WIDGET_COLOR) } val bufferedImageSprite = getBufferedImageFromSprite(API.GetSprite(getSpriteId(i))) val imageCanvas = bufferedImageSprite.let { ImageCanvas(it).apply { - preferredSize = Constants.SKILL_SPRITE_DIMENSION - size = Constants.SKILL_SPRITE_DIMENSION - fillColor = Constants.COLOR_BACKGROUND_DARK + preferredSize = ViewConstants.SKILL_SPRITE_SIZE + size = ViewConstants.SKILL_SPRITE_SIZE + fillColor = WIDGET_COLOR } } val numberLabel = JLabel("", JLabel.RIGHT).apply { name = "skillLabel_$i" - foreground = Constants.COLOR_FOREGROUND_LIGHT - font = Constants.FONT_ARIAL_PLAIN_12 - preferredSize = Constants.NUMBER_LABEL_DIMENSION - minimumSize = Constants.NUMBER_LABEL_DIMENSION + foreground = POPUP_FOREGROUND + font = ViewConstants.FONT_RUNESCAPE_SMALL_16 + preferredSize = ViewConstants.NUMBER_LABEL_SIZE + minimumSize = ViewConstants.NUMBER_LABEL_SIZE } val imageContainer = JPanel(FlowLayout(FlowLayout.CENTER, 5, 0)).apply { - background = Constants.COLOR_BACKGROUND_DARK + background = WIDGET_COLOR add(imageCanvas) add(numberLabel) } @@ -175,52 +144,52 @@ object HiscoresView : View { hiscorePanel.add(skillsPanel) val totalCombatPanel = JPanel(FlowLayout(FlowLayout.CENTER, 0, 0)).apply { - background = Constants.COLOR_BACKGROUND_DARK - preferredSize = Constants.TOTAL_COMBAT_PANEL_DIMENSION + background = WIDGET_COLOR + preferredSize = ViewConstants.TOTAL_COMBAT_PANEL_SIZE maximumSize = preferredSize minimumSize = preferredSize } - val bufferedImageSprite = getBufferedImageFromSprite(API.GetSprite(Constants.LVL_BAR_SPRITE)) + val bufferedImageSprite = getBufferedImageFromSprite(API.GetSprite(ViewConstants.LVL_BAR_SPRITE)) val totalLevelIcon = ImageCanvas(bufferedImageSprite).apply { - fillColor = Constants.COLOR_BACKGROUND_DARK - preferredSize = Constants.ICON_DIMENSION_LARGE - size = Constants.ICON_DIMENSION_LARGE + fillColor = WIDGET_COLOR + preferredSize = ViewConstants.DIMENSION_LARGE_ICON + size = ViewConstants.DIMENSION_LARGE_ICON } val totalLevelLabel = JLabel("").apply { name = "totalLevelLabel" - foreground = Constants.COLOR_FOREGROUND_LIGHT - font = Constants.FONT_ARIAL_BOLD_12 + foreground = POPUP_FOREGROUND + font = ViewConstants.FONT_ARIAL_BOLD_12 horizontalAlignment = JLabel.LEFT iconTextGap = 10 } val totalLevelPanel = JPanel(FlowLayout(FlowLayout.LEFT)).apply { - background = Constants.COLOR_BACKGROUND_DARK + background = WIDGET_COLOR add(totalLevelIcon) add(totalLevelLabel) } - val bufferedImageSprite2 = getBufferedImageFromSprite(API.GetSprite(Constants.COMBAT_LVL_SPRITE)) + val bufferedImageSprite2 = getBufferedImageFromSprite(API.GetSprite(ViewConstants.COMBAT_LVL_SPRITE)) val combatLevelIcon = ImageCanvas(bufferedImageSprite2).apply { - fillColor = Constants.COLOR_BACKGROUND_DARK - preferredSize = Constants.ICON_DIMENSION_LARGE - size = Constants.ICON_DIMENSION_LARGE + fillColor = WIDGET_COLOR + preferredSize = ViewConstants.DIMENSION_LARGE_ICON + size = ViewConstants.DIMENSION_LARGE_ICON } val combatLevelLabel = JLabel("").apply { name = "combatLevelLabel" - foreground = Constants.COLOR_FOREGROUND_LIGHT - font = Constants.FONT_ARIAL_BOLD_12 + foreground = POPUP_FOREGROUND + font = ViewConstants.FONT_ARIAL_BOLD_12 horizontalAlignment = JLabel.LEFT iconTextGap = 10 } val combatLevelPanel = JPanel(FlowLayout(FlowLayout.LEFT)).apply { - background = Constants.COLOR_BACKGROUND_DARK + background = WIDGET_COLOR add(combatLevelIcon) add(combatLevelLabel) } @@ -316,8 +285,8 @@ object HiscoresView : View { playerNameLabel?.removeAll() // Clear previous components var nameLabel = LabelComponent().apply { updateHtmlText(username, secondaryColor, "", primaryColor) - font = Constants.FONT_ARIAL_BOLD_12 - foreground = Constants.COLOR_FOREGROUND_LIGHT + font = ViewConstants.FONT_ARIAL_BOLD_12 + foreground = POPUP_FOREGROUND border = BorderFactory.createEmptyBorder(0, 6, 0, 0) // Top, Left, Bottom, Right padding horizontalAlignment = JLabel.CENTER } @@ -333,11 +302,11 @@ object HiscoresView : View { if (ironMode != "0") { val ironmanBufferedImage = - getBufferedImageFromSprite(Sprites.nameIcons[Constants.IRONMAN_SPRITE + ironMode.toInt() - 1]) + getBufferedImageFromSprite(Sprites.nameIcons[ViewConstants.IRONMAN_SPRITE + ironMode.toInt() - 1]) val imageCanvas = ironmanBufferedImage.let { ImageCanvas(it).apply { - preferredSize = Constants.IMAGE_CANVAS_DIMENSION - size = Constants.IMAGE_CANVAS_DIMENSION + preferredSize = ViewConstants.IMAGE_CANVAS_SIZE + size = ViewConstants.IMAGE_CANVAS_SIZE } } @@ -347,8 +316,8 @@ object HiscoresView : View { val exp_multiplier = data.info.exp_multiplier nameLabel = LabelComponent().apply { updateHtmlText(username, secondaryColor, " (${exp_multiplier}x)", primaryColor) - font = Constants.FONT_ARIAL_BOLD_12 - foreground = Constants.COLOR_FOREGROUND_LIGHT + font = ViewConstants.FONT_ARIAL_BOLD_12 + foreground = POPUP_FOREGROUND border = BorderFactory.createEmptyBorder(0, 6, 0, 0) // Top, Left, Bottom, Right padding horizontalAlignment = JLabel.CENTER }