My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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)

}

Change log

r2 by ram.6383 on Jan 28, 2011   Diff
Added simplecalculator
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 988 bytes, 35 lines
Powered by Google Project Hosting