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

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

?? propertysheettablemodel.java

?? 精美開源Swing組件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/**
 * L2FProd.com Common Components 7.3 License.
 *
 * Copyright 2005-2007 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;
  }

   /**
    * @return the category view toggle states.
    */
   public Map getToggleStates() {
     // Call visibilityChanged to populate the toggleStates map
     visibilityChanged(restoreToggleStates);
     return toggleStates;
   }

   /**
    * Sets the toggle states for the category views. Note this <b>MUST</b> be
    * called <b>BEFORE</b> setting any properties.
    * @param toggleStates the toggle states as returned by getToggleStates
    */
   public void setToggleStates(Map toggleStates) {
     // We are providing a toggleStates map - so by definition we must want to
     // store the toggle states
     setRestoreToggleStates(true);
     this.toggleStates.clear();
     this.toggleStates.putAll(toggleStates);
   }
     
  /**
   * 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;
          

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩夫妻久久| eeuss影院一区二区三区| 亚洲视频图片小说| 久久久www成人免费无遮挡大片| 日本黄色一区二区| 色狠狠一区二区| 成人精品视频一区二区三区尤物| 国产制服丝袜一区| 免费欧美日韩国产三级电影| 亚洲国产精品一区二区www| 日韩经典中文字幕一区| 一区二区三区蜜桃网| 亚洲精品国产成人久久av盗摄 | www国产精品av| 日韩欧美综合一区| 自拍偷自拍亚洲精品播放| 亚洲天堂精品视频| 亚洲精品视频在线| 亚洲国产日韩a在线播放性色| 亚洲一区在线观看免费观看电影高清 | 欧美成人福利视频| 日韩精品影音先锋| 亚洲大片免费看| 亚洲成av人综合在线观看| 亚洲九九爱视频| 久久99精品久久只有精品| 成人app在线观看| 欧美一区二区三区男人的天堂| 欧美美女bb生活片| 亚洲欧美一区二区三区国产精品| 日本一区二区电影| 午夜精品成人在线视频| 国产精品一二三四五| 欧美三日本三级三级在线播放| 久久婷婷久久一区二区三区| 夜夜爽夜夜爽精品视频| 国产99久久精品| 国产精品一级在线| 99re这里只有精品6| 久久久久久黄色| 亚洲一区二区影院| 色综合久久久久久久久久久| 三级影片在线观看欧美日韩一区二区| 日韩一级二级三级| 国产精品久久久久久久浪潮网站| 国产乱子伦一区二区三区国色天香| 日韩免费看网站| 国产一区久久久| 国产精品免费视频网站| 91最新地址在线播放| 久久久精品中文字幕麻豆发布| 日韩激情一二三区| 欧美视频精品在线| 亚洲综合在线电影| 成人激情校园春色| 久久综合久久鬼色中文字| 亚洲国产成人av| 91丨九色丨蝌蚪富婆spa| 91高清视频免费看| 亚洲欧洲精品成人久久奇米网| 一区二区三区在线观看欧美| av中文字幕亚洲| 国产亚洲一二三区| 国产激情一区二区三区| 久久久久久久精| 成人精品鲁一区一区二区| 久久久精品日韩欧美| 国v精品久久久网| 国产精品高潮呻吟久久| 一本色道亚洲精品aⅴ| 国产精品对白交换视频 | 久久丁香综合五月国产三级网站| 亚洲免费观看视频| 99国产精品久| 亚洲国产日韩在线一区模特| 欧美精品tushy高清| 亚洲成人精品一区| 91网页版在线| 亚洲成人午夜电影| 精品精品欲导航| 丁香婷婷综合激情五月色| 国产精品美女一区二区三区| 色综合天天在线| 日韩福利视频导航| 久久综合久久鬼色| 在线观看视频一区| 日韩成人午夜精品| 欧美国产精品v| 欧美日韩一区中文字幕| 激情久久五月天| 亚洲色欲色欲www在线观看| 日韩视频一区二区| av午夜一区麻豆| 久久精品国产一区二区| 亚洲视频 欧洲视频| 久久看人人爽人人| 欧美日韩精品一区二区三区| 国产成人午夜精品影院观看视频| 偷拍一区二区三区四区| 亚洲国产精品精华液2区45| 欧美一区二区在线免费播放| 在线看不卡av| 一本色道综合亚洲| 91亚洲国产成人精品一区二三| 国产精品69毛片高清亚洲| 日韩成人精品在线观看| 美女网站色91| 黄色精品一二区| 国产老肥熟一区二区三区| 精品一区中文字幕| 成人听书哪个软件好| 成人免费av资源| 欧美午夜宅男影院| 欧美一区二区三区系列电影| 精品成人免费观看| 国产精品每日更新| 精品噜噜噜噜久久久久久久久试看| 欧美日韩亚洲综合在线 | 国产精品每日更新| 欧美天天综合网| 成人av免费在线观看| 91亚洲精品一区二区乱码| a级高清视频欧美日韩| 成人丝袜高跟foot| 97久久超碰精品国产| 91视频在线观看免费| 欧美中文字幕亚洲一区二区va在线| 91高清视频免费看| 日韩欧美色综合| 久久综合九色综合欧美就去吻| 欧美精品一区二区三区蜜桃视频| 亚洲精品一线二线三线| 国产欧美一区二区三区沐欲| 国产欧美日韩综合精品一区二区| 国产三区在线成人av| 亚洲免费观看高清完整版在线观看| 亚洲综合区在线| 美女脱光内衣内裤视频久久影院| 午夜国产精品一区| 国产精品1024| 欧美做爰猛烈大尺度电影无法无天| 欧美日韩1区2区| 国产欧美日韩另类视频免费观看| 亚洲精选一二三| 黄一区二区三区| 欧美三级在线看| 久久精品人人做人人爽人人| 亚洲色图在线看| 国产一区二区在线观看视频| 91高清在线观看| 国产三级三级三级精品8ⅰ区| 亚洲国产精品尤物yw在线观看| 国产高清一区日本| 67194成人在线观看| 亚洲欧美日韩国产综合| 国产精品自在在线| 精品久久久久av影院| 亚洲国产精品自拍| 91碰在线视频| 中文字幕视频一区| 国产成人精品一区二| 日韩三级高清在线| 午夜精品一区在线观看| 91传媒视频在线播放| 中文字幕中文字幕中文字幕亚洲无线| 国产一区二区三区免费播放| 91精品国产一区二区| 亚洲成人中文在线| 欧美日韩一区二区不卡| 亚洲六月丁香色婷婷综合久久 | 欧美一区二区精品久久911| 日日夜夜免费精品| 欧美一区二区在线视频| 美女一区二区视频| 精品国产一区久久| 国产福利不卡视频| 中文字幕不卡在线| 色综合色综合色综合| 亚洲综合激情网| 日韩欧美成人一区| 成人激情校园春色| 亚洲一区日韩精品中文字幕| 制服视频三区第一页精品| 黑人精品欧美一区二区蜜桃| 久久久99久久| 一道本成人在线| 美国毛片一区二区三区| 欧美经典一区二区| 欧美精三区欧美精三区 | 精品一区二区三区免费| 国产亚洲精品免费| 欧美视频一区二| 国产成人亚洲综合a∨婷婷| 一区二区三区在线视频观看58 | 亚洲三级在线观看| 日韩欧美一级特黄在线播放| 成人av在线影院| 激情图区综合网| 亚洲午夜日本在线观看| 精品不卡在线视频|