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

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


                return 4;
            }
        }
        public int getIconHeight() {
            if (WindowsMenuItemUI.isVistaPainting()) {
                Skin skin = XPStyle.getXP().getSkin(null, Part.MP_POPUPSUBMENU);
                return skin.getHeight();
            } else {
                return 8;
            }
        }
View Full Code Here


                Icon icon = getIcon();
                int height = 0;
                if (icon != null) {
                    height = icon.getIconHeight() + 2 * OFFSET;
                } else {
                    Skin skin =
                        XPStyle.getXP().getSkin(null, Part.MP_POPUPCHECK);
                    height = skin.getHeight() + 2 * OFFSET;
                }
                return height;
            }
View Full Code Here

                            state =
                                (type == JRadioButtonMenuItem.class)
                                  ? State.BULLETDISABLED
                                  : State.CHECKMARKDISABLED;
                        }
                        Skin skin;
                        XPStyle xp = XPStyle.getXP();
                        skin =  xp.getSkin(c, backgroundPart);
                        skin.paintSkin(g, x, y,
                            getIconWidth(), getIconHeight(), backgroundState);
                        if (icon == null) {
                            skin = xp.getSkin(c, part);
                            skin.paintSkin(g, x + OFFSET, y + OFFSET, state);
                        }
                    }
                }
                if (icon != null) {
                    icon.paintIcon(c, g, x + OFFSET, y + OFFSET);
View Full Code Here

        return state;
    }

    private void paintXPBackground(Graphics g, JComponent c) {
        XPStyle xp = XPStyle.getXP();
        Skin skin = xp.getSkin(c, Part.EP_EDIT);
        State state = getXPState(c);
        skin.paintSkin(g, 0, 0, c.getWidth(), c.getHeight(), state);
    }
View Full Code Here

        Part part = getXPButtonType(b);

  if (b.isContentAreaFilled() && xp != null) {

      Skin skin = xp.getSkin(b, part);

            State state = getXPButtonState(b);
      Dimension d = c.getSize();
      int dx = 0;
      int dy = 0;
      int dw = d.width;
      int dh = d.height;

      Border border = c.getBorder();
      Insets insets;
      if (border != null) {
    // Note: The border may be compound, containing an outer
    // opaque border (supplied by the application), plus an
    // inner transparent margin border. We want to size the
    // background to fill the transparent part, but stay
    // inside the opaque part.
    insets = WindowsButtonUI.getOpaqueInsets(border, c);
      } else {
    insets = c.getInsets();
      }
      if (insets != null) {
    dx += insets.left;
    dy += insets.top;
    dw -= (insets.left + insets.right);
    dh -= (insets.top + insets.bottom);
      }
      skin.paintSkin(g, dx, dy, dw, dh, state);
  }
    }
View Full Code Here

            int width = getIconWidth();
            int height = getIconHeight();

            XPStyle xp = XPStyle.getXP();
            if (xp != null) {
                Skin skin = xp.getSkin(c, part);
                AbstractButton b = (AbstractButton)c;
                ButtonModel model = b.getModel();

                // Find out if frame is inactive
                JInternalFrame jif = (JInternalFrame)SwingUtilities.
                                        getAncestorOfClass(JInternalFrame.class, b);
                boolean jifSelected = (jif != null && jif.isSelected());

                State state;
                if (jifSelected) {
                    if (!model.isEnabled()) {
                        state = State.DISABLED;
                    } else if (model.isArmed() && model.isPressed()) {
                        state = State.PUSHED;
                    } else if (model.isRollover()) {
                        state = State.HOT;
                    } else {
                        state = State.NORMAL;
                    }
                } else {
                    if (!model.isEnabled()) {
                        state = State.INACTIVEDISABLED;
                    } else if (model.isArmed() && model.isPressed()) {
                        state = State.INACTIVEPUSHED;
                    } else if (model.isRollover()) {
                        state = State.INACTIVEHOT;
                    } else {
                        state = State.INACTIVENORMAL;
                    }
                }
                skin.paintSkin(g, 0, 0, width, height, state);
            } else {
                g.setColor(Color.black);
                int x = width / 12 + 2;
                int y = height / 5;
                int h = height - y * 2 - 1;
View Full Code Here

            ButtonModel model = b.getModel();
            XPStyle xp = XPStyle.getXP();

            if (xp != null) {
                Part part = Part.BP_RADIOBUTTON;
                Skin skin = xp.getSkin(b, part);
                State state;
                int index = 0;
                if (model.isSelected()) {
                    state = State.CHECKEDNORMAL;
                    if (!model.isEnabled()) {
                        state = State.CHECKEDDISABLED;
                    } else if (model.isPressed() && model.isArmed()) {
                        state = State.CHECKEDPRESSED;
                    } else if (model.isRollover()) {
                        state = State.CHECKEDHOT;
                    }
                } else {
                    state = State.UNCHECKEDNORMAL;
                    if (!model.isEnabled()) {
                        state = State.UNCHECKEDDISABLED;
                    } else if (model.isPressed() && model.isArmed()) {
                        state = State.UNCHECKEDPRESSED;
                    } else if (model.isRollover()) {
                        state = State.UNCHECKEDHOT;
                    }
                }
                skin.paintSkin(g, x, y, state);
            } else {
                // fill interior
                if((model.isPressed() && model.isArmed()) || !model.isEnabled()) {
                    g.setColor(UIManager.getColor("RadioButton.background"));
                } else {
View Full Code Here

                State state = State.NORMAL;
                if (c instanceof JMenuItem) {
                    state = ((JMenuItem) c).getModel().isEnabled()
                    ? State.NORMAL : State.DISABLED;
                }
                Skin skin = xp.getSkin(c, Part.MP_POPUPSUBMENU);
                if (WindowsGraphicsUtils.isLeftToRight(c)) {
                    skin.paintSkin(g, x, y, state);
                } else {
                    Graphics2D g2d = (Graphics2D)g.create();
                    g2d.translate(x + skin.getWidth(), y);
                    g2d.scale(-1, 1);
                    skin.paintSkin(g2d, 0, 0, state);
                    g2d.dispose();
                }
            } else {
                g.translate(x,y);
                if( WindowsGraphicsUtils.isLeftToRight(c) ) {
View Full Code Here

                g.translate(-x,-y);
            }
        }
        public int getIconWidth() {
            if (WindowsMenuItemUI.isVistaPainting()) {
                Skin skin = XPStyle.getXP().getSkin(null, Part.MP_POPUPSUBMENU);
                return skin.getWidth();
            } else {
                return 4;
            }
        }
View Full Code Here

                return 4;
            }
        }
        public int getIconHeight() {
            if (WindowsMenuItemUI.isVistaPainting()) {
                Skin skin = XPStyle.getXP().getSkin(null, Part.MP_POPUPSUBMENU);
                return skin.getHeight();
            } else {
                return 8;
            }
        }
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.