@Override public void paintFocus(Component mainComp, Component focusedComp, TransitionAwareUI transitionAwareUI, Graphics2D graphics, Shape focusShape, Rectangle textRect, int extraPadding) { if (textRect == null) return; int fontSize = SubstanceSizeUtils .getComponentFontSize(mainComp); float dashLength = getDashLength(fontSize); float dashGap = getDashGap(fontSize); float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition()); graphics.setStroke(new BasicStroke(SubstanceSizeUtils .getFocusStrokeWidth(fontSize), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 0.0f, new float[] { dashLength, dashGap }, dashPhase)); graphics.translate(textRect.x - 1, textRect.y); graphics.drawLine(0, textRect.height - 1, textRect.width, textRect.height - 1); graphics.dispose(); }
@Override public void paintFocus(Component mainComp, Component focusedComp, TransitionAwareUI transitionAwareUI, Graphics2D graphics, Shape focusShape, Rectangle textRect, int extraPadding) { if (textRect == null) return; int fontSize = SubstanceSizeUtils .getComponentFontSize(mainComp); float dashLength = getDashLength(fontSize); float dashGap = getDashGap(fontSize); float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition()); graphics.setStroke(new BasicStroke(SubstanceSizeUtils .getFocusStrokeWidth(fontSize), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 0.0f, new float[] { dashLength, dashGap }, dashPhase)); graphics.translate(textRect.x - 1, textRect.y); graphics.drawLine(0, textRect.height - 1, textRect.width, textRect.height - 1); graphics.dispose(); }
@Override public void paintFocus(Component mainComp, Component focusedComp, TransitionAwareUI transitionAwareUI, Graphics2D graphics, Shape focusShape, Rectangle textRect, int extraPadding) { if (textRect == null) return; if ((textRect.width == 0) || (textRect.height == 0)) return; int fontSize = SubstanceSizeUtils .getComponentFontSize(mainComp); float dashLength = getDashLength(fontSize); float dashGap = getDashGap(fontSize); float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition()); graphics.setStroke(new BasicStroke(SubstanceSizeUtils .getFocusStrokeWidth(fontSize), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 0.0f, new float[] { dashLength, dashGap }, dashPhase)); int delta = ((mainComp instanceof JComboBox) || (mainComp instanceof JSpinner)) ? 0 : 1; GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline( textRect.width + 2 * delta, textRect.height, SubstanceSizeUtils .getClassicButtonCornerRadius(fontSize), null); graphics.translate(textRect.x - delta, textRect.y); graphics.draw(contour); }
@Override public void paintFocus(Component mainComp, Component focusedComp, TransitionAwareUI transitionAwareUI, Graphics2D graphics, Shape focusShape, Rectangle textRect, int extraPadding) { if (textRect == null) return; if ((textRect.width == 0) || (textRect.height == 0)) return; int fontSize = SubstanceSizeUtils .getComponentFontSize(mainComp); float dashLength = getDashLength(fontSize); float dashGap = getDashGap(fontSize); float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition()); graphics.setStroke(new BasicStroke(SubstanceSizeUtils .getFocusStrokeWidth(fontSize), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 0.0f, new float[] { dashLength, dashGap }, dashPhase)); int delta = ((mainComp instanceof JComboBox) || (mainComp instanceof JSpinner)) ? 0 : 1; GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline( textRect.width + 2 * delta, textRect.height, SubstanceSizeUtils .getClassicButtonCornerRadius(fontSize), null); graphics.translate(textRect.x - delta, textRect.y); graphics.draw(contour); }
* (1.0f - transitionAwareUI .getTransitionTracker() .getFocusLoopPosition()); float focusStrokeWidth = SubstanceSizeUtils .getFocusStrokeWidth(fontSize); float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition());
float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition()); graphics.setStroke(new BasicStroke(SubstanceSizeUtils .getFocusStrokeWidth(fontSize), float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition()); graphics.setStroke(new BasicStroke(SubstanceSizeUtils .getFocusStrokeWidth(fontSize),
* (1.0f - transitionAwareUI .getTransitionTracker() .getFocusLoopPosition()); float focusStrokeWidth = SubstanceSizeUtils .getFocusStrokeWidth(fontSize); float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition());
float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition()); graphics.setStroke(new BasicStroke(SubstanceSizeUtils .getFocusStrokeWidth(fontSize), float dashPhase = (dashLength + dashGap) * (1.0f - transitionAwareUI.getTransitionTracker() .getFocusLoopPosition()); graphics.setStroke(new BasicStroke(SubstanceSizeUtils .getFocusStrokeWidth(fontSize),