本文整理了Java中javax.swing.JComponent.getUIClassID()
方法的一些代码示例,展示了JComponent.getUIClassID()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.getUIClassID()
方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:getUIClassID
暂无
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
private int getButtonAdjustment(JComponent source, int edge) {
String uid = source.getUIClassID();
if (uid == "ButtonUI" || uid == "ToggleButtonUI") {
if (!isOcean && (edge == SwingConstants.EAST ||
edge == SwingConstants.SOUTH)) {
return 1;
}
}
else if (edge == SwingConstants.SOUTH) {
if (uid == "RadioButtonUI" || (!isOcean && uid == "CheckBoxUI")) {
return 1;
}
}
return 0;
}
代码示例来源:origin: com.haulmont.thirdparty/swingx-core
/**
* Returns a region appropriate for the component.
*
* @param component the component to get the region for
* @param useParent a boolean indicating whether or not to return a fallback
* of the XRegion, if available
* @return a region for the component or null if not available.
*/
public static Region getXRegion(JComponent component, boolean useParent) {
XRegion region = uiToXRegionMap.get(component.getUIClassID());
if (region != null)
return useParent && region.parent != null ? region.parent : region;
return region;
}
}
代码示例来源:origin: org.swinglabs.swingx/swingx-core
/**
* Returns a region appropriate for the component.
*
* @param component the component to get the region for
* @param useParent a boolean indicating whether or not to return a fallback
* of the XRegion, if available
* @return a region for the component or null if not available.
*/
public static Region getXRegion(JComponent component, boolean useParent) {
XRegion region = uiToXRegionMap.get(component.getUIClassID());
if (region != null)
return useParent && region.parent != null ? region.parent : region;
return region;
}
}
代码示例来源:origin: org.swinglabs.swingx/swingx-all
/**
* Returns a region appropriate for the component.
*
* @param component the component to get the region for
* @param useParent a boolean indicating whether or not to return a fallback
* of the XRegion, if available
* @return a region for the component or null if not available.
*/
public static Region getXRegion(JComponent component, boolean useParent) {
XRegion region = uiToXRegionMap.get(component.getUIClassID());
if (region != null)
return useParent && region.parent != null ? region.parent : region;
return region;
}
}
代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core
/**
* Returns a region appropriate for the component.
*
* @param component the component to get the region for
* @param useParent a boolean indicating whether or not to return a fallback
* of the XRegion, if available
* @return a region for the component or null if not available.
*/
public static Region getXRegion(JComponent component, boolean useParent) {
XRegion region = uiToXRegionMap.get(component.getUIClassID());
if (region != null)
return useParent && region.parent != null ? region.parent : region;
return region;
}
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
private static boolean isInTabbedContainer( Component c ) {
Component parent = c.getParent();
while( null != parent ) {
if( parent instanceof JComponent
&& "TabbedContainerUI".equals( ((JComponent)parent).getUIClassID() ) ) //NOI18N
return true;
parent = parent.getParent();
}
return false;
}
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
private int getCBRBPadding(JComponent c, int position) {
if (c.getUIClassID() == "CheckBoxUI" ||
c.getUIClassID() == "RadioButtonUI") {
Border border = c.getBorder();
if (border instanceof UIResource) {
return getInset(c, position);
}
}
return 0;
}
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
private Insets getContainerGap(Container container, int sizeStyle) {
String uid;
if (container instanceof JComponent) {
uid = ((JComponent) container).getUIClassID();
} else if (container instanceof Dialog) {
uid = "Dialog";
} else if (container instanceof Frame) {
uid = "Frame";
} else if (container instanceof java.applet.Applet) {
uid = "Applet";
} else if (container instanceof Panel) {
uid = "Panel";
} else {
uid = "default";
}
// FIXME insert style code here for JInternalFrame with palette style
return getInsets(CONTAINER_GAPS, uid, null, sizeStyle);
}
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
boolean sourceLabel = (source.getUIClassID() == "LabelUI");
boolean targetLabel = (target.getUIClassID() == "LabelUI");
if ((sourceLabel && !targetLabel) ||
(!sourceLabel && targetLabel)) {
代码示例来源:origin: com.l2fprod.common/l2fprod-common-shared
String uiClassname = (String)UIManager.get(component.getUIClassID());
try {
Class uiClass = Class.forName(uiClassname);
代码示例来源:origin: stackoverflow.com
package javax.swing;
import java.io.IOException;
import java.io.ObjectOutputStream;
import javax.accessibility.Accessible;
public class JMButton extends AbstractButton implements Accessible {
private static final String uiClassID = "JMButtonUI";
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
if (getUIClassID().equals(uiClassID)) {
byte count = JComponent.getWriteObjCounter(this);
JComponent.setWriteObjCounter(this, --count);
if (count == 0 && ui != null) {
ui.installUI(this);
}
}
}
}
代码示例来源:origin: com.jidesoft/jide-oss
if ("DockableFrameUI".equals(((JComponent) c).getUIClassID()) && c.getParent().getComponentCount() > 1) {
g.setColor(UIDefaultsLookup.getColor("JideTabbedPane.selectedTabBackground"));
g.drawLine(x + 2, y + height - 1, x + width - 2, y + height - 1);
代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop
String uiClassname = (String)UIManager.get(component.getUIClassID());
logger.warning("Failed to retrieve UI for " + component.getClass().getName() + " with UIClassID " + component.getUIClassID());
if (logger.isLoggable(Level.FINE)) {
logger.fine("Existing UI defaults keys: "
代码示例来源:origin: org.swinglabs.swingx/swingx-plaf
String uiClassname = (String) UIManager.get(component.getUIClassID());
+ " with UIClassID " + component.getUIClassID());
if (logger.isLoggable(Level.FINE)) {
logger.fine("Existing UI defaults keys: "
代码示例来源:origin: com.jidesoft/jide-oss
@Override
public ComponentUI getUI(JComponent target) {
UIDefaults defaults = UIManager.getDefaults();
// to increase the performance, UIManager is caching the
// className <--> class definition object
// It does not differentiate between classNames from different class loaders
// This means that the cached class definition may not match the current
// classloader and will cause ClassCastException later on.
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4675772
String className = (String) defaults.get(target.getUIClassID());
Class componentUIClass = className != null ? (Class) defaults.get(className) : null;
ClassLoader componentUIClassLoader = componentUIClass != null ? componentUIClass.getClassLoader() : null;
ClassLoader targetClassLoader = target.getClass().getClassLoader();
ClassLoader uiClassLoader = (ClassLoader) UIManager.get("ClassLoader");
if (targetClassLoader == null) { // for JMenuItem and JPopupMenu.Separator
if (componentUIClassLoader != null && componentUIClassLoader != uiClassLoader) {
removeCachedClass(defaults, componentUIClass);
}
return null;
}
if (targetClassLoader != componentUIClassLoader ||
targetClassLoader != uiClassLoader) {
if (componentUIClassLoader != null) {
removeCachedClass(defaults, componentUIClass);
}
installJideExtension(targetClassLoader);
}
return null;
}
}
代码示例来源:origin: org.swinglabs.swingx/swingx-all
String uiClassname = (String) UIManager.get(component.getUIClassID());
+ " with UIClassID " + component.getUIClassID());
if (logger.isLoggable(Level.FINE)) {
logger.fine("Existing UI defaults keys: "
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
private Insets getVisualMargin(JComponent component) {
String uid = component.getUIClassID();
String style = null;
if (uid == "ButtonUI" || uid == "ToggleButtonUI") {
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
boolean sourceLabel = (source.getUIClassID() == "LabelUI");
boolean targetLabel = (target.getUIClassID() == "LabelUI");
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
String uid = component.getUIClassID();
String style = null;
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
return -1;
String uid = component.getUIClassID();
int baseline = -1;
if (uid == "ButtonUI" || uid == "CheckBoxUI" ||
内容来源于网络,如有侵权,请联系作者删除!