Skip to content

Commit

Permalink
JBR-6276 Wayland: WLToolkit logs too much
Browse files Browse the repository at this point in the history
  • Loading branch information
mkartashev authored and jbrbot committed Nov 8, 2024
1 parent 070ec5b commit fee20da
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 64 deletions.
20 changes: 15 additions & 5 deletions src/java.desktop/unix/classes/sun/awt/wl/WLButtonPeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public boolean isFocusable() {

@Override
public void setLabel(String label) {
log.info("Not implemented: WLButtonPeer.setLabel(String)");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.setLabel(String)");
}
}

public void setBackground(Color c) {
Expand All @@ -58,22 +60,30 @@ public void setBackground(Color c) {

public void focusGained(FocusEvent e) {
super.focusGained(e);
log.info("Not implemented: WLButtonPeer.focusGained(FocusEvent)");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.focusGained(FocusEvent)");
}
}

public void focusLost(FocusEvent e) {
super.focusLost(e);
log.info("Not implemented: WLButtonPeer.focusLost(FocusEvent)");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.focusLost(FocusEvent)");
}
}

@Override
void paintPeer(Graphics g) {
super.paintPeer(g);
log.info("Not implemented: WLButtonPeer.paintPeer(Graphics)");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.paintPeer(Graphics)");
}
}

public Dimension getMinimumSize() {
log.info("Not implemented: WLButtonPeer.getMinimumSize()");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.getMinimumSize()");
}
return new Dimension(0, 0);
}
}
8 changes: 6 additions & 2 deletions src/java.desktop/unix/classes/sun/awt/wl/WLClipboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,16 @@ private void handleNewClipboard(long nativePtr) {
@Override
protected void registerClipboardViewerChecked() {
// TODO: is there any need to do more here?
log.info("Unimplemented");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Unimplemented");
}
}

@Override
protected void unregisterClipboardViewerChecked() {
log.info("Unimplemented");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Unimplemented");
}
}

private void notifyOfNewFormats(long[] formats) {
Expand Down
25 changes: 19 additions & 6 deletions src/java.desktop/unix/classes/sun/awt/wl/WLComponentPeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ public void setVisible(boolean v) {
* @see ComponentPeer
*/
public void setEnabled(final boolean value) {
log.info("Not implemented: WLComponentPeer.setEnabled(boolean)");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.setEnabled(boolean)");
}
}

@Override
Expand Down Expand Up @@ -393,7 +395,9 @@ public Component getTarget() {
}

public void print(Graphics g) {
log.info("Not implemented: WLComponentPeer.print(Graphics)");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.print(Graphics)");
}
}

private void setLocationTo(int newX, int newY) {
Expand Down Expand Up @@ -590,9 +594,13 @@ public void handleEvent(AWTEvent e) {
}
} else if (e instanceof KeyEvent && !((InputEvent) e).isConsumed()) {
// even if target is disabled.
log.info("Not implemented: WLComponentPeer.handleEvent(AWTEvent): handleF10JavaKeyEvent");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.handleEvent(AWTEvent): handleF10JavaKeyEvent");
}
} else if (e instanceof InputMethodEvent) {
log.info("Not implemented: WLComponentPeer.handleEvent(AWTEvent): handleJavaInputMethodEvent");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.handleEvent(AWTEvent): handleJavaInputMethodEvent");
}
}

int id = e.getID();
Expand Down Expand Up @@ -715,7 +723,10 @@ public void setForeground(Color c) {
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Set foreground to " + c);
}
log.info("Not implemented: WLComponentPeer.setForeground(Color)");

if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.setForeground(Color)");
}
}

@Override
Expand Down Expand Up @@ -848,7 +859,9 @@ public void destroyBuffers() {

@Override
public void setZOrder(ComponentPeer above) {
log.info("Not implemented: WLComponentPeer.setZOrder(ComponentPeer)");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.setZOrder(ComponentPeer)");
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ protected ByteArrayOutputStream convertFileListToBytes(ArrayList<String> fileLis
@Override
protected String[] dragQueryFile(byte[] bytes) {
// TODO
log.info("Unimplemented");
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Unimplemented");
}
return new String[0];
}

Expand Down
Loading

0 comments on commit fee20da

Please sign in to comment.