• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DefaultEventSelectionModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ca.odell.glazedlists.swing.DefaultEventSelectionModel的典型用法代码示例。如果您正苦于以下问题:Java DefaultEventSelectionModel类的具体用法?Java DefaultEventSelectionModel怎么用?Java DefaultEventSelectionModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultEventSelectionModel类属于ca.odell.glazedlists.swing包,在下文中一共展示了DefaultEventSelectionModel类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: MovieSelectionModel

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
/**
 * Instantiates a new movie selection model. Usage in MoviePanel
 * 
 * @param sortedList
 *          the sorted list
 * @param source
 *          the source
 * @param matcher
 *          the matcher
 */
public MovieSelectionModel(SortedList<Movie> sortedList, EventList<Movie> source, MovieMatcherEditor matcher) {
  this.sortedList = sortedList;
  this.selectionModel = new DefaultEventSelectionModel<>(source);
  this.selectionModel.addListSelectionListener(this);
  this.matcherEditor = matcher;
  this.selectedMovies = selectionModel.getSelected();

  propertyChangeListener = new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if (evt.getSource() == selectedMovie) {
        firePropertyChange(evt);
      }
    }
  };
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:27,代码来源:MovieSelectionModel.java


示例2: adjustActions

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
/**
 * Adjust the affected actions to the glyph selection change.
 *
 * @param enableActions indicates if the actions should be enabled or disabled
 * @param model         the selection event's origin model
 */
private void adjustActions(Boolean enableActions,
                           DefaultEventSelectionModel<GlyphDefinition> model) {
    boolean isSortingOrFiltering = sortedList.getComparator() != null
            || sortedList.size() > filterList.size();

    for (Action action : actions) {

        if (isSortingOrFiltering
                && (action instanceof MoveUpAction || action instanceof MoveDownAction)) {
            action.setEnabled(false);
        } else if (action instanceof MoveUpAction && model.isSelectedIndex(0)) {
            action.setEnabled(false);
        } else if (action instanceof MoveDownAction
                && model.isSelectedIndex(filterList.size() - 1)) {
            action.setEnabled(false);
        } else {
            action.setEnabled(enableActions);
        }
    }
}
 
开发者ID:richard-strauss-werke,项目名称:glyphpicker,代码行数:27,代码来源:GlyphSelectionChangeHandler.java


示例3: expandSeparators

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
public void expandSeparators(final boolean expand) {
	clearExpandedState(); //Reset
	defaultState = expand;
	lock();
	final DefaultEventSelectionModel<?> selectModel = getEventSelectionModel();
	if (selectModel != null) {
		selectModel.setEnabled(false);
	}
	try {
		separatorList.getReadWriteLock().readLock().lock();
		for (int i = 0; i < separatorList.size(); i++) {
			Object object = separatorList.get(i);
			if (object instanceof SeparatorList.Separator) {
				SeparatorList.Separator<?> separator = (SeparatorList.Separator<?>) object;
				try {
					separatorList.getReadWriteLock().readLock().unlock();
					separatorList.getReadWriteLock().writeLock().lock();
					separator.setLimit(expand ? Integer.MAX_VALUE : 0);
				} finally {
					separatorList.getReadWriteLock().writeLock().unlock();
					separatorList.getReadWriteLock().readLock().lock();
				}
			}
		}
	} finally {
		separatorList.getReadWriteLock().readLock().unlock();
	}
	if (selectModel != null) {
		selectModel.setEnabled(true);
	}
	unlock();
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:33,代码来源:JSeparatorTable.java


示例4: getEventSelectionModel

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
private DefaultEventSelectionModel<?> getEventSelectionModel() {
	if (selectionModel instanceof DefaultEventSelectionModel<?>) {
		return (DefaultEventSelectionModel) selectionModel;
	} else {
		return null;
	}
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:8,代码来源:JSeparatorTable.java


示例5: installTable

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
/**
 * Table automation
 * 1. Saving table settings (TableColumns, TableResize, TableColumnsWidth)
 * 2. Restore table selection after update
 * 3. Restore expanded state for JSeparatorTable after update
 * 4. Lock/unlock table doing update
 * 
 * @param jTable
 * @param toolName unique tool name
 */
protected final void installTable(final JAutoColumnTable jTable, String toolName) {
	this.toolName = toolName;

	//Table Selection
	ListSelectionModel selectionModel = jTable.getSelectionModel();
	if (selectionModel instanceof  DefaultEventSelectionModel) {
		this.eventSelectionModel = (DefaultEventSelectionModel<?>) selectionModel;
	}
	TableModel tableModel = jTable.getModel();
	if (tableModel instanceof DefaultEventTableModel) {
		this.eventTableModel = (DefaultEventTableModel<?>) tableModel;
	}

	//Table lock
	this.jTable = jTable;

	//Load Settings
	if (eventTableModel != null && toolName != null) {
		TableFormat<?> tableFormat = eventTableModel.getTableFormat();
		if (tableFormat instanceof  EnumTableFormatAdaptor) {
			EnumTableFormatAdaptor<?, ?> formatAdaptor = (EnumTableFormatAdaptor<?, ?>) tableFormat;
			formatAdaptor.setColumns(Settings.get().getTableColumns().get(toolName));
			formatAdaptor.setResizeMode(Settings.get().getTableResize().get(toolName));
			jTable.setColumnsWidth(Settings.get().getTableColumnsWidth().get(toolName));
			eventTableModel.fireTableStructureChanged();
		}
	}
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:39,代码来源:JMainTab.java


示例6: valueChanged

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
@Override
public void valueChanged(ListSelectionEvent event) {

    if (!event.getValueIsAdjusting()) {
        Boolean enableActions;

        @SuppressWarnings("unchecked")
        DefaultEventSelectionModel<GlyphDefinition> model = ((DefaultEventSelectionModel<GlyphDefinition>) event
                .getSource());

        if (model.isSelectionEmpty()) {
            enableActions = false;
        } else {
            GlyphDefinition d = model.getSelected().get(0);

            if (d == null) {
                infoLabel.setText(null);
                enableActions = false;
            } else {
                infoLabel.setText(DescriptionRenderer.getHTML(d));
                enableActions = true;
            }
        }

        adjustActions(enableActions, model);
    }
}
 
开发者ID:richard-strauss-werke,项目名称:glyphpicker,代码行数:28,代码来源:GlyphSelectionChangeHandler.java


示例7: MemorizeAction

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
/**
 * Instantiates a new MemorizeAction.
 *
 * @param panel          The container tab panel
 * @param listener       the property change listener to be added to this action
 * @param selectionModel the event selection model
 */
public MemorizeAction(TabPanel panel, PropertyChangeListener listener,
                      DefaultEventSelectionModel<GlyphDefinition> selectionModel) {
    super(CLASS_NAME, "/images/oxygen/XPathEditFavorites16.png", "ctrl ENTER");

    addPropertyChangeListener(listener);
    this.selectionModel = selectionModel;
    bindAcceleratorToComponent(this, panel);
}
 
开发者ID:richard-strauss-werke,项目名称:glyphpicker,代码行数:16,代码来源:MemorizeAction.java


示例8: InsertXmlAction

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
/**
 * Instantiates a new InsertXmlAction.
 *
 * @param listener       the property change listener to be added to this action
 * @param selectionModel the event selection model
 */
public InsertXmlAction(PropertyChangeListener listener,
                       DefaultEventSelectionModel<GlyphDefinition> selectionModel) {
    super(CLASS_NAME, "/images/bravura/g.png", "ENTER");

    addPropertyChangeListener(listener);
    this.selectionModel = selectionModel;
}
 
开发者ID:richard-strauss-werke,项目名称:glyphpicker,代码行数:14,代码来源:InsertXmlAction.java


示例9: createSelectionModel

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
public static <E> DefaultEventSelectionModel<E> createSelectionModel(EventList<E> source) {
	return new DefaultEventSelectionModel<E>(createSwingThreadProxyList(source));
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:4,代码来源:EventModels.java


示例10: getSelectionModel

import ca.odell.glazedlists.swing.DefaultEventSelectionModel; //导入依赖的package包/类
/**
 * Gets the selection model.
 * 
 * @return the selection model
 */
public DefaultEventSelectionModel<Movie> getSelectionModel() {
  return selectionModel;
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:9,代码来源:MovieSelectionModel.java



注:本文中的ca.odell.glazedlists.swing.DefaultEventSelectionModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Photoset类代码示例发布时间:2022-05-22
下一篇:
Java DestroyNotify类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap