Closed GoogleCodeExporter closed 8 years ago
Original comment by Alain.Fa...@gmail.com
on 16 Jan 2013 at 1:12
alignment
propertyThe follow JavaFX Classes presents a "alignment" property: Labeled, TextField,
FlowPane, GridPane, HBox, StackPane, TilePane and VBox. We could create a
AlignDelegate trait in delegate package.
package scalafx.delegate
import DimensionDelegate._
import javafx.beans.{ property => jfxbp }
import javafx.{geometry => jfxg }
import scalafx.Includes._
import scalafx.geometry._
object AlignDelegate {
/**
* Types that contains `height` and `width` properties.
*/
type Aligned = {
def alignmentProperty(): jfxg.Pos
}
}
trait AlignDelegate[J <: Object with Aligned]
extends SFXDelegate[J] {
def align = delegate.alignmentProperty
def align_=(p: Pos) {
align() = p
}
}
I agree with Jarek that to give a new name to `alignment` Node's
pseudo-properties would be the best to do. However, before this, I think that
it is necessary ask in dev or users list if someone is using this
pseudo-property to avoid conflicts.
Thanks,
Rafael Afonso
Original comment by rafael.a...@gmail.com
on 19 Jan 2013 at 12:49
Now I saw that ScalaFX layouts (FlowPane, GridPane, HBox, StackPane, TilePane
and VBox) have a innerAlignment getter/setters that calls their respective
alignment property. This name was adopted excatly to avoid conflicts with
alignment Nodes's proerty (e.g. see
http://code.google.com/p/scalafx/source/browse/scalafx-core/src/main/scala/scala
fx/scene/layout/HBox.scala#88). I think that the best to do, as it was written
above, is rename aligment's Node to other name (such as externalAlignment) and
rename innerAlignment to alignment (may be using AlignDelegte trait). Again, it
will necessary verify impact of this modification over code already written.
Original comment by rafael.a...@gmail.com
on 19 Jan 2013 at 6:31
In my clone (http://code.google.com/r/rafaelafonso-scalafx/), I created a
branch 'alignment'
(http://code.google.com/r/rafaelafonso-scalafx/source/browse/?name=alignment)
where I created a AlignmentDelegate
(http://code.google.com/r/rafaelafonso-scalafx/source/browse/scalafx-core/src/ma
in/scala/scalafx/delegate/AlignmentDelegate.scala?spec=svn3fdbec2801ed7d79a18f15
9efcb98dbfe8370fbb&name=alignment&r=3fdbec2801ed7d79a18f159efcb98dbfe8370fbb)
and changed classes mentioned above.
In Layout classes there was there was a getter and setter for "innerAlignment"
that basically wraps alignmentProperty from their original classes (see
http://code.google.com/r/rafaelafonso-scalafx/source/detail?r=3fdbec2801ed7d79a1
8f159efcb98dbfe8370fbb&name=alignment as example). I isolated these methods and
moved them to AlignmentDelegate .
My question is if we'll "alignment" pseudo-property in Node with this name or
change for a more apropriated name to avoid confusion and rename
"innerAlignment" from AlignmentDelegate to "alignment".
Original comment by rafael.a...@gmail.com
on 22 Jan 2013 at 12:35
In my 'alignment'
(http://code.google.com/r/rafaelafonso-scalafx/source/browse/?name=alignment),
Node's alignment pseudo-property was renamed to alignmentInParent
(http://code.google.com/r/rafaelafonso-scalafx/source/detail?r=3ffc0095acbfdacb6
ab7f2295dd3ea8f6cacdd5d&name=alignment). Later, AlignmentDelegate's alignment
property renamed to alignment
(http://code.google.com/r/rafaelafonso-scalafx/source/detail?name=alignment&r=e3
433f5738db2229b426d7cedc130a9efd384da6) according with solicitations
(https://groups.google.com/forum/?fromgroups=#!topic/scalafx-dev/JzL0SuzCoRU).
Later, 'alignment' branch will be merged with default branch.
Original comment by rafael.a...@gmail.com
on 26 Jan 2013 at 12:49
Changes merged with default branch in main repository. See
http://code.google.com/p/scalafx/source/detail?r=33dcc6dc7eae662792efcc312af5f3a
5082ed6c9
Original comment by rafael.a...@gmail.com
on 2 Feb 2013 at 11:38
Original issue reported on code.google.com by
jpsacha
on 9 Jan 2013 at 10:04Attachments: