本文整理汇总了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;
}
示例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();
}
});
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}