亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
高清不卡在线观看av| 日韩欧美123| 日韩av一区二区三区四区| 久久久亚洲精品石原莉奈| 在线视频中文字幕一区二区| 久久99精品久久久久久| 亚洲激情综合网| 亚洲精品在线观看视频| 欧美视频在线观看一区| 丁香婷婷综合网| 蜜桃免费网站一区二区三区| 亚洲男人的天堂在线观看| 久久综合999| 欧美人与z0zoxxxx视频| 成人免费观看av| 久久精品国产在热久久| 一区二区三区丝袜| 国产精品久线在线观看| 精品国产精品一区二区夜夜嗨| 在线视频你懂得一区二区三区| 国产成人精品一区二区三区四区 | 精品第一国产综合精品aⅴ| 在线亚洲一区二区| 成人av网站免费观看| 韩国视频一区二区| 日韩精品国产精品| 一个色妞综合视频在线观看| 1区2区3区国产精品| 国产日本一区二区| 久久这里都是精品| 精品久久久久久久久久久久久久久| 欧美日韩日本视频| 欧美色涩在线第一页| 91福利国产精品| 91丝袜美女网| 91在线小视频| 成人午夜av影视| 国产成人午夜电影网| 99精品国产一区二区三区不卡| 日韩欧美资源站| 欧美日韩国产综合久久| 在线观看成人小视频| 91麻豆国产在线观看| 91在线视频网址| 99r国产精品| 99麻豆久久久国产精品免费| 成人黄色在线看| 不卡av电影在线播放| 波多野洁衣一区| av影院午夜一区| av在线综合网| 一本色道亚洲精品aⅴ| 色香蕉久久蜜桃| 在线观看日韩毛片| 欧美日韩成人综合| 日韩一区二区在线免费观看| 欧美一区三区二区| 精品国产乱码久久久久久久久| 久久嫩草精品久久久精品| 国产亚洲精品bt天堂精选| 国产精品入口麻豆九色| 亚洲精品视频在线| 午夜视频在线观看一区二区| 免费观看久久久4p| 久久综合久久综合久久| 欧美日韩第一区日日骚| 欧美日高清视频| 欧美一区二视频| 26uuu国产电影一区二区| 中文一区在线播放| 亚洲精品日韩专区silk| 日日摸夜夜添夜夜添国产精品| 久久精品免费观看| 国产不卡高清在线观看视频| 91麻豆福利精品推荐| 欧美日韩国产高清一区二区三区 | 在线一区二区三区| 日韩一级二级三级精品视频| 久久久国际精品| 亚洲欧美电影一区二区| 日本最新不卡在线| 国产ts人妖一区二区| 欧美天堂亚洲电影院在线播放| 青娱乐精品视频| 亚洲自拍偷拍欧美| 美女一区二区视频| jiyouzz国产精品久久| 欧美日产在线观看| 国产精品区一区二区三区| 亚洲高清视频在线| 国产ts人妖一区二区| 欧美猛男gaygay网站| 国产欧美日韩中文久久| 亚洲成a人v欧美综合天堂| 国产乱人伦偷精品视频不卡 | 激情欧美一区二区| 色狠狠色狠狠综合| 久久综合九色综合久久久精品综合| 中文字幕在线视频一区| 蜜臀久久99精品久久久画质超高清 | 国产91高潮流白浆在线麻豆| 欧美日韩一区二区三区四区五区| 久久精品欧美日韩| 日韩精品一区第一页| 99re亚洲国产精品| 精品91自产拍在线观看一区| 亚洲成av人片在线观看| 国产日韩欧美精品在线| 国产精品国产a| 日本不卡免费在线视频| 99久久er热在这里只有精品66| 日韩欧美高清一区| 亚洲综合免费观看高清完整版| 国产成人精品aa毛片| 日韩欧美黄色影院| 亚洲国产一二三| 91亚洲精品乱码久久久久久蜜桃 | 国产成人在线看| 日韩视频免费观看高清在线视频| 亚洲欧美另类在线| 成人激情免费网站| 国产欧美视频在线观看| 精品亚洲国内自在自线福利| 91精品国产一区二区三区蜜臀 | 日韩一区二区三区观看| 亚洲一区二区三区国产| 91亚洲资源网| 亚洲欧美在线另类| 国产成人午夜高潮毛片| 久久嫩草精品久久久久| 激情欧美日韩一区二区| 亚洲一区二区美女| 99久久久免费精品国产一区二区| 久久久国产午夜精品| 狠狠色丁香婷婷综合| 欧美不卡一区二区三区| 日韩黄色片在线观看| 欧美高清激情brazzers| 天堂一区二区在线| 3atv一区二区三区| 蜜臀久久99精品久久久久久9| 91精品国产综合久久福利| 青娱乐精品视频| 欧美xxxxx牲另类人与| 极品少妇一区二区| 欧美一级理论性理论a| 国产一区二区三区免费在线观看| 丝袜亚洲另类欧美综合| 在线视频中文字幕一区二区| 亚洲精品伦理在线| 欧美性猛交xxxx黑人交| 亚洲超碰97人人做人人爱| 在线播放日韩导航| 蜜臀av性久久久久蜜臀aⅴ流畅| 怡红院av一区二区三区| 欧美性猛交xxxxxx富婆| 五月天激情小说综合| 日韩一级精品视频在线观看| 国产一区二区三区日韩| 国产精品热久久久久夜色精品三区| 99国产精品久久| 亚洲一区二区影院| 欧美一区二区三区在线电影| 国产一区二区在线影院| 中文字幕一区二区三区四区不卡 | 日本道精品一区二区三区 | 日韩专区欧美专区| 欧美成人vps| 成人午夜视频免费看| 亚洲伊人伊色伊影伊综合网| 欧美一区二区三区日韩| 国产精品99久久久久久久女警| 1000部国产精品成人观看| 欧美日韩成人在线一区| 国产精品99久久久久久久女警| 亚洲免费av网站| 欧美大片在线观看一区| 成人av在线资源网站| 亚洲6080在线| 国产午夜久久久久| 欧美亚洲日本国产| 激情文学综合丁香| 亚洲乱码中文字幕| 日韩一二在线观看| 97久久精品人人做人人爽50路| 天天操天天综合网| 国产精品水嫩水嫩| 欧美一级在线观看| 91亚洲精品乱码久久久久久蜜桃| 蜜臀av性久久久久蜜臀av麻豆| 国产精品久久久久久久第一福利| 欧美疯狂做受xxxx富婆| 国产成人免费在线视频| 午夜影视日本亚洲欧洲精品| 国产欧美精品一区二区色综合| 欧美日韩午夜影院| www.色精品| 久久激情综合网| 亚洲午夜久久久久中文字幕久| 国产欧美一区二区精品性|