Java 类java.awt.event.ContainerAdapter 实例源码

项目:AgentWorkbench    文件:BasicGraphGui.java   
/**
 * This method initializes this
 */
private void initialize() {

    // --- Set appearance -----------------------------
    this.setVisible(true);
    this.setSize(300, 300);
    this.setLayout(new BorderLayout());
    this.setDoubleBuffered(true);

    // --- Add components -----------------------------
    this.add(this.getJPanelToolBars(), BorderLayout.WEST);
    this.add(this.getGraphZoomScrollPane(), BorderLayout.CENTER);

    this.addContainerListener(new ContainerAdapter() {
        boolean doneAdded = false;
        @Override
        public void componentAdded(ContainerEvent ce) {
            if (doneAdded==false) {
                validate();
                zoomSetInitialScalingAndMovement(getVisualizationViewer());
                doneAdded=true;
            }
        }
    });
}
项目:swingx    文件:JXTaskPaneContainer.java   
/**
 * Creates a new empty task pane.
 */
public JXTaskPaneContainer() {
    super(null);
    updateUI();

    addContainerListener(new ContainerAdapter() {
        @Override
        public void componentRemoved(ContainerEvent e) {
            repaint();
        }
    });
    setScrollableHeightHint(ScrollableSizeHint.PREFERRED_STRETCH);
}
项目:aibench-project    文件:JXTaskPaneContainer.java   
/**
 * Creates a new empty taskpane.
 */
public JXTaskPaneContainer() {
    super(null);
  updateUI();

  addContainerListener(new ContainerAdapter() {
      public void componentRemoved(ContainerEvent e) {
          repaint();
      }
  });
}
项目:viskit    文件:JImageListView.java   
/**
 * Ensures {@link #copyUiStateToSubComponent(java.awt.Component) } will
 * be called for any child component added to this component in the
 * future. Called once by the default constructor of JImageListView.
 * Subclasses may (rarely) override, e.g. with an empty implementation
 * if they want to inhibit this behaviour for some (strange) reason.
 */
protected void ensureUiStateIsCopiedForAddedComponents() {
    this.addContainerListener(new ContainerAdapter() {
        @Override
        public void componentAdded(ContainerEvent e) {
            JImageListView.this.copyUiStateToSubComponent(e.getChild());
        }
    });
}