My favorites
▼
|
Sign in
scala-samples
Sample code which i used while learning Scala
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
simplecalculator
/
src
/
main
/
scala
/
MigPanel.scala
r2
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
35
package in.raam.calc
import swing._
import _root_.net.miginfocom.swing._
import scala.collection.mutable._
/**
* MigPanel
*
* Custom Scala wrapper for MigLayout
*
* @author raam
* @version 0.1
*/
class MigPanel(constraints: String, colConst: String, rowConst: String) extends Panel with LayoutContainer {
def this(constraints: String) = this(constraints, "", "")
type Constraints = String
def layoutManager = peer.getLayout.asInstanceOf[MigLayout]
override lazy val peer = new javax.swing.JPanel(new MigLayout(constraints, colConst, rowConst)) with SuperMixin
override def contents: MigContent = new MigContent
protected class MigContent extends Content { def +=(c: Component, l: Constraints) = add(c, l) }
protected def constraintsFor(comp: Component) =
layoutManager.getConstraintMap.get(comp.peer).toString
protected def areValid(c: Constraints): (Boolean, String) = (true, "")
protected def add(c: Component, l: Constraints) = peer.add(c.peer, l)
}
Show details
Hide details
Change log
r2
by ram.6383 on Jan 28, 2011
Diff
Added simplecalculator
Go to:
/trunk/simplecalculator
/trunk/simplecalculator/.ensime
/trunk/simplecalculator/src
/trunk/simplecalculator/src/main
...plecalculator/src/main/resources
.../simplecalculator/src/main/scala
.../src/main/scala/Calculator.scala
...or/src/main/scala/MigPanel.scala
/trunk/simplecalculator/src/test
...plecalculator/src/test/resources
.../simplecalculator/src/test/scala
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 988 bytes, 35 lines
View raw file
Powered by
Google Project Hosting