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

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

?? propertysheetpanel.java

?? java swing控件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/**
 * 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.propertysheet;

import com.l2fprod.common.swing.IconPool;
import com.l2fprod.common.swing.LookAndFeelTweaks;
import com.l2fprod.common.swing.plaf.blue.BlueishButtonUI;
import com.l2fprod.common.util.ResourceManager;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.beans.BeanInfo;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyDescriptor;
import java.util.Comparator;
import java.util.Iterator;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.JEditorPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JToggleButton;
import javax.swing.UIManager;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

/**
 * An implementation of a PropertySheet which shows a table to
 * edit/view values, a description pane which updates when the
 * selection changes and buttons to toggle between a flat view and a
 * by-category view of the properties. A button in the toolbar allows
 * to sort the properties and categories by name.
 * <p>
 * Default sorting is by name (case-insensitive). Custom sorting can
 * be implemented through
 * {@link com.l2fprod.common.propertysheet.PropertySheetTableModel#setCategorySortingComparator(Comparator)}
 * and
 * {@link com.l2fprod.common.propertysheet.PropertySheetTableModel#setPropertySortingComparator(Comparator)}
 */
public class PropertySheetPanel extends JPanel implements PropertySheet, PropertyChangeListener {

  private PropertySheetTable table;
  private PropertySheetTableModel model;
  private JScrollPane tableScroll;
  private ListSelectionListener selectionListener = new SelectionListener();

  private JPanel actionPanel;
  private JToggleButton sortButton;
  private JToggleButton asCategoryButton;
  private JToggleButton descriptionButton;

  private JSplitPane split;
  private int lastDescriptionHeight;
  
  private JEditorPane descriptionPanel;
  private JScrollPane descriptionScrollPane;
  
  public PropertySheetPanel() {
    this(new PropertySheetTable());
  }

  public PropertySheetPanel(PropertySheetTable table) {
    buildUI();
    setTable(table);
  }

  /**
   * Sets the table used by this panel.
   * 
   * Note: listeners previously added with
   * {@link PropertySheetPanel#addPropertySheetChangeListener(PropertyChangeListener)}
   * must be re-added after this call if the table model is not the
   * same as the previous table.
   * 
   * @param table
   */
  public void setTable(PropertySheetTable table) {
    if (table == null) {
      throw new IllegalArgumentException("table must not be null");
    }
    
    // remove the property change listener from any previous model
    if (model != null)
    	model.removePropertyChangeListener(this);

    // get the model from the table
    model = (PropertySheetTableModel)table.getModel();
    model.addPropertyChangeListener(this);

    // remove the listener from the old table
    if (this.table != null)
      this.table.getSelectionModel().removeListSelectionListener(
          selectionListener);

    // prepare the new table
    table.getSelectionModel().addListSelectionListener(selectionListener);
    tableScroll.getViewport().setView(table);

    // use the new table as our table
    this.table = table;
  }

  /**
   * React to property changes by repainting.
   */
  public void propertyChange(PropertyChangeEvent evt) {
      repaint();
	}
  
  /**
   * @return the table used to edit/view Properties.
   */
  public PropertySheetTable getTable() {
    return table;
  }

  /**
   * Toggles the visibility of the description panel.
   * 
   * @param visible
   */
  public void setDescriptionVisible(boolean visible) {
    if (visible) {
      add("Center", split);
      split.setTopComponent(tableScroll);
      split.setBottomComponent(descriptionScrollPane);
      // restore the divider location
      split.setDividerLocation(split.getHeight() - lastDescriptionHeight);
    } else {
      // save the size of the description pane to restore it later
      lastDescriptionHeight = split.getHeight() - split.getDividerLocation();      
      remove(split);      
      add("Center", tableScroll);
    }
    descriptionButton.setSelected(visible);    
    PropertySheetPanel.this.revalidate();
  }

  /**
   * Toggles the visibility of the toolbar panel
   * 
   * @param visible
   */
  public void setToolBarVisible(boolean visible) {
    actionPanel.setVisible(visible);
    PropertySheetPanel.this.revalidate();
  }

  /**
   * Set the current mode, either {@link PropertySheet#VIEW_AS_CATEGORIES}
   * or {@link PropertySheet#VIEW_AS_FLAT_LIST}. 
   */
  public void setMode(int mode) {
    model.setMode(mode);
    asCategoryButton.setSelected(PropertySheet.VIEW_AS_CATEGORIES == mode);
  }

  public void setProperties(Property[] properties) {
    model.setProperties(properties);
  }

  public Property[] getProperties() {
    return model.getProperties();
  }

  public void addProperty(Property property) {
    model.addProperty(property);
  }
  
  public void addProperty(int index, Property property) {
    model.addProperty(index, property);
  }
  
  public void removeProperty(Property property) {
    model.removeProperty(property);
  }
  
  public int getPropertyCount() {
    return model.getPropertyCount();
  }
  
  public Iterator propertyIterator() {
    return model.propertyIterator();
  }
  
  public void setBeanInfo(BeanInfo beanInfo) {
    setProperties(beanInfo.getPropertyDescriptors());
  }

  public void setProperties(PropertyDescriptor[] descriptors) {
    Property[] properties = new Property[descriptors.length];
    for (int i = 0, c = descriptors.length; i < c; i++) {
      properties[i] = new PropertyDescriptorAdapter(descriptors[i]);
    }
    setProperties(properties);
  }

  /**
   * Initializes the PropertySheet from the given object. If any, it cancels
   * pending edit before proceeding with properties.
   * 
   * @param data
   */
  public void readFromObject(Object data) {
    // cancel pending edits
    getTable().cancelEditing();

    Property[] properties = model.getProperties();
    for (int i = 0, c = properties.length; i < c; i++) {
      properties[i].readFromObject(data);
    }
    repaint();
  }

  /**
   * Writes the PropertySheet to the given object. If any, it commits pending
   * edit before proceeding with properties.
   * 
   * @param data
   */
  public void writeToObject(Object data) {
    // ensure pending edits are committed
    getTable().commitEditing();
    
    Property[] properties = getProperties();
    for (int i = 0, c = properties.length; i < c; i++) {
      properties[i].writeToObject(data);
    }
  }

  public void addPropertySheetChangeListener(PropertyChangeListener listener) {
    model.addPropertyChangeListener(listener);
  }

  public void removePropertySheetChangeListener(PropertyChangeListener listener) {
    model.removePropertyChangeListener(listener);
  }

  public void setEditorFactory(PropertyEditorFactory factory) {
    table.setEditorFactory(factory);
  }

  public PropertyEditorFactory getEditorFactory() {
    return table.getEditorFactory();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91玉足脚交白嫩脚丫在线播放| 成a人片国产精品| 青青草国产成人av片免费| 日本特黄久久久高潮| 无码av中文一区二区三区桃花岛| 蜜芽一区二区三区| 成人免费不卡视频| 91精品福利视频| 欧美r级电影在线观看| 国产精品福利在线播放| 亚洲成人综合网站| 国产一区二区精品在线观看| 色综合天天综合狠狠| 日韩一区二区三区电影| 国产精品免费视频一区| 午夜精品久久久久久久久久 | 91成人免费网站| 欧美成人福利视频| 亚洲精品伦理在线| 精品一区二区三区免费播放| 色综合天天综合在线视频| 日韩欧美亚洲一区二区| 17c精品麻豆一区二区免费| 久久国产精品区| 一道本成人在线| 国产欧美日韩精品a在线观看| 亚洲成人av免费| 成人免费电影视频| 精品国产精品一区二区夜夜嗨| 国产午夜三级一区二区三| 亚洲欧美在线aaa| 激情综合网av| 欧美高清性hdvideosex| 亚洲欧美另类小说| 成人做爰69片免费看网站| 精品国产凹凸成av人导航| 亚洲欧美日韩国产另类专区| 成人av网址在线| 欧美激情一区二区三区| 久久99精品国产麻豆不卡| 欧美一区二区三区婷婷月色| 亚洲综合视频网| 91丨porny丨国产入口| 国产日产欧美一区二区视频| 蜜桃传媒麻豆第一区在线观看| 欧美美女网站色| 一区二区三区丝袜| 91在线视频免费观看| 久久色中文字幕| 麻豆国产精品777777在线| 日韩三级电影网址| 久久国产剧场电影| 久久色视频免费观看| 国产在线不卡视频| 国产精品二三区| 欧美日韩视频在线一区二区| 六月婷婷色综合| 国产精品女主播av| 欧美四级电影网| 黄页网站大全一区二区| 成人免费在线视频| 欧美日韩精品福利| 国产乱国产乱300精品| 亚洲天堂中文字幕| 欧美剧情片在线观看| 美洲天堂一区二卡三卡四卡视频| 欧美肥妇free| 亚洲欧洲在线观看av| 成av人片一区二区| 亚洲国产视频在线| 欧美一卡二卡在线| 精品一区二区三区欧美| 中文字幕精品在线不卡| 日本精品免费观看高清观看| 午夜精品久久久久久久99水蜜桃 | 亚洲男人天堂av网| 欧美肥大bbwbbw高潮| 国产精品一区二区x88av| 国产精品不卡一区| 欧美精品久久天天躁| 国产一区二区在线视频| 精品久久国产老人久久综合| eeuss鲁一区二区三区| 一区二区三区四区乱视频| 欧美男男青年gay1069videost| 精品制服美女久久| 日韩美女久久久| 日韩一区国产二区欧美三区| 国产精品18久久久久久久久久久久 | 亚洲国产毛片aaaaa无费看| 日韩欧美中文字幕一区| 久久精品国产一区二区三| 欧美成人一区二区三区片免费| av中文一区二区三区| 亚洲高清免费视频| 精品福利一区二区三区免费视频| 国产精品一卡二卡在线观看| 亚洲私人黄色宅男| 欧美一区二区三区视频在线 | 粉嫩欧美一区二区三区高清影视| 亚洲另类一区二区| 26uuu久久天堂性欧美| 欧美日韩在线综合| 成人av网站免费观看| 国产精品1024| 日本不卡视频在线| 国产精品久久99| 欧美情侣在线播放| 丝袜a∨在线一区二区三区不卡| 欧美一级国产精品| 成人激情视频网站| 欧美日韩高清一区二区三区| 高清国产一区二区三区| 日本美女一区二区三区视频| 亚洲国产日韩a在线播放| 国产精品久久久久久久久久免费看 | 色综合天天天天做夜夜夜夜做| 日韩1区2区3区| 中文字幕欧美一| 久久午夜电影网| 91精品久久久久久久91蜜桃| 欧美婷婷六月丁香综合色| 成人精品高清在线| 国产精品一区二区果冻传媒| 国产精品66部| 成人免费毛片aaaaa**| 国产不卡视频在线播放| 久久 天天综合| 麻豆91免费观看| 免费人成网站在线观看欧美高清| 亚洲综合色成人| 亚洲一区二区三区四区的| 亚洲激情图片qvod| 亚洲色图欧洲色图| 国产精品乱人伦一区二区| 国产亚洲婷婷免费| 久久午夜免费电影| 久久久久亚洲蜜桃| 国产亚洲一区二区三区四区| 久久理论电影网| 久久久综合视频| 亚洲国产精品99久久久久久久久| 久久综合色一综合色88| 精品福利在线导航| 久久久91精品国产一区二区精品 | 国产大陆精品国产| 国产毛片精品国产一区二区三区| 狠狠色狠狠色合久久伊人| 国产经典欧美精品| av亚洲产国偷v产偷v自拍| 91在线免费看| 欧美影片第一页| 制服丝袜亚洲播放| 久久综合色天天久久综合图片| 久久久精品2019中文字幕之3| 日本一区二区综合亚洲| 中文字幕一区二区日韩精品绯色| 亚洲三级在线观看| 丝袜诱惑亚洲看片| 国产老妇另类xxxxx| 色综合一个色综合| 色一区在线观看| 欧美综合在线视频| 69久久夜色精品国产69蝌蚪网| 精品国产乱码久久久久久老虎 | 精品在线你懂的| 国产91丝袜在线18| 色婷婷av一区二区三区gif| 欧美群妇大交群中文字幕| 久久蜜桃av一区精品变态类天堂 | 免费成人美女在线观看| 国产成人丝袜美腿| 色婷婷综合久久久中文字幕| 制服.丝袜.亚洲.中文.综合| 国产欧美日韩三级| 亚洲高清视频的网址| 国产精品一级片| 欧美日韩一卡二卡三卡| 国产欧美日韩三区| 亚洲成人av电影| 国产福利视频一区二区三区| 91久久线看在观草草青青 | 精品久久久久一区二区国产| 国产精品色眯眯| 日韩精品一级二级| 91在线云播放| 久久影院电视剧免费观看| 亚洲精品久久嫩草网站秘色| 久久精品国产精品亚洲红杏| 91香蕉国产在线观看软件| 欧美mv日韩mv国产网站app| 亚洲激情综合网| 成人手机在线视频| 91精品国产麻豆国产自产在线| 国产精品国产三级国产aⅴ原创 | gogogo免费视频观看亚洲一| 欧洲色大大久久| 中文字幕免费一区| 欧美videos中文字幕| 国产精品欧美久久久久无广告 |