summaryrefslogtreecommitdiff
path: root/src/swing/scala/swing/Oriented.scala
blob: 7996d2189802ef9a40075a0ccc56b177e3d761a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2007-2013, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */



package scala.swing

object Oriented {
  trait Wrapper extends Oriented {
    def peer: OrientedMixin

    /*
     * Need to revert to structural type, since scroll bars are oriented
     * and these are created by scroll panes. Shouldn't be a bootleneck.
     */
    protected type OrientedMixin = {
      def getOrientation(): Int
      def setOrientation(n: Int)
    }
    def orientation: Orientation.Value = Orientation(peer.getOrientation)
  }
}

/**
 * Something that can have an orientation.
 */
trait Oriented {
  def orientation: Orientation.Value
}