Java Code Examples for java.awt.Container#repaint()

The following examples show how to use java.awt.Container#repaint() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MemoryView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private void activateSearch() {
    JComponent panel = getBottomPanel();
    
    if (searchPanel == null) {
        searchPanel = SearchUtils.createSearchPanel(table);
        panel.add(searchPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    searchPanel.setVisible(true);
    searchPanel.requestFocusInWindow();
}
 
Example 2
Source File: TruffleSummaryView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
void setRealModel(TableModel model) {
    if (table == null) {
        BorderLayout bl = (BorderLayout)getLayout();
        Component c = bl.getLayoutComponent(BorderLayout.CENTER);
        if (c != null) remove(c);

        table = createTable(model);
        add(table, BorderLayout.CENTER);

        Container parent = getParent();
        if (parent != null) {
            parent.invalidate();
            parent.revalidate();
            parent.repaint();
        }
    } else {
        table.setModel(model);
    }

    setupTable(table);
    enableTableEvents(table);

    link.setEnabled(true);
}
 
Example 3
Source File: ThreadsCPUView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private void activateFilter() {
    JComponent panel = getBottomPanel();
    
    if (filterPanel == null) {
        filterPanel = FilterUtils.createFilterPanel(table, null);
        panel.add(filterPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    filterPanel.setVisible(true);
    filterPanel.requestFocusInWindow();
}
 
Example 4
Source File: MemorySamplerViewSupport.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private void activateFilter() {
    JComponent panel = getBottomPanel();

    if (filterPanel == null) {
        filterPanel = FilterUtils.createFilterPanel(table, null);
        panel.add(filterPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }

    panel.setVisible(true);

    filterPanel.setVisible(true);
    filterPanel.requestFocusInWindow();
}
 
Example 5
Source File: JCollapsiblePane.java    From orbit-image-analysis with GNU General Public License v3.0 6 votes vote down vote up
void validate() {
  Container parent = SwingUtilities.getAncestorOfClass(
    JCollapsiblePaneContainer.class, JCollapsiblePane.this);
  if (parent != null) {
    parent = ((JCollapsiblePaneContainer)parent).getValidatingContainer();
  } else {
    parent = getParent();
  }

  if (parent != null) {
    if (parent instanceof JComponent) {
      ((JComponent)parent).revalidate();
    } else {
      parent.invalidate();
    }
    parent.doLayout();
    parent.repaint();
  }        
}
 
Example 6
Source File: MemoryView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private void activateFilter() {
    JComponent panel = getBottomPanel();
    
    if (filterPanel == null) {
        filterPanel = FilterUtils.createFilterPanel(table, null);
        panel.add(filterPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    filterPanel.setVisible(true);
    filterPanel.requestFocusInWindow();
}
 
Example 7
Source File: DataView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
public void activateSearch() {
    JComponent panel = getBottomPanel();
    
    if (searchPanel == null) {
        SearchUtils.TreeHelper searchHelper = getSearchHelper();
        if (searchHelper == null) searchPanel = SearchUtils.createSearchPanel(getResultsComponent(), getSearchOptions());
        else searchPanel = SearchUtils.createSearchPanel((ProfilerTreeTable)getResultsComponent(), searchHelper, getSearchOptions());
        panel.add(searchPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    searchPanel.setVisible(true);
    searchPanel.requestFocusInWindow();
}
 
Example 8
Source File: MemoryView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private void activateSearch() {
    JComponent panel = getBottomPanel();
    
    if (searchPanel == null) {
        searchPanel = SearchUtils.createSearchPanel(table);
        panel.add(searchPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    searchPanel.setVisible(true);
    searchPanel.requestFocusInWindow();
}
 
Example 9
Source File: MemoryView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private void activateFilter() {
    JComponent panel = getBottomPanel();
    
    if (filterPanel == null) {
        filterPanel = FilterUtils.createFilterPanel(table, null);
        panel.add(filterPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    filterPanel.setVisible(true);
    filterPanel.requestFocusInWindow();
}
 
Example 10
Source File: QPopup.java    From pumpernickel with MIT License 6 votes vote down vote up
@Override
public void hide() {
	Window w = SwingUtilities.getWindowAncestor(contents);
	Container parent = contents.getParent();
	if (parent != null) {
		Rectangle r = contents.getBounds();
		parent.remove(contents);
		parent.repaint(r.x, r.y, r.width, r.height);
	}
	if (w instanceof RootPaneContainer) {
		RootPaneContainer rpc = (RootPaneContainer) w;
		Boolean b = (Boolean) rpc.getRootPane()
				.getClientProperty(PROPERTY_IS_QPOPUP);
		if (Boolean.TRUE.equals(b)) {
			w.setVisible(false);
			w.dispose();
		}
	}
}
 
Example 11
Source File: GraphViewer.java    From org.alloytools.alloy with Apache License 2.0 6 votes vote down vote up
/** 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();
    }
}
 
Example 12
Source File: ThreadsMemoryView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private void activateFilter() {
    JComponent panel = getBottomPanel();
    
    if (filterPanel == null) {
        filterPanel = FilterUtils.createFilterPanel(table, null);
        panel.add(filterPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    filterPanel.setVisible(true);
    filterPanel.requestFocusInWindow();
}
 
Example 13
Source File: ThreadsCPUView.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
private void activateSearch() {
    JComponent panel = getBottomPanel();
    
    if (searchPanel == null) {
        searchPanel = SearchUtils.createSearchPanel(table);
        panel.add(searchPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    searchPanel.setVisible(true);
    searchPanel.requestFocusInWindow();
}
 
Example 14
Source File: Handler.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Hides the associated toolbar by removing it from its dock or by closing
 * its client floating frame.
 */
public void hideToolBar() {
    final Container target = ourDockLayout.getTargetContainer();
    target.remove(ourToolBar);
    final JDialog floatFrame = getFloatingFrame();
    if (floatFrame != null) {
        floatFrame.setVisible(false);
        floatFrame.getContentPane().remove(ourToolBar);
    }

    target.validate();
    target.repaint();
}
 
Example 15
Source File: HintsUI.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void removeIconHint() {
    if (hintIcon != null) {
        Container cont = hintIcon.getParent();
        if (cont != null) {
            Rectangle bds = hintIcon.getBounds();
            cont.remove (hintIcon);
            cont.repaint (bds.x, bds.y, bds.width, bds.height);
        }
    }
}
 
Example 16
Source File: CustomPopupFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected void doHide() {
    Container parent = contents.getParent();
    if (parent != null) {
        contents.getParent().remove (contents);
        parent.repaint(bounds.x, bounds.y, bounds.width, bounds.height);
        parent.setVisible(false);
    }
    //If doShow() was never called, we've modified the visibility
    //of the contents component, which could cause problems elsewhere
    contents.setVisible (true);
}
 
Example 17
Source File: MainFrame.java    From netbeans-mmd-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public void hideFindTextPane() {
  final FindTextPanel panel = this.currentFindTextPanel.getAndSet(null);
  if (panel != null) {
    final Container parent = panel.getParent();
    if (parent != null) {
      parent.remove(panel);
      parent.revalidate();
      parent.repaint();
    }
  }
}
 
Example 18
Source File: FlatPopupFactory.java    From FlatLaf with Apache License 2.0 5 votes vote down vote up
private void hideMediumWeightDropShadow() {
	mediumWeightPanel.removeComponentListener( mediumPanelListener );

	Container parent = dropShadowPanel.getParent();
	if( parent != null ) {
		Rectangle bounds = dropShadowPanel.getBounds();
		parent.remove( dropShadowPanel );
		parent.repaint( bounds.x, bounds.y, bounds.width, bounds.height );
	}
}
 
Example 19
Source File: HierarchicalControllerTopComponent.java    From constellation with Apache License 2.0 5 votes vote down vote up
private static void revalidateParents(Container container) {
    while (container != null) {
        container.invalidate();
        container.validate();
        container.repaint();
        container = container.getParent();
    }
}
 
Example 20
Source File: MoveUIEffect.java    From pumpernickel with MIT License 3 votes vote down vote up
/**
 * This effect may be applied to invisible components, where other
 * special configurations guarantee they still get painted (for example:
 * see {@link com.pump.awt.RowLayout}). In this case we should manually
 * invoke a repaint.
 * <p>
 * (When a component is visible, this will result in redundant repaint
 * requests that should eventually be collapsed.)
 */
private void repaint(Component comp) {
	Container container = comp.getParent();
	if (container != null) {
		Rectangle r = comp.getBounds();
		container.repaint(r.x, r.y, r.width, r.height);
	}
}