diff options
-rw-r--r-- | build.xml | 31 | ||||
-rw-r--r-- | docs/examples/swing/ColorChooserDemo.scala | 61 | ||||
-rw-r--r-- | docs/examples/swing/PopupDemo.scala | 33 | ||||
-rw-r--r-- | src/swing/scala/swing/ColorChooser.scala | 45 | ||||
-rw-r--r-- | src/swing/scala/swing/PopupMenu.scala | 65 | ||||
-rw-r--r-- | src/swing/scala/swing/event/ColorChanged.scala | 14 | ||||
-rw-r--r-- | src/swing/scala/swing/event/PopupMenuEvent.scala | 18 |
7 files changed, 31 insertions, 236 deletions
@@ -2659,6 +2659,7 @@ Binary compatibility testing <dependency groupId="com.typesafe" artifactId="mima-reporter_2.9.2" version="0.1.5-SNAPSHOT"/> </artifact:dependencies> <artifact:dependencies pathId="old.bc.classpath"> + <dependency groupId="org.scala-lang" artifactId="scala-swing" version="2.10.0"/> <dependency groupId="org.scala-lang" artifactId="scala-library" version="2.10.0"/> <dependency groupId="org.scala-lang" artifactId="scala-reflect" version="2.10.0"/> </artifact:dependencies> @@ -2699,6 +2700,21 @@ Binary compatibility testing fork="true" failonerror="true" classname="com.typesafe.tools.mima.cli.Main"> + <arg value="--prev"/> + <arg value="${org.scala-lang:scala-swing:jar}"/> + <arg value="--curr"/> + <arg value="${build-pack.dir}/lib/scala-swing.jar"/> + <arg value="--filters"/> + <arg value="${basedir}/bincompat-backward.whitelist.conf"/> + <arg value="--generate-filters"/> + <classpath> + <path refid="mima.classpath"/> + </classpath> + </java> + <java + fork="true" + failonerror="true" + classname="com.typesafe.tools.mima.cli.Main"> <arg value="--curr"/> <arg value="${org.scala-lang:scala-library:jar}"/> <arg value="--prev"/> @@ -2725,6 +2741,21 @@ Binary compatibility testing <path refid="mima.classpath"/> </classpath> </java> + <java + fork="true" + failonerror="true" + classname="com.typesafe.tools.mima.cli.Main"> + <arg value="--curr"/> + <arg value="${org.scala-lang:scala-swing:jar}"/> + <arg value="--prev"/> + <arg value="${build-pack.dir}/lib/scala-swing.jar"/> + <arg value="--filters"/> + <arg value="${basedir}/bincompat-forward.whitelist.conf"/> + <arg value="--generate-filters"/> + <classpath> + <path refid="mima.classpath"/> + </classpath> + </java> </target> diff --git a/docs/examples/swing/ColorChooserDemo.scala b/docs/examples/swing/ColorChooserDemo.scala deleted file mode 100644 index 1cb2bdefa2..0000000000 --- a/docs/examples/swing/ColorChooserDemo.scala +++ /dev/null @@ -1,61 +0,0 @@ -package examples.swing - -import java.awt.{Color, Font, Dimension} -import swing._ -import event._ -import Swing._ -import BorderPanel._ - -/** - * Demo for ColorChooser. - * Based on http://download.oracle.com/javase/tutorial/uiswing/components/colorchooser.html - * - * @author andy@hicks.net - */ -object ColorChooserDemo extends SimpleSwingApplication { - def top = new MainFrame { - title = "ColorChooser Demo" - size = new Dimension(400, 400) - - contents = ui - } - - def ui = new BorderPanel { - val colorChooser = new ColorChooser { - reactions += { - case ColorChanged(_, c) => - banner.foreground = c - } - } - - colorChooser.border = TitledBorder(EtchedBorder, "Choose Text Color") - - val banner = new Label("Welcome to Scala Swing") { - horizontalAlignment = Alignment.Center - foreground = Color.yellow - background = Color.blue - opaque = true - font = new Font("SansSerif", Font.BOLD, 24) - } - - val bannerArea = new BorderPanel { - layout(banner) = Position.Center - border = TitledBorder(EtchedBorder, "Banner") - } - - // Display a color selection dialog when button pressed - val selectColor = new Button("Choose Background Color") { - reactions += { - case ButtonClicked(_) => - ColorChooser.showDialog(this, "Test", Color.red) match { - case Some(c) => banner.background = c - case None => - } - } - } - - layout(bannerArea) = Position.North - layout(colorChooser) = Position.Center - layout(selectColor) = Position.South - } -}
\ No newline at end of file diff --git a/docs/examples/swing/PopupDemo.scala b/docs/examples/swing/PopupDemo.scala deleted file mode 100644 index 6a9eeb125b..0000000000 --- a/docs/examples/swing/PopupDemo.scala +++ /dev/null @@ -1,33 +0,0 @@ -package examples.swing - -import swing._ -import event._ -import Swing._ - -/** - * @author John Sullivan - * @author Ingo Maier - */ -object PopupDemo extends SimpleSwingApplication { - def top = new MainFrame { - val popupMenu = new PopupMenu { - contents += new Menu("menu 1") { - contents += new RadioMenuItem("radio 1.1") - contents += new RadioMenuItem("radio 1.2") - } - contents += new Menu("menu 2") { - contents += new RadioMenuItem("radio 2.1") - contents += new RadioMenuItem("radio 2.2") - } - } - val button = new Button("Show Popup Menu") - reactions += { - case ButtonClicked(b) => popupMenu.show(b, 0, b.bounds.height) - case PopupMenuCanceled(m) => println("Menu " + m + " canceled.") - } - listenTo(popupMenu) - listenTo(button) - - contents = new FlowPanel(button) - } -}
\ No newline at end of file diff --git a/src/swing/scala/swing/ColorChooser.scala b/src/swing/scala/swing/ColorChooser.scala deleted file mode 100644 index 9bd71e1df0..0000000000 --- a/src/swing/scala/swing/ColorChooser.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2007-2012, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - - - -package scala.swing - -import javax.swing.JColorChooser -import event._ - -/** - * Wrapper for JColorChooser. Publishes `ColorChanged` events, when the color selection changes. - * - * @author andy@hicks.net - * @author Ingo Maier - * @see javax.swing.JColorChooser - */ -object ColorChooser { - def showDialog(parent: Component, title: String, color: Color): scala.Option[Color] = { - toOption[Color](javax.swing.JColorChooser.showDialog(parent.peer, title, color)) - } -} - -class ColorChooser(color0: Color) extends Component { - def this() = this(java.awt.Color.white) - - override lazy val peer: JColorChooser = new JColorChooser(color0) with SuperMixin - - peer.getSelectionModel.addChangeListener(new javax.swing.event.ChangeListener { - def stateChanged(e: javax.swing.event.ChangeEvent) { - publish(ColorChanged(ColorChooser.this, peer.getColor)) - } - }) - - def color: Color = peer.getColor - def color_=(c: Color) = peer.setColor(c) - - def dragEnabled: Boolean = peer.getDragEnabled - def dragEnabled_=(b: Boolean) = peer.setDragEnabled(b) -}
\ No newline at end of file diff --git a/src/swing/scala/swing/PopupMenu.scala b/src/swing/scala/swing/PopupMenu.scala deleted file mode 100644 index 0f292b11a2..0000000000 --- a/src/swing/scala/swing/PopupMenu.scala +++ /dev/null @@ -1,65 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2007-2012, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - - - -package scala.swing - -import javax.swing.JPopupMenu -import javax.swing.event.{PopupMenuListener, PopupMenuEvent} -import event._ - -/** - * A popup menu. - * - * Example usage: - * - * {{{ - * val popupMenu = new PopupMenu { - * contents += new Menu("menu 1") { - * contents += new RadioMenuItem("radio 1.1") - * contents += new RadioMenuItem("radio 1.2") - * } - * contents += new Menu("menu 2") { - * contents += new RadioMenuItem("radio 2.1") - * contents += new RadioMenuItem("radio 2.2") - * } - * } - * val button = new Button("Show Popup Menu") - * reactions += { - * case e: ButtonClicked => popupMenu.show(button, 0, button.bounds.height) - * } - * listenTo(button) - * }}} - * - * @author John Sullivan - * @author Ingo Maier - * @see javax.swing.JPopupMenu - */ -class PopupMenu extends Component with SequentialContainer.Wrapper with Publisher { - override lazy val peer: JPopupMenu = new JPopupMenu with SuperMixin - - peer.addPopupMenuListener(new PopupMenuListener { - def popupMenuCanceled(e: PopupMenuEvent) { - publish(PopupMenuCanceled(PopupMenu.this)) - } - def popupMenuWillBecomeInvisible(e: PopupMenuEvent) { - publish(PopupMenuWillBecomeInvisible(PopupMenu.this)) - } - def popupMenuWillBecomeVisible(e: PopupMenuEvent) { - publish(PopupMenuWillBecomeVisible(PopupMenu.this)) - } - }) - - def show(invoker: Component, x: Int, y: Int): Unit = peer.show(invoker.peer, x, y) - - def margin: Insets = peer.getMargin - def label: String = peer.getLabel - def label_=(s: String) { peer.setLabel(s) } -} - diff --git a/src/swing/scala/swing/event/ColorChanged.scala b/src/swing/scala/swing/event/ColorChanged.scala deleted file mode 100644 index 44387aa864..0000000000 --- a/src/swing/scala/swing/event/ColorChanged.scala +++ /dev/null @@ -1,14 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2007-2011, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - - - -package scala.swing -package event - -case class ColorChanged(source: Component, c: Color) extends ComponentEvent with SelectionEvent diff --git a/src/swing/scala/swing/event/PopupMenuEvent.scala b/src/swing/scala/swing/event/PopupMenuEvent.scala deleted file mode 100644 index f7083c06de..0000000000 --- a/src/swing/scala/swing/event/PopupMenuEvent.scala +++ /dev/null @@ -1,18 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2007-2012, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - - - -package scala.swing -package event - -abstract class PopupMenuEvent extends ComponentEvent - -case class PopupMenuCanceled(source: PopupMenu) extends PopupMenuEvent -case class PopupMenuWillBecomeInvisible(source: PopupMenu) extends PopupMenuEvent -case class PopupMenuWillBecomeVisible(source: PopupMenu) extends PopupMenuEvent
\ No newline at end of file |