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

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


    }

    private void paintXPComboBoxBackground(Graphics g, JComponent c) {
        XPStyle xp = XPStyle.getXP();
        State state = getXPComboBoxState(c);
        Skin skin = null;
        if (! comboBox.isEditable()
              && xp.isSkinDefined(c, Part.CP_READONLY)) {
            skin = xp.getSkin(c, Part.CP_READONLY);
        }
        if (skin == null) {
            skin = xp.getSkin(c, Part.CP_COMBOBOX);
        }
        skin.paintSkin(g, 0, 0, c.getWidth(), c.getHeight(), state);
    }
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

      // 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

    }

    private void paintXPComboBoxBackground(Graphics g, JComponent c) {
        XPStyle xp = XPStyle.getXP();
        State state = getXPComboBoxState(c);
        Skin skin = null;
        if (! comboBox.isEditable()
              && xp.isSkinDefined(c, Part.CP_READONLY)) {
            skin = xp.getSkin(c, Part.CP_READONLY);
        }
        if (skin == null) {
            skin = xp.getSkin(c, Part.CP_COMBOBOX);
        }
        skin.paintSkin(g, 0, 0, c.getWidth(), c.getHeight(), state);
    }
View Full Code Here

  if (xp != null) {
      Part part = frame.isIcon() ? Part.WP_MINCAPTION
                                       : (frame.isMaximum() ? Part.WP_MAXCAPTION
                                                            : Part.WP_CAPTION);
      State state = frame.isSelected() ? State.ACTIVE : State.INACTIVE;
      Skin skin = xp.getSkin(this, part);
      skin.paintSkin(g, 00, getWidth(), getHeight(), state);
  } else {
      Boolean gradientsOn = (Boolean)LookAndFeel.getDesktopPropertyValue(
    "win.frame.captionGradientsOn", Boolean.valueOf(false));
      if (gradientsOn.booleanValue() && g instanceof Graphics2D) {
    Graphics2D g2 = (Graphics2D)g;
View Full Code Here

      size = new Dimension(6, 6);
      XPStyle xp = XPStyle.getXP();
      if (xp != null) {
    boolean vertical = ((JSeparator)c).getOrientation() == SwingConstants.VERTICAL;
    Part part = vertical ? Part.TP_SEPARATOR : Part.TP_SEPARATORVERT;
    Skin skin = xp.getSkin(c, part);
    size.width = skin.getWidth();
    size.height = skin.getHeight();
      }

      if (((JSeparator)c).getOrientation() == SwingConstants.VERTICAL) {
    size.height = 0;
      } else {
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.