Java Code Examples for java.awt.event.PaintEvent#UPDATE

The following examples show how to use java.awt.event.PaintEvent#UPDATE . 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: 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 4
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 5
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 6
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 7
Source File: WComponentPeer.java    From openjdk-8 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 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-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 (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-jdk9 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 12
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 13
Source File: WComponentPeer.java    From hottub 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 14
Source File: WComponentPeer.java    From jdk8u60 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 15
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 16
Source File: XComponentPeer.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void handleEvent(java.awt.AWTEvent e) {
    if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() && target.isEnabled())  {
        if (e instanceof MouseEvent) {
            if (e instanceof MouseWheelEvent) {
                handleJavaMouseWheelEvent((MouseWheelEvent) e);
            }
            else
                handleJavaMouseEvent((MouseEvent) e);
        }
        else if (e instanceof KeyEvent) {
            handleF10JavaKeyEvent((KeyEvent)e);
            handleJavaKeyEvent((KeyEvent)e);
        }
    }
    else if (e instanceof KeyEvent && !((InputEvent)e).isConsumed()) {
        // even if target is disabled.
        handleF10JavaKeyEvent((KeyEvent)e);
    }
    else if (e instanceof InputMethodEvent) {
        handleJavaInputMethodEvent((InputMethodEvent) e);
    }

    int id = e.getID();

    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,false);
          }
          return;
      case FocusEvent.FOCUS_LOST:
      case FocusEvent.FOCUS_GAINED:
          handleJavaFocusEvent(e);
          break;
      case WindowEvent.WINDOW_LOST_FOCUS:
      case WindowEvent.WINDOW_GAINED_FOCUS:
          handleJavaWindowFocusEvent(e);
          break;
      default:
          break;
    }

}
 
Example 17
Source File: XComponentPeer.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void handleEvent(java.awt.AWTEvent e) {
    if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() && target.isEnabled())  {
        if (e instanceof MouseEvent) {
            if (e instanceof MouseWheelEvent) {
                handleJavaMouseWheelEvent((MouseWheelEvent) e);
            }
            else
                handleJavaMouseEvent((MouseEvent) e);
        }
        else if (e instanceof KeyEvent) {
            handleF10JavaKeyEvent((KeyEvent)e);
            handleJavaKeyEvent((KeyEvent)e);
        }
    }
    else if (e instanceof KeyEvent && !((InputEvent)e).isConsumed()) {
        // even if target is disabled.
        handleF10JavaKeyEvent((KeyEvent)e);
    }
    else if (e instanceof InputMethodEvent) {
        handleJavaInputMethodEvent((InputMethodEvent) e);
    }

    int id = e.getID();

    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,false);
          }
          return;
      case FocusEvent.FOCUS_LOST:
      case FocusEvent.FOCUS_GAINED:
          handleJavaFocusEvent(e);
          break;
      case WindowEvent.WINDOW_LOST_FOCUS:
      case WindowEvent.WINDOW_GAINED_FOCUS:
          handleJavaWindowFocusEvent(e);
          break;
      default:
          break;
    }

}
 
Example 18
Source File: XComponentPeer.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void handleEvent(java.awt.AWTEvent e) {
    if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() && target.isEnabled())  {
        if (e instanceof MouseEvent) {
            if (e instanceof MouseWheelEvent) {
                handleJavaMouseWheelEvent((MouseWheelEvent) e);
            }
            else
                handleJavaMouseEvent((MouseEvent) e);
        }
        else if (e instanceof KeyEvent) {
            handleF10JavaKeyEvent((KeyEvent)e);
            handleJavaKeyEvent((KeyEvent)e);
        }
    }
    else if (e instanceof KeyEvent && !((InputEvent)e).isConsumed()) {
        // even if target is disabled.
        handleF10JavaKeyEvent((KeyEvent)e);
    }
    else if (e instanceof InputMethodEvent) {
        handleJavaInputMethodEvent((InputMethodEvent) e);
    }

    int id = e.getID();

    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,false);
          }
          return;
      case FocusEvent.FOCUS_LOST:
      case FocusEvent.FOCUS_GAINED:
          handleJavaFocusEvent(e);
          break;
      case WindowEvent.WINDOW_LOST_FOCUS:
      case WindowEvent.WINDOW_GAINED_FOCUS:
          handleJavaWindowFocusEvent(e);
          break;
      default:
          break;
    }

}
 
Example 19
Source File: XComponentPeer.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void handleEvent(java.awt.AWTEvent e) {
    if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() && target.isEnabled())  {
        if (e instanceof MouseEvent) {
            if (e instanceof MouseWheelEvent) {
                handleJavaMouseWheelEvent((MouseWheelEvent) e);
            }
            else
                handleJavaMouseEvent((MouseEvent) e);
        }
        else if (e instanceof KeyEvent) {
            handleF10JavaKeyEvent((KeyEvent)e);
            handleJavaKeyEvent((KeyEvent)e);
        }
    }
    else if (e instanceof KeyEvent && !((InputEvent)e).isConsumed()) {
        // even if target is disabled.
        handleF10JavaKeyEvent((KeyEvent)e);
    }
    else if (e instanceof InputMethodEvent) {
        handleJavaInputMethodEvent((InputMethodEvent) e);
    }

    int id = e.getID();

    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,false);
          }
          return;
      case FocusEvent.FOCUS_LOST:
      case FocusEvent.FOCUS_GAINED:
          handleJavaFocusEvent(e);
          break;
      case WindowEvent.WINDOW_LOST_FOCUS:
      case WindowEvent.WINDOW_GAINED_FOCUS:
          handleJavaWindowFocusEvent(e);
          break;
      default:
          break;
    }

}
 
Example 20
Source File: XComponentPeer.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void handleEvent(java.awt.AWTEvent e) {
    if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() && target.isEnabled())  {
        if (e instanceof MouseEvent) {
            if (e instanceof MouseWheelEvent) {
                handleJavaMouseWheelEvent((MouseWheelEvent) e);
            }
            else
                handleJavaMouseEvent((MouseEvent) e);
        }
        else if (e instanceof KeyEvent) {
            handleF10JavaKeyEvent((KeyEvent)e);
            handleJavaKeyEvent((KeyEvent)e);
        }
    }
    else if (e instanceof KeyEvent && !((InputEvent)e).isConsumed()) {
        // even if target is disabled.
        handleF10JavaKeyEvent((KeyEvent)e);
    }
    else if (e instanceof InputMethodEvent) {
        handleJavaInputMethodEvent((InputMethodEvent) e);
    }

    int id = e.getID();

    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,false);
          }
          return;
      case FocusEvent.FOCUS_LOST:
      case FocusEvent.FOCUS_GAINED:
          handleJavaFocusEvent(e);
          break;
      case WindowEvent.WINDOW_LOST_FOCUS:
      case WindowEvent.WINDOW_GAINED_FOCUS:
          handleJavaWindowFocusEvent(e);
          break;
      default:
          break;
    }

}