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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jtipoftheday.java

?? java swing控件
?? JAVA
字號(hào):
/**
 * L2FProd.com Common Components 6.9.1 License.
 *
 * Copyright 2005-2006 L2FProd.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.l2fprod.common.swing;

import com.l2fprod.common.swing.TipModel.Tip;
import com.l2fprod.common.swing.plaf.JTipOfTheDayAddon;
import com.l2fprod.common.swing.plaf.LookAndFeelAddons;
import com.l2fprod.common.swing.plaf.TipOfTheDayUI;
import com.l2fprod.common.swing.tips.DefaultTipModel;

import java.awt.Component;
import java.awt.HeadlessException;
import java.util.prefs.Preferences;

import javax.swing.JComponent;
import javax.swing.JDialog;

/**
 * Provides the "Tip of The Day" pane and dialog.<br>
 * Tips are retrieved from the {@link com.l2fprod.common.swing.TipModel}. In
 * the most common usage, a tip (as returned by
 * {@link com.l2fprod.common.swing.TipModel.Tip#getTip()}) is just a
 * <code>String</code>. However, the return type of this method is actually
 * <code>Object</code>. Its interpretation depends on its type:
 * <dl compact>
 * <dt>Component
 * <dd>The <code>Component</code> is displayed in the dialog.
 * <dt>Icon
 * <dd>The <code>Icon</code> is wrapped in a <code>JLabel</code> and
 * displayed in the dialog.
 * <dt>others
 * <dd>The object is converted to a <code>String</code> by calling its
 * <code>toString</code> method. The result is wrapped in a
 * <code>JEditorPane</code> or <code>JTextArea</code> and displayed.
 * </dl>
 * 
 * @author Frederic Lavigne
 */
public class JTipOfTheDay extends JComponent {

  public final static String uiClassID = "l2fprod/TipOfTheDayUI";

  // ensure at least the default ui is registered
  static {
    LookAndFeelAddons.contribute(new JTipOfTheDayAddon());
  }

  /**
   * Key used to store the status of the "Show tip on startup" checkbox"
   */
  public static final String PREFERENCE_KEY = "ShowTipOnStartup";

  /**
   * Used when generating PropertyChangeEvents for the "currentTip" property
   */
  public static final String CURRENT_TIP_CHANGED_KEY = "currentTip";

  private TipModel model;
  private int currentTip = 0;

  public JTipOfTheDay() {
    this(new DefaultTipModel(new Tip[0]));
  }
  
  public JTipOfTheDay(TipModel model) {
    this.model = model;
    updateUI();
  }

  /**
   * Notification from the <code>UIManager</code> that the L&F has changed.
   * Replaces the current UI object with the latest version from the
   * <code>UIManager</code>.
   * 
   * @see javax.swing.JComponent#updateUI
   */
  public void updateUI() {
    setUI((TipOfTheDayUI)LookAndFeelAddons.getUI(this, TipOfTheDayUI.class));
  }

  /**
   * Sets the L&F object that renders this component.
   * 
   * @param ui
   *          the <code>TipOfTheDayUI</code> L&F object
   * @see javax.swing.UIDefaults#getUI
   * 
   * @beaninfo bound: true hidden: true description: The UI object that
   *           implements the taskpane group's LookAndFeel.
   */
  public void setUI(TipOfTheDayUI ui) {
    super.setUI(ui);
  }

  /**
   * Gets the UI object which implements the L&F for this component.
   * 
   * @return the TipOfTheDayUI object that implements the TipOfTheDayUI L&F
   */
  public TipOfTheDayUI getUI() {
    return (TipOfTheDayUI)ui;
  }

  /**
   * Returns the name of the L&F class that renders this component.
   * 
   * @return the string {@link #uiClassID}
   * @see javax.swing.JComponent#getUIClassID
   * @see javax.swing.UIDefaults#getUI
   */
  public String getUIClassID() {
    return uiClassID;
  }

  public TipModel getModel() {
    return model;
  }

  public void setModel(TipModel model) {
    TipModel old = this.model;
    this.model = model;
    firePropertyChange("model", old, model);
  }

  public int getCurrentTip() {
    return currentTip;
  }

  /**
   * Sets the index of the tip to show
   * 
   * @param currentTip
   * @throw IllegalArgumentException if currentTip is not within the bounds [0,
   *        getModel().getTipCount()[.
   */
  public void setCurrentTip(int currentTip) {
    if (currentTip < 0 || currentTip >= getModel().getTipCount()) { throw new IllegalArgumentException(
      "Current tip must be within the bounds [0, " + getModel().getTipCount()
        + "["); }

    int oldTip = this.currentTip;
    this.currentTip = currentTip;
    firePropertyChange(CURRENT_TIP_CHANGED_KEY, oldTip, currentTip);
  }

  /**
   * Shows the next tip in the list. It cycles the tip list.
   */
  public void nextTip() {
    int count = getModel().getTipCount();
    if (count == 0) { return; }

    int nextTip = currentTip + 1;
    if (nextTip >= count) {
      nextTip = 0;
    }
    setCurrentTip(nextTip);
  }

  /**
   * Shows the previous tip in the list. It cycles the tip list.
   */
  public void previousTip() {
    int count = getModel().getTipCount();
    if (count == 0) { return; }

    int previousTip = currentTip - 1;
    if (previousTip < 0) {
      previousTip = count - 1;
    }
    setCurrentTip(previousTip);
  }

  /**
   * Pops up a "Tip of the day" dialog.
   * 
   * @param parentComponent
   * @exception HeadlessException
   *              if GraphicsEnvironment.isHeadless() returns true.
   * @see java.awt.GraphicsEnvironment#isHeadless
   */
  public void showDialog(Component parentComponent) throws HeadlessException {
    showDialog(parentComponent, (ShowOnStartupChoice)null);
  }

  /**
   * Pops up a "Tip of the day" dialog. Additionally, it saves the state of the
   * "Show tips on startup" checkbox in a key named "ShowTipOnStartup" in the
   * given Preferences.
   * 
   * @param parentComponent
   * @param showOnStartupPref
   * @exception HeadlessException
   *              if GraphicsEnvironment.isHeadless() returns true.
   * @throws IllegalArgumentException
   *           if showOnStartupPref is null
   * @see java.awt.GraphicsEnvironment#isHeadless
   * @return true if the user chooses to see the tips again, false otherwise.
   */
  public boolean showDialog(Component parentComponent,
    Preferences showOnStartupPref) throws HeadlessException {
    return showDialog(parentComponent, showOnStartupPref, false);
  }
  
  /**
   * Pops up a "Tip of the day" dialog. Additionally, it saves the state of the
   * "Show tips on startup" checkbox in a key named "ShowTipOnStartup" in the
   * given Preferences.
   * 
   * @param parentComponent
   * @param showOnStartupPref
   * @param force
   *          if true, the dialog is displayed even if the Preferences is set to
   *          hide the dialog
   * @exception HeadlessException
   *              if GraphicsEnvironment.isHeadless() returns true.
   * @throws IllegalArgumentException
   *           if showOnStartupPref is null
   * @see java.awt.GraphicsEnvironment#isHeadless
   * @return true if the user chooses to see the tips again, false
   *         otherwise.
   */
  public boolean showDialog(Component parentComponent,
    final Preferences showOnStartupPref, boolean force) throws HeadlessException {
    if (showOnStartupPref == null) { throw new IllegalArgumentException(
      "Preferences can not be null"); }

    ShowOnStartupChoice store = new ShowOnStartupChoice() {
      public boolean isShowingOnStartup() {
        return showOnStartupPref.getBoolean(PREFERENCE_KEY, true);
      }
      public void setShowingOnStartup(boolean showOnStartup) {
        // only save the choice if it is negative
        if (!showOnStartup) {
          showOnStartupPref.putBoolean(PREFERENCE_KEY, showOnStartup);
        }
      }
    };
    return showDialog(parentComponent, store, force);
  }

  /**
   * Pops up a "Tip of the day" dialog.
   * 
   * If <code>choice</code> is not null, the method first checks if
   * {@link ShowOnStartupChoice#isShowingOnStartup()} is true before showing the
   * dialog.
   * 
   * Additionally, it saves the state of the "Show tips on startup" checkbox
   * using the given {@link ShowOnStartupChoice} object.
   * 
   * @param parentComponent
   * @param choice
   * @exception HeadlessException
   *              if GraphicsEnvironment.isHeadless() returns true.
   * @see java.awt.GraphicsEnvironment#isHeadless
   * @return true if the user chooses to not the tips again, false otherwise.
   */
  public boolean showDialog(Component parentComponent,
    ShowOnStartupChoice choice) {
    return showDialog(parentComponent, choice, false);
  }

  /**
   * Pops up a "Tip of the day" dialog.
   * 
   * If <code>choice</code> is not null, the method first checks if
   * <code>force</code> is true or if
   * {@link ShowOnStartupChoice#isShowingOnStartup()} is true before showing the
   * dialog.
   * 
   * Additionally, it saves the state of the "Show tips on startup" checkbox
   * using the given {@link ShowOnStartupChoice} object.
   * 
   * @param parentComponent
   * @param choice
   * @param force
   *          if true, the dialog is displayed even if
   *          {@link ShowOnStartupChoice#isShowingOnStartup()} is false
   * @exception HeadlessException
   *              if GraphicsEnvironment.isHeadless() returns true.
   * @see java.awt.GraphicsEnvironment#isHeadless
   * @return true if the user chooses to see the tips again, false otherwise.
   */
  public boolean showDialog(Component parentComponent,
    ShowOnStartupChoice choice, boolean force) {    
    if (choice == null) {
      JDialog dialog = createDialog(parentComponent, choice);
      dialog.setVisible(true);
      dialog.dispose();
      return true;
    } else if (force || choice.isShowingOnStartup()) {
      JDialog dialog = createDialog(parentComponent, choice);
      dialog.setVisible(true);
      dialog.dispose();
      return choice.isShowingOnStartup();
    } else {
      return false;
    }
  }
  
  /**
   * @param showOnStartupPref
   * @return true if the key named "ShowTipOnStartup" is not set to false
   */
  public static boolean isShowingOnStartup(Preferences showOnStartupPref) {
    return showOnStartupPref.getBoolean(PREFERENCE_KEY, true);
  }

  /**
   * Removes the value set for "ShowTipOnStartup" in the given Preferences to
   * ensure the dialog shown by a later call to
   * {@link #showDialog(Component, Preferences)} will be visible to the user.
   * 
   * @param showOnStartupPref
   */
  public static void forceShowOnStartup(Preferences showOnStartupPref) {
    showOnStartupPref.remove(PREFERENCE_KEY);
  }

  /**
   * Calls
   * {@link TipOfTheDayUI#createDialog(Component, JTipOfTheDay.ShowOnStartupChoice)}
   * 
   * @param parentComponent
   * @param choice
   * @return a JDialog to show this TipOfTheDay pane
   */
  protected JDialog createDialog(Component parentComponent,
    ShowOnStartupChoice choice) {
    return getUI().createDialog(parentComponent, choice);
  }

  /**
   * Used in conjunction with the
   * {@link JTipOfTheDay#showDialog(Component, ShowOnStartupChoice)} to save the
   * "Show tips on startup" choice.
   */
  public static interface ShowOnStartupChoice {
    void setShowingOnStartup(boolean showOnStartup);
    boolean isShowingOnStartup();
  }

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品一区二区| 色吧成人激情小说| 夜夜精品浪潮av一区二区三区 | 欧美午夜精品久久久| 蜜桃视频在线一区| 亚洲精品成人在线| 国产午夜精品理论片a级大结局| 欧美日韩国产综合视频在线观看 | 激情五月激情综合网| 亚洲综合无码一区二区| 中文字幕第一页久久| 欧美成人三级在线| 欧美日韩国产精品自在自线| 91麻豆免费观看| 国产成人在线视频网站| 老司机精品视频导航| 亚洲国产精品久久艾草纯爱| 成人欧美一区二区三区白人| 久久精品人人做人人爽97| 日韩一区二区免费在线电影 | 国产日韩欧美一区二区三区乱码| 91精品国产综合久久福利软件| 色婷婷综合久久久中文一区二区 | 欧美一二区视频| 欧美在线free| 色哟哟国产精品| www.日韩av| 波多野结衣一区二区三区| 国产精品羞羞答答xxdd| 国模大尺度一区二区三区| 欧美aaaaaa午夜精品| 日韩中文字幕不卡| 亚洲sss视频在线视频| 亚洲国产精品视频| 亚洲自拍偷拍九九九| 一区二区三区国产| 一区二区高清免费观看影视大全| 亚洲欧美中日韩| 亚洲视频资源在线| 亚洲人午夜精品天堂一二香蕉| 中文字幕欧美一区| 亚洲精品国产一区二区三区四区在线| 1000精品久久久久久久久| 亚洲国产精品成人久久综合一区| 国产亚洲精品久| 国产精品不卡在线观看| 最近中文字幕一区二区三区| 亚洲美女电影在线| 亚洲午夜av在线| 免播放器亚洲一区| 高清日韩电视剧大全免费| 成人免费看片app下载| 99久久久无码国产精品| 色女孩综合影院| 欧美日本在线看| 精品嫩草影院久久| 国产欧美一区二区三区在线看蜜臀| 国产精品区一区二区三区| 亚洲精品国产a| 日韩在线一区二区| 国产在线视视频有精品| 成人精品鲁一区一区二区| 91麻豆国产福利精品| 51精品久久久久久久蜜臀| 精品国产1区2区3区| 国产欧美日本一区二区三区| 亚洲天堂福利av| 日韩极品在线观看| 国产美女视频91| 在线看国产一区| 欧美mv和日韩mv国产网站| 中文字幕欧美日韩一区| 亚洲综合激情另类小说区| 久久99久久久欧美国产| k8久久久一区二区三区| 欧美日韩大陆一区二区| 久久久精品综合| 一区二区三区国产| 国产揄拍国内精品对白| 色悠久久久久综合欧美99| 日韩欧美中文字幕一区| 成人欧美一区二区三区| 青青国产91久久久久久| 99在线热播精品免费| 日韩一区二区在线免费观看| 国产精品久久久久影院| 日韩成人一级大片| 99亚偷拍自图区亚洲| 日韩亚洲电影在线| 亚洲综合视频在线观看| 国产精一区二区三区| 欧美日韩一区二区三区视频 | 亚洲高清不卡在线| 成人动漫精品一区二区| 欧美成人r级一区二区三区| 亚洲欧洲日韩综合一区二区| 久久99精品一区二区三区| 在线视频一区二区免费| 国产日韩在线不卡| 麻豆一区二区在线| 在线观看免费视频综合| 国产精品不卡在线观看| 国产资源在线一区| 91精品国产高清一区二区三区| 亚洲久本草在线中文字幕| 国产精品18久久久久久久久久久久 | 欧美一区二区黄色| 尤物视频一区二区| 国产99久久久国产精品潘金网站| 宅男在线国产精品| 亚洲最大成人网4388xx| av一区二区久久| 国产日韩欧美精品综合| 国产一区啦啦啦在线观看| 欧美一区二区黄色| 日韩中文字幕麻豆| 欧美日韩大陆一区二区| 亚洲国产精品尤物yw在线观看| 一本到不卡精品视频在线观看 | 国产午夜精品理论片a级大结局| 日本不卡一二三| 欧美久久一二三四区| 亚洲电影中文字幕在线观看| 欧美影院精品一区| 亚洲乱码中文字幕综合| 99久久夜色精品国产网站| 欧美国产综合一区二区| 国产一区二区久久| 久久久亚洲精华液精华液精华液| 免费成人性网站| 欧美成人三级在线| 国内精品自线一区二区三区视频| 欧美成人性战久久| 国内精品视频666| 久久精品夜色噜噜亚洲a∨| 国产精品一品二品| 欧美国产精品专区| 成人国产在线观看| 亚洲色图欧美在线| 色94色欧美sute亚洲线路二| 亚洲乱码国产乱码精品精可以看| 欧美中文字幕一区| 亚洲3atv精品一区二区三区| 欧美一区二区免费| 极品少妇一区二区三区精品视频| 亚洲精品一区二区三区99| 国产一区二区不卡| 国产精品久久久久久久浪潮网站| 成人av在线电影| 亚洲一级在线观看| 91精品国产91久久久久久一区二区| 日韩不卡一区二区三区| 精品国产乱码久久久久久浪潮| 国产麻豆精品95视频| 国产精品久久久久久久久动漫| 99re热视频这里只精品| 亚洲1区2区3区视频| 精品va天堂亚洲国产| 成人激情免费电影网址| 一区二区三区在线免费| 欧美一级片在线| 国产精品夜夜爽| 一区二区三国产精华液| 欧美一区二区人人喊爽| 国产成人在线视频网站| 亚洲综合清纯丝袜自拍| 欧美成va人片在线观看| 成人av资源下载| 午夜激情一区二区| 国产亚洲一二三区| 欧美在线观看你懂的| 国产一区二区在线视频| 亚洲男同性视频| 精品国产污网站| 色老汉一区二区三区| 美女一区二区三区| ●精品国产综合乱码久久久久| 欧美男生操女生| 成人av在线观| 久久精品国产澳门| 亚洲视频一区在线观看| 91精品国产综合久久福利软件| 成人爽a毛片一区二区免费| 日韩av午夜在线观看| 亚洲欧洲精品一区二区三区| 91精品国产一区二区三区香蕉| thepron国产精品| 久久精品国产亚洲aⅴ| 亚洲欧美另类久久久精品| 精品国产三级a在线观看| 91激情在线视频| 国产suv精品一区二区6| 久久精品国产99国产| 一级特黄大欧美久久久| 国产清纯白嫩初高生在线观看91| 91精品国产乱| 欧美日韩激情一区| 91亚洲男人天堂| 国产成人在线视频免费播放| 免费精品视频在线|