本文整理了Java中javax.swing.JComponent.addImpl()
方法的一些代码示例,展示了JComponent.addImpl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.addImpl()
方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:addImpl
暂无
代码示例来源:origin: com.jidesoft/jide-oss
/**
* If the specified component is already a child of this then we don't bother doing anything - stacking order doesn't matter for cell renderer components (CellRendererPane doesn't paint anyway).<
*/
@Override
protected void addImpl(Component x, Object constraints, int index) {
if (x.getParent() == this) {
return;
}
else {
super.addImpl(x, constraints, index);
}
}
代码示例来源:origin: com.harium.propan/propan-jogl
@Override
protected void addImpl(Component comp, Object constraints, int index) {
if (comp == canvas || comp == drawableComponent) {
super.addImpl(comp, constraints, index);
} else {
throw new IllegalArgumentException("Do not add component to this. Add them to the object in getDrawableComponent()");
}
}
代码示例来源:origin: brandonborkholder/glg2d
@Override
protected void addImpl(Component comp, Object constraints, int index) {
if (comp == canvas || comp == drawableComponent) {
super.addImpl(comp, constraints, index);
} else {
throw new IllegalArgumentException("Do not add component to this. Add them to the object in getDrawableComponent()");
}
}
代码示例来源:origin: org.metawidget.modules.swing/metawidget-swing
@Override
protected void addImpl( Component component, Object constraints, int index ) {
if ( !mIgnoreAddRemove ) {
invalidateWidgets();
// Don't fall through to super.addImpl for facets. Tuck them away
// in mFacets instead. Some layouts may never use them, and
// others (eg. MigLayout) don't like adding components
// without constraints
if ( component instanceof Facet ) {
mFacets.put( component.getName(), (Facet) component );
return;
}
if ( component instanceof JComponent ) {
mExistingComponents.add( (JComponent) component );
}
}
super.addImpl( component, constraints, index );
}
代码示例来源:origin: org.metawidget.modules/metawidget-all
@Override
protected void addImpl( Component component, Object constraints, int index ) {
if ( !mIgnoreAddRemove ) {
invalidateWidgets();
// Don't fall through to super.addImpl for facets. Tuck them away
// in mFacets instead. Some layouts may never use them, and
// others (eg. MigLayout) don't like adding components
// without constraints
if ( component instanceof Facet ) {
mFacets.put( component.getName(), (Facet) component );
return;
}
if ( component instanceof JComponent ) {
mExistingComponents.add( (JComponent) component );
}
}
super.addImpl( component, constraints, index );
}
代码示例来源:origin: com.jidesoft/jide-oss
/**
* Ensures that, by default, children cannot be added directly to this component. Instead, children must be added to
* its content pane. For example:
* <pre>
* thisComponent.getContentPane().add(child)
* </pre>
* An attempt to add to directly to this component will cause a runtime exception to be thrown. Subclasses can
* disable this behavior.
*
* @param comp the <code>Component</code> to be added
* @param constraints the object containing the constraints, if any
* @param index the index
* @throws Error if called with <code>isRootPaneChecking</code> <code>true</code>
* @see #setRootPaneCheckingEnabled
*/
@Override
protected void addImpl(Component comp, Object constraints, int index) {
if (isRootPaneCheckingEnabled()) {
getContentPane().add(comp, constraints, index);
}
else {
super.addImpl(comp, constraints, index);
}
}
代码示例来源:origin: JetBrains/jediterm
@Override
protected void addImpl(final Component comp, final Object constraints, final int index) {
unqueueFromRemove(comp);
if (comp instanceof TabLabel) {
((TabLabel) comp).apply(myUiDecorator.getDecoration());
}
super.addImpl(comp, constraints, index);
}
代码示例来源:origin: org.icepdf.os/icepdf-viewer
/**
* Sets the {@code JXLayer}'s glassPane component, which can be {@code null}.
* <br/>This is a bound property.
*
* @param glassPane the glassPane component of this {@code JXLayer}
* @see #getGlassPane()
*/
public void setGlassPane(JPanel glassPane) {
Container oldGlassPane = getGlassPane();
if (oldGlassPane != null) {
super.remove(oldGlassPane);
}
if (glassPane != null) {
super.addImpl(glassPane, null, 0);
}
this.glassPane = glassPane;
firePropertyChange("glassPane", oldGlassPane, glassPane);
revalidate();
repaint();
}
代码示例来源:origin: org.icepdf.os/icepdf-viewer
/**
* Sets the {@code JXLayer}'s view component, which can be {@code null}.
* <br/>This is a bound property.
*
* @param view the view component for this {@code JXLayer}
* @see #getView()
*/
public void setView(V view) {
Component oldView = getView();
if (oldView != null) {
super.remove(oldView);
}
if (view != null) {
super.addImpl(view, null, getComponentCount());
}
this.view = view;
firePropertyChange("view", oldView, view);
revalidate();
repaint();
}
内容来源于网络,如有侵权,请联系作者删除!