diff options
author | James Iry <jamesiry@gmail.com> | 2013-02-12 21:06:11 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-02-12 21:06:11 -0800 |
commit | cc89bd71edfd4c88ca1099891e6c20b77379122a (patch) | |
tree | 1f66d65496cc93bd24efa332cc5ddb1a06e8fb02 /src | |
parent | b87e9b39d9ee606aab5d86f84ca94df416451e65 (diff) | |
parent | d49532fdf2c38a273198c41285c8717e09f84166 (diff) | |
download | scala-cc89bd71edfd4c88ca1099891e6c20b77379122a.tar.gz scala-cc89bd71edfd4c88ca1099891e6c20b77379122a.tar.bz2 scala-cc89bd71edfd4c88ca1099891e6c20b77379122a.zip |
Merge pull request #2122 from adriaanm/revert-pr-1403
Revert #1403: binary incompatibilities in scala-swing
Diffstat (limited to 'src')
-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 |
4 files changed, 0 insertions, 142 deletions
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 |