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

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


    }

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


    }
   
    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 paintTrack(Graphics g)  {       
  XPStyle xp = XPStyle.getXP();
  if (xp != null) {
      boolean vertical = (slider.getOrientation() == JSlider.VERTICAL);
      Part part = vertical ? Part.TKP_TRACKVERT : Part.TKP_TRACK;
      Skin skin = xp.getSkin(slider, part);

      if (vertical) {
    int x = (trackRect.width - skin.getWidth()) / 2;
    skin.paintSkin(g, trackRect.x + x, trackRect.y,
             skin.getWidth(), trackRect.height, null);
      } else {
    int y = (trackRect.height - skin.getHeight()) / 2;
    skin.paintSkin(g, trackRect.x, trackRect.y + y,
             trackRect.width, skin.getHeight(), null);
      }
  } else {
      super.paintTrack(g);
  }
    }
View Full Code Here

    protected Dimension getThumbSize() {
        XPStyle xp = XPStyle.getXP();
  if (xp != null) {
            Dimension size = new Dimension();
            Skin s = xp.getSkin(slider, getXPThumbPart());
            size.width = s.getWidth();
            size.height = s.getHeight();
            return size;
  } else {
      return super.getThumbSize();
  }
    }
View Full Code Here

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

      XPStyle xp = XPStyle.getXP();
      if (xp != null) {
    Skin skin = xp.getSkin(c, part);
    JButton b = (JButton)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

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.