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


Java Container.getParent方法代码示例

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


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

示例1: formAncestorAdded

import java.awt.Container; //导入方法依赖的package包/类
private void formAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_formAncestorAdded
    if (addedUndoListener) {
        return;
    }
    addedUndoListener = true;
    if (evt.getComponent() instanceof Container) {
        Container anc = (Container) evt.getComponent();
        while (anc != null && anc instanceof Container) {
            if (anc instanceof UndoableEditListener) {
                editSupport.addUndoableEditListener((UndoableEditListener) anc);
                break;
            }
            anc = anc.getParent();
        }
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:VPotSliderTextControl.java

示例2: getContainers

import java.awt.Container; //导入方法依赖的package包/类
/**
 * Returns an array of containers for this component.
 *
 * @return an array of containers
 */
public Container[] getContainers() {
    int counter = 0;
    Container cont = getSource().getParent();
    if (cont == null) {
        return new Container[0];
    }
    do {
        counter++;
    } while ((cont = cont.getParent()) != null);
    Container[] res = new Container[counter];
    cont = getSource().getParent();
    counter = 0;
    do {
        counter++;
        res[counter - 1] = cont;
    } while ((cont = cont.getParent()) != null);
    return res;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:ComponentOperator.java

示例3: findContextHeirarchy

import java.awt.Container; //导入方法依赖的package包/类
public JSONObject findContextHeirarchy(Container parent) {
    JSONObject r = null;
    JSONObject current = null;
    while (parent != null && !(parent instanceof Window)) {
        if (ContextManager.isContext(parent)) {
            JSONObject pContext = getContextJSONObject(parent);
            if (r == null) {
                r = pContext;
            }
            if (current != null) {
                current.put("container", pContext);
            }
            current = pContext;
        }
        parent = parent.getParent();
    }
    return addWindowParents(r, (Window) parent, current);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:RComponent.java

示例4: updateColumnSelectionMouseListener

import java.awt.Container; //导入方法依赖的package包/类
/**
 * This method update mouse listener on the scrollPane if it is needed.
 * It also recomputes the model of searchCombo. Both actions are needed after
 * the set of visible columns is changed.
 */
void updateColumnSelectionMouseListener() {
    Container p = getParent();
    if (p instanceof JViewport) {
        Container gp = p.getParent();
        if (gp instanceof JScrollPane) {
            JScrollPane scrollPane = (JScrollPane)gp;
            // Make certain we are the viewPort's view and not, for
            // example, the rowHeaderView of the scrollPane -
            // an implementor of fixed columns might do this.
            JViewport viewport = scrollPane.getViewport();
            if (viewport == null || viewport.getView() != this) {
                return;
            }
            scrollPane.removeMouseListener(columnSelectionMouseListener);
            if (getColumnModel().getColumnCount() == 0) {
                scrollPane.addMouseListener(columnSelectionMouseListener);
            }
        }
    }
    if (searchCombo != null) {
        searchCombo.setModel(getSearchComboModel());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:ETable.java

示例5: formAncestorAdded

import java.awt.Container; //导入方法依赖的package包/类
private void formAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_formAncestorAdded
            if (addedUndoListener) {
                return;
            }
            addedUndoListener = true;
            if (evt.getComponent() instanceof Container) {
                Container anc = (Container) evt.getComponent();
                while (anc != null && anc instanceof Container) {
                    if (anc instanceof UndoableEditListener) {
                        editSupport.addUndoableEditListener((UndoableEditListener) anc);
                        break;
                    }
                    anc = anc.getParent();
                }
            }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:IPotSliderTextControl.java

示例6: addNotify

import java.awt.Container; //导入方法依赖的package包/类
/**
	 *	Assigns the scrollPane.
	 */
	public void addNotify() {
		super.addNotify();
		Container c = getParent();
		while(c != null) {
			if( c instanceof JScrollPane ) {
				scrollPane = (JScrollPane) c;

//				***** GMA 1.6.4: Add adjustment listeners to scroll bars to perform pan
				scrollPane.getHorizontalScrollBar().addAdjustmentListener(this);
				scrollPane.getVerticalScrollBar().addAdjustmentListener(this);

				return;
			}
			c = c.getParent();
		}
	}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:20,代码来源:XMap.java

示例7: unconfigureEnclosingScrollPane

import java.awt.Container; //导入方法依赖的package包/类
@Override
protected void unconfigureEnclosingScrollPane() {
	Container p = getParent();
	if (p instanceof JViewport) {
		Container gp = p.getParent();
		if (gp instanceof JScrollPane) {
			JScrollPane scrollPane = (JScrollPane) gp;
			// Make certain we are the viewPort's view and not, for
			// example, the rowHeaderView of the scrollPane -
			// an implementor of fixed columns might do this.
			JViewport viewport = scrollPane.getViewport();
			if (viewport == null || viewport.getView() != this) {
				return;
			}
			scrollPane.setColumnHeaderView(null);
			scrollPane.setRowHeaderView(null);

			viewport.removeChangeListener(scrollListener);
			rowHeader.uninstall();
		}
	}
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:23,代码来源:ExactTable.java

示例8: alloyRepaint

import java.awt.Container; //导入方法依赖的package包/类
/** Repaint this component. */
public void alloyRepaint() {
	Container c = getParent();
	while (c != null) {
		if (c instanceof JViewport)
			break;
		else
			c = c.getParent();
	}
	setSize((int) (graph.getTotalWidth() * scale), (int) (graph.getTotalHeight() * scale));
	if (c != null) {
		c.invalidate();
		c.repaint();
		c.validate();
	} else {
		invalidate();
		repaint();
		validate();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:21,代码来源:GraphViewer.java

示例9: addViewportListener

import java.awt.Container; //导入方法依赖的package包/类
private void addViewportListener(JEditorPane pane) {
    Container parent = pane.getParent();
    
    if (parent instanceof JLayeredPane) {
        parent = parent.getParent();
    }

    if (parent instanceof JViewport) {
        JViewport viewport = (JViewport) parent;

        viewport.addChangeListener(WeakListeners.change(AnnotationHolder.this, viewport));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:AnnotationHolder.java

示例10: getApplication

import java.awt.Container; //导入方法依赖的package包/类
private Application getApplication() {
	Container parent = this.getTopLevelAncestor();
	if(parent instanceof Application)
		return (Application)parent;
	parent = this.getParent();
	while((parent=parent.getParent())!=null)
		if(parent instanceof Application)
			break;
	return parent!=null?(Application)parent:null;
}
 
开发者ID:kristian,项目名称:JDigitalSimulator,代码行数:11,代码来源:Simulation.java

示例11: configureEnclosingScrollPane

import java.awt.Container; //导入方法依赖的package包/类
/**
 * duplicated to avoid repeating the same checks multiple times
 */
@Override
protected void configureEnclosingScrollPane() {
	Container p = getParent();
	if (p instanceof JViewport) {
		Container gp = p.getParent();
		if (gp instanceof JScrollPane) {
			JScrollPane scrollPane = (JScrollPane) gp;
			// Make certain we are the viewPort's view and not, for
			// example, the rowHeaderView of the scrollPane -
			// an implementor of fixed columns might do this.
			JViewport viewport = scrollPane.getViewport();
			if (viewport == null || viewport.getView() != this) {
				return;
			}
			scrollPane.setColumnHeaderView(getTableHeader());
			Border border = scrollPane.getBorder();
			if (border == null || border instanceof UIResource) {
				scrollPane.setBorder(UIManager.getBorder("Table.scrollPaneBorder"));
			}
			//rowHeader=new RowHeader(dataModel);
			rowHeader.setRowHeight(CommonConstants.ROW_HEIGHT);
			rowHeader.install(this, scrollPane);
			installLabels(scrollPane);
			installSelectAllButton(scrollPane);
			viewport.addChangeListener(scrollListener);
		}
	}
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:32,代码来源:ExactTable.java

示例12: getInstance

import java.awt.Container; //导入方法依赖的package包/类
/**
 * Returns a new instance of DistributionsEditor, given parent container (used to find
 * top level Dialog or Frame to create this dialog as modal)
 * @param parent any type of container contained in a Frame or Dialog
 * @param initial initial distribution to be set
 * @param recursive indicated if the DistributionEditor is used to select a nested distribution
 * @return new instance of DistributionsEditor
 */
public static DistributionsEditor getInstance(Container parent, Distribution initial, boolean recursive) {
	// Finds top level Dialog or Frame to invoke correct costructor
	while (!(parent instanceof Frame || parent instanceof Dialog)) {
		parent = parent.getParent();
	}

	if (parent instanceof Frame) {
		return new DistributionsEditor((Frame) parent, initial, recursive);
	} else {
		return new DistributionsEditor((Dialog) parent, initial, recursive);
	}
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:21,代码来源:DistributionsEditor.java

示例13: addNotify

import java.awt.Container; //导入方法依赖的package包/类
public void addNotify() {
	super.addNotify();
	Container c = getParent();
	while( c!=null ) {
		if( c instanceof JScrollPane ) {
			scrollPane = (JScrollPane)c;
			return;
		}
		c = c.getParent();
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:SCSImage.java

示例14: getTopmostProvider

import java.awt.Container; //导入方法依赖的package包/类
Container getTopmostProvider(Container focusCycleRoot, Component aComponent) {
    Container aCont = aComponent.getParent();
    Container ftp = null;
    while (aCont  != focusCycleRoot && aCont != null) {
        if (aCont.isFocusTraversalPolicyProvider()) {
            ftp = aCont;
        }
        aCont = aCont.getParent();
    }
    if (aCont == null) {
        return null;
    }
    return ftp;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:SortingFocusTraversalPolicy.java

示例15: getData

import java.awt.Container; //导入方法依赖的package包/类
public Iterator<String> getData(int data){
		Container c = ds.map.getParent();
		while (!(c instanceof Frame || c == null)) c = c.getParent();
		DBOutputConfigDialog dialog = new DBOutputConfigDialog((Frame) c,ds,xIndex,yIndex);
		final int indices[] = dialog.indices;
		if (indices==null) return null;

		return new Iterator<String>() {
			int i=-1;
			public void remove() {
				throw new UnsupportedOperationException();
			}

			public boolean hasNext() {
				return i<ds.tm.displayToDataIndex.size();
			}

			public String next() {
				StringBuffer s = new StringBuffer();
				for (int z = 0;z<indices.length;z++){
					if (i==-1)	s.append(ds.header.get(indices[z]));
					else {
//						int x = ((Integer)ds.tm.displayIndex.get(i)).intValue();
						s.append((ds.rowData
									.get(ds.tm.displayToDataIndex.get(i)))
										.get(indices[z]));
					}
					if (z<indices.length-1) s.append("\t");
				}
				i++;
				return s.toString();
			}
		};
	}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:35,代码来源:DataSetGraph.java


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