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

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

?? propertysheettablemodel.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.ObjectTableModel;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.swing.table.AbstractTableModel;

/**
 * PropertySheetTableModel. <br>
 *  
 */
public class PropertySheetTableModel
  extends AbstractTableModel
  implements PropertyChangeListener, PropertySheet, ObjectTableModel {
  public static final int NAME_COLUMN = 0;
  public static final int VALUE_COLUMN = 1;
  public static final int NUM_COLUMNS = 2;

  private PropertyChangeSupport listeners = new PropertyChangeSupport(this);
  private List model;
  private List publishedModel;
  private List properties;
  private int mode;
  private boolean sortingCategories;
  private boolean sortingProperties;
  private boolean restoreToggleStates;
  private Comparator categorySortingComparator;
  private Comparator propertySortingComparator;
  private Map toggleStates;

  public PropertySheetTableModel() {
    model = new ArrayList();
    publishedModel = new ArrayList();
    properties = new ArrayList();
    mode = PropertySheet.VIEW_AS_FLAT_LIST;
    sortingCategories = false;
    sortingProperties = false;
    restoreToggleStates = false;
    toggleStates=new HashMap();
  }

  /* (non-Javadoc)
   * @see com.l2fprod.common.propertysheet.PropertySheet#setProperties(com.l2fprod.common.propertysheet.Property[])
   */
  public void setProperties(Property[] newProperties) {
    // unregister the listeners from previous properties
    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      Property prop = (Property) iter.next();
      prop.removePropertyChangeListener(this);
    }

    // replace the current properties
    properties.clear();
    properties.addAll(Arrays.asList(newProperties));

    // add listeners
    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      Property prop = (Property) iter.next();
      prop.addPropertyChangeListener(this);
    }

    buildModel();
  }

  /* (non-Javadoc)
   * @see com.l2fprod.common.propertysheet.PropertySheet#getProperties()
   */
  public Property[] getProperties() {
    return (Property[]) properties.toArray(new Property[properties.size()]);
  }

  /* (non-Javadoc)
   * @see com.l2fprod.common.propertysheet.PropertySheet#addProperty(com.l2fprod.common.propertysheet.Property)
   */
  public void addProperty(Property property) {
    properties.add(property);
    property.addPropertyChangeListener(this);
    buildModel();
  }

  /* (non-Javadoc)
   * @see com.l2fprod.common.propertysheet.PropertySheet#addProperty(int, com.l2fprod.common.propertysheet.Property)
   */
  public void addProperty(int index, Property property) {
    properties.add(index, property);
    property.addPropertyChangeListener(this);
    buildModel();
  }

  /* (non-Javadoc)
   * @see com.l2fprod.common.propertysheet.PropertySheet#removeProperty(com.l2fprod.common.propertysheet.Property)
   */
  public void removeProperty(Property property) {
    properties.remove(property);
    property.removePropertyChangeListener(this);
    buildModel();
  }

  /* (non-Javadoc)
   * @see com.l2fprod.common.propertysheet.PropertySheet#getPropertyCount()
   */
  public int getPropertyCount() {
    return properties.size();
  }

  /* (non-Javadoc)
   * @see com.l2fprod.common.propertysheet.PropertySheet#propertyIterator()
   */
  public Iterator propertyIterator() {
    return properties.iterator();
  }

  /**
   * Set the current mode, either {@link PropertySheet#VIEW_AS_CATEGORIES}
   * or {@link PropertySheet#VIEW_AS_FLAT_LIST}. 
   */
  public void setMode(int mode) {
    if (this.mode == mode) {
      return;
    }
    this.mode = mode;
    buildModel();
  }

  /**
   * Get the current mode, either {@link PropertySheet#VIEW_AS_CATEGORIES}
   * or {@link PropertySheet#VIEW_AS_FLAT_LIST}.
   */
  public int getMode() {
    return mode;
  }

  /* (non-Javadoc)
   * @see javax.swing.table.TableModel#getColumnClass(int)
   */
  public Class getColumnClass(int columnIndex) {
    return super.getColumnClass(columnIndex);
  }

  /* (non-Javadoc)
   * @see javax.swing.table.TableModel#getColumnCount()
   */
  public int getColumnCount() {
    return NUM_COLUMNS;
  }

  /* (non-Javadoc)
   * @see javax.swing.table.TableModel#getRowCount()
   */
  public int getRowCount() {
    return publishedModel.size();
  }

  /* (non-Javadoc)
   * @see com.l2fprod.common.swing.ObjectTableModel#getObject(int)
   */
  public Object getObject(int rowIndex) {
    return getPropertySheetElement(rowIndex);
  }

  /**
   * Get the current property sheet element, of type {@link Item}, at
   * the specified row.
   */
  public Item getPropertySheetElement(int rowIndex) {
    return (Item) publishedModel.get(rowIndex);
  }

  /**
   * Get whether this model is currently sorting categories.
   */
  public boolean isSortingCategories() {
    return sortingCategories;
  }

  /**
   * Set whether this model is currently sorting categories.
   * If this changes the sorting, the model will be rebuilt.
   */
  public void setSortingCategories(boolean value) {
    boolean old = sortingCategories;
    sortingCategories = value;
    if (sortingCategories != old)
      buildModel();
  }

  /**
   * Get whether this model is currently sorting properties.
   */
  public boolean isSortingProperties() {
    return sortingProperties;
  }

  /**
   * Set whether this model is currently sorting properties.
   * If this changes the sorting, the model will be rebuilt.
   */
  public void setSortingProperties(boolean value) {
    boolean old = sortingProperties;
    sortingProperties = value;
    if (sortingProperties != old)
      buildModel();
  }

  /**
   * Set the comparator used for sorting categories.  If this
   * changes the comparator, the model will be rebuilt.
   */
  public void setCategorySortingComparator(Comparator comp) {
    Comparator old = categorySortingComparator;
    categorySortingComparator = comp;
    if (categorySortingComparator != old)
      buildModel();
  }

  /**
   * Set the comparator used for sorting properties.  If this
   * changes the comparator, the model will be rebuilt.
   */
  public void setPropertySortingComparator(Comparator comp) {
    Comparator old = propertySortingComparator;
    propertySortingComparator = comp;
    if (propertySortingComparator != old)
      buildModel();
  }

  /**
   * Set whether or not this model will restore the toggle states when new
   * properties are applied.
   */
  public void setRestoreToggleStates(boolean value) {
    restoreToggleStates = value;
    if (!restoreToggleStates) {
      toggleStates.clear();
    }
  }

  /**
   * Get whether this model is restoring toggle states
   */
  public boolean isRestoreToggleStates() {
    return restoreToggleStates;
  }

  /**
   * Retrieve the value at the specified row and column location.
   * When the row contains a category or the column is
   * {@link #NAME_COLUMN}, an {@link Item} object will be returned.
   * If the row is a property and the column is {@link #VALUE_COLUMN},
   * the value of the property will be returned.
   * 
   * @see javax.swing.table.TableModel#getValueAt(int, int)
   */
  public Object getValueAt(int rowIndex, int columnIndex) {
    Object result = null;
    Item item = getPropertySheetElement(rowIndex);

    if (item.isProperty()) {
      switch (columnIndex) {
        case NAME_COLUMN:
          result = item;
          break;
          
        case VALUE_COLUMN:
          try {
            result = item.getProperty().getValue();
          } catch (Exception e) {
            e.printStackTrace();
          }
          break;
          
        default:
          // should not happen
      }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区四区在线 | 精品捆绑美女sm三区| 国产成人av资源| 亚洲成av人片在www色猫咪| 久久久久久影视| 欧美肥胖老妇做爰| 99久久综合精品| 激情综合色播激情啊| 亚洲一区免费观看| 亚洲国产成人自拍| 日韩欧美电影在线| 欧美综合一区二区三区| 成人自拍视频在线| 久久66热re国产| 日韩专区欧美专区| 亚洲一区二区3| 亚洲欧美激情一区二区| 久久一夜天堂av一区二区三区| 欧美日韩另类一区| 欧美性生活影院| 99re成人精品视频| 岛国一区二区三区| 国产一区二区三区电影在线观看 | 欧美综合天天夜夜久久| 99久久国产综合精品女不卡| 国产一区二区视频在线| 久久精品理论片| 蜜臀91精品一区二区三区| 亚洲一区二区三区四区在线免费观看| 中文字幕亚洲视频| 亚洲欧洲日产国产综合网| 国产欧美综合在线观看第十页| 欧美sm极限捆绑bd| 精品毛片乱码1区2区3区| 91精品国产综合久久精品| 欧美日本在线看| 制服视频三区第一页精品| 欧美日本一区二区| 91精品国产综合久久久蜜臀粉嫩| 欧美日免费三级在线| 欧美日韩精品一区视频| 欧美三级电影精品| 4hu四虎永久在线影院成人| 欧美日韩中文国产| 欧美日高清视频| 欧美电影免费观看高清完整版在线 | 亚洲天堂免费在线观看视频| 国产精品欧美精品| 中文字幕一区二区视频| 亚洲黄色尤物视频| 亚洲国产日韩精品| 日韩成人伦理电影在线观看| 日本欧美一区二区三区| 捆绑调教一区二区三区| 狠狠色丁香婷婷综合| 国产乱子伦一区二区三区国色天香| 国产在线精品一区在线观看麻豆| 韩国欧美国产1区| 国产69精品一区二区亚洲孕妇| 国产白丝精品91爽爽久久| 成人高清免费观看| 色悠悠久久综合| 911精品产国品一二三产区| 欧美一区二区精品久久911| 久久久久青草大香线综合精品| 国产精品视频九色porn| 亚洲激情欧美激情| 美国av一区二区| 国产99久久久国产精品潘金网站| 本田岬高潮一区二区三区| 欧美性猛交xxxxxxxx| 日韩免费一区二区三区在线播放| 久久久精品国产免大香伊| 亚洲欧美色图小说| 日韩中文字幕av电影| 国产真实乱对白精彩久久| 91性感美女视频| 欧美一级黄色片| 国产精品视频免费看| 午夜精品久久久久久久久| 狠狠色丁香婷综合久久| 色综合久久九月婷婷色综合| 51精品秘密在线观看| 欧美激情一二三区| 婷婷激情综合网| 成人丝袜视频网| 欧美高清精品3d| 亚洲国产高清aⅴ视频| 日韩成人一区二区三区在线观看| 国产精品99久久久久久似苏梦涵| 色综合天天综合网天天看片| 欧美一区二区三区色| 中文字幕制服丝袜成人av| 午夜精品福利一区二区三区蜜桃| 国产精品亚洲成人| 欧美理论片在线| 中文欧美字幕免费| 日本美女一区二区三区视频| 国产91富婆露脸刺激对白| 欧美精品三级在线观看| 国产精品色哟哟| 经典三级在线一区| 欧美中文字幕一二三区视频| 久久在线观看免费| 日韩二区三区在线观看| 91亚洲男人天堂| 久久一区二区三区国产精品| 亚洲永久精品国产| 高清在线成人网| 欧美成人r级一区二区三区| 亚洲小说春色综合另类电影| aaa欧美色吧激情视频| 精品美女在线播放| 日本va欧美va精品发布| 一本到不卡精品视频在线观看 | 亚洲一区免费观看| 99热99精品| 中文一区二区在线观看| 精品一区二区三区在线播放视频| 欧美在线观看视频在线| 综合网在线视频| 高清不卡一区二区| 久久亚洲一区二区三区明星换脸| 午夜电影一区二区三区| 在线看不卡av| 亚洲自拍偷拍av| 91精品办公室少妇高潮对白| 国产精品免费视频网站| 国产成人av电影在线播放| 国产三级精品三级在线专区| 国内精品在线播放| 欧美成人video| 久久99精品国产麻豆不卡| 91麻豆精品国产91久久久更新时间| 伊人婷婷欧美激情| 91在线观看成人| 亚洲欧美日韩一区二区| 成人福利电影精品一区二区在线观看| 久久综合色天天久久综合图片| 麻豆国产一区二区| 精品国产第一区二区三区观看体验| 免费在线观看视频一区| 日韩一区二区三区电影在线观看| 日一区二区三区| 日韩欧美在线网站| 麻豆精品久久久| 2020国产精品| 国产成人精品三级| 国产精品三级电影| 91免费版pro下载短视频| 伊人一区二区三区| 欧美狂野另类xxxxoooo| 日本最新不卡在线| 欧美成人r级一区二区三区| 国产一区欧美二区| 欧美国产日韩在线观看| 97久久久精品综合88久久| 亚洲五码中文字幕| 91精品久久久久久蜜臀| 麻豆精品视频在线观看视频| 久久五月婷婷丁香社区| 成人高清av在线| 亚洲图片欧美色图| 欧美一区二区三区在线看| 黄色小说综合网站| 国产精品大尺度| 欧美亚洲自拍偷拍| 蜜桃视频一区二区三区在线观看| 久久综合999| 91视频.com| 日韩中文字幕麻豆| 欧美国产日韩在线观看| 在线免费观看日本欧美| 奇米影视7777精品一区二区| 国产欧美日韩精品a在线观看| 99久久国产免费看| 午夜精品影院在线观看| 精品国产成人系列| jlzzjlzz亚洲日本少妇| 亚洲综合色网站| 欧美电视剧免费全集观看| 福利电影一区二区三区| 亚洲一区免费在线观看| 久久色.com| 欧美性大战久久久久久久蜜臀| 蜜臀a∨国产成人精品| 亚洲美女少妇撒尿| 精品国产一区二区精华| 色国产精品一区在线观看| 精品中文av资源站在线观看| 亚洲女同女同女同女同女同69| 日韩欧美国产综合一区| 91在线观看成人| 国产精品 日产精品 欧美精品| 亚洲不卡av一区二区三区| 亚洲国产精品高清| 精品成人在线观看| 欧美日韩久久久久久| 色综合一区二区| 粉嫩av一区二区三区|