From 41706f291f7f6213f096da48c2db8b19a5fdded4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Karlstr=C3=B6m?= Date: Thu, 7 Mar 2024 15:54:46 +0100 Subject: [PATCH] Add compress and endian to run TaskInfoPane --- main/src/main/java/se/trixon/cric/Cric.java | 3 +++ main/src/main/java/se/trixon/cric/core/Task.java | 8 ++++++++ .../main/java/se/trixon/cric/ui/TaskInfoPane.java | 13 +++++++++++++ .../main/java/se/trixon/cric/ui/TaskListEditor.java | 1 + 4 files changed, 25 insertions(+) diff --git a/main/src/main/java/se/trixon/cric/Cric.java b/main/src/main/java/se/trixon/cric/Cric.java index a5f2344..8b75656 100644 --- a/main/src/main/java/se/trixon/cric/Cric.java +++ b/main/src/main/java/se/trixon/cric/Cric.java @@ -52,6 +52,9 @@ public class Cric { public static void displaySystemInformation() { sGlobalState.put(KEY_INFO, SystemHelper.getSystemInfo()); + var io = IOProvider.getDefault().getIO(Dict.INFORMATION.toString(), false); + var outputHelper = new OutputHelper(Dict.INFORMATION.toString(), io, false); + outputHelper.println(OutputLineMode.ERROR, "\nWelcome to CRIC, the Custom Runtime Image Creator (with cross-targeting) "); } public static GlobalState getGlobalState() { diff --git a/main/src/main/java/se/trixon/cric/core/Task.java b/main/src/main/java/se/trixon/cric/core/Task.java index 5e273b8..45dd009 100644 --- a/main/src/main/java/se/trixon/cric/core/Task.java +++ b/main/src/main/java/se/trixon/cric/core/Task.java @@ -140,6 +140,10 @@ public int getCompress() { return mCompress; } + public String getCompressString() { + return "Zip-%d".formatted(mCompress); + } + public String getDescription() { return StringUtils.defaultString(mDescription); } @@ -148,6 +152,10 @@ public int getEndian() { return mEndian; } + public String getEndianString() { + return new String[]{"Native", "Little", "Big"}[mEndian]; + } + public String getId() { return mId; } diff --git a/main/src/main/java/se/trixon/cric/ui/TaskInfoPane.java b/main/src/main/java/se/trixon/cric/ui/TaskInfoPane.java index 71f90fc..71de561 100644 --- a/main/src/main/java/se/trixon/cric/ui/TaskInfoPane.java +++ b/main/src/main/java/se/trixon/cric/ui/TaskInfoPane.java @@ -71,6 +71,10 @@ void load(Task task) { public class SummaryDetails extends TextFlow { + private final Text mCompressHeaderText = new Text("\n\ncompress "); + private final Text mCompressText = new Text(); + private final Text mEndianHeaderText = new Text("\t\tendian "); + private final Text mEndianText = new Text(); private final Text mJLinkHeaderText = new Text("\n\njlink\n"); private final Text mJLinkText = new Text(); private final Text mLauncherHeaderText = new Text("\nlauncher\n"); @@ -92,12 +96,17 @@ void load(Task task) { sb.append(getBallotBox(task.isStripDebug())).append(" strip-debug"); mOptionsBallotsText.setText(sb.toString()); + + mEndianText.setText(task.getEndianString()); + mCompressText.setText(task.getCompressString()); mJLinkText.setText(task.getJlinkString()); mOutputText.setText(task.getOutput().getPath()); mLauncherText.setText(task.getLauncher()); getChildren().setAll( mOptionsBallotsText, + mCompressHeaderText, mCompressText, + mEndianHeaderText, mEndianText, mJLinkHeaderText, mJLinkText, mLauncherHeaderText, @@ -107,12 +116,16 @@ void load(Task task) { ); var headerTexts = new HashSet(); + headerTexts.add(mCompressHeaderText); + headerTexts.add(mEndianHeaderText); headerTexts.add(mJLinkHeaderText); headerTexts.add(mOutputHeaderText); headerTexts.add(mLauncherHeaderText); var bodyTexts = new HashSet(); bodyTexts.add(mOptionsBallotsText); + bodyTexts.add(mCompressText); + bodyTexts.add(mEndianText); bodyTexts.add(mJLinkText); bodyTexts.add(mOutputText); bodyTexts.add(mLauncherText); diff --git a/main/src/main/java/se/trixon/cric/ui/TaskListEditor.java b/main/src/main/java/se/trixon/cric/ui/TaskListEditor.java index 5173ef9..6910622 100644 --- a/main/src/main/java/se/trixon/cric/ui/TaskListEditor.java +++ b/main/src/main/java/se/trixon/cric/ui/TaskListEditor.java @@ -90,6 +90,7 @@ protected void fxConstructor() { private void init() { mEditableList = new NbEditableList.Builder() + .setIconSize(FxHelper.getUIScaled(22)) .setItemSingular(Dict.TASK.toString()) .setItemPlural(Dict.TASKS.toString()) .setItemsProperty(mTaskManager.itemsProperty())