本文整理汇总了Java中ca.odell.glazedlists.EventList类的典型用法代码示例。如果您正苦于以下问题:Java EventList类的具体用法?Java EventList怎么用?Java EventList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventList类属于ca.odell.glazedlists包,在下文中一共展示了EventList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: updateNames
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
public static <T extends MyAsset> void updateNames(EventList<T> eventList, Set<Long> itemIDs) {
if (itemIDs == null || itemIDs.isEmpty()) {
return;
}
List<T> found = new ArrayList<T>();
try {
eventList.getReadWriteLock().readLock().lock();
for (T asset : eventList) {
if (itemIDs.contains(asset.getItemID())) {
found.add(asset); //Save for update
updateName(asset); //Update data
}
}
} finally {
eventList.getReadWriteLock().readLock().unlock();
}
updateList(eventList, found);
}
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:19,代码来源:ProfileData.java
示例2: updatePrices
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
public static <T extends ItemType & EditablePriceType> void updatePrices(EventList<T> eventList, Set<Integer> typeIDs) {
if (typeIDs == null || typeIDs.isEmpty()) {
return;
}
List<T> found = new ArrayList<T>();
try {
eventList.getReadWriteLock().readLock().lock();
for (T t : eventList) {
if (typeIDs.contains(t.getItem().getTypeID())) {
found.add(t); //Save for update
t.setDynamicPrice(ApiIdConverter.getPrice(t.getItem().getTypeID(), t.isBPC())); //Update data
}
}
} finally {
eventList.getReadWriteLock().readLock().unlock();
}
updateList(eventList, found);
}
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:19,代码来源:ProfileData.java
示例3: updateIndustryJobPrices
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
private void updateIndustryJobPrices(EventList<MyIndustryJob> eventList, Set<Integer> typeIDs) {
if (typeIDs == null || typeIDs.isEmpty()) {
return;
}
List<MyIndustryJob> found = new ArrayList<MyIndustryJob>();
try {
eventList.getReadWriteLock().readLock().lock();
for (MyIndustryJob industryJob : eventList) {
if (typeIDs.contains(industryJob.getItem().getTypeID()) || typeIDs.contains(industryJob.getProductTypeID())) {
found.add(industryJob); //Save for update
updatePrice(industryJob); //Update data
}
}
} finally {
eventList.getReadWriteLock().readLock().unlock();
}
updateList(eventList, found);
}
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:19,代码来源:ProfileData.java
示例4: updateLocation
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
public static <T extends EditableLocationType> void updateLocation(EventList<T> eventList, Set<Long> locationIDs) {
if (locationIDs == null || locationIDs.isEmpty()) {
return;
}
List<T> found = new ArrayList<T>();
try {
eventList.getReadWriteLock().readLock().lock();
for (T t : eventList) {
if (locationIDs.contains(t.getLocationID())) {
found.add(t); //Save for update
t.setLocation(ApiIdConverter.getLocation(t.getLocationID())); //Update data
}
}
} finally {
eventList.getReadWriteLock().readLock().unlock();
}
updateList(eventList, found);
}
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:19,代码来源:ProfileData.java
示例5: updateLocations
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
private <T extends LocationsType> void updateLocations(EventList<T> eventList, Set<Long> locationIDs) {
if (locationIDs == null || locationIDs.isEmpty()) {
return;
}
List<T> found = new ArrayList<T>();
try {
eventList.getReadWriteLock().readLock().lock();
for (T t : eventList) {
for (MyLocation location : t.getLocations()) {
if (locationIDs.contains(location.getLocationID())) {
found.add(t); //Save for update
break; //Item already added
}
}
}
} finally {
eventList.getReadWriteLock().readLock().unlock();
}
updateList(eventList, found);
}
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:21,代码来源:ProfileData.java
示例6: VizListComponent
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
/**
* A protected constructor inherited from TransformedList.
*
* @param source
* The source list used by the TransformedList.
*/
protected VizListComponent(EventList<T> source) {
super(source);
// Create the logger
logger = LoggerFactory.getLogger(getClass());
// Store the source list locally too so that JAXB gets it
jaxbSourceList = (BasicEventList<T>) source;
// Set it all up
idList = new BasicEventList<String>();
idList.add("1");
idList.add("ICE Object");
idList.add("ICE Object");
// Setup the listener map
listenerMap = new HashMap<IVizUpdateableListener, ListEventListener<Object>>();
}
开发者ID:eclipse,项目名称:eavp,代码行数:23,代码来源:VizListComponent.java
示例7: fillComboBoxes
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void fillComboBoxes() {
try {
if (projectAutoComplete != null) {
EventList itemList = projectAutoComplete.getItemList();
itemList.clear();
}
categoryComboBox.setModel(new DefaultComboBoxModel<>(db.getCategories()));
severityComboBox.setModel(new DefaultComboBoxModel<>(db.getSeverities()));
sourceComboBox.setModel(new DefaultComboBoxModel<>(db.getSources()));
projectComboBox.setSelectedItem(null);
auditComboBox.setSelectedItem(null);
categoryComboBox.setSelectedItem(null);
vulnerabilityComboBox.setSelectedItem(null);
severityComboBox.setSelectedItem(null);
sourceComboBox.setSelectedItem(null);
} catch (IOException ex) {
log.err(ex);
}
}
开发者ID:sapo,项目名称:sscan,代码行数:23,代码来源:Tab.java
示例8: MovieSelectionModel
import ca.odell.glazedlists.EventList; //导入依赖的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
示例9: MediaFilesPanel
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
public MediaFilesPanel(EventList<MediaFile> mediaFiles) {
this.mediaFileEventList = mediaFiles;
setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("default:grow"), }, new RowSpec[] { RowSpec.decode("default:grow"), }));
mediaFileTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(mediaFileEventList), new MediaTableFormat());
tableFiles = new ZebraJTable(mediaFileTableModel);
tableFiles.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
LinkListener linkListener = new LinkListener();
tableFiles.addMouseListener(linkListener);
tableFiles.addMouseMotionListener(linkListener);
scrollPaneFiles = ZebraJTable.createStripedJScrollPane(tableFiles);
add(scrollPaneFiles, "1, 1, fill, fill");
scrollPaneFiles.setViewportView(tableFiles);
// align the runtime to the right
DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
rightRenderer.setHorizontalAlignment(SwingConstants.RIGHT);
tableFiles.getColumnModel().getColumn(6).setCellRenderer(rightRenderer);
}
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:23,代码来源:MediaFilesPanel.java
示例10: updatePanel
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
private void updatePanel() {
EventList<Message> list = TmmUIMessageCollector.instance.getMessages();
list.getReadWriteLock().readLock().lock();
try {
for (int i = 0; i < list.size(); i++) {
Message message = list.get(i);
if (!messageMap.containsKey(message)) {
MessagePanel panel = new MessagePanel(message);
messageMap.put(message, panel);
messagesPanel.add(panel);
}
}
messagesPanel.revalidate();
messagesPanel.repaint();
}
finally {
list.getReadWriteLock().readLock().unlock();
}
}
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:20,代码来源:MessageHistoryDialog.java
示例11: MediaIdTable
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
public MediaIdTable(EventList<MediaId> ids, ScraperType type) {
this.idMap = null;
this.editable = true;
this.idList = ids;
setModel(new DefaultEventTableModel<>(idList, new MediaIdTableFormat()));
setTableHeader(null);
putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
TableColumn column = getColumnModel().getColumn(0);
Set<String> providerIds = new HashSet<>();
for (MediaId id : ids) {
providerIds.add(id.key);
}
for (MediaScraper scraper : MediaScraper.getMediaScrapers(type)) {
providerIds.add(scraper.getId());
}
JComboBox<String> comboBox = new JComboBox<>(providerIds.toArray(new String[0]));
column.setCellEditor(new DefaultCellEditor(comboBox));
}
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:22,代码来源:MediaIdTable.java
示例12: convertIdMapToEventList
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
public static EventList<MediaId> convertIdMapToEventList(Map<String, Object> idMap) {
EventList<MediaId> idList = new BasicEventList<>();
for (Entry<String, Object> entry : idMap.entrySet()) {
MediaId id = new MediaId();
id.key = entry.getKey();
try {
id.value = entry.getValue().toString();
}
catch (Exception e) {
id.value = "";
}
idList.add(id);
}
return idList;
}
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:17,代码来源:MediaIdTable.java
示例13: updatePreview
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
private void updatePreview(final BibEntry toShow, int repeats) {
if (workingOnPreview) {
if (repeats > 0) {
return; // We've already waited once. Give up on this selection.
}
Timer t = new Timer(50, actionEvent -> updatePreview(toShow, 1));
t.setRepeats(false);
t.start();
return;
}
EventList<BibEntry> list = table.getSelected();
// Check if the entry to preview is still selected:
if ((list.size() != 1) || (list.get(0) != toShow)) {
return;
}
workingOnPreview = true;
SwingUtilities.invokeLater(() -> {
panel.showPreview(toShow);
workingOnPreview = false;
});
}
开发者ID:JabRef,项目名称:jabref,代码行数:22,代码来源:MainTableSelectionListener.java
示例14: MainTableDataModel
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
public MainTableDataModel(BibDatabaseContext context) {
List<BibEntry> entries = context.getDatabase().getEntries();
EventList<BibEntry> initialEventList = new BasicEventList<>();
initialEventList.addAll(entries);
listSynchronizer = new ListSynchronizer(initialEventList);
// This SortedList has a Comparator controlled by the TableComparatorChooser
// we are going to install, which responds to user sorting selections:
sortedForUserDefinedTableColumnSorting = new SortedList<>(initialEventList, null);
// This SortedList applies afterwards, and floats marked entries:
sortedForMarkingSearchGrouping = new SortedList<>(sortedForUserDefinedTableColumnSorting, null);
FilterList<BibEntry> groupFilterList = new FilterList<>(sortedForMarkingSearchGrouping, EverythingMatcher.INSTANCE);
filterGroupToggle = new StartStopListFilterAction(groupFilterList, GroupMatcher.INSTANCE,
EverythingMatcher.INSTANCE);
FilterList<BibEntry> searchFilterList = new FilterList<>(groupFilterList, EverythingMatcher.INSTANCE);
filterSearchToggle = new StartStopListFilterAction(searchFilterList, SearchMatcher.INSTANCE,
EverythingMatcher.INSTANCE);
finalList = searchFilterList;
}
开发者ID:JabRef,项目名称:jabref,代码行数:24,代码来源:MainTableDataModel.java
示例15: MoveDownAction
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
/**
* Instantiates a MoveDownAction.
*
* @param panel The container tab panel
* @param listener the property change listener to be added to this action
* @param glyphList the glyph list model
* @param list the list component
*/
public MoveDownAction(TabPanel panel, PropertyChangeListener listener,
EventList<GlyphDefinition> glyphList, GlyphGrid list) {
super(I18N.getString(CLASS_NAME + ".label"), new ImageIcon(
MoveDownAction.class.getResource("/images/oxygen/MoveDown16.gif")));
this.addPropertyChangeListener(listener);
this.glyphList = glyphList;
this.list = list;
String description = I18N.getString(CLASS_NAME + ".description");
putValue(SHORT_DESCRIPTION, description + " (" + MENU_SHORTCUT_NAME + "+↓)");
putValue(MNEMONIC_KEY, KeyEvent.VK_DOWN);
String osIndependentAccelerator = (IS_MAC) ? "meta DOWN" : "ctrl DOWN";
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(osIndependentAccelerator));
bindAcceleratorToComponent(this, panel);
}
开发者ID:richard-strauss-werke,项目名称:glyphpicker,代码行数:27,代码来源:MoveDownAction.java
示例16: MoveUpAction
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
/**
* Instantiates a new MoveUpAction.
*
* @param panel The container tab panel
* @param listener the property change listener to be added to this action
* @param glyphList the glyph list model
* @param list the list component
*/
public MoveUpAction(TabPanel panel, PropertyChangeListener listener,
EventList<GlyphDefinition> glyphList, GlyphGrid list) {
super(I18N.getString(CLASS_NAME + ".label"), new ImageIcon(
MoveUpAction.class.getResource("/images/oxygen/MoveUp16.gif")));
this.addPropertyChangeListener(listener);
this.glyphList = glyphList;
this.list = list;
String description = I18N.getString(CLASS_NAME + ".description");
putValue(SHORT_DESCRIPTION, description + " (" + MENU_SHORTCUT_NAME + "+↑)");
putValue(MNEMONIC_KEY, KeyEvent.VK_DOWN);
String osIndependentAccelerator = (IS_MAC) ? "meta UP" : "ctrl UP";
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(osIndependentAccelerator));
bindAcceleratorToComponent(this, panel);
}
开发者ID:richard-strauss-werke,项目名称:glyphpicker,代码行数:27,代码来源:MoveUpAction.java
示例17: FeatureTable
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
/**
* Create a new feature table with the specified list of features.
*
* @param features list of features, must not be null
*/
FeatureTable(final EventList<Feature> features)
{
super("Features:", features, TABLE_FORMAT);
refresh.setEnabled(false);
getAddAction().setEnabled(false);
getPasteAction().setEnabled(false);
Component refreshContextMenuComponent = getContextMenu().add(refresh);
// place at index 8 before add action
getContextMenu().remove(refreshContextMenuComponent);
getContextMenu().add(refreshContextMenuComponent, 8);
Component refreshToolBarComponent = getToolBar().add(refresh);
// place at index 0 before add action
getToolBar().remove(refreshToolBarComponent);
getToolBar().add(refreshToolBarComponent, 0);
getToolBar().displayIcons();
getToolBar().setIconSize(TangoProject.EXTRA_SMALL);
}
开发者ID:heuermh,项目名称:variation-cytoscape3-app,代码行数:26,代码来源:FeatureView.java
示例18: createOutputsList
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
private EventList<AddressAmountPair> createOutputsList(Transaction transaction) {
KeyShareWalletExtension walletExtension = (KeyShareWalletExtension) wallet.addOrGetExistingExtension(new KeyShareWalletExtension());
EventList<AddressAmountPair> result = new BasicEventList<>();
for (TransactionOutput transactionOutput : transaction.getOutputs()) {
String addressString = transactionOutput.getScriptPubKey().getToAddress(RegTestParams.get()).toString();
if (addressString.equals(walletExtension.getAddressAsString())) {
addressString = "Change ("
+ addressString.substring(0, 4)
+ "..."
+ addressString.substring(addressString.length() - 4, addressString.length())
+ ")";
}
result.add(new AddressAmountPair(addressString,
transactionOutput.getValue().toFriendlyString())
);
}
result.add(new AddressAmountPair("Miner fee",
TransactionHelper.computeOverpay(transaction).toFriendlyString()));
return result;
}
开发者ID:ChristopherMann,项目名称:2FactorWallet,代码行数:21,代码来源:TransactionDialog.java
示例19: testManualSynchronization
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
public void testManualSynchronization() {
List list1 = Arrays.asList(new String[] { "item 1", "item2", "item3" });
List list2 = Arrays.asList(new String[] { "item 4", "item5", "item6" });
EventList eventList = new BasicEventList();
ValueModel valueModel = new ValueHolder(list1);
ValueModel2EventListBridge bridge = new ValueModel2EventListBridge(valueModel, eventList, true);
assertTrue("manual sync: data not copied in constructor", eventList.isEmpty());
bridge.synchronize();
assertEquals("sync copies data", list1, eventList);
valueModel.setValue(list2);
assertEquals("when value in ValueModel changes, it's NOT copied to the EventList", list1, eventList);
bridge.synchronize();
assertEquals(list2, eventList);
}
开发者ID:shevek,项目名称:spring-rich-client,代码行数:20,代码来源:ValueModel2EventListBridgeTests.java
示例20: findInFolder
import ca.odell.glazedlists.EventList; //导入依赖的package包/类
private boolean findInFolder(String folderLabel,
EventList<StoredSmtpMessage> eventList,
DisposableMap<String, List<StoredSmtpMessage>> map,
String host)
{
eventList.getReadWriteLock().readLock().lock();
try
{
List<StoredSmtpMessage> folder = map.get(folderLabel);
if (folder != null)
{
for (StoredSmtpMessage msg : folder)
{
if (host.equals(msg.getMessageHost()))
return true;
}
}
}
finally
{
eventList.getReadWriteLock().readLock().unlock();
}
return false;
}
开发者ID:edeoliveira,项目名称:Mailster,代码行数:26,代码来源:FilterTreeView.java
注:本文中的ca.odell.glazedlists.EventList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论