683 protected Image createImage(Component c, int w, int h,
684 GraphicsConfiguration config, Object[] args) {
685 return new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
686 }
687 }
688
689 @SuppressWarnings("serial") // Superclass is not serializable across versions
690 static class GlyphButton extends JButton {
691 private Skin skin;
692
693 public GlyphButton(Component parent, Part part) {
694 XPStyle xp = getXP();
695 skin = xp != null ? xp.getSkin(parent, part) : null;
696 setBorder(null);
697 setContentAreaFilled(false);
698 setMinimumSize(new Dimension(5, 5));
699 setPreferredSize(new Dimension(16, 16));
700 setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
701 }
702
703 public boolean isFocusTraversable() {
704 return false;
705 }
706
707 protected State getState() {
708 State state = State.NORMAL;
709 if (!isEnabled()) {
710 state = State.DISABLED;
711 } else if (getModel().isPressed()) {
712 state = State.PRESSED;
713 } else if (getModel().isRollover()) {
714 state = State.HOT;
715 }
716 return state;
717 }
718
719 public void paintComponent(Graphics g) {
720 if (XPStyle.getXP() == null || skin == null) {
721 return;
722 }
|
683 protected Image createImage(Component c, int w, int h,
684 GraphicsConfiguration config, Object[] args) {
685 return new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
686 }
687 }
688
689 @SuppressWarnings("serial") // Superclass is not serializable across versions
690 static class GlyphButton extends JButton {
691 private Skin skin;
692
693 public GlyphButton(Component parent, Part part) {
694 XPStyle xp = getXP();
695 skin = xp != null ? xp.getSkin(parent, part) : null;
696 setBorder(null);
697 setContentAreaFilled(false);
698 setMinimumSize(new Dimension(5, 5));
699 setPreferredSize(new Dimension(16, 16));
700 setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
701 }
702
703 @SuppressWarnings("deprecation")
704 public boolean isFocusTraversable() {
705 return false;
706 }
707
708 protected State getState() {
709 State state = State.NORMAL;
710 if (!isEnabled()) {
711 state = State.DISABLED;
712 } else if (getModel().isPressed()) {
713 state = State.PRESSED;
714 } else if (getModel().isRollover()) {
715 state = State.HOT;
716 }
717 return state;
718 }
719
720 public void paintComponent(Graphics g) {
721 if (XPStyle.getXP() == null || skin == null) {
722 return;
723 }
|