Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2122 from adriaanm/revert-pr-1403

Revert #1403: binary incompatibilities in scala-swing
  • Loading branch information...
commit cc89bd71edfd4c88ca1099891e6c20b77379122a 2 parents b87e9b3 + d49532f
@JamesIry JamesIry authored
View
31 build.xml
@@ -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>
View
61 docs/examples/swing/ColorChooserDemo.scala
@@ -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
- }
-}
View
33 docs/examples/swing/PopupDemo.scala
@@ -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)
- }
-}
View
45 src/swing/scala/swing/ColorChooser.scala
@@ -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)
-}
View
65 src/swing/scala/swing/PopupMenu.scala
@@ -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) }
-}
-
View
14 src/swing/scala/swing/event/ColorChanged.scala
@@ -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
View
18 src/swing/scala/swing/event/PopupMenuEvent.scala
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.