javax.swing.TextComponent getDocument to scala.swing.document.

peer.getDocument() replaced with document member function in scala.swing.TextComponent.
It's not obvious which form is simpler.  Typical uses of grid 
constraints modify
the constraints between applications to components.  Not all of the 
constraint
properties are modified between each application.

The original source code changes from

   c.gridwidth = java.awt.GridBagConstraints.REMAINDER
   c.fill = GridBagPanel.Fill.Horizontal
   layout(textField) = c
   c.fill = GridBagPanel.Fill.Both
   c.weightx = 1.0
   c.weighty = 1.0
   layout(scrollPane) = c

to

   val c1: Constraints = new Constraints() {
       gridwidth = java.awt.GridBagConstraints.REMAINDER
       fill = GridBagPanel.Fill.Horizontal
   }
   layout(textField) = c1

   val c2: Constraints = new Constraints() {
       gridwidth = java.awt.GridBagConstraints.REMAINDER
       fill = GridBagPanel.Fill.Both
       weightx = 1.0
       weighty = 1.0
   }
   layout(scrollPane) = c2

What do you think?
On 10/20/2014 06:16 AM, Andy Hicks wrote:
>
> In 
> examples/src/main/scala/scala/swing/examples/tutorials/components/TextDemo.scala:
>
> > + *
> > + * Source code references:
> > + * [[http://docs.oracle.com/javase/tutorial/uiswing/examples/components/TextDemoProject/src/components/TextDemo.java]]
> > + *
> > + * TextDemo.scala requires no other files.
> > + */
> > +class TextDemo extends GridBagPanel {
> > +  private val newline = "\n"
> > +  val textField = new TextField(20)
> > +  val textArea = new TextArea(5, 20) {
> > +    editable = false
> > +  }
> > +  val scrollPane = new ScrollPane(textArea)
> > +
> > +  //Add Components to this panel.
> > +  val c: Constraints = new Constraints()
>
> Does this look better
>
> |val c: Constraints = new Constraints() {
>    gridwidth = java.awt.GridBagConstraints.REMAINDER
>    fill = GridBagPanel.Fill.Both
>   ... etc
> }
> |
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/scala/scala-swing/pull/26/files#r19083188>.
>