當前位置: 首頁>>代碼示例>>Java>>正文


Java Container.repaint方法代碼示例

本文整理匯總了Java中java.awt.Container.repaint方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.repaint方法的具體用法?Java Container.repaint怎麽用?Java Container.repaint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.Container的用法示例。


在下文中一共展示了Container.repaint方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: saveGameRecord

import java.awt.Container; //導入方法依賴的package包/類
public void saveGameRecord(JFrame frame, String competidores, PvpScore pvpScore) {
    try {
        frame.validate();
        frame.repaint();            
        Container c = frame.getContentPane();
        c.validate();
        c.repaint();
        BufferedImage im = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB);
        c.paint(im.getGraphics());
        pvpScore.setGameRecord(im);
    } catch (Exception ex) {
        Logger.getLogger(OthelloTournament.class
                .getName()).log(Level.SEVERE, null, ex);
    }
}
 
開發者ID:data-library,項目名稱:jOthelloT,代碼行數:16,代碼來源:OthelloTournament.java

示例2: activateFilter

import java.awt.Container; //導入方法依賴的package包/類
public void activateFilter() {
    JComponent panel = getBottomPanel();
    
    if (filterPanel == null) {
        filterPanel = FilterUtils.createFilterPanel(getResultsComponent(), getExcludesFilter(), getFilterOptions());
        panel.add(filterPanel);
        Container parent = panel.getParent();
        parent.invalidate();
        parent.revalidate();
        parent.repaint();
    }
    
    panel.setVisible(true);
    
    filterPanel.setVisible(true);
    filterPanel.requestFocusInWindow();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:DataView.java

示例3: activateSearch

import java.awt.Container; //導入方法依賴的package包/類
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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:DataView.java

示例4: 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

示例5: dockToolBar

import java.awt.Container; //導入方法依賴的package包/類
/**
 * Docks the associated toolbar at the secified edge and indicies.
 */
public void dockToolBar(final int edge, final int row, final int index) {
    final Container target = ourDockLayout.getTargetContainer();
    if (target == null)
        return;

    target.remove(ourToolBar);
    final JDialog floatFrame = getFloatingFrame();
    if (floatFrame != null) {
        floatFrame.setVisible(false);
        floatFrame.getContentPane().remove(ourToolBar);
    }

    ourConstraints.setEdge(edge);
    ourConstraints.setRow(row);
    ourConstraints.setIndex(index);

    target.add(ourToolBar, ourConstraints);
    ourToolBarShouldFloat = false;

    target.validate();
    target.repaint();
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:26,代碼來源:Handler.java

示例6: removeIconHint

import java.awt.Container; //導入方法依賴的package包/類
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);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:HintsUI.java

示例7: doHide

import java.awt.Container; //導入方法依賴的package包/類
@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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:CustomPopupFactory.java

示例8: hideToolBar

import java.awt.Container; //導入方法依賴的package包/類
/**
 * 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();
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:17,代碼來源:Handler.java

示例9: floatToolBar

import java.awt.Container; //導入方法依賴的package包/類
/**
 * Floats the associated toolbar at the specified screen location,
 * optionally centering the floating frame on this point.
 */
public void floatToolBar(int x, int y, final boolean center) {
    final JDialog floatFrame = getFloatingFrame();
    if (floatFrame == null)
        return;

    final Container target = ourDockLayout.getTargetContainer();
    if (target != null)
        target.remove(ourToolBar);
    floatFrame.setVisible(false);
    floatFrame.getContentPane().remove(ourToolBar);

    ourToolBar.setOrientation(ToolBarLayout.HORIZONTAL);
    floatFrame.getContentPane().add(ourToolBar, BorderLayout.CENTER);
    floatFrame.pack();

    if (center) {
        x -= floatFrame.getWidth() / 2;
        y -= floatFrame.getHeight() / 2;
    }

    // x and y are given relative to screen
    floatFrame.setLocation(x, y);
    floatFrame.setTitle(ourToolBar.getName());
    floatFrame.setVisible(true);

    ourToolBarShouldFloat = true;

    if (target != null) {
        target.validate();
        target.repaint();
    }
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:37,代碼來源:Handler.java

示例10: 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:ModelWriter,項目名稱:Tarski,代碼行數:8,代碼來源:GraphViewer.java

示例11: setEnlargedView

import java.awt.Container; //導入方法依賴的package包/類
/**
 * This method shows the enlarged dialog for the current ontology class instances
 * in order to provide an easier access for the end user.
 */
private void setEnlargedView() {
	
	JDialog dialog = new JDialog(OntologyVisualisationConfiguration.getOwnerWindow());
	dialog.setPreferredSize(new Dimension(100, 200));
	dialog.setName("Ontology-Instance-Viewer");
	dialog.setTitle(OntologyVisualisationConfiguration.getApplicationTitle() +  ": Ontology-Instance-Viewer");
	dialog.setModal(true);
	dialog.setResizable(true);
	dialog.setContentPane(getJContentPane());
	
	// --- Size and center the dialog -----------------
	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	int diaWidth = (int) (screenSize.width*0.8);
	int diaHeight = (int) (screenSize.height * 0.9);

	int left = (screenSize.width - diaWidth) / 2;
	int top = (screenSize.height - diaHeight) / 2; 

	dialog.setSize(new Dimension(diaWidth, diaHeight));
    dialog.setLocation(left, top);	
	
    // --- Remind and remove THIS from the parent -----
    this.getDynTableJPanel().setOntologyClassVisualsationVisible(null);
    Container parentContainer = this.getParent();
    parentContainer.remove(this);
    parentContainer.validate();
    parentContainer.repaint();
    
    // --- Add THIS to the dialog ---------------------
    this.removeEnlargeTab();
    jPanel4TouchDown.add(this, BorderLayout.CENTER);
    dialog.setVisible(true);
	// - - - - - - - - - - - - - - - - - - - - - - - -  
    // - - User-Interaction  - - - - - - - - - - - - - 
	// - - - - - - - - - - - - - - - - - - - - - - - -
    this.addEnlargeTab();
	
    // --- Add THIS again to the parent ---------------
    this.getDynTableJPanel().setOntologyClassVisualsationVisible(null);
    parentContainer.add(this);
    parentContainer.validate();
    parentContainer.repaint();
    
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:49,代碼來源:OntologyInstanceViewer.java


注:本文中的java.awt.Container.repaint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。