本文整理汇总了Java中ca.odell.glazedlists.EventList类的典型用法代码示例。如果您正苦于以下问题:Java EventList类的具体用法?Java EventList怎么用?Java EventList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventList类属于ca.odell.glazedlists包,在下文中一共展示了EventList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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>>();
}
示例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);
}
}
示例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);
}
}
};
}
示例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);
}
示例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();
}
}
示例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));
}
示例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;
}
示例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;
});
}
示例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;
}
示例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);
}