|
@ -179,6 +179,24 @@ class ImageTilePaneSelectionModel[ImageTile](parentTilePane: ImageTilePane) exte |
|
|
this.selectedIndexes.add(index) |
|
|
this.selectedIndexes.add(index) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private def setSelectionFormatting(index: Int): Unit = { |
|
|
|
|
|
setSelectionFormatting(this.parentTilePane.getChildren.get(index).asInstanceOf[ImageTile]) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private def setSelectionFormatting(imageTile: ImageTile) = { |
|
|
|
|
|
val borderStroke = new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderStroke.THIN) |
|
|
|
|
|
imageTile.asInstanceOf[VBox].setBorder(new Border(borderStroke)) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private def clearSelectionFormatting() = { |
|
|
|
|
|
val iterator = this.parentTilePane.getChildren.iterator() |
|
|
|
|
|
while (iterator.hasNext) { |
|
|
|
|
|
//remove the selection styling |
|
|
|
|
|
val imageTile: VBox = iterator.next().asInstanceOf[VBox] |
|
|
|
|
|
imageTile.setBorder(Border.EMPTY) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
override def clearSelection(index: Int): Unit = { |
|
|
override def clearSelection(index: Int): Unit = { |
|
|
val i = this.selectedIndexes.indexOf(index) |
|
|
val i = this.selectedIndexes.indexOf(index) |
|
|
if (i >= 0) { |
|
|
if (i >= 0) { |
|
@ -221,15 +239,6 @@ class ImageTilePaneSelectionModel[ImageTile](parentTilePane: ImageTilePane) exte |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private def setSelectionFormatting(index: Int): Unit = { |
|
|
|
|
|
setSelectionFormatting(this.parentTilePane.getChildren.get(index).asInstanceOf[ImageTile]) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private def setSelectionFormatting(imageTile: ImageTile) = { |
|
|
|
|
|
val borderStroke = new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderStroke.THIN) |
|
|
|
|
|
imageTile.asInstanceOf[VBox].setBorder(new Border(borderStroke)) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override def select(obj: ImageTile): Unit = { |
|
|
override def select(obj: ImageTile): Unit = { |
|
|
if (this.parentTilePane.getChildren.contains(obj)) { |
|
|
if (this.parentTilePane.getChildren.contains(obj)) { |
|
|
clearSelectionFormatting |
|
|
clearSelectionFormatting |
|
@ -239,15 +248,6 @@ class ImageTilePaneSelectionModel[ImageTile](parentTilePane: ImageTilePane) exte |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private def clearSelectionFormatting() = { |
|
|
|
|
|
val iterator = this.parentTilePane.getChildren.iterator() |
|
|
|
|
|
while (iterator.hasNext) { |
|
|
|
|
|
//remove the selection styling |
|
|
|
|
|
val imageTile: VBox = iterator.next().asInstanceOf[VBox] |
|
|
|
|
|
imageTile.setBorder(Border.EMPTY) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override def isEmpty: Boolean = { |
|
|
override def isEmpty: Boolean = { |
|
|
this.parentTilePane.getChildren.isEmpty |
|
|
this.parentTilePane.getChildren.isEmpty |
|
|
} |
|
|
} |
|
@ -281,5 +281,4 @@ class ArrayObservableList[E] extends ModifiableObservableListBase[E] { |
|
|
def doRemove(index: Int): E = { |
|
|
def doRemove(index: Int): E = { |
|
|
delegate.remove(index) |
|
|
delegate.remove(index) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |