java.awt.event.PaintEvent Java Examples

The following examples show how to use java.awt.event.PaintEvent. 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: WComponentPeer.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }

    if (log.isLoggable(PlatformLogger.Level.FINEST)) {
        switch(e.getID()) {
        case PaintEvent.UPDATE:
            log.finest("coalescePaintEvent: UPDATE: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        case PaintEvent.PAINT:
            log.finest("coalescePaintEvent: PAINT: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        }
    }
}
 
Example #2
Source File: WComponentPeer.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }

    if (log.isLoggable(PlatformLogger.Level.FINEST)) {
        switch(e.getID()) {
        case PaintEvent.UPDATE:
            log.finest("coalescePaintEvent: UPDATE: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        case PaintEvent.PAINT:
            log.finest("coalescePaintEvent: PAINT: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        }
    }
}
 
Example #3
Source File: RepaintArea.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a <code>Rectangle</code> to this <code>RepaintArea</code>.
 * PAINT Rectangles are divided into mostly vertical and mostly horizontal.
 * Each group is unioned together.
 * UPDATE Rectangles are unioned.
 *
 * @param   r   the specified <code>Rectangle</code>
 * @param   id  possible values PaintEvent.UPDATE or PaintEvent.PAINT
 * @since   1.3
 */
public synchronized void add(Rectangle r, int id) {
    // Make sure this new rectangle has positive dimensions
    if (r.isEmpty()) {
        return;
    }
    int addTo = UPDATE;
    if (id == PaintEvent.PAINT) {
        addTo = (r.width > r.height) ? HORIZONTAL : VERTICAL;
    }
    if (paintRects[addTo] != null) {
        paintRects[addTo].add(r);
    } else {
        paintRects[addTo] = new Rectangle(r);
    }
}
 
Example #4
Source File: RepaintArea.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a <code>Rectangle</code> to this <code>RepaintArea</code>.
 * PAINT Rectangles are divided into mostly vertical and mostly horizontal.
 * Each group is unioned together.
 * UPDATE Rectangles are unioned.
 *
 * @param   r   the specified <code>Rectangle</code>
 * @param   id  possible values PaintEvent.UPDATE or PaintEvent.PAINT
 * @since   1.3
 */
public synchronized void add(Rectangle r, int id) {
    // Make sure this new rectangle has positive dimensions
    if (r.isEmpty()) {
        return;
    }
    int addTo = UPDATE;
    if (id == PaintEvent.PAINT) {
        addTo = (r.width > r.height) ? HORIZONTAL : VERTICAL;
    }
    if (paintRects[addTo] != null) {
        paintRects[addTo].add(r);
    } else {
        paintRects[addTo] = new Rectangle(r);
    }
}
 
Example #5
Source File: RepaintArea.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a <code>Rectangle</code> to this <code>RepaintArea</code>.
 * PAINT Rectangles are divided into mostly vertical and mostly horizontal.
 * Each group is unioned together.
 * UPDATE Rectangles are unioned.
 *
 * @param   r   the specified <code>Rectangle</code>
 * @param   id  possible values PaintEvent.UPDATE or PaintEvent.PAINT
 * @since   1.3
 */
public synchronized void add(Rectangle r, int id) {
    // Make sure this new rectangle has positive dimensions
    if (r.isEmpty()) {
        return;
    }
    int addTo = UPDATE;
    if (id == PaintEvent.PAINT) {
        addTo = (r.width > r.height) ? HORIZONTAL : VERTICAL;
    }
    if (paintRects[addTo] != null) {
        paintRects[addTo].add(r);
    } else {
        paintRects[addTo] = new Rectangle(r);
    }
}
 
Example #6
Source File: XComponentPeer.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }
    if (true) {
        switch(e.getID()) {
          case PaintEvent.UPDATE:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : UPDATE : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
          case PaintEvent.PAINT:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : PAINT : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
        }
    }
}
 
Example #7
Source File: WComponentPeer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }

    if (log.isLoggable(PlatformLogger.Level.FINEST)) {
        switch(e.getID()) {
        case PaintEvent.UPDATE:
            log.finest("coalescePaintEvent: UPDATE: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        case PaintEvent.PAINT:
            log.finest("coalescePaintEvent: PAINT: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        }
    }
}
 
Example #8
Source File: WComponentPeer.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }

    if (log.isLoggable(PlatformLogger.Level.FINEST)) {
        switch(e.getID()) {
        case PaintEvent.UPDATE:
            log.finest("coalescePaintEvent: UPDATE: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        case PaintEvent.PAINT:
            log.finest("coalescePaintEvent: PAINT: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        }
    }
}
 
Example #9
Source File: XComponentPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }
    if (true) {
        switch(e.getID()) {
          case PaintEvent.UPDATE:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : UPDATE : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
          case PaintEvent.PAINT:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : PAINT : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
        }
    }
}
 
Example #10
Source File: XComponentPeer.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }
    if (true) {
        switch(e.getID()) {
          case PaintEvent.UPDATE:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : UPDATE : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
          case PaintEvent.PAINT:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : PAINT : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
        }
    }
}
 
Example #11
Source File: WComponentPeer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }

    if (log.isLoggable(PlatformLogger.Level.FINEST)) {
        switch(e.getID()) {
        case PaintEvent.UPDATE:
            log.finest("coalescePaintEvent: UPDATE: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        case PaintEvent.PAINT:
            log.finest("coalescePaintEvent: PAINT: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        }
    }
}
 
Example #12
Source File: RepaintArea.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a <code>Rectangle</code> to this <code>RepaintArea</code>.
 * PAINT Rectangles are divided into mostly vertical and mostly horizontal.
 * Each group is unioned together.
 * UPDATE Rectangles are unioned.
 *
 * @param   r   the specified <code>Rectangle</code>
 * @param   id  possible values PaintEvent.UPDATE or PaintEvent.PAINT
 * @since   1.3
 */
public synchronized void add(Rectangle r, int id) {
    // Make sure this new rectangle has positive dimensions
    if (r.isEmpty()) {
        return;
    }
    int addTo = UPDATE;
    if (id == PaintEvent.PAINT) {
        addTo = (r.width > r.height) ? HORIZONTAL : VERTICAL;
    }
    if (paintRects[addTo] != null) {
        paintRects[addTo].add(r);
    } else {
        paintRects[addTo] = new Rectangle(r);
    }
}
 
Example #13
Source File: RepaintArea.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a <code>Rectangle</code> to this <code>RepaintArea</code>.
 * PAINT Rectangles are divided into mostly vertical and mostly horizontal.
 * Each group is unioned together.
 * UPDATE Rectangles are unioned.
 *
 * @param   r   the specified <code>Rectangle</code>
 * @param   id  possible values PaintEvent.UPDATE or PaintEvent.PAINT
 * @since   1.3
 */
public synchronized void add(Rectangle r, int id) {
    // Make sure this new rectangle has positive dimensions
    if (r.isEmpty()) {
        return;
    }
    int addTo = UPDATE;
    if (id == PaintEvent.PAINT) {
        addTo = (r.width > r.height) ? HORIZONTAL : VERTICAL;
    }
    if (paintRects[addTo] != null) {
        paintRects[addTo].add(r);
    } else {
        paintRects[addTo] = new Rectangle(r);
    }
}
 
Example #14
Source File: WComponentPeer.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }

    if (log.isLoggable(PlatformLogger.Level.FINEST)) {
        switch(e.getID()) {
        case PaintEvent.UPDATE:
            log.finest("coalescePaintEvent: UPDATE: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        case PaintEvent.PAINT:
            log.finest("coalescePaintEvent: PAINT: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        }
    }
}
 
Example #15
Source File: RepaintArea.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a <code>Rectangle</code> to this <code>RepaintArea</code>.
 * PAINT Rectangles are divided into mostly vertical and mostly horizontal.
 * Each group is unioned together.
 * UPDATE Rectangles are unioned.
 *
 * @param   r   the specified <code>Rectangle</code>
 * @param   id  possible values PaintEvent.UPDATE or PaintEvent.PAINT
 * @since   1.3
 */
public synchronized void add(Rectangle r, int id) {
    // Make sure this new rectangle has positive dimensions
    if (r.isEmpty()) {
        return;
    }
    int addTo = UPDATE;
    if (id == PaintEvent.PAINT) {
        addTo = (r.width > r.height) ? HORIZONTAL : VERTICAL;
    }
    if (paintRects[addTo] != null) {
        paintRects[addTo].add(r);
    } else {
        paintRects[addTo] = new Rectangle(r);
    }
}
 
Example #16
Source File: XComponentPeer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }
    if (true) {
        switch(e.getID()) {
          case PaintEvent.UPDATE:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : UPDATE : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
          case PaintEvent.PAINT:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : PAINT : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
        }
    }
}
 
Example #17
Source File: XComponentPeer.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }
    if (true) {
        switch(e.getID()) {
          case PaintEvent.UPDATE:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : UPDATE : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
          case PaintEvent.PAINT:
              if (log.isLoggable(PlatformLogger.Level.FINER)) {
                  log.finer("XCP coalescePaintEvent : PAINT : add : x = " +
                        r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
              }
              return;
        }
    }
}
 
Example #18
Source File: WComponentPeer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void coalescePaintEvent(PaintEvent e) {
    Rectangle r = e.getUpdateRect();
    if (!(e instanceof IgnorePaintEvent)) {
        paintArea.add(r, e.getID());
    }

    if (log.isLoggable(PlatformLogger.Level.FINEST)) {
        switch(e.getID()) {
        case PaintEvent.UPDATE:
            log.finest("coalescePaintEvent: UPDATE: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        case PaintEvent.PAINT:
            log.finest("coalescePaintEvent: PAINT: add: x = " +
                r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
            return;
        }
    }
}
 
Example #19
Source File: WComponentPeer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void postPaintIfNecessary(int x, int y, int w, int h) {
    if ( !AWTAccessor.getComponentAccessor().getIgnoreRepaint( (Component) target) ) {
        PaintEvent event = PaintEventDispatcher.getPaintEventDispatcher().
            createPaintEvent((Component)target, x, y, w, h);
        if (event != null) {
            postEvent(event);
        }
    }
}
 
Example #20
Source File: WComponentPeer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void endLayout() {
    if(!paintArea.isEmpty() && !paintPending &&
        !((Component)target).getIgnoreRepaint()) {
        // if not waiting for native painting repaint damaged area
        postEvent(new PaintEvent((Component)target, PaintEvent.PAINT,
                      new Rectangle()));
    }
    isLayouting = false;
}
 
Example #21
Source File: WComponentPeer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings("fallthrough")
public void handleEvent(AWTEvent e) {
    int id = e.getID();

    if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() &&
        ((Component)target).isEnabled())
    {
        if (e instanceof MouseEvent && !(e instanceof MouseWheelEvent)) {
            handleJavaMouseEvent((MouseEvent) e);
        } else if (e instanceof KeyEvent) {
            if (handleJavaKeyEvent((KeyEvent)e)) {
                return;
            }
        }
    }

    switch(id) {
        case PaintEvent.PAINT:
            // Got native painting
            paintPending = false;
            // Fallthrough to next statement
        case PaintEvent.UPDATE:
            // Skip all painting while layouting and all UPDATEs
            // while waiting for native paint
            if (!isLayouting && ! paintPending) {
                paintArea.paint(target,shouldClearRectBeforePaint());
            }
            return;
        case FocusEvent.FOCUS_LOST:
        case FocusEvent.FOCUS_GAINED:
            handleJavaFocusEvent((FocusEvent)e);
        default:
        break;
    }

    // Call the native code
    nativeHandleEvent(e);
}
 
Example #22
Source File: WComponentPeer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void postPaintIfNecessary(int x, int y, int w, int h) {
    if ( !AWTAccessor.getComponentAccessor().getIgnoreRepaint( (Component) target) ) {
        PaintEvent event = PaintEventDispatcher.getPaintEventDispatcher().
            createPaintEvent((Component)target, x, y, w, h);
        if (event != null) {
            postEvent(event);
        }
    }
}
 
Example #23
Source File: XComponentPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void endLayout() {
    if (!paintPending && !paintArea.isEmpty()
        && !AWTAccessor.getComponentAccessor().getIgnoreRepaint(target))
    {
        // if not waiting for native painting repaint damaged area
        postEvent(new PaintEvent(target, PaintEvent.PAINT,
                                 new Rectangle()));
    }
    isLayouting = false;
}
 
Example #24
Source File: WComponentPeer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void postPaintIfNecessary(int x, int y, int w, int h) {
    if ( !AWTAccessor.getComponentAccessor().getIgnoreRepaint( (Component) target) ) {
        PaintEvent event = PaintEventDispatcher.getPaintEventDispatcher().
            createPaintEvent((Component)target, x, y, w, h);
        if (event != null) {
            postEvent(event);
        }
    }
}
 
Example #25
Source File: WComponentPeer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void endLayout() {
    if(!paintArea.isEmpty() && !paintPending &&
        !((Component)target).getIgnoreRepaint()) {
        // if not waiting for native painting repaint damaged area
        postEvent(new PaintEvent((Component)target, PaintEvent.PAINT,
                      new Rectangle()));
    }
    isLayouting = false;
}
 
Example #26
Source File: WComponentPeer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void postPaintIfNecessary(int x, int y, int w, int h) {
    if ( !AWTAccessor.getComponentAccessor().getIgnoreRepaint( (Component) target) ) {
        PaintEvent event = PaintEventDispatcher.getPaintEventDispatcher().
            createPaintEvent((Component)target, x, y, w, h);
        if (event != null) {
            postEvent(event);
        }
    }
}
 
Example #27
Source File: WComponentPeer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings("fallthrough")
public void handleEvent(AWTEvent e) {
    int id = e.getID();

    if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() &&
        ((Component)target).isEnabled())
    {
        if (e instanceof MouseEvent && !(e instanceof MouseWheelEvent)) {
            handleJavaMouseEvent((MouseEvent) e);
        } else if (e instanceof KeyEvent) {
            if (handleJavaKeyEvent((KeyEvent)e)) {
                return;
            }
        }
    }

    switch(id) {
        case PaintEvent.PAINT:
            // Got native painting
            paintPending = false;
            // Fallthrough to next statement
        case PaintEvent.UPDATE:
            // Skip all painting while layouting and all UPDATEs
            // while waiting for native paint
            if (!isLayouting && ! paintPending) {
                paintArea.paint(target,shouldClearRectBeforePaint());
            }
            return;
        case FocusEvent.FOCUS_LOST:
        case FocusEvent.FOCUS_GAINED:
            handleJavaFocusEvent((FocusEvent)e);
        default:
        break;
    }

    // Call the native code
    nativeHandleEvent(e);
}
 
Example #28
Source File: WComponentPeer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("fallthrough")
public void handleEvent(AWTEvent e) {
    int id = e.getID();

    if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() &&
        ((Component)target).isEnabled())
    {
        if (e instanceof MouseEvent && !(e instanceof MouseWheelEvent)) {
            handleJavaMouseEvent((MouseEvent) e);
        } else if (e instanceof KeyEvent) {
            if (handleJavaKeyEvent((KeyEvent)e)) {
                return;
            }
        }
    }

    switch(id) {
        case PaintEvent.PAINT:
            // Got native painting
            paintPending = false;
            // Fallthrough to next statement
        case PaintEvent.UPDATE:
            // Skip all painting while layouting and all UPDATEs
            // while waiting for native paint
            if (!isLayouting && ! paintPending) {
                paintArea.paint(target,shouldClearRectBeforePaint());
            }
            return;
        case FocusEvent.FOCUS_LOST:
        case FocusEvent.FOCUS_GAINED:
            handleJavaFocusEvent((FocusEvent)e);
        default:
        break;
    }

    // Call the native code
    nativeHandleEvent(e);
}
 
Example #29
Source File: WComponentPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings("fallthrough")
public void handleEvent(AWTEvent e) {
    int id = e.getID();

    if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() &&
        ((Component)target).isEnabled())
    {
        if (e instanceof MouseEvent && !(e instanceof MouseWheelEvent)) {
            handleJavaMouseEvent((MouseEvent) e);
        } else if (e instanceof KeyEvent) {
            if (handleJavaKeyEvent((KeyEvent)e)) {
                return;
            }
        }
    }

    switch(id) {
        case PaintEvent.PAINT:
            // Got native painting
            paintPending = false;
            // Fallthrough to next statement
        case PaintEvent.UPDATE:
            // Skip all painting while layouting and all UPDATEs
            // while waiting for native paint
            if (!isLayouting && ! paintPending) {
                paintArea.paint(target,shouldClearRectBeforePaint());
            }
            return;
        case FocusEvent.FOCUS_LOST:
        case FocusEvent.FOCUS_GAINED:
            handleJavaFocusEvent((FocusEvent)e);
        default:
        break;
    }

    // Call the native code
    nativeHandleEvent(e);
}
 
Example #30
Source File: XComponentPeer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void endLayout() {
    if (!paintPending && !paintArea.isEmpty()
        && !AWTAccessor.getComponentAccessor().getIgnoreRepaint(target))
    {
        // if not waiting for native painting repaint damaged area
        postEvent(new PaintEvent(target, PaintEvent.PAINT,
                                 new Rectangle()));
    }
    isLayouting = false;
}