public HDMColdAccountForm(final WalletListPanel walletListPanel) { this.walletListPanel = walletListPanel; inactiveBackGroundColor = Color.WHITE; selected = false; panelMain.setOpaque(true); panelMain.setFocusable(true); panelMain.setBackground(inactiveBackGroundColor); if (ColorAndFontConstants.isInverse()) { inactiveBackGroundColor = new Color( Math.min(255, Themes.currentTheme.detailPanelBackground().getRed() + 2 * COLOR_DELTA), Math.min( 255, Themes.currentTheme.detailPanelBackground().getBlue() + 2 * COLOR_DELTA), Math.min( 255, Themes.currentTheme.detailPanelBackground().getGreen() + 2 * COLOR_DELTA)); } else { inactiveBackGroundColor = new Color( Math.max(0, Themes.currentTheme.detailPanelBackground().getRed() - COLOR_DELTA), Math.max(0, Themes.currentTheme.detailPanelBackground().getBlue() - COLOR_DELTA), Math.max(0, Themes.currentTheme.detailPanelBackground().getGreen() - COLOR_DELTA)); } panelMain.applyComponentOrientation( ComponentOrientation.getOrientation(LocaliserUtils.getLocale())); updateFromModel(); panelMain.addMouseListener( new WalletMouseListener(this.walletListPanel, HDMColdAccountForm.this)); setSelected(false); setContent(); }
/** Update any UI elements from the model (hint that data has changed). */ public void updateFromModel() { if (ColorAndFontConstants.isInverse()) { inactiveBackGroundColor = new Color( Math.min(255, Themes.currentTheme.detailPanelBackground().getRed() + 2 * COLOR_DELTA), Math.min( 255, Themes.currentTheme.detailPanelBackground().getBlue() + 2 * COLOR_DELTA), Math.min( 255, Themes.currentTheme.detailPanelBackground().getGreen() + 2 * COLOR_DELTA)); } else { inactiveBackGroundColor = new Color( Math.max(0, Themes.currentTheme.detailPanelBackground().getRed() - COLOR_DELTA), Math.max(0, Themes.currentTheme.detailPanelBackground().getBlue() - COLOR_DELTA), Math.max(0, Themes.currentTheme.detailPanelBackground().getGreen() - COLOR_DELTA)); } panelMain.invalidate(); panelMain.revalidate(); panelMain.repaint(); }