当前位置: 首页>>代码示例>>Java>>正文


Java UIDescriptor类代码示例

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


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

示例1: getSelectedUIDescriptor

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
private UIDescriptor getSelectedUIDescriptor() {

            if (!(new ServiceListItem(item)).isUI()) {
                return null;
            }

            Entry[] attrs = item.attributeSets;
            if ((attrs != null) && (attrs.length != 0)) {
                for (int i = 0; i < attrs.length; i++) {
                    if (attrs[i] instanceof UIDescriptor) {
                        UIDescriptor desc = (UIDescriptor) attrs[i];
                        if (!"javax.swing".equals(desc.toolkit)) {
                            continue;
                        }
                        return desc;
                    }
                }
            }
            return null;
        }
 
开发者ID:apache,项目名称:river-container,代码行数:21,代码来源:Browser.java

示例2: actionPerformed

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public void actionPerformed(ActionEvent anEvent) {

	    UIDescriptor uiDescriptor = getSelectedUIDescriptor();

	    if (uiDescriptor == null) {
		return;
	    }

	    try {
		JFrameFactory uiFactory = (JFrameFactory)
		    uiDescriptor.getUIFactory(Thread.currentThread().getContextClassLoader());
		JFrame frame = uiFactory.getJFrame(serviceItem);

		frame.validate();
		frame.setVisible(true);
	    }
	    catch (Exception e) {
		e.printStackTrace();

		return;
	    }
	}
 
开发者ID:apache,项目名称:river-container,代码行数:23,代码来源:ServiceBrowser.java

示例3: mouseReleased

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public void mouseReleased(MouseEvent ev) {

	    higlightSelection(ev);

	    if (!ev.isPopupTrigger()) {
		return;
	    }

	    UIDescriptor selectedDescriptor = getSelectedUIDescriptor();

	    if (selectedDescriptor == null) {
		return;
	    }

	    if (!"javax.swing".equals(selectedDescriptor.toolkit)) {
		return;
	    }

	    popup.setServiceItem(serviceItem);
	    popup.show(ev.getComponent(), ev.getX(), ev.getY());
	}
 
开发者ID:apache,项目名称:river-container,代码行数:22,代码来源:ServiceBrowser.java

示例4: mousePressed

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public void mousePressed(MouseEvent ev) {

	    higlightSelection(ev);

	    if (!ev.isPopupTrigger()) {
		return;
	    }

	    UIDescriptor selectedDescriptor = getSelectedUIDescriptor();

	    if (selectedDescriptor == null) {
		return;
	    }

	    if (!"javax.swing".equals(selectedDescriptor.toolkit)) {
		return;
	    }

	    popup.setServiceItem(serviceItem);
	    popup.show(ev.getComponent(), ev.getX(), ev.getY());
	}
 
开发者ID:apache,项目名称:river-container,代码行数:22,代码来源:ServiceBrowser.java

示例5: getSelectedUIDescriptor

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
private UIDescriptor getSelectedUIDescriptor() {

	ObjectNode selectedNode =
		(ObjectNode) attrPanel.tree.getLastSelectedPathComponent();

	if (selectedNode == null) {
	    return null;
	}

	Object selectedObject = selectedNode.getObject();

	try {
	    return (UIDescriptor) selectedObject;
	}
	catch (ClassCastException e) {
	    return null;
	}
    }
 
开发者ID:apache,项目名称:river-container,代码行数:19,代码来源:ServiceBrowser.java

示例6: printLookupAttributes

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
static public void printLookupAttributes(Entry[] attributeSets)
		throws IOException, ClassNotFoundException {
	if (attributeSets.length > 0) {
		PrintStream out = NetworkShell.getShellOutputStream();
		out.println("Lookup attributes:");
		for (int k = 0; k < attributeSets.length; k++) {
			if (attributeSets[k] instanceof UIDescriptor) {
				out.println("  "
				// + attributeSets[k].getClass()
				// + "UIDescriptor: "
						+ ((UIDescriptor) attributeSets[k]).factory
								.get());
			} else if (attributeSets[k] instanceof SorcerServiceInfo) {
				printSorcerServiceInfo((SorcerServiceInfo) attributeSets[k]);
			} else {
				if (attributeSets[k] instanceof AbstractEntry) {
					out.println("  "
							+ toShortString((AbstractEntry) attributeSets[k]));
				} else {
					out.println("  " + attributeSets[k]);
				}
			}
		}
	}
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:26,代码来源:NetworkShell.java

示例7: getMainUIDescriptor

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
/**
    * Returns a service UI descriptor for LoggerManagerUI. The service
    * UI allows for viewing remote logs of selected providers.
    */
/*
 * (non-Java doc)
 *
 * @see sorcer.core.provider.ServiceProvider#getMainUIDescriptor()
 */
   public static UIDescriptor getMainUIDescriptor() {
       UIDescriptor uiDesc = null;
       try {
           URL uiUrl = new URL(Sorcer.getWebsterUrl() + "/sos-logger-"+ SOS.getSorcerVersion()+"-ui.jar");
           URL helpUrl = new URL(Sorcer.getWebsterUrl() + "/logger.html");

           uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
                   (JFrameFactory) new UIFrameFactory(new URL[]{uiUrl},
                           LoggerFrameUI.class
                                   .getName(),
                           "Log Viewer",
                           helpUrl));
       } catch (Exception ex) {
           ex.printStackTrace();
       }
       return uiDesc;
   }
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:27,代码来源:RemoteLoggerManager.java

示例8: isUI

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
private boolean isUI() {
    Entry[] attrs = item.attributeSets;
    if ((attrs != null) && (attrs.length != 0)) {
        for (int i = 0; i < attrs.length; i++) {
            if (attrs[i] instanceof UIDescriptor) {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:apache,项目名称:river-container,代码行数:13,代码来源:Browser.java

示例9: getUIDescriptor

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
/**
 * Returns a service UI descriptor for this service. Usually this method is
 * used as an entry in provider configuration files when smart proxies are
 * deployed with a standard off the shelf {@link sorcer.core.provider.ServiceProvider}.
 *
 * @return service UI descriptor
 */
public static UIDescriptor getUIDescriptor() {
	UIDescriptor uiDesc = null;
	try {
		String serverVersion = System.getProperty("sorcer.version");
		uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
				new UIComponentFactory(new URL[] { new URL(Sorcer.getWebsterUrl() + "/adder-" + serverVersion + "-ui.jar") },
						AdderUI.class.getName()));
	} catch (Exception ex) {
		logger.warn("getCalculatorDescriptor", ex);
	}
	return uiDesc;
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:20,代码来源:AdderUI.java

示例10: getCalculatorDescriptor

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
/**
 * Returns a service UI descriptorfor this service. Usally this method is
 * used as an entry in provider configuration files when smart proxies are
 * deployed with a standard off the shelf {@link ServiceProvider}.
 * 
 * @return service UI descriptor
 */
public static UIDescriptor getCalculatorDescriptor() {
	UIDescriptor uiDesc = null;
	try {
		uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
				new UIComponentFactory(new URL[] { new URL(Sorcer
						.getWebsterUrl()
						+ "/calculator-ui.jar") }, CalculatorUI.class
						.getName()));
	} catch (Exception ex) {
		logger.warn("getCalculatorDescriptor", ex);
	}
	return uiDesc;
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:21,代码来源:CalculatorUI.java

示例11: getCalculatorDescriptor

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public static UIDescriptor getCalculatorDescriptor() {
	UIDescriptor uiDesc = null;
	try {
		uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
				new UIComponentFactory(new URL[] { new URL(Sorcer
						.getWebsterUrl()
						+ "/calculator-ui.jar") }, CalculatorUI.class
						.getName()));
	} catch (Exception ex) {
		// do nothing
	}
	return uiDesc;
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:14,代码来源:AdderProvider.java

示例12: getMainUIDescriptor

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public UIDescriptor getMainUIDescriptor() {
      UIDescriptor uiDesc = null;
      try {
          URL uiUrl = new URL(Sorcer.getWebsterUrl() + "/sos-cataloger-"+ SOS.getSorcerVersion()+"-ui.jar");
          uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
                                                       new UIFrameFactory(new URL[]{uiUrl},
                                                                          CatalogerUI.class.getName(),
                                                                          "Cataloger UI",
                                                                          null));
      } catch (Exception ex) {
	logger.warn("Could not create UI descriptor", ex);
}
      return uiDesc;
  }
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:15,代码来源:ServiceCataloger.java

示例13: getUIRoles

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
private Object[] getUIRoles(Entry atts[]) {
	java.util.List list = new ArrayList();
	for (int i = 0; atts != null && i < atts.length; i++)
		if (atts[i] instanceof UIDescriptor) {
			UIDescriptor desc = (UIDescriptor) atts[i];
			if (desc.role != null)
				list.add(desc.role);
		}

	return list.toArray();
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:12,代码来源:AdminView.java

示例14: getProviderUIDescriptor

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public static UIDescriptor getProviderUIDescriptor() {
	UIDescriptor descriptor = null;
	try {
		descriptor = UIDescriptorFactory.getUIDescriptor(
				MainUI.ROLE,
				new UIComponentFactory(new URL[] { new URL(String.format("%s/sorcer-ui-%s.jar",
						Sorcer.getWebsterUrl(),
						SOS.getSorcerVersion()))
				},
						"sorcer.ui.provider.ProviderUI"));
	} catch (Exception ex) {
		logger.debug("getServiceUI", ex);
	}
	return descriptor;
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:16,代码来源:ServiceProvider.java

示例15: getServiceUIEntries

import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
/**
	 * Returns an array of additional service UI descriptors to be included in a
	 * Jini service item that is registerd with lookup services. By default a
	 * generic ServiceProvider service UI is provided with: attribute viewer,
	 * context and task editor for this service provider.
	 *
	 * @return an array of service UI descriptors
	 */
	public UIDescriptor[] getServiceUIEntries() {
		// Service UI as a panel of the ServiceBrowser
//		UIDescriptor uiDesc1 = null;
//		try {
//			uiDesc1 = UIDescriptorFactory.getUIDescriptor(
//					MainUI.ROLE,
//					new UIComponentFactory(new URL[] {new URL(String.format("%s/sorcer-ui-%s.jar",
//							Sorcer.getWebsterUrl(),
//							SOS.getSorcerVersion()))
//					},
//							"sorcer.ui.exertlet.NetletEditor"));
//		} catch (Exception ex) {
//			logger.debug("getServiceUI", ex);
//		}

		// Service UI as a standalone frame is the ServiceBrowser
		UIDescriptor uiDesc2 = null;
		try {
			URL uiUrl = new URL(Sorcer.getWebsterUrl() + "/exertlet-ui.jar");
			URL helpUrl = new URL(Sorcer.getWebsterUrl()
					+ "/exertlet/exertlet-ui.html");

			// URL exportUrl, String className, String name, String helpFilename
			uiDesc2 = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
					(JFrameFactory) new UIFrameFactory(new URL[] { uiUrl },
							"sorcer.ui.exertlet.NetletUI", "Netlet Editor",
							helpUrl));
		} catch (Exception ex) {
			logger.debug("getServiceUI", ex);
		}

		return new UIDescriptor[] { getProviderUIDescriptor(), uiDesc2 };
	}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:42,代码来源:ServiceProvider.java


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