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


Java Component.getClass方法代码示例

本文整理汇总了Java中java.awt.Component.getClass方法的典型用法代码示例。如果您正苦于以下问题:Java Component.getClass方法的具体用法?Java Component.getClass怎么用?Java Component.getClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Component的用法示例。


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

示例1: createOperator

import java.awt.Component; //导入方法依赖的package包/类
/**
 * Creates operator for component. Tries to find class with "operator
 * package"."class name"Operator name, where "operator package" is a package
 * from operator packages list, and "class name" is the name of class or one
 * of its superclasses.
 *
 * @param comp Component to create operator for.
 * @return a new operator with default environment.
 * @see #addOperatorPackage(String)
 */
public static ComponentOperator createOperator(Component comp) {
    //hack!
    try {
        Class<?> cclass = Class.forName("java.awt.Component");
        Class<?> compClass = comp.getClass();
        ComponentOperator result;
        do {
            if ((result = createOperator(comp, compClass)) != null) {
                return result;
            }
        } while (cclass.isAssignableFrom(compClass = compClass.getSuperclass()));
    } catch (ClassNotFoundException ignored) {
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:Operator.java

示例2: addFocusListener

import java.awt.Component; //导入方法依赖的package包/类
private void addFocusListener(Component C) {
    C.getClass();
    super.getComponent().addFocusListener(
        new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent fe) {
                lostFocus();
            }
        });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ParameterizedQueryDialog.java

示例3: checkComponent

import java.awt.Component; //导入方法依赖的package包/类
public boolean checkComponent(Component comp) {
           Class cls = comp.getClass();
           do {
               if(cls.getName().equals("org.openide.explorer.view.TreeTable")) {
                   return(subFinder.checkComponent(comp));
               }
           } while((cls = cls.getSuperclass()) != null);
    return(false);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:TreeTableOperator.java

示例4: checkComponent

import java.awt.Component; //导入方法依赖的package包/类
@Override
public boolean checkComponent(Component comp) {
    Class cls = comp.getClass();
    do {
        if (cls.getName().equals("org.netbeans.swing.outline.Outline")) {
            return (subFinder.checkComponent(comp));
        }
    } while ((cls = cls.getSuperclass()) != null);
    return (false);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:OutlineOperator.java

示例5: checkComponent

import java.awt.Component; //导入方法依赖的package包/类
public boolean checkComponent(Component comp) {
           Class cls = comp.getClass();
           do {
               if(cls.getName().equals("org.openide.explorer.view.OutlineView")) {
                   return(subFinder.checkComponent(comp));
               }
           } while((cls = cls.getSuperclass()) != null);
    return(false);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:OutlineViewOperator.java

示例6: get

import java.awt.Component; //导入方法依赖的package包/类
private static <T> T get(Class<? extends T> type, Container container) {
    Component component = container.getComponent(0);
    if (!type.isAssignableFrom(component.getClass())) {
        throw new IllegalStateException("expected " + type + "; expected " + component.getClass());
    }
    return (T) component;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:Test6817933.java

示例7: ComponentNode

import java.awt.Component; //导入方法依赖的package包/类
public ComponentNode(Component comp) {
    super(comp.getClass());
    try {
        props = Operator.createOperator(comp).getDump();
    } catch (Exception e) {
        props = new Hashtable<>();
    }
    clss = comp.getClass().getName();
    compToString = comp.toString();
    this.comp = comp;
    x = comp.getLocationOnScreen().x;
    y = comp.getLocationOnScreen().y;
    w = comp.getWidth();
    h = comp.getHeight();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:GUIBrowser.java

示例8: ExtendedJFileChooser

import java.awt.Component; //导入方法依赖的package包/类
/**
 * Constructs
 * 
 * @param objPcontrolJFrame
 * @param strPtitle
 * @param bolPsave
 * @param objPfileFilterA
 */
public ExtendedJFileChooser(ControlJFrame objPcontrolJFrame,
							String strPtitle,
							Window objPcenteringReferenceWindow,
							boolean bolPsave,
							javax.swing.filechooser.FileFilter... objPfileFilterA) {

	this.objGcontrolJFrame = objPcontrolJFrame;
	this.objGcenteringReferenceWindow = objPcenteringReferenceWindow;
	try {
		ExtendedJFileChooser.strS_LOADING_PATH =
													ExtendedJFileChooser.strS_SAVING_PATH =
																							new File(	objPcontrolJFrame.getJuggleMasterPro().strS_CODE_BASE,
																										Constants.strS_FILE_NAME_A[Constants.intS_FILE_FOLDER_DATA]).getAbsolutePath();
	} catch (final Throwable objPthrowable) {
		Tools.err("Error while setting default paths");
	}

	this.objGparentJFrame = new JFrame();
	this.objGparentJFrame.setIconImage(this.objGcontrolJFrame.getJuggleMasterPro().getFrame().imgGjmp);
	this.setDialogTitle(strPtitle);
	this.setAcceptAllFileFilterUsed(true);
	this.setFont(this.objGcontrolJFrame.getFont());

	for (final javax.swing.filechooser.FileFilter objLfileFilter : objPfileFilterA) {
		this.addChoosableFileFilter(objLfileFilter);
	}
	if (objPfileFilterA.length > 0) {
		this.setFileFilter(objPfileFilterA[0]);
	}
	this.setFileView(new ExtendedFileView(objPcontrolJFrame));
	this.setCurrentDirectory(new File(bolPsave ? ExtendedJFileChooser.strS_SAVING_PATH : ExtendedJFileChooser.strS_LOADING_PATH));
	this.setDialogType(bolPsave ? JFileChooser.SAVE_DIALOG : JFileChooser.OPEN_DIALOG);

	if (!Preferences.getGlobalBooleanPreference(Constants.bytS_BOOLEAN_GLOBAL_BUTTONS_TOOLTIPS)) {
		for (final Component objLcomponent : this.getComponents()) {
			final Class<?> objLclass = objLcomponent.getClass();
			for (final Class<?> objLinterface : objLclass.getInterfaces()) {
				if (objLinterface.getName() == "ItemSelectable") {
					((JComponent) objLcomponent).setToolTipText(null);
				}
			}
		}
	}
	// ExtendedJFileChooser.setNewFolderButtonEnable(this, !bolPsave);
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:54,代码来源:ExtendedJFileChooser.java


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