Skip to content

Commit

Permalink
8265440: IGV: make node selection more visible
Browse files Browse the repository at this point in the history
Reviewed-by: chagedorn, neliasso
  • Loading branch information
jyukutyo authored and chhagedorn committed Jun 8, 2021
1 parent 81bad59 commit fd91b2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -164,8 +164,10 @@ protected void notifyStateChanged(ObjectState previousState, ObjectState state)
super.notifyStateChanged(previousState, state);

Font font = this.figure.getDiagram().getFont();
int thickness = 1;
if (state.isSelected()) {
font = this.figure.getDiagram().getBoldFont();
thickness = 2;
}

Color borderColor = Color.BLACK;
Expand All @@ -174,7 +176,7 @@ protected void notifyStateChanged(ObjectState previousState, ObjectState state)
innerBorderColor = borderColor = Color.BLUE;
}

middleWidget.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(borderColor, 1), BorderFactory.createLineBorder(innerBorderColor, 1)));
middleWidget.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(borderColor, thickness), BorderFactory.createLineBorder(innerBorderColor, 1)));
for (LabelWidget labelWidget : labelWidgets) {
labelWidget.setFont(font);
}
Expand Down
Expand Up @@ -28,6 +28,7 @@
import com.sun.hotspot.igv.graph.Slot;
import com.sun.hotspot.igv.util.DoubleClickHandler;
import com.sun.hotspot.igv.view.DiagramScene;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
Expand Down Expand Up @@ -103,6 +104,9 @@ protected void paintWidget() {
Font font = this.getSlot().getFigure().getDiagram().getSlotFont();
if (this.getState().isSelected()) {
font = font.deriveFont(Font.BOLD);
g.setStroke(new BasicStroke(1.5f));
} else {
g.setStroke(new BasicStroke(1f));
}

if (getSlot().getShortName() != null && getSlot().getShortName().length() > 0) {
Expand Down

1 comment on commit fd91b2a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.