/** * Returns the spinner arrow button insets under the specified font size. * * @param fontSize * Font size. * @return Spinner arrow button insets under the specified font size. */ public static Insets getSpinnerArrowButtonInsets(int fontSize) { int borderStrokeWidth = (int) Math .floor(getBorderStrokeWidth(fontSize)); return new Insets(borderStrokeWidth, borderStrokeWidth, borderStrokeWidth, borderStrokeWidth); }
/** * Returns the spinner arrow button insets under the specified font size. * * @param fontSize * Font size. * @return Spinner arrow button insets under the specified font size. */ public static Insets getSpinnerArrowButtonInsets(int fontSize) { int borderStrokeWidth = (int) Math .floor(getBorderStrokeWidth(fontSize)); return new Insets(borderStrokeWidth, borderStrokeWidth, borderStrokeWidth, borderStrokeWidth); }
/** * Returns the tabbed pane content insets under the specified size. The * {@link org.pushingpixels.substance.api.SubstanceConstants.TabContentPaneBorderKind#SINGLE_FULL} is * assumed. * * @param fontSize * Font size. * @return Tabbed pane content insets under the specified size. */ public static Insets getTabbedPaneContentInsets(int fontSize) { float borderStrokeWidth = getBorderStrokeWidth(fontSize); int tbIns = (int) (Math.ceil(2.5 * borderStrokeWidth)); int lrIns = (int) (Math.ceil(3.0 * borderStrokeWidth)); return new Insets(tbIns, lrIns, tbIns, lrIns); }
/** * Returns the tabbed pane content insets under the specified size. The * {@link SubstanceConstants.TabContentPaneBorderKind#SINGLE_FULL} is * assumed. * * @param fontSize * Font size. * @return Tabbed pane content insets under the specified size. */ public static Insets getTabbedPaneContentInsets(int fontSize) { float borderStrokeWidth = getBorderStrokeWidth(fontSize); int tbIns = (int) (Math.ceil(2.5 * borderStrokeWidth)); int lrIns = (int) (Math.ceil(3.0 * borderStrokeWidth)); return new Insets(tbIns, lrIns, tbIns, lrIns); }
public Insets getBorderInsets(Component c) { float borderStrokeWidth = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(c)); int prefSize = (int) (Math.ceil(2.0 * borderStrokeWidth)); return new Insets(prefSize, prefSize, prefSize, prefSize); } }
@Override public Insets getBorderInsets(Component c) { float borderStrokeWidth = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(c)); int ins = (int) borderStrokeWidth; return new Insets(ins, ins, ins, ins); }
@Override public Dimension getPreferredSize(JComponent c) { float borderStrokeWidth = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(c)); int prefSize = (int) (Math.ceil(2.0 * borderStrokeWidth)); return new Dimension(0, prefSize); } }
public Insets getBorderInsets(Component c) { float borderStrokeWidth = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(c)); int ins = (int) borderStrokeWidth; return new Insets(ins, ins, ins, ins); }
@Override public Dimension getPreferredSize(JComponent c) { float borderStrokeWidth = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(c)); int prefSize = (int) (Math.ceil(2.0 * borderStrokeWidth)); return new Dimension(0, prefSize); } }
@Override public Insets getBorderInsets(Component c) { float borderStrokeWidth = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(c)); int prefSize = (int) (Math.ceil(2.0 * borderStrokeWidth)); return new Insets(prefSize, prefSize, prefSize, prefSize); } }
@Override public Dimension getPreferredSize(JComponent c) { float borderStrokeWidth = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(c)); int prefSize = (int) (Math.ceil(2.0 * borderStrokeWidth)); if (((JSeparator) c).getOrientation() == SwingConstants.VERTICAL) return new Dimension(prefSize, 0); else return new Dimension(0, prefSize); } }
@Override public Dimension getPreferredSize(JComponent c) { float borderStrokeWidth = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(c)); int prefSize = (int) (Math.ceil(2.0 * borderStrokeWidth)); if (((JSeparator) c).getOrientation() == SwingConstants.VERTICAL) return new Dimension(prefSize, 0); else return new Dimension(0, prefSize); } }
private Rectangle getCellRectangleForRepaint(int row, int column) { Rectangle rect = this.table.getCellRect(row, column, true); if (!table.getShowHorizontalLines() && !table.getShowVerticalLines()) { float extra = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(table.getTableHeader())); rect.x -= (int) extra; rect.width += 2 * (int) extra; rect.y -= (int) extra; rect.height += 2 * (int) extra; } return rect; }
private Rectangle getCellRectangleForRepaint(int row, int column) { Rectangle rect = this.table.getCellRect(row, column, true); if (!table.getShowHorizontalLines() && !table.getShowVerticalLines()) { float extra = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(table.getTableHeader())); rect.x -= (int) extra; rect.width += 2 * (int) extra; rect.y -= (int) extra; rect.height += 2 * (int) extra; } return rect; }
@Override public void paint(Graphics g, JComponent c) { Graphics2D graphics = (Graphics2D) g.create(); int componentFontSize = SubstanceSizeUtils .getComponentFontSize(this.datePicker); int borderDelta = (int) Math.floor(SubstanceSizeUtils .getBorderStrokeWidth(componentFontSize)); Shape contour = SubstanceOutlineUtilities.getBaseOutline(datePicker .getWidth(), datePicker.getHeight(), Math.max(0, 2.0f * SubstanceSizeUtils .getClassicButtonCornerRadius(componentFontSize) - borderDelta), null, borderDelta); graphics.setColor(SubstanceTextUtilities .getTextBackgroundFillColor(this.datePicker)); graphics.fill(contour); super.paint(g, c); }
@Override protected void installDefaults() { super.installDefaults(); this.displayedValue = progressBar.getValue(); LookAndFeel.installProperty(progressBar, "opaque", Boolean.FALSE); this.speed = (20.0f * UIManager.getInt("ProgressBar.repaintInterval")) / UIManager.getInt("ProgressBar.cycleTime"); float borderThickness = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(this.progressBar)); this.margin = (int) Math.ceil(1.5 * borderThickness); }
@Override protected void installDefaults() { super.installDefaults(); this.displayedValue = progressBar.getValue(); LookAndFeel.installProperty(progressBar, "opaque", Boolean.FALSE); this.speed = (20.0f * UIManager.getInt("ProgressBar.repaintInterval")) / UIManager.getInt("ProgressBar.cycleTime"); float borderThickness = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(this.progressBar)); this.margin = (int) Math.ceil(1.5 * borderThickness); }
@Override public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g.create(); int componentFontSize = SubstanceSizeUtils.getComponentFontSize(this); int width = getWidth(); int height = getHeight(); int clipDelta = (int) SubstanceSizeUtils .getBorderStrokeWidth(componentFontSize); if (this.getComponentOrientation().isLeftToRight()) { g2d.clipRect(clipDelta, 0, width - clipDelta, height); } else { g2d.clipRect(0, 0, width - clipDelta, height); } super.paint(g2d); g2d.dispose(); } }
@Override public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g.create(); int componentFontSize = SubstanceSizeUtils.getComponentFontSize(this); int width = getWidth(); int height = getHeight(); int clipDelta = (int) SubstanceSizeUtils .getBorderStrokeWidth(componentFontSize); if (this.getComponentOrientation().isLeftToRight()) { g2d.clipRect(clipDelta, 0, width - clipDelta, height); } else { g2d.clipRect(0, 0, width - clipDelta, height); } super.paint(g2d); g2d.dispose(); } }
@Override public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g.create(); int componentFontSize = SubstanceSizeUtils.getComponentFontSize(this); int width = getWidth(); int height = getHeight(); int clipDelta = (int) SubstanceSizeUtils .getBorderStrokeWidth(componentFontSize); if (this.getComponentOrientation().isLeftToRight()) { g2d.clipRect(clipDelta, 0, width - clipDelta, height); } else { g2d.clipRect(0, 0, width - clipDelta, height); } super.paint(g2d); g2d.dispose(); } }