Java Code Examples for sun.swing.SwingUtilities2#drawStringUnderlineCharAt()

The following examples show how to use sun.swing.SwingUtilities2#drawStringUnderlineCharAt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MetalToggleButtonUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) {
    AbstractButton b = (AbstractButton) c;
    ButtonModel model = b.getModel();
    FontMetrics fm = SwingUtilities2.getFontMetrics(b, g);
    int mnemIndex = b.getDisplayedMnemonicIndex();

    /* Draw the Text */
    if(model.isEnabled()) {
        /*** paint the text normally */
        g.setColor(b.getForeground());
    }
    else {
        /*** paint the text disabled ***/
        if (model.isSelected()) {
            g.setColor(c.getBackground());
        } else {
            g.setColor(getDisabledTextColor());
        }
    }
    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, mnemIndex,
            textRect.x, textRect.y + fm.getAscent());
}
 
Example 2
Source File: AquaLabelUI.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paint clippedText at textX, textY with background.lighter() and then
 * shifted down and to the right by one pixel with background.darker().
 *
 * @see #paint
 * @see #paintEnabledText
 */
protected void paintDisabledText(final JLabel l, final Graphics g, final String s, final int textX, final int textY) {
    int accChar = l.getDisplayedMnemonicIndex();
    if (AquaMnemonicHandler.isMnemonicHidden()) {
        accChar = -1;
    }

    final Color background = l.getBackground();

    // if our background is still something we set then we can use our happy background color.
    if (background instanceof UIResource) {
        g.setColor(getDisabledLabelColor(l));
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s, accChar, textX, textY);
    } else {
        super.paintDisabledText(l, g, s, textX, textY);
    }
}
 
Example 3
Source File: BasicButtonUI.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * As of Java 2 platform v 1.4 this method should not be used or overriden.
 * Use the paintText method which takes the AbstractButton argument.
 */
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) {
    AbstractButton b = (AbstractButton) c;
    ButtonModel model = b.getModel();
    FontMetrics fm = SwingUtilities2.getFontMetrics(c, g);
    int mnemonicIndex = b.getDisplayedMnemonicIndex();

    /* Draw the Text */
    if(model.isEnabled()) {
        /*** paint the text normally */
        g.setColor(b.getForeground());
        SwingUtilities2.drawStringUnderlineCharAt(c, g,text, mnemonicIndex,
                                      textRect.x + getTextShiftOffset(),
                                      textRect.y + fm.getAscent() + getTextShiftOffset());
    }
    else {
        /*** paint the text disabled ***/
        g.setColor(b.getBackground().brighter());
        SwingUtilities2.drawStringUnderlineCharAt(c, g,text, mnemonicIndex,
                                      textRect.x, textRect.y + fm.getAscent());
        g.setColor(b.getBackground().darker());
        SwingUtilities2.drawStringUnderlineCharAt(c, g,text, mnemonicIndex,
                                      textRect.x - 1, textRect.y + fm.getAscent() - 1);
    }
}
 
Example 4
Source File: AquaMenuPainter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** Draw a string with the graphics g at location (x,y) just like g.drawString() would.
 *  The first occurrence of underlineChar in text will be underlined. The matching is
 *  not case sensitive.
 */
public void drawString(final Graphics g, final JComponent c, final String text, final int underlinedChar, final int x, final int y, final boolean isEnabled, final boolean isSelected) {
    char lc, uc;
    int index = -1, lci, uci;

    if (underlinedChar != '\0') {
        uc = Character.toUpperCase((char)underlinedChar);
        lc = Character.toLowerCase((char)underlinedChar);

        uci = text.indexOf(uc);
        lci = text.indexOf(lc);

        if (uci == -1) index = lci;
        else if (lci == -1) index = uci;
        else index = (lci < uci) ? lci : uci;
    }

    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, index, x, y);
}
 
Example 5
Source File: AquaButtonUI.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * As of Java 2 platform v 1.4 this method should not be used or overriden.
 * Use the paintText method which takes the AbstractButton argument.
 */
protected void paintText(final Graphics g, final JComponent c, final Rectangle localTextRect, final String text) {
    final Graphics2D g2d = g instanceof Graphics2D ? (Graphics2D)g : null;

    final AbstractButton b = (AbstractButton)c;
    final ButtonModel model = b.getModel();
    final FontMetrics fm = g.getFontMetrics();
    final int mnemonicIndex = AquaMnemonicHandler.isMnemonicHidden() ? -1 : b.getDisplayedMnemonicIndex();

    /* Draw the Text */
    if (model.isEnabled()) {
        /*** paint the text normally */
        g.setColor(b.getForeground());
    } else {
        /*** paint the text disabled ***/
        g.setColor(defaultDisabledTextColor);
    }
    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, mnemonicIndex, localTextRect.x, localTextRect.y + fm.getAscent());
}
 
Example 6
Source File: MetalToggleButtonUI.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) {
    AbstractButton b = (AbstractButton) c;
    ButtonModel model = b.getModel();
    FontMetrics fm = SwingUtilities2.getFontMetrics(b, g);
    int mnemIndex = b.getDisplayedMnemonicIndex();

    /* Draw the Text */
    if(model.isEnabled()) {
        /*** paint the text normally */
        g.setColor(b.getForeground());
    }
    else {
        /*** paint the text disabled ***/
        if (model.isSelected()) {
            g.setColor(c.getBackground());
        } else {
            g.setColor(getDisabledTextColor());
        }
    }
    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, mnemIndex,
            textRect.x, textRect.y + fm.getAscent());
}
 
Example 7
Source File: MetalToggleButtonUI.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) {
    AbstractButton b = (AbstractButton) c;
    ButtonModel model = b.getModel();
    FontMetrics fm = SwingUtilities2.getFontMetrics(b, g);
    int mnemIndex = b.getDisplayedMnemonicIndex();

    /* Draw the Text */
    if(model.isEnabled()) {
        /*** paint the text normally */
        g.setColor(b.getForeground());
    }
    else {
        /*** paint the text disabled ***/
        if (model.isSelected()) {
            g.setColor(c.getBackground());
        } else {
            g.setColor(getDisabledTextColor());
        }
    }
    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, mnemIndex,
            textRect.x, textRect.y + fm.getAscent());
}
 
Example 8
Source File: MetalLabelUI.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Just paint the text gray (Label.disabledForeground) rather than
 * in the labels foreground color.
 *
 * @see #paint
 * @see #paintEnabledText
 */
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
{
    int mnemIndex = l.getDisplayedMnemonicIndex();
    g.setColor(UIManager.getColor("Label.disabledForeground"));
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemIndex,
                                               textX, textY);
}
 
Example 9
Source File: DarculaButtonUI.java    From Darcula with Apache License 2.0 5 votes vote down vote up
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) {
  final AbstractButton button = (AbstractButton)c;
  final ButtonModel model = button.getModel();
  Color fg = button.getForeground();
  if (fg instanceof UIResource && button instanceof JButton && ((JButton)button).isDefaultButton()) {
    final Color selectedFg = UIManager.getColor("Button.darcula.selectedButtonForeground");
    if (selectedFg != null) {
      fg = selectedFg;
    }
  }
  g.setColor(fg);

  FontMetrics metrics = SwingUtilities2.getFontMetrics(c, g);
  int mnemonicIndex = button.getDisplayedMnemonicIndex();
  if (model.isEnabled()) {

    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, mnemonicIndex,
                                              textRect.x + getTextShiftOffset(),
                                              textRect.y + metrics.getAscent() + getTextShiftOffset());
  }
  else {
    g.setColor(UIManager.getColor("Button.darcula.disabledText.shadow"));
    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, -1,
                                              textRect.x + getTextShiftOffset()+1,
                                              textRect.y + metrics.getAscent() + getTextShiftOffset()+1);
    g.setColor(UIManager.getColor("Button.disabledText"));
    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, -1,
                                              textRect.x + getTextShiftOffset(),
                                              textRect.y + metrics.getAscent() + getTextShiftOffset());


  }
}
 
Example 10
Source File: WindowsLabelUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected void paintEnabledText(JLabel l, Graphics g, String s,
                                int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }

    g.setColor(l.getForeground());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
                                                 textX, textY);
}
 
Example 11
Source File: WindowsLabelUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
Example 12
Source File: WindowsLabelUI.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
Example 13
Source File: MetalLabelUI.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Just paint the text gray (Label.disabledForeground) rather than
 * in the labels foreground color.
 *
 * @see #paint
 * @see #paintEnabledText
 */
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
{
    int mnemIndex = l.getDisplayedMnemonicIndex();
    g.setColor(UIManager.getColor("Label.disabledForeground"));
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemIndex,
                                               textX, textY);
}
 
Example 14
Source File: WindowsLabelUI.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected void paintEnabledText(JLabel l, Graphics g, String s,
                                int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }

    g.setColor(l.getForeground());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
                                                 textX, textY);
}
 
Example 15
Source File: BasicLabelUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Paint clippedText at textX, textY with background.lighter() and then
 * shifted down and to the right by one pixel with background.darker().
 *
 * @see #paint
 * @see #paintEnabledText
 */
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
{
    int accChar = l.getDisplayedMnemonicIndex();
    Color background = l.getBackground();
    g.setColor(background.brighter());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, accChar,
                                               textX + 1, textY + 1);
    g.setColor(background.darker());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, accChar,
                                               textX, textY);
}
 
Example 16
Source File: DarculaButtonUI.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) {
  AbstractButton button = (AbstractButton)c;
  ButtonModel model = button.getModel();
  Color fg = button.getForeground();
  if (fg instanceof UIResource && button instanceof JButton && ((JButton)button).isDefaultButton()) {
    final Color selectedFg = UIManager.getColor("Button.darcula.selectedButtonForeground");
    if (selectedFg != null) {
      fg = selectedFg;
    }
  }
  g.setColor(fg);

  FontMetrics metrics = SwingUtilities2.getFontMetrics(c, g);
  int mnemonicIndex = button.getDisplayedMnemonicIndex();
  if (model.isEnabled()) {

    SwingUtilities2
            .drawStringUnderlineCharAt(c, g, text, mnemonicIndex, textRect.x + getTextShiftOffset(), textRect.y + metrics.getAscent() + getTextShiftOffset());
  }
  else {
    g.setColor(UIManager.getColor("Button.darcula.disabledText.shadow"));
    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, -1, textRect.x + getTextShiftOffset() + JBUI.scale(1),
                                              textRect.y + metrics.getAscent() + getTextShiftOffset() + JBUI.scale(1));
    g.setColor(UIManager.getColor("Button.disabledText"));
    SwingUtilities2.drawStringUnderlineCharAt(c, g, text, -1, textRect.x + getTextShiftOffset(), textRect.y + metrics.getAscent() + getTextShiftOffset());


  }
}
 
Example 17
Source File: WindowsGraphicsUtils.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
static void paintXPText(AbstractButton b, Part part, State state,
        Graphics g, int x, int y, String text, int mnemIndex) {
    XPStyle xp = XPStyle.getXP();
    if (xp == null) {
        return;
    }
    Color textColor = b.getForeground();

    if (textColor instanceof UIResource) {
        textColor = xp.getColor(b, part, state, Prop.TEXTCOLOR, b.getForeground());
        // to work around an apparent bug in Windows, use the pushbutton
        // color for disabled toolbar buttons if the disabled color is the
        // same as the enabled color
        if (part == Part.TP_BUTTON && state == State.DISABLED) {
            Color enabledColor = xp.getColor(b, part, State.NORMAL,
                                 Prop.TEXTCOLOR, b.getForeground());
            if(textColor.equals(enabledColor)) {
                textColor = xp.getColor(b, Part.BP_PUSHBUTTON, state,
                            Prop.TEXTCOLOR, textColor);
            }
        }
        // only draw shadow if developer hasn't changed the foreground color
        // and if the current style has text shadows.
        TypeEnum shadowType = xp.getTypeEnum(b, part,
                                             state, Prop.TEXTSHADOWTYPE);
        if (shadowType == TypeEnum.TST_SINGLE ||
                    shadowType == TypeEnum.TST_CONTINUOUS) {
            Color shadowColor = xp.getColor(b, part, state,
                                            Prop.TEXTSHADOWCOLOR, Color.black);
            Point offset = xp.getPoint(b, part, state, Prop.TEXTSHADOWOFFSET);
            if (offset != null) {
                g.setColor(shadowColor);
                SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex,
                                                          x + offset.x,
                                                          y + offset.y);
            }
        }
    }

    g.setColor(textColor);
    SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
}
 
Example 18
Source File: BasicTabbedPaneUI.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected void paintText(Graphics g, int tabPlacement,
                         Font font, FontMetrics metrics, int tabIndex,
                         String title, Rectangle textRect,
                         boolean isSelected) {

    g.setFont(font);

    View v = getTextViewForTab(tabIndex);
    if (v != null) {
        // html
        v.paint(g, textRect);
    } else {
        // plain text
        int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);

        if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) {
            Color fg = tabPane.getForegroundAt(tabIndex);
            if (isSelected && (fg instanceof UIResource)) {
                Color selectedFG = UIManager.getColor(
                              "TabbedPane.selectedForeground");
                if (selectedFG != null) {
                    fg = selectedFG;
                }
            }
            g.setColor(fg);
            SwingUtilities2.drawStringUnderlineCharAt(tabPane, g,
                         title, mnemIndex,
                         textRect.x, textRect.y + metrics.getAscent());

        } else { // tab disabled
            g.setColor(tabPane.getBackgroundAt(tabIndex).brighter());
            SwingUtilities2.drawStringUnderlineCharAt(tabPane, g,
                         title, mnemIndex,
                         textRect.x, textRect.y + metrics.getAscent());
            g.setColor(tabPane.getBackgroundAt(tabIndex).darker());
            SwingUtilities2.drawStringUnderlineCharAt(tabPane, g,
                         title, mnemIndex,
                         textRect.x - 1, textRect.y + metrics.getAscent() - 1);

        }
    }
}
 
Example 19
Source File: StringPainter.java    From darklaf with MIT License 4 votes vote down vote up
public static <T extends JComponent> void drawStringImpl(final Graphics g, final T c,
                                                         final View view,
                                                         final String text, final Rectangle textRect,
                                                         final Font font, final FontMetrics fm,
                                                         final int mnemIndex,
                                                         final Color background) {
    if (text == null || text.equals("")) return;

    GraphicsContext context = GraphicsUtil.setupAntialiasing(g);

    final int asc = fm.getAscent();
    final int x = textRect.x;
    final int y = textRect.y;

    Graphics2D drawingGraphics = (Graphics2D) g;
    BufferedImage img = null; // Only needed for translucent AA painting.
    Point textPos = null; // Only needed for experimental algorithm.

    Color fgColor = g.getColor();
    Color bgColor = background;

    /*
     * If there is a non-opaque parent on Windows no sub-pixel AA is supported.
     * In this case we paint the text to an offscreen image with opaque background and paste
     * it draw it back to the original graphics object.
     *
     * See https://bugs.openjdk.java.net/browse/JDK-8215980?attachmentOrder=desc
     */
    Component window = getNonOpaqueWindow(c);
    boolean paintOpaqueBuffered = window != null;

    if (paintOpaqueBuffered) {
        LOGGER.finest(() -> "Using opaque buffering for " + c);
        double scaleX = Scale.getScaleX((Graphics2D) g);
        double scaleY = Scale.getScaleX((Graphics2D) g);

        if (experimentalAntialiasingEnabled) {
            textPos = new Point(x, y);
            textPos.setLocation(SwingUtilities.convertPoint(c, textPos, window));
            textPos.setLocation((int) Math.round(scaleX * textPos.x),
                                (int) Math.round(scaleX * textPos.y));

            /*
             * Ensure the background color has sufficient contrast to the foreground.
             */
            Color fg = g.getColor();
            double brightness = ColorUtil.getPerceivedBrightness(fg);
            bgColor = brightness > 127 ? Color.BLACK : Color.WHITE;
        }

        img = ImageUtil.createCompatibleImage((int) Math.round(scaleX * textRect.width),
                                              (int) Math.round(scaleY * textRect.height));
        drawingGraphics = prepareImage(img, bgColor, fgColor, scaleX, scaleY);
        textRect.setLocation(0, 0);
    } else {
        drawingGraphics.clipRect(textRect.x, textRect.y, textRect.width, textRect.height);
    }
    drawingGraphics.setFont(font);

    View v = view != null ? view : PropertyUtil.getObject(c, BasicHTML.propertyKey, View.class);
    if (v != null) {
        v.paint(drawingGraphics, textRect);
    } else {
        textRect.y += asc;
        if (mnemIndex >= 0) {
            SwingUtilities2.drawStringUnderlineCharAt(c, drawingGraphics, text,
                                                      mnemIndex, textRect.x, textRect.y);
        } else {
            SwingUtilities2.drawString(c, drawingGraphics, text, textRect.x, textRect.y);
        }
    }

    if (paintOpaqueBuffered) {
        drawingGraphics.dispose();
        Image result = postProcessImage((Graphics2D) g, img, textPos, bgColor, fgColor);
        g.drawImage(result, x, y, textRect.width, textRect.height, null);
    }
    context.restore();
}
 
Example 20
Source File: SynthGraphicsUtils.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Paints text at the specified location. This will not attempt to
 * render the text as html nor will it offset by the insets of the
 * component.
 *
 * @param ss SynthContext
 * @param g Graphics used to render string in.
 * @param text Text to render
 * @param x X location to draw text at.
 * @param y Upper left corner to draw text at.
 * @param mnemonicIndex Index to draw string at.
 */
public void paintText(SynthContext ss, Graphics g, String text,
                      int x, int y, int mnemonicIndex) {
    if (text != null) {
        JComponent c = ss.getComponent();
        FontMetrics fm = SwingUtilities2.getFontMetrics(c, g);
        y += fm.getAscent();
        SwingUtilities2.drawStringUnderlineCharAt(c, g, text,
                                                  mnemonicIndex, x, y);
    }
}