Skip to content

Commit

Permalink
Add compress and endian to run TaskInfoPane
Browse files Browse the repository at this point in the history
  • Loading branch information
trixon committed Mar 7, 2024
1 parent 1163524 commit 41706f2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main/src/main/java/se/trixon/cric/Cric.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 8 additions & 0 deletions main/src/main/java/se/trixon/cric/core/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public int getCompress() {
return mCompress;
}

public String getCompressString() {
return "Zip-%d".formatted(mCompress);
}

public String getDescription() {
return StringUtils.defaultString(mDescription);
}
Expand All @@ -148,6 +152,10 @@ public int getEndian() {
return mEndian;
}

public String getEndianString() {
return new String[]{"Native", "Little", "Big"}[mEndian];
}

public String getId() {
return mId;
}
Expand Down
13 changes: 13 additions & 0 deletions main/src/main/java/se/trixon/cric/ui/TaskInfoPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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,
Expand All @@ -107,12 +116,16 @@ void load(Task task) {
);

var headerTexts = new HashSet<Text>();
headerTexts.add(mCompressHeaderText);
headerTexts.add(mEndianHeaderText);
headerTexts.add(mJLinkHeaderText);
headerTexts.add(mOutputHeaderText);
headerTexts.add(mLauncherHeaderText);

var bodyTexts = new HashSet<Text>();
bodyTexts.add(mOptionsBallotsText);
bodyTexts.add(mCompressText);
bodyTexts.add(mEndianText);
bodyTexts.add(mJLinkText);
bodyTexts.add(mOutputText);
bodyTexts.add(mLauncherText);
Expand Down
1 change: 1 addition & 0 deletions main/src/main/java/se/trixon/cric/ui/TaskListEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ protected void fxConstructor() {

private void init() {
mEditableList = new NbEditableList.Builder<Task>()
.setIconSize(FxHelper.getUIScaled(22))
.setItemSingular(Dict.TASK.toString())
.setItemPlural(Dict.TASKS.toString())
.setItemsProperty(mTaskManager.itemsProperty())
Expand Down

0 comments on commit 41706f2

Please sign in to comment.