@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); }
public void layoutContainer(Container parent) { int popupButtonWidth = substancePopupButton != null ? substancePopupButton .getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds( ltr ? layoutInsets.left : layoutInsets.left + popupButtonWidth, layoutInsets.top, datePicker.getWidth() - popupButtonWidth - layoutInsets.left - layoutInsets.right, datePicker.getHeight() - layoutInsets.top - layoutInsets.bottom); if (substancePopupButton != null) { if (ltr) { substancePopupButton.setBounds(datePicker.getWidth() - popupButtonWidth, 0, popupButtonWidth, datePicker .getHeight()); } else { substancePopupButton.setBounds(0, 0, popupButtonWidth, datePicker.getHeight()); } } } }
public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }
@Override public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }
@Override public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }
@Override public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }
@Override public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }