Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
IllianiCBT committed Jul 20, 2024
1 parent 2af16d2 commit f80a68f
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions MekHQ/src/mekhq/gui/dialog/ManageAssetsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,13 @@ public int getColumnCount() {

@Override
public String getColumnName(int column) {
switch (column) {
case COL_NAME:
return "Name";
case COL_VALUE:
return "Value";
case COL_SCHEDULE:
return "Pay Frequency";
case COL_INCOME:
return "Income";
default:
return "?";
}
return switch (column) {
case COL_NAME -> "Name";
case COL_VALUE -> "Value";
case COL_SCHEDULE -> "Pay Frequency";
case COL_INCOME -> "Income";
default -> "?";
};
}

@Override
Expand Down Expand Up @@ -256,26 +251,18 @@ public Asset getAssetAt(int row) {
}

public int getColumnWidth(int c) {
switch (c) {
default:
return 10;
}
return 10;
}

public int getAlignment(int col) {
switch (col) {
case COL_NAME:
return SwingConstants.LEFT;
default:
return SwingConstants.RIGHT;
if (col == COL_NAME) {
return SwingConstants.LEFT;
}
return SwingConstants.RIGHT;
}

public String getTooltip(int row, int col) {
switch (col) {
default:
return null;
}
return null;
}

public Renderer getRenderer() {
Expand Down

0 comments on commit f80a68f

Please sign in to comment.