src/solaris/classes/sun/awt/X11/XComponentPeer.java

Print this page

        

*** 212,232 **** /** * Called when component receives focus */ public void focusGained(FocusEvent e) { ! if (focusLog.isLoggable(PlatformLogger.FINE)) { focusLog.fine("{0}", e); } bHasFocus = true; } /** * Called when component loses focus */ public void focusLost(FocusEvent e) { ! if (focusLog.isLoggable(PlatformLogger.FINE)) { focusLog.fine("{0}", e); } bHasFocus = false; } --- 212,232 ---- /** * Called when component receives focus */ public void focusGained(FocusEvent e) { ! if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("{0}", e); } bHasFocus = true; } /** * Called when component loses focus */ public void focusLost(FocusEvent e) { ! if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("{0}", e); } bHasFocus = false; }
*** 296,306 **** case XKeyboardFocusManagerPeer.SNFH_FAILURE: return false; case XKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED: // Currently we just generate focus events like we deal with lightweight instead of calling // XSetInputFocus on native window ! if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer("Proceeding with request to " + lightweightChild + " in " + target); } /** * The problems with requests in non-focused window arise because shouldNativelyFocusHeavyweight --- 296,306 ---- case XKeyboardFocusManagerPeer.SNFH_FAILURE: return false; case XKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED: // Currently we just generate focus events like we deal with lightweight instead of calling // XSetInputFocus on native window ! if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Proceeding with request to " + lightweightChild + " in " + target); } /** * The problems with requests in non-focused window arise because shouldNativelyFocusHeavyweight
*** 323,333 **** * when a component inside a Frame is requesting focus. * See 6314575 for details. */ boolean res = wpeer.requestWindowFocus(null); ! if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer("Requested window focus: " + res); } // If parent window can be made focused and has been made focused(synchronously) // then we can proceed with children, otherwise we retreat. if (!(res && parentWindow.isFocused())) { --- 323,333 ---- * when a component inside a Frame is requesting focus. * See 6314575 for details. */ boolean res = wpeer.requestWindowFocus(null); ! if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Requested window focus: " + res); } // If parent window can be made focused and has been made focused(synchronously) // then we can proceed with children, otherwise we retreat. if (!(res && parentWindow.isFocused())) {
*** 345,363 **** } return false; } private boolean rejectFocusRequestHelper(String logMsg) { ! if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer(logMsg); } XKeyboardFocusManagerPeer.removeLastFocusRequest(target); return false; } void handleJavaFocusEvent(AWTEvent e) { ! if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer(e.toString()); } if (e.getID() == FocusEvent.FOCUS_GAINED) { focusGained((FocusEvent)e); } else { --- 345,363 ---- } return false; } private boolean rejectFocusRequestHelper(String logMsg) { ! if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer(logMsg); } XKeyboardFocusManagerPeer.removeLastFocusRequest(target); return false; } void handleJavaFocusEvent(AWTEvent e) { ! if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer(e.toString()); } if (e.getID() == FocusEvent.FOCUS_GAINED) { focusGained((FocusEvent)e); } else {
*** 384,394 **** /** * @see java.awt.peer.ComponentPeer */ public void setEnabled(final boolean value) { ! if (enableLog.isLoggable(PlatformLogger.FINE)) { enableLog.fine("{0}ing {1}", (value ? "Enabl" : "Disabl"), this); } boolean status = value; // If any of our heavyweight ancestors are disable, we should be too // See 6176875 for more information --- 384,394 ---- /** * @see java.awt.peer.ComponentPeer */ public void setEnabled(final boolean value) { ! if (enableLog.isLoggable(PlatformLogger.Level.FINE)) { enableLog.fine("{0}ing {1}", (value ? "Enabl" : "Disabl"), this); } boolean status = value; // If any of our heavyweight ancestors are disable, we should be too // See 6176875 for more information
*** 465,481 **** 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; } --- 465,481 ---- 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; }
*** 638,648 **** g.drawLine(x+1, y+height, x+width, y+height); // bottom g.drawLine(x+width, y+height, x+width, y+1); // right } public void setBackground(Color c) { ! if (log.isLoggable(PlatformLogger.FINE)) { log.fine("Set background to " + c); } synchronized (getStateLock()) { background = c; } --- 638,648 ---- g.drawLine(x+1, y+height, x+width, y+height); // bottom g.drawLine(x+width, y+height, x+width, y+1); // right } public void setBackground(Color c) { ! if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Set background to " + c); } synchronized (getStateLock()) { background = c; }
*** 649,659 **** super.setBackground(c); repaint(); } public void setForeground(Color c) { ! if (log.isLoggable(PlatformLogger.FINE)) { log.fine("Set foreground to " + c); } synchronized (getStateLock()) { foreground = c; } --- 649,659 ---- super.setBackground(c); repaint(); } public void setForeground(Color c) { ! if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Set foreground to " + c); } synchronized (getStateLock()) { foreground = c; }
*** 670,680 **** * @see java.awt.peer.ComponentPeer#getFontMetrics(Font) * @see Toolkit#getFontMetrics(Font) * @since JDK1.0 */ public FontMetrics getFontMetrics(Font font) { ! if (fontLog.isLoggable(PlatformLogger.FINE)) { fontLog.fine("Getting font metrics for " + font); } return sun.font.FontDesignMetrics.getMetrics(font); } --- 670,680 ---- * @see java.awt.peer.ComponentPeer#getFontMetrics(Font) * @see Toolkit#getFontMetrics(Font) * @since JDK1.0 */ public FontMetrics getFontMetrics(Font font) { ! if (fontLog.isLoggable(PlatformLogger.Level.FINE)) { fontLog.fine("Getting font metrics for " + font); } return sun.font.FontDesignMetrics.getMetrics(font); }
*** 1156,1166 **** private BufferCapabilities backBufferCaps; public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException { ! if (buffersLog.isLoggable(PlatformLogger.FINE)) { buffersLog.fine("createBuffers(" + numBuffers + ", " + caps + ")"); } // set the caps first, they're used when creating the bb backBufferCaps = caps; backBuffer = graphicsConfig.createBackBuffer(this, numBuffers, caps); --- 1156,1166 ---- private BufferCapabilities backBufferCaps; public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException { ! if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) { buffersLog.fine("createBuffers(" + numBuffers + ", " + caps + ")"); } // set the caps first, they're used when creating the bb backBufferCaps = caps; backBuffer = graphicsConfig.createBackBuffer(this, numBuffers, caps);
*** 1174,1184 **** } public void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction) { ! if (buffersLog.isLoggable(PlatformLogger.FINE)) { buffersLog.fine("flip(" + flipAction + ")"); } if (backBuffer == 0) { throw new IllegalStateException("Buffers have not been created"); } --- 1174,1184 ---- } public void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction) { ! if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) { buffersLog.fine("flip(" + flipAction + ")"); } if (backBuffer == 0) { throw new IllegalStateException("Buffers have not been created"); }
*** 1185,1205 **** graphicsConfig.flip(this, target, xBackBuffer, x1, y1, x2, y2, flipAction); } public Image getBackBuffer() { ! if (buffersLog.isLoggable(PlatformLogger.FINE)) { buffersLog.fine("getBackBuffer()"); } if (backBuffer == 0) { throw new IllegalStateException("Buffers have not been created"); } return xBackBuffer; } public void destroyBuffers() { ! if (buffersLog.isLoggable(PlatformLogger.FINE)) { buffersLog.fine("destroyBuffers()"); } graphicsConfig.destroyBackBuffer(backBuffer); backBuffer = 0; xBackBuffer = null; --- 1185,1205 ---- graphicsConfig.flip(this, target, xBackBuffer, x1, y1, x2, y2, flipAction); } public Image getBackBuffer() { ! if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) { buffersLog.fine("getBackBuffer()"); } if (backBuffer == 0) { throw new IllegalStateException("Buffers have not been created"); } return xBackBuffer; } public void destroyBuffers() { ! if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) { buffersLog.fine("destroyBuffers()"); } graphicsConfig.destroyBackBuffer(backBuffer); backBuffer = 0; xBackBuffer = null;
*** 1230,1240 **** * Returns true if this event is disabled and shouldn't be processed by window * Currently if target component is disabled the following event will be disabled on window: * ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify */ protected boolean isEventDisabled(XEvent e) { ! if (enableLog.isLoggable(PlatformLogger.FINEST)) { enableLog.finest("Component is {1}, checking for disabled event {0}", e, (isEnabled()?"enabled":"disable")); } if (!isEnabled()) { switch (e.get_type()) { case XConstants.ButtonPress: --- 1230,1240 ---- * Returns true if this event is disabled and shouldn't be processed by window * Currently if target component is disabled the following event will be disabled on window: * ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify */ protected boolean isEventDisabled(XEvent e) { ! if (enableLog.isLoggable(PlatformLogger.Level.FINEST)) { enableLog.finest("Component is {1}, checking for disabled event {0}", e, (isEnabled()?"enabled":"disable")); } if (!isEnabled()) { switch (e.get_type()) { case XConstants.ButtonPress:
*** 1242,1252 **** case XConstants.KeyPress: case XConstants.KeyRelease: case XConstants.EnterNotify: case XConstants.LeaveNotify: case XConstants.MotionNotify: ! if (enableLog.isLoggable(PlatformLogger.FINER)) { enableLog.finer("Event {0} is disable", e); } return true; } } --- 1242,1252 ---- case XConstants.KeyPress: case XConstants.KeyRelease: case XConstants.EnterNotify: case XConstants.LeaveNotify: case XConstants.MotionNotify: ! if (enableLog.isLoggable(PlatformLogger.Level.FINER)) { enableLog.finer("Event {0} is disable", e); } return true; } }
*** 1365,1375 **** * Applies the shape to the X-window. * @since 1.7 */ public void applyShape(Region shape) { if (XlibUtil.isShapingSupported()) { ! if (shapeLog.isLoggable(PlatformLogger.FINER)) { shapeLog.finer( "*** INFO: Setting shape: PEER: " + this + "; WINDOW: " + getWindow() + "; TARGET: " + target + "; SHAPE: " + shape); --- 1365,1375 ---- * Applies the shape to the X-window. * @since 1.7 */ public void applyShape(Region shape) { if (XlibUtil.isShapingSupported()) { ! if (shapeLog.isLoggable(PlatformLogger.Level.FINER)) { shapeLog.finer( "*** INFO: Setting shape: PEER: " + this + "; WINDOW: " + getWindow() + "; TARGET: " + target + "; SHAPE: " + shape);
*** 1395,1405 **** } } finally { XToolkit.awtUnlock(); } } else { ! if (shapeLog.isLoggable(PlatformLogger.FINER)) { shapeLog.finer("*** WARNING: Shaping is NOT supported!"); } } } --- 1395,1405 ---- } } finally { XToolkit.awtUnlock(); } } else { ! if (shapeLog.isLoggable(PlatformLogger.Level.FINER)) { shapeLog.finer("*** WARNING: Shaping is NOT supported!"); } } }