File tree 1 file changed +17
-10
lines changed
src/main/scala/scala/swing 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -39,26 +39,33 @@ class DesktopPane extends Component with SequentialContainer.Wrapper {
39
39
/**
40
40
* Specifies how dragged frames will be animated.
41
41
*
42
- * @param newMode either `LiveDragMode ` or `OutlineDragMode `.
42
+ * @param newMode either `DragMode.Live ` or `DragMode.Outline `.
43
43
*/
44
- def dragMode_= (newMode : DragMode ) : Unit = peer.setDragMode(newMode.intValue )
44
+ def dragMode_= (newMode : DragMode ) : Unit = peer.setDragMode(newMode.id )
45
45
}
46
46
47
47
48
48
object DesktopPane {
49
49
50
50
/**
51
- * Indicates how an internal frame will be animated as it is dragged .
51
+ * Supported types of drag modes for internal frames .
52
52
*/
53
- final case class DragMode (intValue : Int )
53
+ // noinspection TypeAnnotation
54
+ object DragMode extends Enumeration {
55
+ /**
56
+ * Renders the contents of the frame while dragging.
57
+ */
58
+ val Live = Value (JDesktopPane .LIVE_DRAG_MODE )
54
59
55
- /**
56
- * Indicates that a dragged internal frame will be animated with its contents.
57
- */
58
- val LiveDragMode : DragMode = DragMode (JDesktopPane .LIVE_DRAG_MODE )
60
+ /**
61
+ * Renders only the outline of the frame while dragging.
62
+ */
63
+ val Outline = Value (JDesktopPane .OUTLINE_DRAG_MODE )
64
+ }
59
65
60
66
/**
61
- * Indicates that a dragged internal frame will only render as an outline .
67
+ * Type indicating a type of mode for dragging internal frames .
62
68
*/
63
- val OutlineDragMode : DragMode = DragMode (JDesktopPane .OUTLINE_DRAG_MODE )
69
+ type DragMode = DragMode .Value
70
+
64
71
}
You can’t perform that action at this time.
0 commit comments