亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? skinrootpaneui.java

?? Skin Look And Feel 1.2.10, 給你的java程序換膚, 支持大量通用皮膚文件.
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * Adapted from MetalRootPaneUI comments below were copied from that class
 */

package com.l2fprod.gui.plaf.skin;

import com.l2fprod.util.AccessUtils;

import java.awt.*;
import java.awt.event.ComponentEvent;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.beans.PropertyChangeEvent;

import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JMenu;
import javax.swing.JRootPane;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicRootPaneUI;

/**
 * 
 * Provides the metal look and feel implementation of <code>RootPaneUI</code>.
 * <p>
 * <code>MetalRootPaneUI</code> provides support for the <code>windowDecorationStyle</code>
 * property of <code>JRootPane</code>.<code>MetalRootPaneUI</code> does
 * this by way of installing a custom <code>LayoutManager</code>, a private
 * <code>Component</code> to render the appropriate widgets, and a private
 * <code>Border</code>. The <code>LayoutManager</code> is always
 * installed, regardless of the value of the <code>windowDecorationStyle</code>
 * property, but the <code>Border</code> and <code>Component</code> are
 * only installed/added if the <code>windowDecorationStyle</code> is other
 * than <code>JRootPane.NONE</code>.
 * <p>
 * <strong>Warning:</strong> Serialized objects of this class will not be
 * compatible with future Swing releases. The current serialization support is
 * appropriate for short term storage or RMI between applications running the
 * same version of Swing. As of 1.4, support for long term storage of all
 * JavaBeans <sup><font size="-2">TM</font></sup> has been added to the
 * <code>java.beans</code> package. Please see {@link java.beans.XMLEncoder}.
 * 
 * @version 1.16 02/04/02
 * @author Terry Kellerman
 * @since 1.4
 */
public final class SkinRootPaneUI extends BasicRootPaneUI {

  // TO MAKE THE CODE COMPILE WITH JDK < 1.4
  public final static int Frame_MAXIMIZED_BOTH =
    AccessUtils.getIntValue(JFrame.class, "MAXIMIZED_BOTH");

  public final static int JRootPane_NONE =
    AccessUtils.getIntValue(JRootPane.class, "NONE");

  public static int getExtendedState(Frame p_Frame) {
    return AccessUtils.getAsInt(p_Frame, "getExtendedState");
  }

  public static void setExtendedState(Frame p_Frame, int p_Value) {
    AccessUtils.setAsInt(p_Frame, "setExtendedState", p_Value);
  }

  public static int getWindowDecorationStyle(JRootPane p_Pane) {
    return AccessUtils.getAsInt(p_Pane, "getWindowDecorationStyle");
  }

  private Skin skin = SkinLookAndFeel.getSkin();
  private Window.FrameWindow title = null;

  /**
   * The amount of space (in pixels) that the cursor is changed on.
   */
  private static final int CORNER_DRAG_WIDTH = 16;

  /**
   * Region from edges that dragging is active from.
   */
  private static final int BORDER_DRAG_THICKNESS = 5;

  /**
   * Window the <code>JRootPane</code> is in.
   */
  private java.awt.Window window;
 
  /**
   * <code>JComponent</code> providing window decorations. This will be null
   * if not providing window decorations.
   */
  private SkinTitlePane titlePane;

  /**
   * <code>MouseInputListener</code> that is added to the parent <code>Window</code>
   * the <code>JRootPane</code> is contained in.
   */
  private MouseInputListener mouseInputListener;
  /**
   * The <code>LayoutManager</code> that is set on the <code>JRootPane</code>.
   */
  private LayoutManager layoutManager;

  /**
   * <code>LayoutManager</code> of the <code>JRootPane</code> before we
   * replaced it.
   */
  private LayoutManager savedOldLayout;

  /**
   * <code>JRootPane</code> providing the look and feel for.
   */
  private JRootPane root;

  /**
   * <code>Cursor</code> used to track the cursor set by the user. This is
   * initially <code>Cursor.DEFAULT_CURSOR</code>.
   */
  private Cursor lastCursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);

  /**
   * Creates a UI for a <code>JRootPane</code>.
   * 
   * @param c the JRootPane the RootPaneUI will be created for
   * @return the RootPaneUI implementation for the passed in JRootPane
   */
  public static ComponentUI createUI(JComponent c) {
    return new SkinRootPaneUI();
  }

  private static java.awt.Window translateSource(MouseEvent ev) {
    Object source = ev.getSource();
    java.awt.Window w;

    if (source.getClass() == SkinTitlePane.class) {
      SkinTitlePane titleSource = (SkinTitlePane)source;
      Window.FrameWindow win = (Window.FrameWindow)titleSource.getWindow();
      w = win.getMainFrame();
    } else
      w = (java.awt.Window)ev.getSource();
    return w;
  }

  /**
   * Invokes supers implementation of <code>installUI</code> to install the
   * necessary state onto the passed in <code>JRootPane</code> to render the
   * metal look and feel implementation of <code>RootPaneUI</code>. If the
   * <code>windowDecorationStyle</code> property of the <code>JRootPane</code>
   * is other than <code>JRootPane.NONE</code>, this will add a custom
   * <code>Component</code> to render the widgets to <code>JRootPane</code>,
   * as well as installing a custom <code>Border</code> and <code>LayoutManager</code>
   * on the <code>JRootPane</code>.
   * 
   * @param c the JRootPane to install state onto
   */
  public void installUI(JComponent c) {
    super.installUI(c);
    root = (JRootPane)c;
    int style = getWindowDecorationStyle(root);
    if (style != JRootPane_NONE) {
      installClientDecorations(root);

    }
    //skin.getFrame().installSkin(c);

  }

  /**
   * Invokes supers implementation to uninstall any of its state. This will
   * also reset the <code>LayoutManager</code> of the <code>JRootPane</code>.
   * If a <code>Component</code> has been added to the <code>JRootPane</code>
   * to render the window decoration style, this method will remove it.
   * Similarly, this will revert the Border and LayoutManager of the <code>JRootPane</code>
   * to what it was before <code>installUI</code> was invoked.
   * 
   * @param c the JRootPane to uninstall state from
   */
  public void uninstallUI(JComponent c) {
    super.uninstallUI(c);
    uninstallClientDecorations(root);

    layoutManager = null;
    mouseInputListener = null;
    root = null;
  }

  /**
   * Installs the appropriate <code>Border</code> onto the <code>JRootPane</code>.
   */
  void installBorder(JRootPane root) {
    int style = getWindowDecorationStyle(root);

    if (style == JRootPane_NONE) {
      LookAndFeel.uninstallBorder(root);
    } else {

      //LookAndFeel.installBorder(root, borderKeys[style]);
      skin.getFrame().installSkin(root);
    }
  }

  /**
   * Removes any border that may have been installed.
   */
  private void uninstallBorder(JRootPane root) {
    LookAndFeel.uninstallBorder(root);
  }

  /**
   * Installs the necessary Listeners on the parent <code>Window</code>, if
   * there is one.
   * <p>
   * This takes the parent so that cleanup can be done from <code>removeNotify</code>,
   * at which point the parent hasn't been reset yet.
   * 
   * @param parent The parent of the JRootPane
   */
  private void installWindowListeners(JRootPane root, Component parent) {
    if (parent instanceof java.awt.Window) {
      window = (java.awt.Window)parent;
    } else {
      window = SwingUtilities.getWindowAncestor(parent);
    }
    if (window != null) {

      if (mouseInputListener == null) {
        mouseInputListener = createWindowMouseInputListener(root);
      }

      window.addMouseListener(mouseInputListener);
      window.addMouseMotionListener(mouseInputListener);
    }
  }

  /**
   * Uninstalls the necessary Listeners on the <code>Window</code> the
   * Listeners were last installed on.
   */
  private void uninstallWindowListeners(JRootPane root) {
    if (window != null) {

      window.removeMouseListener(mouseInputListener);
      window.removeMouseMotionListener(mouseInputListener);
    }
  }

  /**
   * Installs the appropriate LayoutManager on the <code>JRootPane</code> to
   * render the window decorations.
   */
  private void installLayout(JRootPane root) {
    if (layoutManager == null) {
      layoutManager = createLayoutManager();
    }
    savedOldLayout = root.getLayout();
    root.setLayout(layoutManager);
  }

  /**
   * Uninstalls the previously installed <code>LayoutManager</code>.
   */
  private void uninstallLayout(JRootPane root) {
    if (savedOldLayout != null) {
      root.setLayout(savedOldLayout);
      savedOldLayout = null;
    }
  }

  /**
   * Installs the necessary state onto the JRootPane to render client
   * decorations. This is ONLY invoked if the <code>JRootPane</code> has a
   * decoration style other than <code>JRootPane.NONE</code>.
   */
  private void installClientDecorations(JRootPane root) {
    installBorder(root);

    JComponent titlePane = createTitlePane(root);

    setTitlePane(root, titlePane);
    installWindowListeners(root, root.getParent());
    installLayout(root);
    adjustIconAndBackground();
    if (window != null) {
      root.revalidate();
      root.repaint();

    }
  }

  /**
   * @param window
   */
  private void adjustIconAndBackground() {
    if (window != null) {

      title.setFrame(window);

      // the titlePane may not have been updated yet as it was created with a
      // empty FrameWindow so update its actions.
      titlePane.enableActions();
      // callback to notify the titlePane the FrameWindow was set
      titlePane.windowSet();
      
      String[] colors = skin.getColors();
      boolean cont = true;
      for (int i = 0; i < colors.length && cont; i++) {
        String string = colors[i];
        if (string.equalsIgnoreCase("desktop")) {
          cont = false;
          try {
            Color background = new ColorUIResource(Color.decode(colors[i + 1]));
            window.setBackground(background);
          } catch (NumberFormatException e) {
          }
        }
      }
      java.awt.Window target = title.getMainFrame();
      if (target instanceof JFrame) {
        JFrame current = (JFrame)target;
        Icon provided = titlePane.getWindow().getFrameIcon();
        Icon general = UIManager.getIcon("InternalFrame.icon");
        Icon toWork = provided;
        if (provided == null)
          toWork = general;
        if (toWork != null) {
          BufferedImage theIcon =
            new BufferedImage(
              toWork.getIconWidth(),
              toWork.getIconHeight(),
              BufferedImage.TYPE_INT_ARGB);
          Graphics graph = theIcon.getGraphics();
          toWork.paintIcon(null, graph, 0, 0);
          current.setIconImage(theIcon);
        }
      }
    }

  }

  private void resetIconAndBackground() {
    if (window != null) {

      window.setBackground(null);
      title.setFrame(null);
    }

  }

  /**
   * Uninstalls any state that <code>installClientDecorations</code> has
   * installed.
   * <p>
   * NOTE: This may be called if you haven't installed client decorations yet
   * (ie before <code>installClientDecorations</code> has been invoked).
   */
  private void uninstallClientDecorations(JRootPane root) {
    uninstallBorder(root);
    uninstallWindowListeners(root);
    setTitlePane(root, null);
    uninstallLayout(root);
    resetIconAndBackground();
    // We have to revalidate/repaint root if the style is JRootPane.NONE
    // only. When we needs to call revalidate/repaint with other styles
    // the installClientDecorations is always called after this method
    // imediatly and it will cause the revalidate/repaint at the proper
    // time.
    int style = getWindowDecorationStyle(root);
    if (style == JRootPane_NONE) {
      root.repaint();
      root.revalidate();
    }
    // Reset the cursor, as we may have changed it to a resize cursor
    if (window != null) {
      window.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    }
    window = null;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费国产在线观看| 亚洲欧美怡红院| 1024成人网色www| 日本vs亚洲vs韩国一区三区| 91在线小视频| 久久精品欧美一区二区三区不卡 | 欧美国产精品一区| 日本不卡视频一二三区| 欧美亚洲高清一区| 中文字幕一区二区三区不卡| 国产在线精品一区二区夜色| 7777女厕盗摄久久久| 亚洲欧美日韩国产成人精品影院| 国产一区二区不卡| 欧美成人aa大片| 日韩成人一级大片| 欧美日韩亚洲国产综合| 亚洲精品欧美激情| 在线欧美日韩精品| 亚洲精品国产a久久久久久| 成人国产精品免费观看动漫| 久久婷婷一区二区三区| 黄色精品一二区| 337p日本欧洲亚洲大胆精品| 日本不卡不码高清免费观看| 欧美日韩国产成人在线91| 亚洲成a人片在线观看中文| 欧美三级日韩三级| 香蕉影视欧美成人| 51久久夜色精品国产麻豆| 亚洲成国产人片在线观看| 欧美精品欧美精品系列| 视频一区二区三区在线| 欧美老人xxxx18| 免费在线一区观看| 精品福利在线导航| 国产成人欧美日韩在线电影| 中文字幕免费不卡| 一本大道综合伊人精品热热| 亚洲三级视频在线观看| 色爱区综合激月婷婷| 亚洲制服丝袜av| 欧美精品丝袜久久久中文字幕| 亚洲第一av色| 日韩女优av电影在线观看| 久久av中文字幕片| 国产亚洲视频系列| 91免费看视频| 国产福利精品一区二区| 久久久国产精品麻豆| av在线免费不卡| 一个色在线综合| 欧美一区二区三区日韩视频| 国产一区二区精品久久91| 国产免费成人在线视频| 欧洲一区在线电影| 激情深爱一区二区| 亚洲免费毛片网站| 欧美一区二区女人| eeuss影院一区二区三区| 亚洲一区二区三区免费视频| 日韩一级片网站| www.亚洲在线| 丝袜美腿亚洲一区| 国产欧美一区二区三区在线老狼| 91麻豆国产精品久久| 蜜桃久久久久久| 国产精品嫩草影院com| 欧美精品一二三四| 丁香天五香天堂综合| 日韩1区2区3区| 国产精品美女久久久久高潮| 91精品国产综合久久小美女| 国产1区2区3区精品美女| 香蕉成人啪国产精品视频综合网 | 六月丁香婷婷久久| 亚洲视频一区二区在线观看| 日韩免费一区二区三区在线播放| 91视频国产观看| 国产精品中文有码| 婷婷成人综合网| 成人免费视频在线观看| 精品国产污污免费网站入口 | 亚洲五月六月丁香激情| wwwwxxxxx欧美| 欧美午夜视频网站| 99久久婷婷国产| 激情图片小说一区| 日韩av电影免费观看高清完整版| 亚洲精选视频在线| 日本一区二区电影| 久久综合资源网| 91麻豆精品国产91久久久资源速度| 99久久国产免费看| 丁香桃色午夜亚洲一区二区三区| 久久99精品久久久| 免费在线观看一区| 五月婷婷激情综合| 亚洲国产精品人人做人人爽| 中文字幕亚洲欧美在线不卡| 久久久久久久久久久黄色| 91精品国产综合久久久久久久久久| 91麻豆福利精品推荐| 波多野结衣精品在线| 国产aⅴ精品一区二区三区色成熟| 美女一区二区三区| 视频在线在亚洲| 日韩av电影免费观看高清完整版| 亚洲图片欧美视频| 亚洲电影一级片| 国产电影一区二区三区| 韩国女主播一区| 国内精品久久久久影院薰衣草 | 亚洲综合免费观看高清完整版在线| 国产欧美日韩在线视频| 久久久www成人免费无遮挡大片| 日韩一卡二卡三卡国产欧美| 日韩精品一区国产麻豆| 精品国产乱码久久久久久免费| 日韩亚洲欧美在线| 日韩欧美黄色影院| 国产亚洲污的网站| 国产精品传媒入口麻豆| 亚洲精品亚洲人成人网 | 欧美性色综合网| 欧美性生活影院| 69堂精品视频| 26uuu另类欧美| 国产精品久久久久久久久免费相片 | 国产一区在线观看视频| 国产一区欧美二区| 99精品欧美一区二区三区综合在线| 99视频精品在线| 欧美日韩精品一区二区三区| 欧美一卡二卡三卡| 欧美国产欧美综合| 一区二区三区加勒比av| 日本成人中文字幕| 顶级嫩模精品视频在线看| 色成人在线视频| 欧美变态口味重另类| 国产精品夫妻自拍| 亚洲一二三四区不卡| 久久激情五月激情| 欧美日韩一区二区在线观看 | 亚洲国产高清在线| 一区二区在线免费| 韩国成人精品a∨在线观看| 成人激情免费网站| 欧美日高清视频| 日本一区二区成人在线| 亚洲成av人影院在线观看网| 国产一区二区三区免费在线观看| 一本大道久久a久久综合婷婷| 欧美一级xxx| 亚洲人成在线观看一区二区| 蜜臀av国产精品久久久久| 99re在线精品| 26uuu亚洲| 亚州成人在线电影| 北岛玲一区二区三区四区| 欧美一区二区视频观看视频 | 色综合色综合色综合色综合色综合| 91精品福利在线一区二区三区| 国产精品伦一区二区三级视频| 蜜芽一区二区三区| 91激情在线视频| 国产精品久久久久久久第一福利| 免费成人结看片| 欧美日韩国产小视频| 国产精品福利一区二区| 国产一区二区三区香蕉| 欧美日韩一区二区三区四区五区| 国产精品久久看| 国产成人午夜精品影院观看视频 | 久久久不卡网国产精品二区| 亚洲va欧美va天堂v国产综合| 欧美高清hd18日本| 日韩伦理av电影| 国产成人免费视频网站高清观看视频 | 国产三级一区二区| 奇米精品一区二区三区在线观看 | 在线视频国内一区二区| 亚洲国产精品ⅴa在线观看| 狠狠色丁香久久婷婷综合丁香| 欧美丰满嫩嫩电影| 亚洲国产成人av| 欧美在线视频全部完| 亚洲精品美腿丝袜| 色88888久久久久久影院按摩| 亚洲欧美一区二区视频| 成人动漫视频在线| 亚洲欧美在线高清| 成人app网站| 亚洲人吸女人奶水| 91在线观看高清| 一区二区三区欧美亚洲| 91九色02白丝porn| 亚洲成人免费av| 日韩一级片网站|