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

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

?? propertysheettable.java

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

import com.l2fprod.common.propertysheet.PropertySheetTableModel.Item;
import com.l2fprod.common.swing.HeaderlessColumnResizer;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyEditor;

import javax.swing.AbstractAction;
import javax.swing.CellEditor;
import javax.swing.Icon;
import javax.swing.JTable;
import javax.swing.KeyStroke;
import javax.swing.ListSelectionModel;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableModel;

/**
 * A table which allows the editing of Properties through
 * PropertyEditors. The PropertyEditors can be changed by using the
 * PropertyEditorRegistry.
 */
public class PropertySheetTable extends JTable {
  
  private static final int HOTSPOT_SIZE = 18;
  
  private static final String TREE_EXPANDED_ICON_KEY = "Tree.expandedIcon";
  private static final String TREE_COLLAPSED_ICON_KEY = "Tree.collapsedIcon";
  private static final String TABLE_BACKGROUND_COLOR_KEY = "Table.background";
  private static final String TABLE_FOREGROUND_COLOR_KEY = "Table.foreground";
  private static final String TABLE_SELECTED_BACKGROUND_COLOR_KEY = "Table.selectionBackground";
  private static final String TABLE_SELECTED_FOREGROUND_COLOR_KEY = "Table.selectionForeground";
  private static final String PANEL_BACKGROUND_COLOR_KEY = "Panel.background";

  private PropertyEditorFactory editorFactory;
  private PropertyRendererFactory rendererFactory;

  private TableCellRenderer nameRenderer;  
  
  private boolean wantsExtraIndent = false;
  
  /**
   * Cancel editing when editing row is changed
   */
  private TableModelListener cancelEditing;

  // Colors used by renderers
  private Color categoryBackground;
  private Color categoryForeground;
  private Color propertyBackground;
  private Color propertyForeground;
  private Color selectedPropertyBackground;
  private Color selectedPropertyForeground;
  private Color selectedCategoryBackground;
  private Color selectedCategoryForeground;
  
  public PropertySheetTable() {
    this(new PropertySheetTableModel());
  }

  public PropertySheetTable(PropertySheetTableModel dm) {
    super(dm);
    initDefaultColors();

    // select only one property at a time
    getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    // hide the table header, we do not need it
    Dimension nullSize = new Dimension(0, 0);
    getTableHeader().setPreferredSize(nullSize);
    getTableHeader().setMinimumSize(nullSize);
    getTableHeader().setMaximumSize(nullSize);
    getTableHeader().setVisible(false);

    // table header not being visible, make sure we can still resize the columns
    new HeaderlessColumnResizer(this);

    // default renderers and editors
    setRendererFactory(new PropertyRendererRegistry());
    setEditorFactory(new PropertyEditorRegistry());
    
    nameRenderer = new NameRenderer();
    
    // force the JTable to commit the edit when it losts focus
    putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
    
    // only full rows can be selected
    setColumnSelectionAllowed(false);
    setRowSelectionAllowed(true);

    // replace the edit action to always trigger the editing of the value column
    getActionMap().put("startEditing", new StartEditingAction());
    
    // ensure navigating with "TAB" moves to the next row
    getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0),
      "selectNextRowCell");
    getInputMap().put(
      KeyStroke.getKeyStroke(KeyEvent.VK_TAB, KeyEvent.SHIFT_DOWN_MASK),
      "selectPreviousRowCell");
    
    // allow category toggle with SPACE and mouse
    getActionMap().put("toggle", new ToggleAction());
    getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0),
      "toggle");    
    addMouseListener(new ToggleMouseHandler());
  }

  /**
   * Initializes the default set of colors used by the PropertySheetTable.
   * 
   * @see #categoryBackground
   * @see #categoryForeground
   * @see #selectedCategoryBackground
   * @see #selectedCategoryForeground
   * @see #propertyBackground
   * @see #propertyForeground
   * @see #selectedPropertyBackground
   * @see #selectedPropertyForeground
   */
  private void initDefaultColors() {    
    this.categoryBackground = UIManager.getColor(PANEL_BACKGROUND_COLOR_KEY);
    this.categoryForeground = UIManager.getColor(TABLE_FOREGROUND_COLOR_KEY).darker().darker().darker();
    
    this.selectedCategoryBackground = categoryBackground.darker();
    this.selectedCategoryForeground = categoryForeground;
    
    this.propertyBackground = UIManager.getColor(TABLE_BACKGROUND_COLOR_KEY);
    this.propertyForeground = UIManager.getColor(TABLE_FOREGROUND_COLOR_KEY);
    
    this.selectedPropertyBackground = UIManager
      .getColor(TABLE_SELECTED_BACKGROUND_COLOR_KEY);
    this.selectedPropertyForeground = UIManager
      .getColor(TABLE_SELECTED_FOREGROUND_COLOR_KEY);
    
    setGridColor(categoryBackground);
  }
    
  
  public Color getCategoryBackground() {
    return categoryBackground;
  }

  /**
   * Sets the color used to paint a Category background.
   * 
   * @param categoryBackground
   */
  public void setCategoryBackground(Color categoryBackground) {
    this.categoryBackground = categoryBackground;
    repaint();
  }

  public Color getCategoryForeground() {
    return categoryForeground;
  }

  /**
   * Sets the color used to paint a Category foreground.
   * 
   * @param categoryForeground
   */
  public void setCategoryForeground(Color categoryForeground) {
    this.categoryForeground = categoryForeground;
    repaint();
  }

  public Color getSelectedCategoryBackground() {
    return selectedCategoryBackground;
  }

  /**
   * Sets the color used to paint a selected/focused Category background.
   * 
   * @param selectedCategoryBackground
   */
  public void setSelectedCategoryBackground(Color selectedCategoryBackground) {
    this.selectedCategoryBackground = selectedCategoryBackground;
    repaint();
  }

  public Color getSelectedCategoryForeground() {
    return selectedCategoryForeground;
  }

  /**
   * Sets the color used to paint a selected/focused Category foreground.
   * 
   * @param selectedCategoryForeground
   */
  public void setSelectedCategoryForeground(Color selectedCategoryForeground) {
    this.selectedCategoryForeground = selectedCategoryForeground;
    repaint();
  }

  public Color getPropertyBackground() {
    return propertyBackground;
  }

  /**
   * Sets the color used to paint a Property background.
   * 
   * @param propertyBackground
   */
  public void setPropertyBackground(Color propertyBackground) {
    this.propertyBackground = propertyBackground;
    repaint();
  }

  public Color getPropertyForeground() {
    return propertyForeground;
  }

  /**
   * Sets the color used to paint a Property foreground.
   * 
   * @param propertyForeground
   */
  public void setPropertyForeground(Color propertyForeground) {
    this.propertyForeground = propertyForeground;
    repaint();
  }

  public Color getSelectedPropertyBackground() {
    return selectedPropertyBackground;
  }

  /**
   * Sets the color used to paint a selected/focused Property background.
   * 
   * @param selectedPropertyBackground
   */
  public void setSelectedPropertyBackground(Color selectedPropertyBackground) {
    this.selectedPropertyBackground = selectedPropertyBackground;
    repaint();
  }

  public Color getSelectedPropertyForeground() {
    return selectedPropertyForeground;
  }

  /**
   * Sets the color used to paint a selected/focused Property foreground.
   * 
   * @param selectedPropertyForeground
   */
  public void setSelectedPropertyForeground(Color selectedPropertyForeground) {
    this.selectedPropertyForeground = selectedPropertyForeground;
    repaint();
  }

  public void setEditorFactory(PropertyEditorFactory factory) {
    editorFactory = factory;
  }

  public final PropertyEditorFactory getEditorFactory() {
    return editorFactory;
  }

  /**
   * @param registry
   * @deprecated use {@link #setEditorFactory(PropertyEditorFactory)}
   */
  public void setEditorRegistry(PropertyEditorRegistry registry) {
    setEditorFactory(registry);
  }

  /**
   * @deprecated use {@link #getEditorFactory()}
   * @throws ClassCastException if the current editor factory is not a
   *           PropertyEditorRegistry
   */
  public PropertyEditorRegistry getEditorRegistry() {
    return (PropertyEditorRegistry) editorFactory;
  }

  public void setRendererFactory(PropertyRendererFactory factory) {
    rendererFactory = factory;
  }

  public PropertyRendererFactory getRendererFactory() {
    return rendererFactory;
  }

  /**
   * @deprecated use {@link #setRendererFactory(PropertyRendererFactory)}
   * @param registry
   */
  public void setRendererRegistry(PropertyRendererRegistry registry) {
    setRendererFactory(registry);
  }

  /**
   * @deprecated use {@link #getRendererFactory()}
   * @throws ClassCastException if the current renderer factory is not a
   *           PropertyRendererRegistry
   */
  public PropertyRendererRegistry getRendererRegistry() {
    return (PropertyRendererRegistry) getRendererFactory();
  }

  /* (non-Javadoc)
   * @see javax.swing.JTable#isCellEditable(int, int)
   */
  public boolean isCellEditable(int row, int column) {
    // names are not editable
    if (column == 0) { return false; }

    PropertySheetTableModel.Item item = getSheetModel().getPropertySheetElement(row);
    return item.isProperty() && item.getProperty().isEditable();
  }

  /**
   * Gets the CellEditor for the given row and column. It uses the
   * editor registry to find a suitable editor for the property.
   * @see javax.swing.JTable#getCellEditor(int, int)
   */
  public TableCellEditor getCellEditor(int row, int column) {
    if (column == 0) { return null; }

    Item item = getSheetModel().getPropertySheetElement(row);
    if (!item.isProperty())
      return null;
    
    TableCellEditor result = null;
    Property propery = item.getProperty();
    PropertyEditor editor = getEditorFactory().createPropertyEditor(propery);
    if (editor != null)
      result = new CellEditorAdapter(editor);

    return result;
  }

  /* (non-Javadoc)
   * @see javax.swing.JTable#getCellRenderer(int, int)
   */
  public TableCellRenderer getCellRenderer(int row, int column) {
    PropertySheetTableModel.Item item = getSheetModel()
      .getPropertySheetElement(row);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品视频一区三区九区| 丁香网亚洲国际| 懂色av一区二区夜夜嗨| 在线观看视频欧美| 欧美精品一区二区三区视频| 欧美精品一区二区三区久久久| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲欧美一区二区视频| 亚洲午夜免费视频| 国产1区2区3区精品美女| 欧美性生活一区| 欧美国产精品一区二区| 日韩精品一二三区| 91最新地址在线播放| 欧美va亚洲va在线观看蝴蝶网| 中文字幕一区二区5566日韩| 麻豆国产91在线播放| 欧美中文字幕一区| 国产精品色哟哟网站| 日本强好片久久久久久aaa| 99视频一区二区三区| 日韩三级精品电影久久久| 亚洲免费在线视频一区 二区| 精品一区二区在线视频| 欧美视频完全免费看| 国产精品第13页| 久久精品国产在热久久| 欧美日本国产视频| 亚洲欧美日韩在线不卡| 国产成人精品三级麻豆| 日韩欧美国产综合| 午夜免费久久看| 91国在线观看| 亚洲视频狠狠干| 国产精品18久久久久久久久| 日韩午夜中文字幕| 亚洲免费观看高清完整版在线 | 欧美性视频一区二区三区| 久久综合av免费| 欧美96一区二区免费视频| 欧洲国内综合视频| 亚洲欧美日韩国产成人精品影院 | 亚洲精品欧美激情| 国产成人av电影在线播放| 欧洲精品在线观看| 亚洲美腿欧美偷拍| 99精品欧美一区| 亚洲欧洲色图综合| 成人蜜臀av电影| 国产精品欧美极品| 6080yy午夜一二三区久久| 亚洲精品国产视频| 97精品久久久久中文字幕| 国产精品亲子伦对白| 国v精品久久久网| 国产欧美综合在线观看第十页| 国产一区二区三区在线观看免费| 精品电影一区二区三区| 精品在线播放午夜| 久久亚洲精品小早川怜子| 精品一区二区在线视频| 久久久美女毛片| 国产一级精品在线| 日本一区二区在线不卡| 国产成人一区二区精品非洲| 国产日韩精品一区二区浪潮av| 国产露脸91国语对白| 久久精品无码一区二区三区| 久久精品久久99精品久久| 久久午夜免费电影| 国产成人在线视频免费播放| 日本一区二区动态图| av电影在线观看一区| 亚洲精品成人少妇| 欧美视频在线不卡| 亚洲国产另类av| 欧美日本精品一区二区三区| 热久久一区二区| 日韩亚洲欧美综合| 国产成人在线免费观看| 久久精品亚洲麻豆av一区二区 | 国产精品美女久久久久aⅴ| 成人福利视频在线| 亚洲欧美一区二区三区极速播放 | 国产日韩av一区| 国产 日韩 欧美大片| 亚洲欧洲日产国产综合网| 色综合天天综合网天天狠天天| 亚洲国产精品麻豆| 日韩欧美在线123| 国产精品一二三四| 亚洲人成精品久久久久| 欧美精品国产精品| 国内外成人在线| 亚洲色图欧美偷拍| 欧美猛男男办公室激情| 精品亚洲免费视频| 国产精品你懂的| 欧美色成人综合| 久久精品国产亚洲高清剧情介绍 | 国产成人鲁色资源国产91色综 | 91看片淫黄大片一级| 亚洲sss视频在线视频| 精品国产一区二区三区久久久蜜月 | 91久久一区二区| 日韩国产精品91| 日本一区二区三区高清不卡| 色妹子一区二区| 久久精品国产网站| 亚洲老司机在线| 日韩精品一区二区三区三区免费| 成人性视频免费网站| 亚洲成人午夜电影| 欧美经典一区二区| 欧美日韩在线观看一区二区 | 91麻豆精品国产自产在线观看一区| 精品中文字幕一区二区小辣椒| 久久女同互慰一区二区三区| 色哟哟日韩精品| 国产在线一区二区综合免费视频| 一区二区三区中文字幕| 欧美成人精精品一区二区频| 色网综合在线观看| 国产麻豆午夜三级精品| 亚洲第一久久影院| 国产亚洲成av人在线观看导航 | 青草av.久久免费一区| 国产精品色眯眯| 欧美一区二区三区性视频| 99久久er热在这里只有精品15| 人人精品人人爱| 一区二区在线观看免费| 精品国产精品一区二区夜夜嗨| 91久久久免费一区二区| 日韩av高清在线观看| 一区二区三区免费观看| 国产蜜臀av在线一区二区三区| 欧美一区二区视频在线观看| 91麻豆国产精品久久| 国产精品亚洲一区二区三区在线| 亚洲高清不卡在线| 自拍视频在线观看一区二区| 精品1区2区在线观看| 欧美军同video69gay| 91麻豆精东视频| 成人毛片老司机大片| 国内精品国产成人国产三级粉色| 亚洲成人中文在线| 中文字幕日韩av资源站| 日韩欧美国产综合在线一区二区三区| 91黄色激情网站| 91亚洲资源网| 成人18视频日本| 成人免费视频网站在线观看| 久久精品99国产国产精| 日韩av在线发布| 五月婷婷综合在线| 亚洲国产一区视频| 一区二区三区欧美日韩| 亚洲欧美另类久久久精品2019| 亚洲国产精品99久久久久久久久 | 日韩一区精品字幕| 亚洲国产wwwccc36天堂| 欧美在线综合视频| 91免费在线看| 在线看国产一区二区| 欧美日韩不卡一区二区| 69精品人人人人| 精品日韩在线观看| 久久久久久久久伊人| 中文字幕国产一区| 亚洲欧美日韩国产综合| 亚洲福利视频三区| 日韩黄色片在线观看| 激情综合网最新| 成人国产一区二区三区精品| 一本色道a无线码一区v| 欧美日韩一区中文字幕| 日韩精品一区二区三区四区视频 | 欧美三级视频在线| 91精品国产麻豆| 国产午夜精品久久久久久免费视| 国产精品麻豆欧美日韩ww| 一区二区三区在线视频免费观看| 香蕉久久夜色精品国产使用方法 | 99久久婷婷国产综合精品| 色婷婷av一区二区三区gif| 欧美日韩视频不卡| 久久欧美中文字幕| 亚洲欧美日韩在线| 免费视频最近日韩| 成人综合婷婷国产精品久久| 色拍拍在线精品视频8848| 在线不卡的av| 亚洲国产精品精华液ab| 亚洲午夜影视影院在线观看| 精品综合久久久久久8888| 97久久久精品综合88久久| 91麻豆精品国产91久久久使用方法 | 欧美一区二区三区日韩|