diff --git a/src/main/java/core/gui/model/PlayerOverviewTableModel.kt b/src/main/java/core/gui/model/PlayerOverviewTableModel.kt index 765b77d58..da2bf65cb 100644 --- a/src/main/java/core/gui/model/PlayerOverviewTableModel.kt +++ b/src/main/java/core/gui/model/PlayerOverviewTableModel.kt @@ -116,7 +116,7 @@ class PlayerOverviewTableModel(id: ColumnModelId, name: String) : HOTableModel(i } fun getPlayerAtRow(tableRow: Int): Player? { - if (players != null && tableRow > -1) { + if (players != null && tableRow > -1 && tableRow < players!!.size) { val modelIndex = table!!.convertRowIndexToModel(tableRow) if (modelIndex < players!!.size) { return players!![modelIndex] diff --git a/src/main/java/core/gui/model/PlayerPositionColumn.java b/src/main/java/core/gui/model/PlayerPositionColumn.java index 153ba0871..d1e0de84f 100644 --- a/src/main/java/core/gui/model/PlayerPositionColumn.java +++ b/src/main/java/core/gui/model/PlayerPositionColumn.java @@ -5,6 +5,7 @@ import core.gui.comp.entry.DoubleLabelEntries; import core.gui.comp.entry.IHOTableEntry; import core.model.HOVerwaltung; +import core.model.UserParameter; import core.model.player.IMatchRoleID; import core.model.player.Player; import core.util.Helper; @@ -31,19 +32,20 @@ public class PlayerPositionColumn extends PlayerColumn { /** * constructor * - * @param id - * @param name - * @param tooltip - * @param position + * @param id User column identifier + * @param name Column header string + * @param tooltip Column tool tip + * @param position Lineup position code */ protected PlayerPositionColumn(int id, String name, String tooltip, byte position) { super(id, name, tooltip); this.position = position; + this.preferredWidth = UserParameter.instance().fontSize * 5; } /** * returns TableEntry - * will not be overwrite + * will not be overridden */ @Override public IHOTableEntry getTableEntry(Player player, Player comparePlayer) { @@ -51,11 +53,11 @@ public IHOTableEntry getTableEntry(Player player, Player comparePlayer) { } /** - * returns player value + * Returns player value * overwritten by created columns * - * @param player - * @return + * @param player Player + * @return ColorLabelEntry */ public ColorLabelEntry getEntryValue(Player player) { var ratingPredictionModel = HOVerwaltung.instance().getModel().getRatingPredictionModel(); @@ -73,10 +75,10 @@ public ColorLabelEntry getEntryValue(Player player) { } /** - * return a value if comparePlayer is not null + * Return a value if comparePlayer is not null * - * @param player - * @param comparePlayer + * @param player Player + * @param comparePlayer Player to compare with * @return ColorLabelEntry */ public ColorLabelEntry getCompareValue(Player player, Player comparePlayer) { diff --git a/src/main/java/core/gui/model/PlayerSkillColumn.java b/src/main/java/core/gui/model/PlayerSkillColumn.java index 512387db8..6e9cadb96 100644 --- a/src/main/java/core/gui/model/PlayerSkillColumn.java +++ b/src/main/java/core/gui/model/PlayerSkillColumn.java @@ -5,6 +5,7 @@ import core.gui.comp.entry.DoubleLabelEntries; import core.gui.comp.entry.IHOTableEntry; import core.gui.comp.entry.SkillEntry; +import core.model.UserParameter; import core.model.player.Player; import core.util.Helper; @@ -38,6 +39,7 @@ public class PlayerSkillColumn extends PlayerColumn { protected PlayerSkillColumn(int id,String name, String tooltip,PlayerSkill skill){ super(id,name,tooltip); this.skill = skill; + this.preferredWidth = UserParameter.instance().fontSize * 5; background = (skill == PlayerSkill.EXPERIENCE || skill == PlayerSkill.FORM || skill == PlayerSkill.LEADERSHIP diff --git a/src/main/java/core/rating/RatingPredictionModel.java b/src/main/java/core/rating/RatingPredictionModel.java index b7f49e682..0b4f22c55 100644 --- a/src/main/java/core/rating/RatingPredictionModel.java +++ b/src/main/java/core/rating/RatingPredictionModel.java @@ -1748,6 +1748,6 @@ protected double calcCounterAttack(@NotNull Lineup lineup, int minute) { } a *= f / n; // 0,017272a + 1,042313 - return 0.01727 * a + 1.042313; + return 0.017272 * a + 1.042313; } } \ No newline at end of file diff --git a/src/main/resources/release_notes.md b/src/main/resources/release_notes.md index a5de3bc1c..96390f7b7 100644 --- a/src/main/resources/release_notes.md +++ b/src/main/resources/release_notes.md @@ -17,6 +17,7 @@ * Fix display of best position rating (#2166) * Display coach conversion costs (#2204) * New column "trainer notes" (#2229) +* Fix initial size of skill and position columns (#2217) * Fix long shot rating calculation (#2237) ### Team Analyzer