本文整理汇总了Java中java.beans.EventSetDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java EventSetDescriptor类的具体用法?Java EventSetDescriptor怎么用?Java EventSetDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventSetDescriptor类属于java.beans包,在下文中一共展示了EventSetDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPList
import java.beans.EventSetDescriptor; //导入依赖的package包/类
/** try to register PropertyChangeListener to instance to fire its changes.
* @param bean */
private void initPList (Object bean, BeanInfo bInfo, BeanNode.Descriptor descr) {
EventSetDescriptor[] descs = bInfo.getEventSetDescriptors();
try {
Method setter = null;
for (int i = 0; descs != null && i < descs.length; i++) {
setter = descs[i].getAddListenerMethod();
if (setter != null && setter.getName().equals("addPropertyChangeListener")) { // NOI18N
propertyChangeListener = new PropL(createSupportedPropertyNames(descr));
setter.invoke(bean, new Object[] {WeakListeners.propertyChange(propertyChangeListener, bean)});
setSettingsInstance(bean);
}
}
} catch (Exception ex) {
// ignore
}
}
示例2: _addEvent
import java.beans.EventSetDescriptor; //导入依赖的package包/类
private void _addEvent(
Hashtable<String, EventSetDescriptor> events,
EventSetDescriptor descriptor
)
{
String key = descriptor.getName() + descriptor.getListenerType();
if (descriptor.getName().equals("propertyChange"))
{
_propertyChangeSource = true;
}
EventSetDescriptor oldDescriptor = events.get(key);
if (oldDescriptor == null)
{
events.put(key, descriptor);
return;
}
EventSetDescriptor composite = _createMergedEventSetDescriptor(
oldDescriptor,
descriptor);
events.put(key, composite);
}
示例3: __createMergedEventSetStub
import java.beans.EventSetDescriptor; //导入依赖的package包/类
static EventSetDescriptor __createMergedEventSetStub(
EventSetDescriptor oldDescriptor,
MethodDescriptor[] listenerDescriptors
)
{
try
{
EventSetDescriptor stubDescriptor = new EventSetDescriptor(
oldDescriptor.getName(),
oldDescriptor.getListenerType(),
listenerDescriptors,
oldDescriptor.getAddListenerMethod(),
oldDescriptor.getRemoveListenerMethod());
// set the unicast attribute
stubDescriptor.setUnicast(oldDescriptor.isUnicast());
return stubDescriptor;
}
catch (Exception e)
{
// _LOG.severe(e);
return null;
}
}
示例4: main
import java.beans.EventSetDescriptor; //导入依赖的package包/类
public static void main(String[] args) throws IntrospectionException, NoSuchMethodException {
EventSetDescriptor esd = new EventSetDescriptor(
"foo",
FooListener.class,
new Method[] {
FooListener.class.getMethod("fooHappened", EventObject.class),
FooListener.class.getMethod("moreFooHappened", EventObject.class, Object.class),
FooListener.class.getMethod("lessFooHappened"),
},
Bean.class.getMethod("addFooListener", FooListener.class),
Bean.class.getMethod("removeFooListener", FooListener.class)
);
System.gc();
for (Method method : esd.getListenerMethods()) {
System.out.println(method);
}
}
示例5: main
import java.beans.EventSetDescriptor; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
Class<?> bt = Accessor.getBeanType();
Class<?> lt = Accessor.getListenerType();
// test PropertyDescriptor
PropertyDescriptor pd = new PropertyDescriptor("boolean", bt);
test(pd.getReadMethod());
test(pd.getWriteMethod());
// test IndexedPropertyDescriptor
IndexedPropertyDescriptor ipd = new IndexedPropertyDescriptor("indexed", bt);
test(ipd.getReadMethod());
test(ipd.getWriteMethod());
test(ipd.getIndexedReadMethod());
test(ipd.getIndexedWriteMethod());
// test EventSetDescriptor
EventSetDescriptor esd = new EventSetDescriptor(bt, "test", lt, "process");
test(esd.getAddListenerMethod());
test(esd.getRemoveListenerMethod());
test(esd.getGetListenerMethod());
test(esd.getListenerMethods());
}
示例6: getEventSetDescriptors
import java.beans.EventSetDescriptor; //导入依赖的package包/类
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
EventSetDescriptor[] es = new EventSetDescriptor[2];
try {
es[iAction] = new EventSetDescriptor(
TestClass.class,
"actionListener",
java.awt.event.ActionListener.class,
new String[] {"actionPerformed"},
"addActionListener",
"removeActionListener");
es[iMouse] = new EventSetDescriptor(
TestClass.class,
"mouseListener",
java.awt.event.MouseListener.class,
new String[] {"mouseClicked", "mousePressed", "mouseReleased", "mouseEntered", "mouseExited"},
"addMouseListener",
"removeMouseListener");
} catch(IntrospectionException e) {
e.printStackTrace();
}
return es;
}
示例7: getEdescriptor
import java.beans.EventSetDescriptor; //导入依赖的package包/类
private static EventSetDescriptor[] getEdescriptor(){
EventSetDescriptor[] eventSets = new EventSetDescriptor[14];
try {
eventSets[EVENT_ancestorListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "ancestorListener", javax.swing.event.AncestorListener.class, new String[] {"ancestorAdded", "ancestorRemoved", "ancestorMoved"}, "addAncestorListener", "removeAncestorListener" ); // NOI18N
eventSets[EVENT_caretListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "caretListener", javax.swing.event.CaretListener.class, new String[] {"caretUpdate"}, "addCaretListener", "removeCaretListener" ); // NOI18N
eventSets[EVENT_componentListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "componentListener", java.awt.event.ComponentListener.class, new String[] {"componentResized", "componentMoved", "componentShown", "componentHidden"}, "addComponentListener", "removeComponentListener" ); // NOI18N
eventSets[EVENT_containerListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "containerListener", java.awt.event.ContainerListener.class, new String[] {"componentAdded", "componentRemoved"}, "addContainerListener", "removeContainerListener" ); // NOI18N
eventSets[EVENT_focusListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "focusListener", java.awt.event.FocusListener.class, new String[] {"focusGained", "focusLost"}, "addFocusListener", "removeFocusListener" ); // NOI18N
eventSets[EVENT_hierarchyBoundsListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "hierarchyBoundsListener", java.awt.event.HierarchyBoundsListener.class, new String[] {"ancestorMoved", "ancestorResized"}, "addHierarchyBoundsListener", "removeHierarchyBoundsListener" ); // NOI18N
eventSets[EVENT_hierarchyListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "hierarchyListener", java.awt.event.HierarchyListener.class, new String[] {"hierarchyChanged"}, "addHierarchyListener", "removeHierarchyListener" ); // NOI18N
eventSets[EVENT_inputMethodListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "inputMethodListener", java.awt.event.InputMethodListener.class, new String[] {"inputMethodTextChanged", "caretPositionChanged"}, "addInputMethodListener", "removeInputMethodListener" ); // NOI18N
eventSets[EVENT_keyListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "keyListener", java.awt.event.KeyListener.class, new String[] {"keyTyped", "keyPressed", "keyReleased"}, "addKeyListener", "removeKeyListener" ); // NOI18N
eventSets[EVENT_mouseListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "mouseListener", java.awt.event.MouseListener.class, new String[] {"mouseClicked", "mousePressed", "mouseReleased", "mouseEntered", "mouseExited"}, "addMouseListener", "removeMouseListener" ); // NOI18N
eventSets[EVENT_mouseMotionListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "mouseMotionListener", java.awt.event.MouseMotionListener.class, new String[] {"mouseDragged", "mouseMoved"}, "addMouseMotionListener", "removeMouseMotionListener" ); // NOI18N
eventSets[EVENT_mouseWheelListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "mouseWheelListener", java.awt.event.MouseWheelListener.class, new String[] {"mouseWheelMoved"}, "addMouseWheelListener", "removeMouseWheelListener" ); // NOI18N
eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "propertyChangeListener", java.beans.PropertyChangeListener.class, new String[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); // NOI18N
eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MyTextArea.class, "vetoableChangeListener", java.beans.VetoableChangeListener.class, new String[] {"vetoableChange"}, "addVetoableChangeListener", "removeVetoableChangeListener" ); // NOI18N
}
catch(IntrospectionException e) {
e.printStackTrace();
}//GEN-HEADEREND:Events
// Here you can add code for customizing the event sets array.
return eventSets; }
示例8: getEdescriptor
import java.beans.EventSetDescriptor; //导入依赖的package包/类
private static EventSetDescriptor[] getEdescriptor(){
EventSetDescriptor[] eventSets = new EventSetDescriptor[15];
try {
eventSets[EVENT_ancestorListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "ancestorListener", javax.swing.event.AncestorListener.class, new String[] {"ancestorAdded", "ancestorRemoved", "ancestorMoved"}, "addAncestorListener", "removeAncestorListener" ); // NOI18N
eventSets[EVENT_componentListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "componentListener", java.awt.event.ComponentListener.class, new String[] {"componentResized", "componentMoved", "componentShown", "componentHidden"}, "addComponentListener", "removeComponentListener" ); // NOI18N
eventSets[EVENT_containerListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "containerListener", java.awt.event.ContainerListener.class, new String[] {"componentAdded", "componentRemoved"}, "addContainerListener", "removeContainerListener" ); // NOI18N
eventSets[EVENT_focusListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "focusListener", java.awt.event.FocusListener.class, new String[] {"focusGained", "focusLost"}, "addFocusListener", "removeFocusListener" ); // NOI18N
eventSets[EVENT_hierarchyBoundsListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "hierarchyBoundsListener", java.awt.event.HierarchyBoundsListener.class, new String[] {"ancestorMoved", "ancestorResized"}, "addHierarchyBoundsListener", "removeHierarchyBoundsListener" ); // NOI18N
eventSets[EVENT_hierarchyListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "hierarchyListener", java.awt.event.HierarchyListener.class, new String[] {"hierarchyChanged"}, "addHierarchyListener", "removeHierarchyListener" ); // NOI18N
eventSets[EVENT_inputMethodListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "inputMethodListener", java.awt.event.InputMethodListener.class, new String[] {"inputMethodTextChanged", "caretPositionChanged"}, "addInputMethodListener", "removeInputMethodListener" ); // NOI18N
eventSets[EVENT_keyListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "keyListener", java.awt.event.KeyListener.class, new String[] {"keyTyped", "keyPressed", "keyReleased"}, "addKeyListener", "removeKeyListener" ); // NOI18N
eventSets[EVENT_menuKeyListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "menuKeyListener", javax.swing.event.MenuKeyListener.class, new String[] {"menuKeyTyped", "menuKeyPressed", "menuKeyReleased"}, "addMenuKeyListener", "removeMenuKeyListener" ); // NOI18N
eventSets[EVENT_mouseListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "mouseListener", java.awt.event.MouseListener.class, new String[] {"mouseClicked", "mousePressed", "mouseReleased", "mouseEntered", "mouseExited"}, "addMouseListener", "removeMouseListener" ); // NOI18N
eventSets[EVENT_mouseMotionListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "mouseMotionListener", java.awt.event.MouseMotionListener.class, new String[] {"mouseDragged", "mouseMoved"}, "addMouseMotionListener", "removeMouseMotionListener" ); // NOI18N
eventSets[EVENT_mouseWheelListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "mouseWheelListener", java.awt.event.MouseWheelListener.class, new String[] {"mouseWheelMoved"}, "addMouseWheelListener", "removeMouseWheelListener" ); // NOI18N
eventSets[EVENT_popupMenuListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "popupMenuListener", javax.swing.event.PopupMenuListener.class, new String[] {"popupMenuWillBecomeVisible", "popupMenuWillBecomeInvisible", "popupMenuCanceled"}, "addPopupMenuListener", "removePopupMenuListener" ); // NOI18N
eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "propertyChangeListener", java.beans.PropertyChangeListener.class, new String[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); // NOI18N
eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor ( com.talent.aio.examples.im.client.ui.component.MsgTextAreaJPopupMenu.class, "vetoableChangeListener", java.beans.VetoableChangeListener.class, new String[] {"vetoableChange"}, "addVetoableChangeListener", "removeVetoableChangeListener" ); // NOI18N
}
catch(IntrospectionException e) {
e.printStackTrace();
}//GEN-HEADEREND:Events
// Here you can add code for customizing the event sets array.
return eventSets; }
示例9: ExplicitBeanInfo
import java.beans.EventSetDescriptor; //导入依赖的package包/类
public ExplicitBeanInfo(BeanDescriptor beanDescriptor,
BeanInfo[] additionalBeanInfo,
PropertyDescriptor[] propertyDescriptors,
int defaultPropertyIndex,
EventSetDescriptor[] eventSetDescriptors,
int defaultEventIndex,
MethodDescriptor[] methodDescriptors,
Image[] icons) {
this.beanDescriptor = beanDescriptor;
this.additionalBeanInfo = additionalBeanInfo;
this.propertyDescriptors = propertyDescriptors;
this.defaultPropertyIndex = defaultPropertyIndex;
this.eventSetDescriptors = eventSetDescriptors;
this.defaultEventIndex = defaultEventIndex;
this.methodDescriptors = methodDescriptors;
this.icons = icons;
}
示例10: findAddRemovePairs
import java.beans.EventSetDescriptor; //导入依赖的package包/类
void findAddRemovePairs(BeanInfoEmbryo b) throws IntrospectionException {
Enumeration listenerEnum = listenerMethods.keys();
while(listenerEnum.hasMoreElements()) {
DoubleKey k = (DoubleKey)listenerEnum.nextElement();
Method[] m = (Method[])listenerMethods.get(k);
if(m[ADD] != null && m[REMOVE] != null) {
EventSetDescriptor e = new EventSetDescriptor(Introspector.decapitalize(k.getName()),
k.getType(), k.getType().getMethods(),
m[ADD],m[REMOVE]);
e.setUnicast(ArrayHelper.contains(m[ADD].getExceptionTypes(),java.util.TooManyListenersException.class));
if(!b.hasEvent(e)) {
b.addEvent(e);
}
}
}
}
示例11: getEventSetDescriptors
import java.beans.EventSetDescriptor; //导入依赖的package包/类
/**
* Get the event set descriptors pertinent to data sources
*
* @return an <code>EventSetDescriptor[]</code> value
*/
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
try {
List<EventSetDescriptor> descriptors =
new ArrayList<EventSetDescriptor>();
for (EventSetDescriptor es : super.getEventSetDescriptors()) {
descriptors.add(es);
}
descriptors.add(new EventSetDescriptor(CSVToARFFHadoopJob.class,
"dataSet", DataSourceListener.class, "acceptDataSet"));
descriptors.add(new EventSetDescriptor(CSVToARFFHadoopJob.class, "image",
ImageListener.class, "acceptImage"));
return descriptors.toArray(new EventSetDescriptor[descriptors.size()]);
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例12: getEventSetDescriptors
import java.beans.EventSetDescriptor; //导入依赖的package包/类
/**
* Get the event set descriptors pertinent to data sources
*
* @return an <code>EventSetDescriptor[]</code> value
*/
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
try {
List<EventSetDescriptor> descriptors =
new ArrayList<EventSetDescriptor>();
for (EventSetDescriptor es : super.getEventSetDescriptors()) {
descriptors.add(es);
}
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:21,代码来源:RandomizedDataChunkHadoopJobBeanInfo.java
示例13: getEventSetDescriptors
import java.beans.EventSetDescriptor; //导入依赖的package包/类
/**
* Get the event set descriptors pertinent to data sources
*
* @return an <code>EventSetDescriptor[]</code> value
*/
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
try {
List<EventSetDescriptor> descriptors = new ArrayList<EventSetDescriptor>();
for (EventSetDescriptor es : super.getEventSetDescriptors()) {
descriptors.add(es);
}
descriptors.add(new EventSetDescriptor(WekaClassifierHadoopJob.class,
"text", TextListener.class, "acceptText"));
descriptors.add(new EventSetDescriptor(WekaClassifierHadoopJob.class,
"batchClassifier", BatchClassifierListener.class, "acceptClassifier"));
return descriptors.toArray(new EventSetDescriptor[descriptors.size()]);
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:27,代码来源:WekaClassifierHadoopJobBeanInfo.java
示例14: getEventSetDescriptors
import java.beans.EventSetDescriptor; //导入依赖的package包/类
/**
* Get the event set descriptors pertinent to data sources
*
* @return an <code>EventSetDescriptor[]</code> value
*/
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
try {
List<EventSetDescriptor> descriptors = new ArrayList<EventSetDescriptor>();
for (EventSetDescriptor es : super.getEventSetDescriptors()) {
descriptors.add(es);
}
descriptors.add(new EventSetDescriptor(
WekaClassifierEvaluationHadoopJob.class, "text", TextListener.class,
"acceptText"));
descriptors.add(new EventSetDescriptor(
WekaClassifierEvaluationHadoopJob.class, "dataSet",
DataSourceListener.class, "acceptDataSet"));
return descriptors.toArray(new EventSetDescriptor[descriptors.size()]);
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:28,代码来源:WekaClassifierEvaluationHadoopJobBeanInfo.java
示例15: getEventSetDescriptors
import java.beans.EventSetDescriptor; //导入依赖的package包/类
/**
* Get the event set descriptors pertinent to data sources
*
* @return an <code>EventSetDescriptor[]</code> value
*/
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
try {
List<EventSetDescriptor> descriptors =
new ArrayList<EventSetDescriptor>();
for (EventSetDescriptor es : super.getEventSetDescriptors()) {
descriptors.add(es);
}
descriptors.add(new EventSetDescriptor(KMeansClustererHadoopJob.class,
"text", TextListener.class, "acceptText"));
descriptors.add(new EventSetDescriptor(KMeansClustererHadoopJob.class,
"batchClusterer", BatchClustererListener.class, "acceptClusterer"));
return descriptors.toArray(new EventSetDescriptor[descriptors.size()]);
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:28,代码来源:KMeansClustererHadoopJobBeanInfo.java