Package com.sun.java.swing.plaf.windows.XPStyle

Examples of com.sun.java.swing.plaf.windows.XPStyle.Skin


    }

    protected Dimension getPreferredInnerVertical() {
         XPStyle xp = XPStyle.getXP();
         if (xp != null) {
             Skin skin = xp.getSkin(progressBar, Part.PP_BARVERT);
             return new Dimension(
                     skin.getWidth(),
                     (int)super.getPreferredInnerVertical().getHeight());
         }
         return super.getPreferredInnerVertical();
    }
View Full Code Here


                                barRectWidth/2 + 1, barRectHeight + 1 - amountFull + 2);
                    paintString(g, 2, 2, barRectWidth, barRectHeight, amountFull, null);
                }

            } else {
                Skin skin = xp.getSkin(progressBar, vertical ? Part.PP_CHUNKVERT : Part.PP_CHUNK);
                int thickness;
                if (vertical) {
                    thickness = barRectWidth - 5;
                } else {
                    thickness = barRectHeight - 5;
                }

                int chunkSize = xp.getInt(progressBar, Part.PP_PROGRESS, null, Prop.PROGRESSCHUNKSIZE, 2);
                int spaceSize = xp.getInt(progressBar, Part.PP_PROGRESS, null, Prop.PROGRESSSPACESIZE, 0);
                int nChunks = (amountFull-4) / (chunkSize + spaceSize);

                // See if we can squeeze in an extra chunk without spacing after
                if (spaceSize > 0 && (nChunks * (chunkSize + spaceSize) + chunkSize) < (amountFull-4)) {
                    nChunks++;
                }

                for (int i = 0; i < nChunks; i++) {
                    if (vertical) {
                        skin.paintSkin(g,
                                       3, barRectHeight - i * (chunkSize + spaceSize) - chunkSize - 2,
                                       thickness, chunkSize, null);
                    } else {
                        if (isLeftToRight) {
                            skin.paintSkin(g,
                                           4 + i * (chunkSize + spaceSize), 2,
                                           chunkSize, thickness, null);
                        } else {
                            skin.paintSkin(g,
                                           barRectWidth - (2 + (i+1) * (chunkSize + spaceSize)), 2,
                                           chunkSize, thickness, null);
                        }
                    }
                }
View Full Code Here

    private void paintXPBackground(Graphics g, boolean vertical,
                                   int barRectWidth, int barRectHeight) {
        XPStyle xp = XPStyle.getXP();
        Part part = vertical ? Part.PP_BARVERT : Part.PP_BAR;
        Skin skin = xp.getSkin(progressBar, part);

        // Paint background
        skin.paintSkin(g, 0, 0, barRectWidth, barRectHeight, null);
    }
View Full Code Here

         */
        public void paintIcon(Component c, Graphics g, int x, int y) {
            XPStyle xp = XPStyle.getXP();
            assert xp != null;
            if (xp != null) {
                Skin skin = xp.getSkin(null, part);
                skin.paintSkin(g, x, y, state);
            }
        }
View Full Code Here

        public int getIconWidth() {
            int width = 0;
            XPStyle xp = XPStyle.getXP();
            assert xp != null;
            if (xp != null) {
                Skin skin = xp.getSkin(null, part);
                width = skin.getWidth();
            }
            return width;
        }
View Full Code Here

         */
        public int getIconHeight() {
            int height = 0;
            XPStyle xp = XPStyle.getXP();
            if (xp != null) {
                Skin skin = xp.getSkin(null, part);
                height = skin.getHeight();
            }
            return height;
        }
View Full Code Here

        private static class XPColorValueKey {
            Skin skin;
            Prop prop;

            XPColorValueKey(Part part, State state, Prop prop) {
                this.skin = new Skin(part, state);
                this.prop = prop;
            }
View Full Code Here

            verticalThumbSize = null;
        }
    }

    private static Dimension getSize(Component component, XPStyle xp, Part part) {
        Skin skin = xp.getSkin(component, part);
        return new Dimension(skin.getWidth(), skin.getHeight());
    }
View Full Code Here

            // Paint thumb
            Part thumbPart = v ? Part.SBP_THUMBBTNVERT : Part.SBP_THUMBBTNHORZ;
            xp.getSkin(sb, thumbPart).paintSkin(g, thumbBounds, state);
            // Paint gripper
            Part gripperPart = v ? Part.SBP_GRIPPERVERT : Part.SBP_GRIPPERHORZ;
            Skin skin = xp.getSkin(sb, gripperPart);
            Insets gripperInsets = xp.getMargin(c, thumbPart, null, Prop.CONTENTMARGINS);
            if (gripperInsets == null ||
                (v && (thumbBounds.height - gripperInsets.top -
                       gripperInsets.bottom >= skin.getHeight())) ||
                (!v && (thumbBounds.width - gripperInsets.left -
                        gripperInsets.right >= skin.getWidth()))) {
                skin.paintSkin(g,
                               thumbBounds.x + (thumbBounds.width  - skin.getWidth()) / 2,
                               thumbBounds.y + (thumbBounds.height - skin.getHeight()) / 2,
                               skin.getWidth(), skin.getHeight(), state);
            }
        } else {
            super.paintThumb(g, c, thumbBounds);
        }
    }
View Full Code Here

        public void paint(Graphics g) {
            XPStyle xp = XPStyle.getXP();
            if (xp != null) {
                ButtonModel model = getModel();
                Skin skin = xp.getSkin(this, Part.SBP_ARROWBTN);
                State state = null;

                boolean jointRollover = XPStyle.isVista() && (isThumbRollover() ||
                    (this == incrButton && decrButton.getModel().isRollover()) ||
                    (this == decrButton && incrButton.getModel().isRollover()));

                // normal, rollover, pressed, disabled
                if (model.isArmed() && model.isPressed()) {
                    switch (direction) {
                        case NORTH: state = State.UPPRESSED;    break;
                        case SOUTH: state = State.DOWNPRESSED;  break;
                        case WEST:  state = State.LEFTPRESSED;  break;
                        case EAST:  state = State.RIGHTPRESSED; break;
                    }
                } else if (!model.isEnabled()) {
                    switch (direction) {
                        case NORTH: state = State.UPDISABLED;    break;
                        case SOUTH: state = State.DOWNDISABLED;  break;
                        case WEST:  state = State.LEFTDISABLED;  break;
                        case EAST:  state = State.RIGHTDISABLED; break;
                    }
                } else if (model.isRollover() || model.isPressed()) {
                    switch (direction) {
                        case NORTH: state = State.UPHOT;    break;
                        case SOUTH: state = State.DOWNHOT;  break;
                        case WEST:  state = State.LEFTHOT;  break;
                        case EAST:  state = State.RIGHTHOT; break;
                    }
                } else if (jointRollover) {
                    switch (direction) {
                        case NORTH: state = State.UPHOVER;    break;
                        case SOUTH: state = State.DOWNHOVER;  break;
                        case WEST:  state = State.LEFTHOVER;  break;
                        case EAST:  state = State.RIGHTHOVER; break;
                    }
                } else {
                    switch (direction) {
                        case NORTH: state = State.UPNORMAL;    break;
                        case SOUTH: state = State.DOWNNORMAL;  break;
                        case WEST:  state = State.LEFTNORMAL;  break;
                        case EAST:  state = State.RIGHTNORMAL; break;
                    }
                }

                skin.paintSkin(g, 0, 0, getWidth(), getHeight(), state);
            } else {
                super.paint(g);
            }
        }
View Full Code Here

TOP

Related Classes of com.sun.java.swing.plaf.windows.XPStyle.Skin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.