本文整理汇总了Java中java.awt.event.PaintEvent.UPDATE属性的典型用法代码示例。如果您正苦于以下问题:Java PaintEvent.UPDATE属性的具体用法?Java PaintEvent.UPDATE怎么用?Java PaintEvent.UPDATE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.event.PaintEvent
的用法示例。
在下文中一共展示了PaintEvent.UPDATE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: coalescePaintEvent
@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;
}
}
}
示例2: coalescePaintEvent
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;
}
}
}
示例3: handleEvent
public void handleEvent (AWTEvent event)
{
int id = event.getID();
KeyEvent ke = null;
switch (id)
{
case PaintEvent.PAINT:
paintComponent((PaintEvent) event);
break;
case PaintEvent.UPDATE:
updateComponent((PaintEvent) event);
break;
case KeyEvent.KEY_PRESSED:
ke = (KeyEvent) event;
gtkWidgetDispatchKeyEvent (ke.getID (), ke.getWhen (), ke.getModifiersEx (),
ke.getKeyCode (), ke.getKeyLocation ());
break;
case KeyEvent.KEY_RELEASED:
ke = (KeyEvent) event;
gtkWidgetDispatchKeyEvent (ke.getID (), ke.getWhen (), ke.getModifiersEx (),
ke.getKeyCode (), ke.getKeyLocation ());
break;
}
}
示例4: handleEvent
public void handleEvent (AWTEvent e)
{
int eventID = e.getID();
Rectangle r;
switch (eventID)
{
case ComponentEvent.COMPONENT_SHOWN:
QtToolkit.repaintThread.queueComponent(this);
break;
case PaintEvent.PAINT:
case PaintEvent.UPDATE:
r = ((PaintEvent)e).getUpdateRect();
QtToolkit.repaintThread.queueComponent(this, r.x, r.y,
r.width, r.height);
break;
case KeyEvent.KEY_PRESSED:
break;
case KeyEvent.KEY_RELEASED:
break;
}
}
示例5: handleEvent
public void handleEvent (AWTEvent e)
{
int eventID = e.getID();
Rectangle r;
switch (eventID)
{
case ComponentEvent.COMPONENT_SHOWN:
QtToolkit.repaintThread.queueComponent(this);
break;
case PaintEvent.PAINT:
case PaintEvent.UPDATE:
r = ((PaintEvent)e).getUpdateRect();
QtToolkit.repaintThread.queueComponent(this, r.x, r.y,
r.width, r.height);
break;
case KeyEvent.KEY_PRESSED:
break;
case KeyEvent.KEY_RELEASED:
break;
}
}
示例6: coalescePaintEvent
public void coalescePaintEvent(PaintEvent e) {
Rectangle r = e.getUpdateRect();
if (!(e instanceof IgnorePaintEvent)) {
paintArea.add(r, e.getID());
}
if (log.isLoggable(PlatformLogger.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;
}
}
}
示例7: coalescePaintEvent
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.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.FINER)) {
log.finer("XCP coalescePaintEvent : PAINT : add : x = " +
r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
}
return;
}
}
}
示例8: coalescePaintEvent
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:
log.finer("XCP coalescePaintEvent : UPDATE : add : x = " +
r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
return;
case PaintEvent.PAINT:
log.finer("XCP coalescePaintEvent : PAINT : add : x = " +
r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
return;
}
}
}
示例9: coalescePaintEvent
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;
}
}
}
示例10: handleEvent
@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);
}
示例11: coalesceEvents
/**
* This is called by the EventQueue if two events with the same event id
* and owner component are queued. Returns a new combined event, or null if
* no combining is done. The coelesced events are currently mouse moves
* (intermediate ones are discarded) and paint events (a merged paint is
* created in place of the two events).
*
* @param existingEvent the event on the queue
* @param newEvent the new event that might be entered on the queue
* @return null if both events are kept, or the replacement coelesced event
*/
protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)
{
AWTEvent coalesced = null;
switch (existingEvent.id)
{
case MouseEvent.MOUSE_MOVED:
case MouseEvent.MOUSE_DRAGGED:
// Just drop the old (intermediate) event and return the new one.
MouseEvent me1 = (MouseEvent) existingEvent;
MouseEvent me2 = (MouseEvent) newEvent;
if (me1.getModifiers() == me2.getModifiers())
coalesced = newEvent;
break;
case PaintEvent.PAINT:
case PaintEvent.UPDATE:
// For heavyweights the EventQueue should ask the peer.
if (peer == null || peer instanceof LightweightPeer)
{
PaintEvent pe1 = (PaintEvent) existingEvent;
PaintEvent pe2 = (PaintEvent) newEvent;
Rectangle r1 = pe1.getUpdateRect();
Rectangle r2 = pe2.getUpdateRect();
if (r1.contains(r2))
coalesced = existingEvent;
else if (r2.contains(r1))
coalesced = newEvent;
}
else
{
// Replace the event and let the heavyweight figure out the expanding
// of the repaint area.
coalesced = newEvent;
}
break;
default:
coalesced = null;
}
return coalesced;
}
示例12: getPriority
private static int getPriority(AWTEvent theEvent) {
if (theEvent instanceof PeerEvent &&
(((PeerEvent)theEvent).getFlags() &
PeerEvent.ULTIMATE_PRIORITY_EVENT) != 0)
{
return ULTIMATE_PRIORITY;
}
if (theEvent instanceof PeerEvent &&
(((PeerEvent)theEvent).getFlags() &
PeerEvent.PRIORITY_EVENT) != 0)
{
return HIGH_PRIORITY;
}
if (theEvent instanceof PeerEvent &&
(((PeerEvent)theEvent).getFlags() &
PeerEvent.LOW_PRIORITY_EVENT) != 0)
{
return LOW_PRIORITY;
}
int id = theEvent.getID();
if (id == PaintEvent.PAINT || id == PaintEvent.UPDATE) {
return LOW_PRIORITY;
}
return NORM_PRIORITY;
}
示例13: eventToCacheIndex
private static int eventToCacheIndex(AWTEvent e) {
switch(e.getID()) {
case PaintEvent.PAINT:
return PAINT;
case PaintEvent.UPDATE:
return UPDATE;
case MouseEvent.MOUSE_MOVED:
return MOVE;
case MouseEvent.MOUSE_DRAGGED:
return DRAG;
default:
return e instanceof PeerEvent ? PEER : -1;
}
}
示例14: handleEvent
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);
}
示例15: handleEvent
@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);
}