Skip to content

Commit 7378b39

Browse files
committed
Minor tidying of #381
1 parent d1285fb commit 7378b39

File tree

4 files changed

+7
-24
lines changed

4 files changed

+7
-24
lines changed

src/main/java/me/coley/recaf/command/impl/Remap.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,19 @@ public Void call() throws Exception {
6161

6262
byte[] manifestBytes = primary.getFiles().get("META-INF/MANIFEST.MF");
6363
if (manifestBytes != null) {
64-
debug("Found manifest file");
6564
Manifest manifest = new Manifest(new ByteArrayInputStream(manifestBytes));
6665
Attributes attr = manifest.getMainAttributes();
6766
if (!attr.isEmpty()) {
6867
String mainClass = attr.getValue("Main-Class").replaceAll("\\.", "/");
6968
if (mapped.containsKey(mainClass)) {
70-
debug("Found Main-Class attribute");
71-
attr.putValue("Main-Class", new ClassReader(mapped.get(mainClass))
72-
.getClassName().replaceAll("/", "\\."));
69+
String mappedName = new ClassReader(mapped.get(mainClass))
70+
.getClassName().replaceAll("/", "\\.");
71+
debug("Remapping Main-Class attribute in MANIFEST.MF from '{}' to '{}'", mainClass, mappedName);
72+
attr.putValue("Main-Class", mappedName);
7373
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
7474
manifest.write(outputStream);
7575
primary.getFiles().put("META-INF/MANIFEST.MF", outputStream.toByteArray());
7676
outputStream.close();
77-
debug("Remapped manifest");
7877
}
7978
}
8079
}

src/main/java/me/coley/recaf/config/ConfDisplay.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ public class ConfDisplay extends Config {
8383
@Conf("display.maxtreedepth")
8484
public int maxTreeDepth = 30;
8585

86-
/**
87-
* Displays access flags tooltip for class/field/method icons
88-
*/
89-
@Conf("display.accessflags")
90-
public boolean accessFlagsTooltip = true;
91-
9286
ConfDisplay() {
9387
super("display");
9488
}

src/main/java/me/coley/recaf/ui/controls/node/ClassNodeEditorPane.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,6 @@ public void updateItem(Integer item, boolean empty) {
244244
setGraphic(null);
245245
} else {
246246
setGraphic(UiUtil.createFieldGraphic(item));
247-
setTooltip(new Tooltip(AccessFlag.getApplicableFlags(AccessFlag.Type.FIELD).stream()
248-
.filter(flag -> (flag.getMask() & item) == flag.getMask())
249-
.map(AccessFlag::getName)
250-
.collect(Collectors.joining(", "))));
251247
}
252248
}
253249
});
@@ -316,10 +312,6 @@ public void updateItem(Integer item, boolean empty) {
316312
setGraphic(null);
317313
} else {
318314
setGraphic(UiUtil.createMethodGraphic(item));
319-
setTooltip(new Tooltip(AccessFlag.getApplicableFlags(AccessFlag.Type.METHOD).stream()
320-
.filter(flag -> (flag.getMask() & item) == flag.getMask())
321-
.map(AccessFlag::getName)
322-
.collect(Collectors.joining(", "))));
323315
}
324316
}
325317
});

src/main/java/me/coley/recaf/util/UiUtil.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import javafx.scene.image.WritableImage;
1616
import javafx.scene.paint.Color;
1717
import javafx.util.Duration;
18-
import me.coley.recaf.Recaf;
1918
import me.coley.recaf.ui.controls.IconView;
2019
import me.coley.recaf.workspace.*;
2120

@@ -192,14 +191,13 @@ private static void createAccessToolTips(Node node, AccessFlag.Type type, int ac
192191
Set<String> accessFlags = AccessFlag.getApplicableFlags(type, access).stream()
193192
.map(AccessFlag::getName).collect(Collectors.toSet());
194193
Tooltip tooltip = new Tooltip(String.join(", ", accessFlags));
194+
// Show tooltip instantly, Tooltip.install(node, tooltip) has a significant delay
195195
node.setOnMouseEntered(event -> {
196-
if (!tooltip.getText().isEmpty() && Recaf.getController().config().display().accessFlagsTooltip) {
197-
tooltip.show(node, event.getScreenX(), event.getScreenY() + 15);
196+
if (!tooltip.getText().isEmpty()) {
197+
tooltip.show(node, event.getScreenX() + 10, event.getScreenY() + 1);
198198
}
199199
});
200200
node.setOnMouseExited(event -> tooltip.hide());
201-
// This has a weird delay
202-
// Tooltip.install(node, tooltip);
203201
}
204202

205203
/**

0 commit comments

Comments
 (0)