mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-24 22:50:45 +00:00
small dump view change
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.jpexs.decompiler.flash.gui;
|
package com.jpexs.decompiler.flash.gui;
|
||||||
|
|
||||||
|
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
@@ -116,8 +117,27 @@ public class DumpViewPanel extends JPanel {
|
|||||||
add(new JScrollPane(dumpViewHexTable), BorderLayout.CENTER);
|
add(new JScrollPane(dumpViewHexTable), BorderLayout.CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setData(byte[] data) {
|
public void setData(byte[] data, DumpInfo dumpInfo) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
|
|
||||||
|
if (dumpInfo.lengthBytes != 0 || dumpInfo.lengthBits != 0) {
|
||||||
|
// todo
|
||||||
|
int end = (int) dumpInfo.startByte;
|
||||||
|
if (dumpInfo.lengthBytes != 0) {
|
||||||
|
end += dumpInfo.lengthBytes;
|
||||||
|
} else {
|
||||||
|
int bits = dumpInfo.startBit + dumpInfo.lengthBits;
|
||||||
|
end += bits / 8;
|
||||||
|
if (bits % 8 != 0) {
|
||||||
|
end++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//setSelectedRange((int) dumpInfo.startByte, end - 1);
|
||||||
|
setLabelText("startByte: " + dumpInfo.startByte
|
||||||
|
+ " startBit: " + dumpInfo.startBit
|
||||||
|
+ " lengthBytes: " + dumpInfo.lengthBytes
|
||||||
|
+ " lengthBits: " + dumpInfo.lengthBits);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLabelText(String text) {
|
public void setLabelText(String text) {
|
||||||
|
|||||||
@@ -2381,16 +2381,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
|
|
||||||
private void dumpTreeValueChanged(TreeSelectionEvent e) {
|
private void dumpTreeValueChanged(TreeSelectionEvent e) {
|
||||||
DumpInfo dumpInfo = (DumpInfo) e.getPath().getLastPathComponent();
|
DumpInfo dumpInfo = (DumpInfo) e.getPath().getLastPathComponent();
|
||||||
if (dumpInfo.lengthBytes != 0 || dumpInfo.lengthBits != 0) {
|
|
||||||
// todo
|
|
||||||
dumpViewPanel.setLabelText("startByte: " + dumpInfo.startByte
|
|
||||||
+ " startBit: " + dumpInfo.startBit
|
|
||||||
+ " lengthBytes: " + dumpInfo.lengthBytes
|
|
||||||
+ " lengthBits: " + dumpInfo.lengthBits);
|
|
||||||
}
|
|
||||||
|
|
||||||
// todo honfika: support multiple swf
|
// todo honfika: support multiple swf
|
||||||
dumpViewPanel.setData(swfs.get(0).swfs.get(0).uncompressedData);
|
dumpViewPanel.setData(swfs.get(0).swfs.get(0).uncompressedData, dumpInfo);
|
||||||
dumpViewPanel.revalidate();
|
dumpViewPanel.revalidate();
|
||||||
showCard(CARDDUMPVIEW);
|
showCard(CARDDUMPVIEW);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user