sun.swing.plaf.synth.SynthIcon Java Examples

The following examples show how to use sun.swing.plaf.synth.SynthIcon. 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: SynthToolBarUI.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #2
Source File: SynthToolBarUI.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #3
Source File: SynthToolBarUI.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #4
Source File: SynthToolBarUI.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #5
Source File: SynthToolBarUI.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #6
Source File: SynthToolBarUI.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #7
Source File: SynthToolBarUI.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #8
Source File: SynthToolBarUI.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #9
Source File: SynthToolBarUI.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #10
Source File: SynthToolBarUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #11
Source File: SynthToolBarUI.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
Example #12
Source File: SynthTreeUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public int getIconHeight(SynthContext context) {
    int height;
    if (context == null) {
        context = getContext(tree);
        height = SynthIcon.getIconHeight(expandedIcon, context);
        context.dispose();
    }
    else {
        height = SynthIcon.getIconHeight(expandedIcon, context);
    }
    return height;
}
 
Example #13
Source File: SynthTreeUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void drawCentered(Component c, Graphics graphics, Icon icon,
                            int x, int y) {
    int w = SynthIcon.getIconWidth(icon, paintContext);
    int h = SynthIcon.getIconHeight(icon, paintContext);

    SynthIcon.paintIcon(icon, paintContext, graphics,
                        findCenteredX(x, w),
                        y - h/2, w, h);
}
 
Example #14
Source File: SynthTreeUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void drawCentered(Component c, Graphics graphics, Icon icon,
                            int x, int y) {
    int w = SynthIcon.getIconWidth(icon, paintContext);
    int h = SynthIcon.getIconHeight(icon, paintContext);

    SynthIcon.paintIcon(icon, paintContext, graphics,
                        findCenteredX(x, w),
                        y - h/2, w, h);
}
 
Example #15
Source File: SynthTreeUI.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public int getIconHeight(SynthContext context) {
    int height;
    if (context == null) {
        context = getContext(tree);
        height = SynthIcon.getIconHeight(expandedIcon, context);
        context.dispose();
    }
    else {
        height = SynthIcon.getIconHeight(expandedIcon, context);
    }
    return height;
}
 
Example #16
Source File: SynthTreeUI.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public int getIconHeight(SynthContext context) {
    int height;
    if (context == null) {
        context = getContext(tree);
        height = SynthIcon.getIconHeight(expandedIcon, context);
        context.dispose();
    }
    else {
        height = SynthIcon.getIconHeight(expandedIcon, context);
    }
    return height;
}
 
Example #17
Source File: SynthTreeUI.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public int getIconWidth(SynthContext context) {
    int width;
    if (context == null) {
        context = getContext(tree);
        width = SynthIcon.getIconWidth(expandedIcon, context);
        context.dispose();
    }
    else {
        width = SynthIcon.getIconWidth(expandedIcon, context);
    }
    return width;
}
 
Example #18
Source File: SynthTreeUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x,
                      int y, int w, int h) {
    if (context == null) {
        context = getContext(tree);
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
        context.dispose();
    }
    else {
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
    }
}
 
Example #19
Source File: SynthTreeUI.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public int getIconHeight(SynthContext context) {
    int height;
    if (context == null) {
        context = getContext(tree);
        height = SynthIcon.getIconHeight(expandedIcon, context);
        context.dispose();
    }
    else {
        height = SynthIcon.getIconHeight(expandedIcon, context);
    }
    return height;
}
 
Example #20
Source File: SynthTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public int getIconHeight(SynthContext context) {
    int height;
    if (context == null) {
        context = getContext(tree);
        height = SynthIcon.getIconHeight(expandedIcon, context);
        context.dispose();
    }
    else {
        height = SynthIcon.getIconHeight(expandedIcon, context);
    }
    return height;
}
 
Example #21
Source File: SynthTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public int getIconWidth(SynthContext context) {
    int width;
    if (context == null) {
        context = getContext(tree);
        width = SynthIcon.getIconWidth(expandedIcon, context);
        context.dispose();
    }
    else {
        width = SynthIcon.getIconWidth(expandedIcon, context);
    }
    return width;
}
 
Example #22
Source File: SynthTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x,
                      int y, int w, int h) {
    if (context == null) {
        context = getContext(tree);
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
        context.dispose();
    }
    else {
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
    }
}
 
Example #23
Source File: SynthTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void drawCentered(Component c, Graphics graphics, Icon icon,
                            int x, int y) {
    int w = SynthIcon.getIconWidth(icon, paintContext);
    int h = SynthIcon.getIconHeight(icon, paintContext);

    SynthIcon.paintIcon(icon, paintContext, graphics,
                        findCenteredX(x, w),
                        y - h/2, w, h);
}
 
Example #24
Source File: NimbusLookAndFeel.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Icon getDisabledIcon(JComponent component, Icon icon) {
    if (icon instanceof SynthIcon) {
        SynthIcon si = (SynthIcon)icon;
        BufferedImage img = EffectUtils.createCompatibleTranslucentImage(
                si.getIconWidth(), si.getIconHeight());
        Graphics2D gfx = img.createGraphics();
        si.paintIcon(component, gfx, 0, 0);
        gfx.dispose();
        return new ImageIconUIResource(GrayFilter.createDisabledImage(img));
    } else {
        return super.getDisabledIcon(component, icon);
    }
}
 
Example #25
Source File: SynthTreeUI.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public int getIconWidth(SynthContext context) {
    int width;
    if (context == null) {
        context = getContext(tree);
        width = SynthIcon.getIconWidth(expandedIcon, context);
        context.dispose();
    }
    else {
        width = SynthIcon.getIconWidth(expandedIcon, context);
    }
    return width;
}
 
Example #26
Source File: NimbusLookAndFeel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Icon getDisabledIcon(JComponent component, Icon icon) {
    if (icon instanceof SynthIcon) {
        SynthIcon si = (SynthIcon)icon;
        BufferedImage img = EffectUtils.createCompatibleTranslucentImage(
                si.getIconWidth(), si.getIconHeight());
        Graphics2D gfx = img.createGraphics();
        si.paintIcon(component, gfx, 0, 0);
        gfx.dispose();
        return new ImageIconUIResource(GrayFilter.createDisabledImage(img));
    } else {
        return super.getDisabledIcon(component, icon);
    }
}
 
Example #27
Source File: NimbusLookAndFeel.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Icon getDisabledIcon(JComponent component, Icon icon) {
    if (icon instanceof SynthIcon) {
        SynthIcon si = (SynthIcon)icon;
        BufferedImage img = EffectUtils.createCompatibleTranslucentImage(
                si.getIconWidth(), si.getIconHeight());
        Graphics2D gfx = img.createGraphics();
        si.paintIcon(component, gfx, 0, 0);
        gfx.dispose();
        return new ImageIconUIResource(GrayFilter.createDisabledImage(img));
    } else {
        return super.getDisabledIcon(component, icon);
    }
}
 
Example #28
Source File: SynthTreeUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public int getIconHeight(SynthContext context) {
    int height;
    if (context == null) {
        context = getContext(tree);
        height = SynthIcon.getIconHeight(expandedIcon, context);
        context.dispose();
    }
    else {
        height = SynthIcon.getIconHeight(expandedIcon, context);
    }
    return height;
}
 
Example #29
Source File: SynthTreeUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public int getIconWidth(SynthContext context) {
    int width;
    if (context == null) {
        context = getContext(tree);
        width = SynthIcon.getIconWidth(expandedIcon, context);
        context.dispose();
    }
    else {
        width = SynthIcon.getIconWidth(expandedIcon, context);
    }
    return width;
}
 
Example #30
Source File: SynthTreeUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x,
                      int y, int w, int h) {
    if (context == null) {
        context = getContext(tree);
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
        context.dispose();
    }
    else {
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
    }
}