Skip to content

Commit

Permalink
Porting HOTableModel and others to Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
wsbrenk committed Nov 4, 2024
1 parent 86a15b6 commit 2663987
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/main/java/core/gui/comp/table/HOTableModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ abstract class HOTableModel protected constructor(
get() {
val columnNames =
arrayOfNulls<String>(displayedColumnCount)
for (i in getDisplayedColumns().indices) columnNames[i] = getDisplayedColumns()[i]!!.getColumnName()
for (i in getDisplayedColumns().indices) columnNames[i] = getDisplayedColumns()[i].getColumnName()
return columnNames
}

Expand All @@ -87,7 +87,7 @@ abstract class HOTableModel protected constructor(
*/
get() {
val tooltips = arrayOfNulls<String>(displayedColumnCount)
for (i in getDisplayedColumns().indices) tooltips[i] = getDisplayedColumns()[i]!!.getTooltip()
for (i in getDisplayedColumns().indices) tooltips[i] = getDisplayedColumns()[i].getTooltip()
return tooltips
}

Expand Down Expand Up @@ -177,7 +177,7 @@ abstract class HOTableModel protected constructor(
*/
override fun getColumnName(columnIndex: Int): String? {
if (displayedColumnCount > columnIndex) {
return getDisplayedColumns()[columnIndex]!!.getColumnName()
return getDisplayedColumns()[columnIndex].getColumnName()
}

return null
Expand Down Expand Up @@ -205,7 +205,7 @@ abstract class HOTableModel protected constructor(
fun getPositionInArray(searchid: Int): Int {
val tmpColumns = getDisplayedColumns()
for (i in tmpColumns.indices) {
if (tmpColumns[i]!!.getId() == searchid) return i
if (tmpColumns[i].getId() == searchid) return i
}
return -1
}
Expand Down Expand Up @@ -310,7 +310,7 @@ abstract class HOTableModel protected constructor(
for (i in 0 until displayedColumnsCount) {
val userColumn = displayedColumns[i]
val tableColumn = getTableColumn(table, i)
tableColumn.identifier = userColumn!!.getId()
tableColumn.identifier = userColumn.getId()
}
getUserColumnSettings(table)
val rowSorter = TableRowSorter(this)
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/core/model/HOConfigurationIntParameter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class HOConfigurationIntParameter(key: String, defaultValue: Int) :

/**
* Constructor calls string constructor
* @param key Parameter key
* @param defaultValue Default integer value
*/
init {
this.intValue = parameters.getInt(key, defaultValue)
Expand Down

0 comments on commit 2663987

Please sign in to comment.