Skip to content

Commit

Permalink
FixedColumnsTable extends JTable
Browse files Browse the repository at this point in the history
  • Loading branch information
wsbrenk committed Oct 22, 2024
1 parent d562ea2 commit 2c96673
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
12 changes: 0 additions & 12 deletions src/main/java/core/gui/comp/table/FixedColumnsTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

import core.gui.comp.renderer.HODefaultTableCellRenderer;
import core.model.HOConfigurationIntParameter;

import javax.swing.*;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
import java.awt.*;

public class FixedColumnsTable extends JTable {
Expand All @@ -20,22 +18,12 @@ public class FixedColumnsTable extends JTable {

private final HOConfigurationIntParameter dividerLocation;

/**
* Table sorter
*/
// private final TableRowSorter<HOTableModel> tableRowSorter;

/**
* Fixed table part (left hand side)
*/
private final JTable fixed;
private final JScrollPane scrollPane;

/**
* Scrollable table part (right hand side)
*/
// private final JTable scroll;


public FixedColumnsTable(HOTableModel tableModel) {
this(tableModel, 1);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/core/gui/comp/table/HOTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public abstract class HOTableModel extends AbstractTableModel {
// protected int instance;

public TableRowSorter<HOTableModel> getRowSorter() {
if ( table != null) return (TableRowSorter<HOTableModel>) table.getRowSorter();
if ( table != null) {
return (TableRowSorter<HOTableModel>) table.getRowSorter();
}
return null;
}

Expand Down
1 change: 0 additions & 1 deletion src/main/java/core/gui/model/PlayerAnalysisModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import core.db.DBManager;
import core.gui.comp.table.HOTableModel;
import core.gui.comp.table.UserColumn;
import core.model.TranslationFacility;
import core.model.enums.MatchType;
import core.model.match.Matchdetails;
import core.model.player.Player;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/module/playerOverview/PlayerOverviewTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import core.model.match.MatchKurzInfo;
import core.model.player.Player;
import core.net.HattrickLink;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.awt.*;
Expand Down Expand Up @@ -81,7 +82,7 @@ public void mouseReleased(MouseEvent e) {
});
}

public int columnAtPoint(Point point) {
public int columnAtPoint(@NotNull Point point) {
var ret = super.columnAtPoint(point);
if (ret > -1){
return ret + getFixedColumnsCount();
Expand Down

0 comments on commit 2c96673

Please sign in to comment.