@Override protected void installDefaults() { super.installDefaults(); Border b = this.datePicker.getBorder(); if (b == null || b instanceof UIResource) { int fontSize = SubstanceSizeUtils .getComponentFontSize(this.datePicker); Insets borderInsets = SubstanceSizeUtils .getComboBorderInsets(fontSize); this.datePicker.setBorder(new SubstanceTextComponentBorder( borderInsets)); this.layoutInsets = SubstanceSizeUtils .getComboLayoutInsets(fontSize); } this.datePicker.setOpaque(false); }
private void updateComboBoxBorder() { Border b = this.comboBox.getBorder(); if (b == null || b instanceof UIResource) { int comboFontSize = SubstanceSizeUtils .getComponentFontSize(this.comboBox); Insets comboBorderInsets = SubstanceSizeUtils .getComboBorderInsets(comboFontSize); if (this.comboBox.isEditable()) { this.comboBox.setBorder(new SubstanceTextComponentBorder( comboBorderInsets)); } else { this.comboBox .setBorder(new BorderUIResource.EmptyBorderUIResource( comboBorderInsets)); // BasicComboBoxUI does not invalidate display size when // combo becomes uneditable. However, this is not good // in Substance which has different preferred size for // editable and uneditable combos. Calling the method below // will trigger the path in BasicComboBoxUI.Handler that // will invalidate the cached sizes. this.comboBox.setPrototypeDisplayValue(this.comboBox .getPrototypeDisplayValue()); } this.layoutInsets = SubstanceSizeUtils .getComboLayoutInsets(comboFontSize); } else { this.layoutInsets = new Insets(0, 0, 0, 0); } }
private void updateComboBoxBorder() { Border b = this.comboBox.getBorder(); if (b == null || b instanceof UIResource) { int comboFontSize = SubstanceSizeUtils .getComponentFontSize(this.comboBox); Insets comboBorderInsets = SubstanceSizeUtils .getComboBorderInsets(comboFontSize); if (this.comboBox.isEditable()) { this.comboBox.setBorder(new SubstanceTextComponentBorder( comboBorderInsets)); } else { this.comboBox .setBorder(new BorderUIResource.EmptyBorderUIResource( comboBorderInsets)); // BasicComboBoxUI does not invalidate display size when // combo becomes uneditable. However, this is not good // in Substance which has different preferred size for // editable and uneditable combos. Calling the method below // will trigger the path in BasicComboBoxUI.Handler that // will invalidate the cached sizes. this.comboBox.setPrototypeDisplayValue(this.comboBox .getPrototypeDisplayValue()); } this.layoutInsets = SubstanceSizeUtils .getComboLayoutInsets(comboFontSize); } else { this.layoutInsets = new Insets(0, 0, 0, 0); } }