/** * Returns the combo box text border insets under the specified font size. * * @param fontSize * Font size. * @return Combo box text border insets under the specified font size. */ public static Insets getComboTextBorderInsets(int fontSize) { // the following makes sure that the text components // and combos have the same height and text alignment // under all font sizes. Insets textInsets = getTextBorderInsets(fontSize); Insets comboInsets = getComboBorderInsets(fontSize); int topDelta = textInsets.top - comboInsets.top;// - 1; int bottomDelta = textInsets.bottom - comboInsets.bottom;// - 1; int lrInset = getAdjustedSize(fontSize, 3, 4, 1, false); return new Insets(topDelta, lrInset, bottomDelta, lrInset); }
/** * Returns the table cell renderer insets under the specified font size. * * @param fontSize * Font size. * @return Table cell renderer insets under the specified font size. */ public static Insets getTableCellRendererInsets(int fontSize) { Insets textInsets = getTextBorderInsets(fontSize); Insets comboInsets = getComboBorderInsets(fontSize); int topDelta = textInsets.top - comboInsets.top - 1; int bottomDelta = textInsets.bottom - comboInsets.bottom - 2; if (fontSize == 11) { bottomDelta++; } int lrInset = SubstanceSizeUtils.getAdjustedSize(fontSize, 2, 4, 1, false); return new Insets(topDelta, lrInset, bottomDelta, lrInset); }
/** * Returns the list cell renderer insets under the specified font size. * * @param fontSize * Font size. * @return List cell renderer insets under the specified font size. */ public static Insets getButtonInsets(int fontSize) { // Special handling to make buttons // have the same height as text components. // We subtract the border stroke width - since the new // text component border appearance has a lighter "halo" // around the darker inner border. Insets textInsets = getTextBorderInsets(fontSize); int borderStroke = (int) getBorderStrokeWidth(fontSize); int topDelta = textInsets.top - borderStroke; int bottomDelta = textInsets.bottom - borderStroke; int lrInset = SubstanceSizeUtils.getAdjustedSize(fontSize, 4, 4, 1, false); return new Insets(topDelta, lrInset, bottomDelta, lrInset); }
/** * Returns the combo box text border insets under the specified font size. * * @param fontSize * Font size. * @return Combo box text border insets under the specified font size. */ public static Insets getComboTextBorderInsets(int fontSize) { // the following makes sure that the text components // and combos have the same height and text alignment // under all font sizes. Insets textInsets = getTextBorderInsets(fontSize); Insets comboInsets = getComboBorderInsets(fontSize); int topDelta = textInsets.top - comboInsets.top;// - 1; int bottomDelta = textInsets.bottom - comboInsets.bottom;// - 1; int lrInset = getAdjustedSize(fontSize, 3, 4, 1, false); return new Insets(topDelta, lrInset, bottomDelta, lrInset); }
/** * Returns the list cell renderer insets under the specified font size. * * @param fontSize * Font size. * @return List cell renderer insets under the specified font size. */ public static Insets getButtonInsets(int fontSize) { // Special handling to make buttons // have the same height as text components. // We subtract the border stroke width - since the new // text component border appearance has a lighter "halo" // around the darker inner border. Insets textInsets = getTextBorderInsets(fontSize); int borderStroke = (int) getBorderStrokeWidth(fontSize); int topDelta = textInsets.top - borderStroke; int bottomDelta = textInsets.bottom - borderStroke; int lrInset = SubstanceSizeUtils.getAdjustedSize(fontSize, 4, 4, 1, false); return new Insets(topDelta, lrInset, bottomDelta, lrInset); }
/** * Returns the table cell renderer insets under the specified font size. * * @param fontSize * Font size. * @return Table cell renderer insets under the specified font size. */ public static Insets getTableCellRendererInsets(int fontSize) { Insets textInsets = getTextBorderInsets(fontSize); Insets comboInsets = getComboBorderInsets(fontSize); int topDelta = textInsets.top - comboInsets.top - 1; int bottomDelta = textInsets.bottom - comboInsets.bottom - 2; if (fontSize == 11) { bottomDelta++; } int lrInset = SubstanceSizeUtils.getAdjustedSize(fontSize, 2, 4, 1, false); return new Insets(topDelta, lrInset, bottomDelta, lrInset); }
/** * Returns the list cell renderer insets under the specified font size. * * @param fontSize * Font size. * @return List cell renderer insets under the specified font size. */ public static Insets getListCellRendererInsets(int fontSize) { // Special handling to make non-editable combo boxes // have the same height as text components. The combo box // uses list cell renderer, so to compute the top and // bottom insets of a list cell renderer, we subtract the // insets of combo box from the insets of text component. // We also subtract the border stroke width - since the new // text component border appearance has a lighter "halo" // around the darker inner border. Insets textInsets = getTextBorderInsets(fontSize); Insets comboInsets = getComboBorderInsets(fontSize); int borderStroke = (int) getBorderStrokeWidth(fontSize); int topDelta = textInsets.top - comboInsets.top - borderStroke; int bottomDelta = textInsets.bottom - comboInsets.bottom - borderStroke; int lrInset = SubstanceSizeUtils.getAdjustedSize(fontSize, 4, 4, 1, false); return new Insets(topDelta, lrInset, bottomDelta, lrInset); }
/** * Returns the list cell renderer insets under the specified font size. * * @param fontSize * Font size. * @return List cell renderer insets under the specified font size. */ public static Insets getListCellRendererInsets(int fontSize) { // Special handling to make non-editable combo boxes // have the same height as text components. The combo box // uses list cell renderer, so to compute the top and // bottom insets of a list cell renderer, we subtract the // insets of combo box from the insets of text component. // We also subtract the border stroke width - since the new // text component border appearance has a lighter "halo" // around the darker inner border. Insets textInsets = getTextBorderInsets(fontSize); Insets comboInsets = getComboBorderInsets(fontSize); int borderStroke = (int) getBorderStrokeWidth(fontSize); int topDelta = textInsets.top - comboInsets.top - borderStroke; int bottomDelta = textInsets.bottom - comboInsets.bottom - borderStroke; int lrInset = SubstanceSizeUtils.getAdjustedSize(fontSize, 4, 4, 1, false); return new Insets(topDelta, lrInset, bottomDelta, lrInset); }
@Override public Object createValue(UIDefaults table) { return new BorderUIResource.CompoundBorderUIResource( new SubstanceTextComponentBorder( SubstanceSizeUtils .getTextBorderInsets(SubstanceSizeUtils .getControlFontSize())), new BasicBorders.MarginBorder()); } };
@Override public Object createValue(UIDefaults table) { return new BorderUIResource.CompoundBorderUIResource( new SubstanceTextComponentBorder(SubstanceSizeUtils .getTextBorderInsets(SubstanceSizeUtils .getControlFontSize())), new BasicBorders.MarginBorder()); } };
Border newB = new BorderUIResource.CompoundBorderUIResource( new SubstanceTextComponentBorder(SubstanceSizeUtils .getTextBorderInsets(SubstanceSizeUtils .getComponentFontSize(this.passwordField))), new BasicBorders.MarginBorder());
Border newB = new BorderUIResource.CompoundBorderUIResource( new SubstanceTextComponentBorder(SubstanceSizeUtils .getTextBorderInsets(SubstanceSizeUtils .getComponentFontSize(this.textField))), new BasicBorders.MarginBorder());
Border newB = new BorderUIResource.CompoundBorderUIResource( new SubstanceTextComponentBorder(SubstanceSizeUtils .getTextBorderInsets(SubstanceSizeUtils .getComponentFontSize(this.textField))), new BasicBorders.MarginBorder());
Border newB = new BorderUIResource.CompoundBorderUIResource( new SubstanceTextComponentBorder(SubstanceSizeUtils .getTextBorderInsets(SubstanceSizeUtils .getComponentFontSize(this.textField))), new BasicBorders.MarginBorder());
Border newB = new BorderUIResource.CompoundBorderUIResource( new SubstanceTextComponentBorder(SubstanceSizeUtils .getTextBorderInsets(SubstanceSizeUtils .getComponentFontSize(this.textField))), new BasicBorders.MarginBorder());
Border newB = new BorderUIResource.CompoundBorderUIResource( new SubstanceTextComponentBorder(SubstanceSizeUtils .getTextBorderInsets(SubstanceSizeUtils .getComponentFontSize(this.passwordField))), new BasicBorders.MarginBorder());