Java Code Examples for com.sun.java.swing.plaf.windows.XPStyle.Skin

The following examples show how to use com.sun.java.swing.plaf.windows.XPStyle.Skin. These examples are extracted from open source projects. 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
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 2
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 3
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 4
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 5
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 6
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 7
Source Project: jdk8u60   Source File: AnimationController.java    License: GNU General Public License v2.0 6 votes vote down vote up
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 8
Source Project: jdk8u60   Source File: AnimationController.java    License: GNU General Public License v2.0 6 votes vote down vote up
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 9
Source Project: JDKSourceCode1.8   Source File: AnimationController.java    License: MIT License 6 votes vote down vote up
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 10
Source Project: JDKSourceCode1.8   Source File: AnimationController.java    License: MIT License 6 votes vote down vote up
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 11
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 12
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 13
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 14
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 15
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 16
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 17
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 18
Source Project: hottub   Source File: AnimationController.java    License: GNU General Public License v2.0 6 votes vote down vote up
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 19
Source Project: hottub   Source File: AnimationController.java    License: GNU General Public License v2.0 6 votes vote down vote up
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 20
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 21
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 22
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 23
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 24
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 25
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 26
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 27
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 28
static void paintSkin(JComponent component, Skin skin,
                  Graphics g, int dx, int dy, int dw, int dh, State state) {
    if (VISTA_ANIMATION_DISABLED) {
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        return;
    }
    triggerAnimation(component, skin.part, state);
    AnimationController controller = getAnimationController();
    synchronized (controller) {
        AnimationState animationState = null;
        Map<Part, AnimationState> map =
            controller.animationStateMap.get(component);
        if (map != null) {
            animationState = map.get(skin.part);
        }
        if (animationState != null) {
            animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
        } else {
            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        }
    }
}
 
Example 29
void paintSkin(Skin skin, Graphics _g,
               int dx, int dy, int dw, int dh, State state) {
    assert SwingUtilities.isEventDispatchThread();

    updateProgress();
    if (! isDone()) {
        Graphics2D g = (Graphics2D) _g.create();
        skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
        float alpha;
        if (isForward) {
            alpha = progress;
        } else {
            alpha = 1 - progress;
        }
        g.setComposite(AlphaComposite.SrcOver.derive(alpha));
        skin.paintSkinRaw(g, dx, dy, dw, dh, state);
        g.dispose();
    } else {
        skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
    }
}
 
Example 30
Source Project: jdk1.8-source-analysis   Source File: WindowsPopupMenuUI.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns gutter width.
 * used only on Vista.
 * @return width of the gutter
 */
static int getGutterWidth() {
    int rv = 2;
    XPStyle xp = XPStyle.getXP();
    if (xp != null) {
        Skin skin = xp.getSkin(null, Part.MP_POPUPGUTTER);
        rv = skin.getWidth();
    }
    return rv;
}