类javax.swing.RepaintManager源码实例Demo

下面列出了怎么用javax.swing.RepaintManager的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: netbeans   文件: TagsAndEditorsTest.java
public void testPropertySheetRepaintsCellOnPropertyChange() throws Exception {
    if (!canSafelyRunFocusTests()) {
        return;
    }
    Node n = new TNode(new SingleTagEditor());
    setCurrentNode(n, ps);
    Rectangle test = ps.table.getCellRect(1, 1, true);
    RM rm = new RM(test, ps.table);
    RepaintManager.setCurrentManager(rm);
    sleep();
    sleep();
    Node.Property prop = n.getPropertySets()[0].getProperties()[0];
    prop.setValue("new value");
    Thread.currentThread().sleep(1000);
    sleep();
    rm.assertRectRepainted();
}
 
源代码2 项目: gcs   文件: CharacterSheet.java
@Override
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) {
    if (pageIndex >= getComponentCount()) {
        mLastPage = -1;
        return NO_SUCH_PAGE;
    }

    // We do the following trick to avoid going through the work twice,
    // as we are called twice for each page, the first of which doesn't
    // seem to be used.
    if (mLastPage == pageIndex) {
        Component      comp  = getComponent(pageIndex);
        RepaintManager mgr   = RepaintManager.currentManager(comp);
        boolean        saved = mgr.isDoubleBufferingEnabled();
        mgr.setDoubleBufferingEnabled(false);
        mOkToPaint = true;
        comp.print(graphics);
        mOkToPaint = false;
        mgr.setDoubleBufferingEnabled(saved);
    } else {
        mLastPage = pageIndex;
    }
    return PAGE_EXISTS;
}
 
源代码3 项目: hottub   文件: bug6608456.java
private static boolean registerDelegate(JComponent c,
        RepaintManager repaintManager) {
    boolean rv = false;
    try {
        Class<?> clazz = Class.forName("com.sun.java.swing.SwingUtilities3");
        Method method = clazz.getMethod("setDelegateRepaintManager",
            JComponent.class, RepaintManager.class);
        method.invoke(clazz, c, repaintManager);
        rv = true;
    } catch (Exception ignore) {
    }
    return rv;
}
 
源代码4 项目: dragonwell8_jdk   文件: SwingAccessor.java
/**
 * Retrieve the accessor object for the RepaintManager class.
 */
public static RepaintManagerAccessor getRepaintManagerAccessor() {
    if (repaintManagerAccessor == null) {
        unsafe.ensureClassInitialized(RepaintManager.class);
    }
    return repaintManagerAccessor;
}
 
源代码5 项目: dragonwell8_jdk   文件: SwingUtilities3.java
/**
  * Registers delegate RepaintManager for {@code JComponent}.
  */
public static void setDelegateRepaintManager(JComponent component,
                                            RepaintManager repaintManager) {
    /* setting up flag in AppContext to speed up lookups in case
     * there are no delegate RepaintManagers used.
     */
    AppContext.getAppContext().put(DELEGATE_REPAINT_MANAGER_KEY,
                                   Boolean.TRUE);

    component.putClientProperty(DELEGATE_REPAINT_MANAGER_KEY,
                                repaintManager);
}
 
源代码6 项目: dragonwell8_jdk   文件: bug6608456.java
@Override
public void addDirtyRegion(JComponent c, int x, int y, int w, int h) {
    if (RepaintManager.currentManager(c) == this) {
        testFuture.defaultCalled();
    } else {
        testFuture.delegateCalled();
    }
    super.addDirtyRegion(c, x, y, w, h);
}
 
源代码7 项目: jdk8u-dev-jdk   文件: bug6608456.java
@Override
public void addDirtyRegion(JComponent c, int x, int y, int w, int h) {
    if (RepaintManager.currentManager(c) == this) {
        testFuture.defaultCalled();
    } else {
        testFuture.delegateCalled();
    }
    super.addDirtyRegion(c, x, y, w, h);
}
 
源代码8 项目: TencentKona-8   文件: SwingUtilities3.java
/**
  * Registers delegate RepaintManager for {@code JComponent}.
  */
public static void setDelegateRepaintManager(JComponent component,
                                            RepaintManager repaintManager) {
    /* setting up flag in AppContext to speed up lookups in case
     * there are no delegate RepaintManagers used.
     */
    AppContext.getAppContext().put(DELEGATE_REPAINT_MANAGER_KEY,
                                   Boolean.TRUE);

    component.putClientProperty(DELEGATE_REPAINT_MANAGER_KEY,
                                repaintManager);
}
 
源代码9 项目: TencentKona-8   文件: bug6608456.java
private static boolean registerDelegate(JComponent c,
        RepaintManager repaintManager) {
    boolean rv = false;
    try {
        Class<?> clazz = Class.forName("com.sun.java.swing.SwingUtilities3");
        Method method = clazz.getMethod("setDelegateRepaintManager",
            JComponent.class, RepaintManager.class);
        method.invoke(clazz, c, repaintManager);
        rv = true;
    } catch (Exception ignore) {
    }
    return rv;
}
 
源代码10 项目: jdk8u60   文件: SwingAccessor.java
/**
 * Retrieve the accessor object for the RepaintManager class.
 */
public static RepaintManagerAccessor getRepaintManagerAccessor() {
    if (repaintManagerAccessor == null) {
        unsafe.ensureClassInitialized(RepaintManager.class);
    }
    return repaintManagerAccessor;
}
 
源代码11 项目: openjdk-8   文件: bug6608456.java
@Override
public void addDirtyRegion(JComponent c, int x, int y, int w, int h) {
    if (RepaintManager.currentManager(c) == this) {
        testFuture.defaultCalled();
    } else {
        testFuture.delegateCalled();
    }
    super.addDirtyRegion(c, x, y, w, h);
}
 
源代码12 项目: jdk8u60   文件: bug6608456.java
private static boolean registerDelegate(JComponent c,
        RepaintManager repaintManager) {
    boolean rv = false;
    try {
        Class<?> clazz = Class.forName("com.sun.java.swing.SwingUtilities3");
        Method method = clazz.getMethod("setDelegateRepaintManager",
            JComponent.class, RepaintManager.class);
        method.invoke(clazz, c, repaintManager);
        rv = true;
    } catch (Exception ignore) {
    }
    return rv;
}
 
源代码13 项目: openjdk-8   文件: bug6608456.java
private static boolean registerDelegate(JComponent c,
        RepaintManager repaintManager) {
    boolean rv = false;
    try {
        Class<?> clazz = Class.forName("com.sun.java.swing.SwingUtilities3");
        Method method = clazz.getMethod("setDelegateRepaintManager",
            JComponent.class, RepaintManager.class);
        method.invoke(clazz, c, repaintManager);
        rv = true;
    } catch (Exception ignore) {
    }
    return rv;
}
 
源代码14 项目: jdk8u_jdk   文件: bug6608456.java
private static boolean registerDelegate(JComponent c,
        RepaintManager repaintManager) {
    boolean rv = false;
    try {
        Class<?> clazz = Class.forName("com.sun.java.swing.SwingUtilities3");
        Method method = clazz.getMethod("setDelegateRepaintManager",
            JComponent.class, RepaintManager.class);
        method.invoke(clazz, c, repaintManager);
        rv = true;
    } catch (Exception ignore) {
    }
    return rv;
}
 
源代码15 项目: openjdk-jdk8u   文件: SwingAccessor.java
/**
 * Retrieve the accessor object for the RepaintManager class.
 */
public static RepaintManagerAccessor getRepaintManagerAccessor() {
    if (repaintManagerAccessor == null) {
        unsafe.ensureClassInitialized(RepaintManager.class);
    }
    return repaintManagerAccessor;
}
 
源代码16 项目: jdk8u-dev-jdk   文件: bug6608456.java
private static boolean registerDelegate(JComponent c,
        RepaintManager repaintManager) {
    boolean rv = false;
    try {
        Class<?> clazz = Class.forName("com.sun.java.swing.SwingUtilities3");
        Method method = clazz.getMethod("setDelegateRepaintManager",
            JComponent.class, RepaintManager.class);
        method.invoke(clazz, c, repaintManager);
        rv = true;
    } catch (Exception ignore) {
    }
    return rv;
}
 
源代码17 项目: openjdk-jdk8u   文件: SwingUtilities3.java
/**
  * Registers delegate RepaintManager for {@code JComponent}.
  */
public static void setDelegateRepaintManager(JComponent component,
                                            RepaintManager repaintManager) {
    /* setting up flag in AppContext to speed up lookups in case
     * there are no delegate RepaintManagers used.
     */
    AppContext.getAppContext().put(DELEGATE_REPAINT_MANAGER_KEY,
                                   Boolean.TRUE);

    component.putClientProperty(DELEGATE_REPAINT_MANAGER_KEY,
                                repaintManager);
}
 
源代码18 项目: jdk8u_jdk   文件: SwingAccessor.java
/**
 * Retrieve the accessor object for the RepaintManager class.
 */
public static RepaintManagerAccessor getRepaintManagerAccessor() {
    if (repaintManagerAccessor == null) {
        unsafe.ensureClassInitialized(RepaintManager.class);
    }
    return repaintManagerAccessor;
}
 
源代码19 项目: openjdk-jdk8u   文件: bug6608456.java
private static boolean registerDelegate(JComponent c,
        RepaintManager repaintManager) {
    boolean rv = false;
    try {
        Class<?> clazz = Class.forName("com.sun.java.swing.SwingUtilities3");
        Method method = clazz.getMethod("setDelegateRepaintManager",
            JComponent.class, RepaintManager.class);
        method.invoke(clazz, c, repaintManager);
        rv = true;
    } catch (Exception ignore) {
    }
    return rv;
}
 
源代码20 项目: netbeans   文件: AnimationLayer.java
/**
 * Initial point of the next frame (invoked by the animation timer).
 *
 * @param e action event.
 */
@Override
public void actionPerformed(ActionEvent e) {
    updatePhase();
    RepaintManager manager = RepaintManager.currentManager(glassPane);
    manager.markCompletelyDirty(glassPane);
    manager.paintDirtyRegions();
}
 
源代码21 项目: jdk8u-dev-jdk   文件: SwingUtilities3.java
/**
  * Registers delegate RepaintManager for {@code JComponent}.
  */
public static void setDelegateRepaintManager(JComponent component,
                                            RepaintManager repaintManager) {
    /* setting up flag in AppContext to speed up lookups in case
     * there are no delegate RepaintManagers used.
     */
    AppContext.getAppContext().put(DELEGATE_REPAINT_MANAGER_KEY,
                                   Boolean.TRUE);

    component.putClientProperty(DELEGATE_REPAINT_MANAGER_KEY,
                                repaintManager);
}
 
源代码22 项目: netbeans   文件: QueryBuilder.java
private static void doShowBusyCursor(boolean busy) {
    JFrame mainWindow = (JFrame)WindowManager.getDefault().getMainWindow();
    if(busy){
        RepaintManager.currentManager(mainWindow).paintDirtyRegions();
        mainWindow.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        mainWindow.getGlassPane().setVisible(true);
        mainWindow.repaint();
    } else {
        mainWindow.getGlassPane().setVisible(false);
        mainWindow.getGlassPane().setCursor(null);
        mainWindow.repaint();
    }
}
 
源代码23 项目: netbeans   文件: DebuggingViewComponent.java
/**
 * Restore stored scroll position.
 */
private void restoreScrollPosition(boolean delayScrollWithMarkingDirtyRegion) {
    if (visibleTreePosition != null) {
        JTree tree = getJTree();
        if (tree != null) {
            int row = tree.getRowForPath(visibleTreePosition.getPath());
            if (row != -1) {
                Rectangle bounds = tree.getRowBounds(row);
                if (bounds != null) {
                    int scrollY = bounds.y - visibleTreePosition.getOffset();
                    JViewport viewport = mainScrollPane.getViewport();
                    Rectangle rect = viewport.getViewRect();
                    rect.y = scrollY;
                    if (!rect.isEmpty()) {
                        JComponent view = (JComponent) viewport.getView();
                        if (delayScrollWithMarkingDirtyRegion) {
                            RepaintManager.currentManager(viewport).addDirtyRegion(
                                    view,
                                    rect.x, rect.x, rect.width, rect.height);
                        }
                        ignoreScrollAdjustment = true;
                        try {
                            view.scrollRectToVisible(
                                    rect);
                        } finally {
                            ignoreScrollAdjustment = false;
                        }
                    }
                }
            }
        }
    }
}
 
源代码24 项目: pentaho-reporting   文件: ComponentDrawable.java
/**
 * A helper method that performs some cleanup and disconnects the component from the AWT and the Swing-Framework to
 * avoid memory-leaks.
 */
protected final void cleanUp() {
  if ( component instanceof JComponent && isOwnPeerConnected() == false ) {
    final JComponent jc = (JComponent) component;
    RepaintManager.currentManager( jc ).removeInvalidComponent( jc );
    RepaintManager.currentManager( jc ).markCompletelyClean( jc );
  }
  contentPane.removeAll();
  RepaintManager.currentManager( contentPane ).removeInvalidComponent( contentPane );
  RepaintManager.currentManager( contentPane ).markCompletelyClean( contentPane );
  peerSupply.dispose();
}
 
源代码25 项目: openjdk-jdk8u-backup   文件: SwingAccessor.java
/**
 * Retrieve the accessor object for the RepaintManager class.
 */
public static RepaintManagerAccessor getRepaintManagerAccessor() {
    if (repaintManagerAccessor == null) {
        unsafe.ensureClassInitialized(RepaintManager.class);
    }
    return repaintManagerAccessor;
}
 
源代码26 项目: openjdk-jdk8u-backup   文件: bug6608456.java
@Override
public void addDirtyRegion(JComponent c, int x, int y, int w, int h) {
    if (RepaintManager.currentManager(c) == this) {
        testFuture.defaultCalled();
    } else {
        testFuture.delegateCalled();
    }
    super.addDirtyRegion(c, x, y, w, h);
}
 
源代码27 项目: jdk8u_jdk   文件: SwingUtilities3.java
/**
  * Registers delegate RepaintManager for {@code JComponent}.
  */
public static void setDelegateRepaintManager(JComponent component,
                                            RepaintManager repaintManager) {
    /* setting up flag in AppContext to speed up lookups in case
     * there are no delegate RepaintManagers used.
     */
    AppContext.getAppContext().put(DELEGATE_REPAINT_MANAGER_KEY,
                                   Boolean.TRUE);

    component.putClientProperty(DELEGATE_REPAINT_MANAGER_KEY,
                                repaintManager);
}
 
源代码28 项目: Bytecoder   文件: SwingUtilities3.java
/**
  * Registers delegate RepaintManager for {@code JComponent}.
  */
public static void setDelegateRepaintManager(JComponent component,
                                            RepaintManager repaintManager) {
    /* setting up flag in AppContext to speed up lookups in case
     * there are no delegate RepaintManagers used.
     */
    AppContext.getAppContext().put(DELEGATE_REPAINT_MANAGER_KEY,
                                   Boolean.TRUE);

    component.putClientProperty(DELEGATE_REPAINT_MANAGER_KEY,
                                repaintManager);
}
 
源代码29 项目: openjdk-8-source   文件: bug6608456.java
@Override
public void addDirtyRegion(JComponent c, int x, int y, int w, int h) {
    if (RepaintManager.currentManager(c) == this) {
        testFuture.defaultCalled();
    } else {
        testFuture.delegateCalled();
    }
    super.addDirtyRegion(c, x, y, w, h);
}
 
源代码30 项目: jdk8u-dev-jdk   文件: SwingAccessor.java
/**
 * Retrieve the accessor object for the RepaintManager class.
 */
public static RepaintManagerAccessor getRepaintManagerAccessor() {
    if (repaintManagerAccessor == null) {
        unsafe.ensureClassInitialized(RepaintManager.class);
    }
    return repaintManagerAccessor;
}
 
 类所在包
 同包方法