/** 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
}
}
java类java.beans.EventSetDescriptor的实例源码
SerialDataNode.java 文件源码
项目:incubator-netbeans
阅读 49
收藏 0
点赞 0
评论 0
JavaIntrospector.java 文件源码
项目:myfaces-trinidad
阅读 21
收藏 0
点赞 0
评论 0
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);
}
JavaIntrospector.java 文件源码
项目:myfaces-trinidad
阅读 22
收藏 0
点赞 0
评论 0
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;
}
}
Test6311051.java 文件源码
项目:jdk8u-jdk
阅读 16
收藏 0
点赞 0
评论 0
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);
}
}
Test6976577.java 文件源码
项目:jdk8u-jdk
阅读 18
收藏 0
点赞 0
评论 0
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());
}
TestBeanInfoPriority.java 文件源码
项目:openjdk-jdk10
阅读 21
收藏 0
点赞 0
评论 0
@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;
}
Test6311051.java 文件源码
项目:openjdk-jdk10
阅读 27
收藏 0
点赞 0
评论 0
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);
}
}
Test6976577.java 文件源码
项目:openjdk-jdk10
阅读 23
收藏 0
点赞 0
评论 0
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());
}
TestBeanInfoPriority.java 文件源码
项目:openjdk9
阅读 20
收藏 0
点赞 0
评论 0
@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;
}
Test6311051.java 文件源码
项目:openjdk9
阅读 24
收藏 0
点赞 0
评论 0
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);
}
}
Test6976577.java 文件源码
项目:openjdk9
阅读 20
收藏 0
点赞 0
评论 0
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());
}
MyTextAreaBeanInfo.java 文件源码
项目:talent-aio
阅读 20
收藏 0
点赞 0
评论 0
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; }
MsgTextAreaJPopupMenuBeanInfo.java 文件源码
项目:talent-aio
阅读 19
收藏 0
点赞 0
评论 0
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; }
Test6311051.java 文件源码
项目:jdk8u_jdk
阅读 29
收藏 0
点赞 0
评论 0
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);
}
}
Test6976577.java 文件源码
项目:jdk8u_jdk
阅读 21
收藏 0
点赞 0
评论 0
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());
}
Test6311051.java 文件源码
项目:lookaside_java-1.8.0-openjdk
阅读 24
收藏 0
点赞 0
评论 0
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);
}
}
Test6976577.java 文件源码
项目:lookaside_java-1.8.0-openjdk
阅读 23
收藏 0
点赞 0
评论 0
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());
}
ExplicitBeanInfo.java 文件源码
项目:javify
阅读 21
收藏 0
点赞 0
评论 0
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;
}
IntrospectionIncubator.java 文件源码
项目:javify
阅读 32
收藏 0
点赞 0
评论 0
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);
}
}
}
}
CSVToARFFHadoopJobBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 19
收藏 0
点赞 0
评论 0
/**
* 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;
}
RandomizedDataChunkHadoopJobBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 19
收藏 0
点赞 0
评论 0
/**
* 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;
}
WekaClassifierHadoopJobBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 20
收藏 0
点赞 0
评论 0
/**
* 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;
}
WekaClassifierEvaluationHadoopJobBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 19
收藏 0
点赞 0
评论 0
/**
* 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;
}
KMeansClustererHadoopJobBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 31
收藏 0
点赞 0
评论 0
/**
* 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;
}
IncrementalClassifierEvaluatorBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 19
收藏 0
点赞 0
评论 0
/**
* Get the event set descriptors for this bean
*
* @return an <code>EventSetDescriptor[]</code> value
*/
public EventSetDescriptor [] getEventSetDescriptors() {
try {
EventSetDescriptor [] esds = {
new EventSetDescriptor(IncrementalClassifierEvaluator.class,
"chart",
ChartListener.class,
"acceptDataPoint"),
new EventSetDescriptor(IncrementalClassifierEvaluator.class,
"text",
TextListener.class,
"acceptText")
};
return esds;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
AttributeSummarizerBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 132
收藏 0
点赞 0
评论 0
/**
* Get the event set descriptors for this bean
*
* @return an <code>EventSetDescriptor[]</code> value
*/
public EventSetDescriptor [] getEventSetDescriptors() {
// hide all gui events
try {
EventSetDescriptor [] esds = {
new EventSetDescriptor(DataVisualizer.class,
"image",
ImageListener.class,
"acceptImage")
};
return esds;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
SorterBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 22
收藏 0
点赞 0
评论 0
/**
* Returns the event set descriptors
*
* @return an <code>EventSetDescriptor[]</code> value
*/
public EventSetDescriptor [] getEventSetDescriptors() {
try {
EventSetDescriptor [] esds =
{
new EventSetDescriptor(DataSource.class,
"instance",
InstanceListener.class,
"acceptInstance"),
new EventSetDescriptor(DataSource.class,
"dataSet",
DataSourceListener.class,
"acceptDataSet")
};
return esds;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
CreateListenerAction.java 文件源码
项目:intellij-ce-playground
阅读 27
收藏 0
点赞 0
评论 0
private DefaultActionGroup prepareActionGroup(final List<RadComponent> selection) {
final DefaultActionGroup actionGroup = new DefaultActionGroup();
final EventSetDescriptor[] eventSetDescriptors;
try {
BeanInfo beanInfo = Introspector.getBeanInfo(selection.get(0).getComponentClass());
eventSetDescriptors = beanInfo.getEventSetDescriptors();
}
catch (IntrospectionException e) {
LOG.error(e);
return null;
}
EventSetDescriptor[] sortedDescriptors = new EventSetDescriptor[eventSetDescriptors.length];
System.arraycopy(eventSetDescriptors, 0, sortedDescriptors, 0, eventSetDescriptors.length);
Arrays.sort(sortedDescriptors, new Comparator<EventSetDescriptor>() {
public int compare(final EventSetDescriptor o1, final EventSetDescriptor o2) {
return o1.getListenerType().getName().compareTo(o2.getListenerType().getName());
}
});
for(EventSetDescriptor descriptor: sortedDescriptors) {
actionGroup.add(new MyCreateListenerAction(selection, descriptor));
}
return actionGroup;
}
JoinBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 24
收藏 0
点赞 0
评论 0
/**
* Returns the event set descriptors
*
* @return an <code>EventSetDescriptor[]</code> value
*/
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
try {
EventSetDescriptor[] esds =
{
new EventSetDescriptor(DataSource.class, "instance",
InstanceListener.class, "acceptInstance"),
new EventSetDescriptor(DataSource.class, "dataSet",
DataSourceListener.class, "acceptDataSet") };
return esds;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
AbstractTrainAndTestSetProducerBeanInfo.java 文件源码
项目:repo.kmeanspp.silhouette_score
阅读 76
收藏 0
点赞 0
评论 0
public EventSetDescriptor [] getEventSetDescriptors() {
try {
EventSetDescriptor [] esds = {
new EventSetDescriptor(TrainingSetProducer.class,
"trainingSet",
TrainingSetListener.class,
"acceptTrainingSet"),
new EventSetDescriptor(TestSetProducer.class,
"testSet",
TestSetListener.class,
"acceptTestSet") };
return esds;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}