Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / swingjs / j2s / javax / swing / JList.js
index f9d7c06..4d696b6 100644 (file)
-Clazz.declarePackage ("javax.swing");\r
-Clazz.load (["javax.swing.JComponent", "$.Scrollable", "javax.swing.event.ListSelectionListener"], "javax.swing.JList", ["java.lang.IllegalArgumentException", "java.awt.Component", "$.Dimension", "$.Point", "java.awt.event.MouseEvent", "javax.swing.AbstractListModel", "$.DefaultListSelectionModel", "$.JViewport", "$.SwingUtilities", "$.UIManager", "javax.swing.event.ListSelectionEvent", "javax.swing.text.Position"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.fixedCellWidth = -1;\r
-this.fixedCellHeight = -1;\r
-this.horizontalScrollIncrement = -1;\r
-this.prototypeCellValue = null;\r
-this.visibleRowCount = 8;\r
-this.selectionForeground = null;\r
-this.selectionBackground = null;\r
-this.dragEnabled = false;\r
-this.selectionModel = null;\r
-this.dataModel = null;\r
-this.cellRenderer = null;\r
-this.selectionListener = null;\r
-this.layoutOrientation = 0;\r
-if (!Clazz.isClassDefined ("javax.swing.JList.ListSelectionHandler")) {\r
-javax.swing.JList.$JList$ListSelectionHandler$ ();\r
-}\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing, "JList", javax.swing.JComponent, javax.swing.Scrollable);\r
-Clazz.makeConstructor (c$, \r
-function (dataModel) {\r
-Clazz.superConstructor (this, javax.swing.JList, []);\r
-if (dataModel == null) {\r
-throw  new IllegalArgumentException ("dataModel must be non null");\r
-}this.layoutOrientation = 0;\r
-this.dataModel = dataModel;\r
-this.selectionModel = this.createSelectionModel ();\r
-this.setAutoscrolls (true);\r
-this.setOpaque (true);\r
-this.updateUI ();\r
-}, "javax.swing.ListModel");\r
-Clazz.makeConstructor (c$, \r
-function (listData) {\r
-this.construct (((Clazz.isClassDefined ("javax.swing.JList$1") ? 0 : javax.swing.JList.$JList$1$ ()), Clazz.innerTypeInstance (javax.swing.JList$1, this, Clazz.cloneFinals ("listData", listData))));\r
-}, "~A");\r
-Clazz.makeConstructor (c$, \r
-function (listData) {\r
-this.construct (((Clazz.isClassDefined ("javax.swing.JList$2") ? 0 : javax.swing.JList.$JList$2$ ()), Clazz.innerTypeInstance (javax.swing.JList$2, this, Clazz.cloneFinals ("listData", listData))));\r
-}, "java.util.Vector");\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-this.construct (((Clazz.isClassDefined ("javax.swing.JList$3") ? 0 : javax.swing.JList.$JList$3$ ()), Clazz.innerTypeInstance (javax.swing.JList$3, this, null)));\r
-});\r
-Clazz.overrideMethod (c$, "getUI", \r
-function () {\r
-return this.ui;\r
-});\r
-Clazz.overrideMethod (c$, "updateUI", \r
-function () {\r
-this.setUI (javax.swing.UIManager.getUI (this));\r
-var renderer = this.getCellRenderer ();\r
-if (Clazz.instanceOf (renderer, java.awt.Component)) {\r
-javax.swing.SwingUtilities.updateComponentTreeUI (renderer);\r
-}});\r
-Clazz.overrideMethod (c$, "getUIClassID", \r
-function () {\r
-return "ListUI";\r
-});\r
-Clazz.defineMethod (c$, "updateFixedCellSize", \r
- function () {\r
-var cr = this.getCellRenderer ();\r
-var value = this.getPrototypeCellValue ();\r
-if ((cr != null) && (value != null)) {\r
-var c = cr.getListCellRendererComponent (this, value, 0, false, false);\r
-var f = c.getFont ();\r
-c.setFont (this.getFont ());\r
-var d = c.getPreferredSize ();\r
-this.fixedCellWidth = d.width;\r
-this.fixedCellHeight = d.height;\r
-c.setFont (f);\r
-}});\r
-Clazz.defineMethod (c$, "getPrototypeCellValue", \r
-function () {\r
-return this.prototypeCellValue;\r
-});\r
-Clazz.defineMethod (c$, "setPrototypeCellValue", \r
-function (prototypeCellValue) {\r
-var oldValue = this.prototypeCellValue;\r
-this.prototypeCellValue = prototypeCellValue;\r
-if ((prototypeCellValue != null) && !prototypeCellValue.equals (oldValue)) {\r
-this.updateFixedCellSize ();\r
-}this.firePropertyChangeObject ("prototypeCellValue", oldValue, prototypeCellValue);\r
-}, "~O");\r
-Clazz.defineMethod (c$, "getFixedCellWidth", \r
-function () {\r
-return this.fixedCellWidth;\r
-});\r
-Clazz.defineMethod (c$, "setFixedCellWidth", \r
-function (width) {\r
-var oldValue = this.fixedCellWidth;\r
-this.fixedCellWidth = width;\r
-this.firePropertyChangeInt ("fixedCellWidth", oldValue, this.fixedCellWidth);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getFixedCellHeight", \r
-function () {\r
-return this.fixedCellHeight;\r
-});\r
-Clazz.defineMethod (c$, "setFixedCellHeight", \r
-function (height) {\r
-var oldValue = this.fixedCellHeight;\r
-this.fixedCellHeight = height;\r
-this.firePropertyChangeInt ("fixedCellHeight", oldValue, this.fixedCellHeight);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getCellRenderer", \r
-function () {\r
-return this.cellRenderer;\r
-});\r
-Clazz.defineMethod (c$, "setCellRenderer", \r
-function (cellRenderer) {\r
-var oldValue = this.cellRenderer;\r
-this.cellRenderer = cellRenderer;\r
-if ((cellRenderer != null) && !cellRenderer.equals (oldValue)) {\r
-this.updateFixedCellSize ();\r
-}this.firePropertyChangeObject ("cellRenderer", oldValue, cellRenderer);\r
-}, "javax.swing.ListCellRenderer");\r
-Clazz.defineMethod (c$, "getSelectionForeground", \r
-function () {\r
-return this.selectionForeground;\r
-});\r
-Clazz.defineMethod (c$, "setSelectionForeground", \r
-function (selectionForeground) {\r
-var oldValue = this.selectionForeground;\r
-this.selectionForeground = selectionForeground;\r
-this.firePropertyChangeObject ("selectionForeground", oldValue, selectionForeground);\r
-}, "java.awt.Color");\r
-Clazz.defineMethod (c$, "getSelectionBackground", \r
-function () {\r
-return this.selectionBackground;\r
-});\r
-Clazz.defineMethod (c$, "setSelectionBackground", \r
-function (selectionBackground) {\r
-var oldValue = this.selectionBackground;\r
-this.selectionBackground = selectionBackground;\r
-this.firePropertyChangeObject ("selectionBackground", oldValue, selectionBackground);\r
-}, "java.awt.Color");\r
-Clazz.defineMethod (c$, "getVisibleRowCount", \r
-function () {\r
-return this.visibleRowCount;\r
-});\r
-Clazz.defineMethod (c$, "setVisibleRowCount", \r
-function (visibleRowCount) {\r
-var oldValue = this.visibleRowCount;\r
-this.visibleRowCount = Math.max (0, visibleRowCount);\r
-this.firePropertyChangeInt ("visibleRowCount", oldValue, visibleRowCount);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getLayoutOrientation", \r
-function () {\r
-return this.layoutOrientation;\r
-});\r
-Clazz.defineMethod (c$, "setLayoutOrientation", \r
-function (layoutOrientation) {\r
-var oldValue = this.layoutOrientation;\r
-switch (layoutOrientation) {\r
-case 0:\r
-case 1:\r
-case 2:\r
-this.layoutOrientation = layoutOrientation;\r
-this.firePropertyChangeInt ("layoutOrientation", oldValue, layoutOrientation);\r
-break;\r
-default:\r
-throw  new IllegalArgumentException ("layoutOrientation must be one of: VERTICAL, HORIZONTAL_WRAP or VERTICAL_WRAP");\r
-}\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getFirstVisibleIndex", \r
-function () {\r
-var r = this.getVisibleRect ();\r
-var first;\r
-if (this.getComponentOrientation ().isLeftToRight ()) {\r
-first = this.locationToIndex (r.getLocation ());\r
-} else {\r
-first = this.locationToIndex ( new java.awt.Point ((r.x + r.width) - 1, r.y));\r
-}if (first != -1) {\r
-var bounds = this.getCellBounds (first, first);\r
-if (bounds != null) {\r
-javax.swing.SwingUtilities.computeIntersection (r.x, r.y, r.width, r.height, bounds);\r
-if (bounds.width == 0 || bounds.height == 0) {\r
-first = -1;\r
-}}}return first;\r
-});\r
-Clazz.defineMethod (c$, "getLastVisibleIndex", \r
-function () {\r
-var leftToRight = this.getComponentOrientation ().isLeftToRight ();\r
-var r = this.getVisibleRect ();\r
-var lastPoint;\r
-if (leftToRight) {\r
-lastPoint =  new java.awt.Point ((r.x + r.width) - 1, (r.y + r.height) - 1);\r
-} else {\r
-lastPoint =  new java.awt.Point (r.x, (r.y + r.height) - 1);\r
-}var location = this.locationToIndex (lastPoint);\r
-if (location != -1) {\r
-var bounds = this.getCellBounds (location, location);\r
-if (bounds != null) {\r
-javax.swing.SwingUtilities.computeIntersection (r.x, r.y, r.width, r.height, bounds);\r
-if (bounds.width == 0 || bounds.height == 0) {\r
-var isHorizontalWrap = (this.getLayoutOrientation () == 2);\r
-var visibleLocation = isHorizontalWrap ?  new java.awt.Point (lastPoint.x, r.y) :  new java.awt.Point (r.x, lastPoint.y);\r
-var last;\r
-var visIndex = -1;\r
-var lIndex = location;\r
-location = -1;\r
-do {\r
-last = visIndex;\r
-visIndex = this.locationToIndex (visibleLocation);\r
-if (visIndex != -1) {\r
-bounds = this.getCellBounds (visIndex, visIndex);\r
-if (visIndex != lIndex && bounds != null && bounds.contains (visibleLocation)) {\r
-location = visIndex;\r
-if (isHorizontalWrap) {\r
-visibleLocation.y = bounds.y + bounds.height;\r
-if (visibleLocation.y >= lastPoint.y) {\r
-last = visIndex;\r
-}} else {\r
-visibleLocation.x = bounds.x + bounds.width;\r
-if (visibleLocation.x >= lastPoint.x) {\r
-last = visIndex;\r
-}}} else {\r
-last = visIndex;\r
-}}} while (visIndex != -1 && last != visIndex);\r
-}}}return location;\r
-});\r
-Clazz.defineMethod (c$, "ensureIndexIsVisible", \r
-function (index) {\r
-var cellBounds = this.getCellBounds (index, index);\r
-if (cellBounds != null) {\r
-this.scrollRectToVisible (cellBounds);\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "setDragEnabled", \r
-function (b) {\r
-this.dragEnabled = b;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "getDragEnabled", \r
-function () {\r
-return this.dragEnabled;\r
-});\r
-Clazz.defineMethod (c$, "getNextMatch", \r
-function (prefix, startIndex, bias) {\r
-var model = this.getModel ();\r
-var max = model.getSize ();\r
-if (prefix == null) {\r
-throw  new IllegalArgumentException ();\r
-}if (startIndex < 0 || startIndex >= max) {\r
-throw  new IllegalArgumentException ();\r
-}prefix = prefix.toUpperCase ();\r
-var increment = (bias === javax.swing.text.Position.Bias.Forward) ? 1 : -1;\r
-var index = startIndex;\r
-do {\r
-var o = model.getElementAt (index);\r
-if (o != null) {\r
-var string;\r
-if (Clazz.instanceOf (o, String)) {\r
-string = (o).toUpperCase ();\r
-} else {\r
-string = o.toString ();\r
-if (string != null) {\r
-string = string.toUpperCase ();\r
-}}if (string != null && string.startsWith (prefix)) {\r
-return index;\r
-}}index = (index + increment + max) % max;\r
-} while (index != startIndex);\r
-return -1;\r
-}, "~S,~N,javax.swing.text.Position.Bias");\r
-Clazz.defineMethod (c$, "getToolTipText", \r
-function (event) {\r
-if (event != null) {\r
-var p = event.getPoint ();\r
-var index = this.locationToIndex (p);\r
-var r = this.getCellRenderer ();\r
-var cellBounds;\r
-if (index != -1 && r != null && (cellBounds = this.getCellBounds (index, index)) != null && cellBounds.contains (p.x, p.y)) {\r
-var lsm = this.getSelectionModel ();\r
-var rComponent = r.getListCellRendererComponent (this, this.getModel ().getElementAt (index), index, lsm.isSelectedIndex (index), (this.hasFocus () && (lsm.getLeadSelectionIndex () == index)));\r
-if (Clazz.instanceOf (rComponent, javax.swing.JComponent)) {\r
-var newEvent;\r
-p.translate (-cellBounds.x, -cellBounds.y);\r
-newEvent =  new java.awt.event.MouseEvent (rComponent, event.getID (), event.getWhen (), event.getModifiers (), p.x, p.y, event.getXOnScreen (), event.getYOnScreen (), event.getClickCount (), event.isPopupTrigger (), 0);\r
-var tip = (rComponent).getToolTipText (newEvent);\r
-if (tip != null) {\r
-return tip;\r
-}}}}return Clazz.superCall (this, javax.swing.JList, "getToolTipText", []);\r
-}, "java.awt.event.MouseEvent");\r
-Clazz.defineMethod (c$, "locationToIndex", \r
-function (location) {\r
-var ui = this.getUI ();\r
-return (ui != null) ? ui.locationToIndex (this, location) : -1;\r
-}, "java.awt.Point");\r
-Clazz.defineMethod (c$, "indexToLocation", \r
-function (index) {\r
-var ui = this.getUI ();\r
-return (ui != null) ? ui.indexToLocation (this, index) : null;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getCellBounds", \r
-function (index0, index1) {\r
-var ui = this.getUI ();\r
-return (ui != null) ? ui.getCellBounds (this, index0, index1) : null;\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "getModel", \r
-function () {\r
-return this.dataModel;\r
-});\r
-Clazz.defineMethod (c$, "setModel", \r
-function (model) {\r
-if (model == null) {\r
-throw  new IllegalArgumentException ("model must be non null");\r
-}var oldValue = this.dataModel;\r
-this.dataModel = model;\r
-this.firePropertyChangeObject ("model", oldValue, this.dataModel);\r
-this.clearSelection ();\r
-}, "javax.swing.ListModel");\r
-Clazz.defineMethod (c$, "setListData", \r
-function (listData) {\r
-this.setModel (((Clazz.isClassDefined ("javax.swing.JList$4") ? 0 : javax.swing.JList.$JList$4$ ()), Clazz.innerTypeInstance (javax.swing.JList$4, this, Clazz.cloneFinals ("listData", listData))));\r
-}, "~A");\r
-Clazz.defineMethod (c$, "setListData", \r
-function (listData) {\r
-this.setModel (((Clazz.isClassDefined ("javax.swing.JList$5") ? 0 : javax.swing.JList.$JList$5$ ()), Clazz.innerTypeInstance (javax.swing.JList$5, this, Clazz.cloneFinals ("listData", listData))));\r
-}, "java.util.Vector");\r
-Clazz.defineMethod (c$, "createSelectionModel", \r
-function () {\r
-return  new javax.swing.DefaultListSelectionModel ();\r
-});\r
-Clazz.defineMethod (c$, "getSelectionModel", \r
-function () {\r
-return this.selectionModel;\r
-});\r
-Clazz.defineMethod (c$, "fireSelectionValueChanged", \r
-function (firstIndex, lastIndex, isAdjusting) {\r
-var listeners = this.listenerList.getListenerList ();\r
-var e = null;\r
-for (var i = listeners.length - 2; i >= 0; i -= 2) {\r
-if (listeners[i] === javax.swing.event.ListSelectionListener) {\r
-if (e == null) {\r
-e =  new javax.swing.event.ListSelectionEvent (this, firstIndex, lastIndex, isAdjusting);\r
-}(listeners[i + 1]).valueChanged (e);\r
-}}\r
-}, "~N,~N,~B");\r
-Clazz.defineMethod (c$, "addListSelectionListener", \r
-function (listener) {\r
-if (this.selectionListener == null) {\r
-this.selectionListener = Clazz.innerTypeInstance (javax.swing.JList.ListSelectionHandler, this, null);\r
-this.getSelectionModel ().addListSelectionListener (this.selectionListener);\r
-}this.listenerList.add (javax.swing.event.ListSelectionListener, listener);\r
-}, "javax.swing.event.ListSelectionListener");\r
-Clazz.defineMethod (c$, "removeListSelectionListener", \r
-function (listener) {\r
-this.listenerList.remove (javax.swing.event.ListSelectionListener, listener);\r
-}, "javax.swing.event.ListSelectionListener");\r
-Clazz.defineMethod (c$, "getListSelectionListeners", \r
-function () {\r
-return this.listenerList.getListeners (javax.swing.event.ListSelectionListener);\r
-});\r
-Clazz.defineMethod (c$, "setSelectionModel", \r
-function (selectionModel) {\r
-if (selectionModel == null) {\r
-throw  new IllegalArgumentException ("selectionModel must be non null");\r
-}if (this.selectionListener != null) {\r
-this.selectionModel.removeListSelectionListener (this.selectionListener);\r
-selectionModel.addListSelectionListener (this.selectionListener);\r
-}var oldValue = this.selectionModel;\r
-this.selectionModel = selectionModel;\r
-this.firePropertyChangeObject ("selectionModel", oldValue, selectionModel);\r
-}, "javax.swing.ListSelectionModel");\r
-Clazz.defineMethod (c$, "setSelectionMode", \r
-function (selectionMode) {\r
-this.getSelectionModel ().setSelectionMode (selectionMode);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getSelectionMode", \r
-function () {\r
-return this.getSelectionModel ().getSelectionMode ();\r
-});\r
-Clazz.defineMethod (c$, "getAnchorSelectionIndex", \r
-function () {\r
-return this.getSelectionModel ().getAnchorSelectionIndex ();\r
-});\r
-Clazz.defineMethod (c$, "getLeadSelectionIndex", \r
-function () {\r
-return this.getSelectionModel ().getLeadSelectionIndex ();\r
-});\r
-Clazz.defineMethod (c$, "getMinSelectionIndex", \r
-function () {\r
-return this.getSelectionModel ().getMinSelectionIndex ();\r
-});\r
-Clazz.defineMethod (c$, "getMaxSelectionIndex", \r
-function () {\r
-return this.getSelectionModel ().getMaxSelectionIndex ();\r
-});\r
-Clazz.defineMethod (c$, "isSelectedIndex", \r
-function (index) {\r
-return this.getSelectionModel ().isSelectedIndex (index);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "isSelectionEmpty", \r
-function () {\r
-return this.getSelectionModel ().isSelectionEmpty ();\r
-});\r
-Clazz.defineMethod (c$, "clearSelection", \r
-function () {\r
-this.getSelectionModel ().clearSelection ();\r
-});\r
-Clazz.defineMethod (c$, "setSelectionInterval", \r
-function (anchor, lead) {\r
-this.getSelectionModel ().setSelectionInterval (anchor, lead);\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "addSelectionInterval", \r
-function (anchor, lead) {\r
-this.getSelectionModel ().addSelectionInterval (anchor, lead);\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "removeSelectionInterval", \r
-function (index0, index1) {\r
-this.getSelectionModel ().removeSelectionInterval (index0, index1);\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "setValueIsAdjusting", \r
-function (b) {\r
-this.getSelectionModel ().setValueIsAdjusting (b);\r
-}, "~B");\r
-Clazz.defineMethod (c$, "getValueIsAdjusting", \r
-function () {\r
-return this.getSelectionModel ().getValueIsAdjusting ();\r
-});\r
-Clazz.defineMethod (c$, "getSelectedIndices", \r
-function () {\r
-var sm = this.getSelectionModel ();\r
-var iMin = sm.getMinSelectionIndex ();\r
-var iMax = sm.getMaxSelectionIndex ();\r
-if ((iMin < 0) || (iMax < 0)) {\r
-return  Clazz.newIntArray (0, 0);\r
-}var rvTmp =  Clazz.newIntArray (1 + (iMax - iMin), 0);\r
-var n = 0;\r
-for (var i = iMin; i <= iMax; i++) {\r
-if (sm.isSelectedIndex (i)) {\r
-rvTmp[n++] = i;\r
-}}\r
-var rv =  Clazz.newIntArray (n, 0);\r
-System.arraycopy (rvTmp, 0, rv, 0, n);\r
-return rv;\r
-});\r
-Clazz.defineMethod (c$, "setSelectedIndex", \r
-function (index) {\r
-if (index >= this.getModel ().getSize ()) {\r
-return;\r
-}this.getSelectionModel ().setSelectionInterval (index, index);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "setSelectedIndices", \r
-function (indices) {\r
-var sm = this.getSelectionModel ();\r
-sm.clearSelection ();\r
-var size = this.getModel ().getSize ();\r
-for (var i = 0; i < indices.length; i++) {\r
-if (indices[i] < size) {\r
-sm.addSelectionInterval (indices[i], indices[i]);\r
-}}\r
-}, "~A");\r
-Clazz.defineMethod (c$, "getSelectedValues", \r
-function () {\r
-var sm = this.getSelectionModel ();\r
-var dm = this.getModel ();\r
-var iMin = sm.getMinSelectionIndex ();\r
-var iMax = sm.getMaxSelectionIndex ();\r
-if ((iMin < 0) || (iMax < 0)) {\r
-return  new Array (0);\r
-}var rvTmp =  new Array (1 + (iMax - iMin));\r
-var n = 0;\r
-for (var i = iMin; i <= iMax; i++) {\r
-if (sm.isSelectedIndex (i)) {\r
-rvTmp[n++] = dm.getElementAt (i);\r
-}}\r
-var rv =  new Array (n);\r
-System.arraycopy (rvTmp, 0, rv, 0, n);\r
-return rv;\r
-});\r
-Clazz.defineMethod (c$, "getSelectedIndex", \r
-function () {\r
-return this.getMinSelectionIndex ();\r
-});\r
-Clazz.defineMethod (c$, "getSelectedValue", \r
-function () {\r
-var i = this.getMinSelectionIndex ();\r
-return (i == -1) ? null : this.getModel ().getElementAt (i);\r
-});\r
-Clazz.defineMethod (c$, "setSelectedValue", \r
-function (anObject, shouldScroll) {\r
-if (anObject == null) this.setSelectedIndex (-1);\r
- else if (!anObject.equals (this.getSelectedValue ())) {\r
-var i;\r
-var c;\r
-var dm = this.getModel ();\r
-for (i = 0, c = dm.getSize (); i < c; i++) if (anObject.equals (dm.getElementAt (i))) {\r
-this.setSelectedIndex (i);\r
-if (shouldScroll) this.ensureIndexIsVisible (i);\r
-this.repaint ();\r
-return;\r
-}\r
-this.setSelectedIndex (-1);\r
-}this.repaint ();\r
-}, "~O,~B");\r
-Clazz.defineMethod (c$, "checkScrollableParameters", \r
- function (visibleRect, orientation) {\r
-if (visibleRect == null) {\r
-throw  new IllegalArgumentException ("visibleRect must be non-null");\r
-}switch (orientation) {\r
-case 1:\r
-case 0:\r
-break;\r
-default:\r
-throw  new IllegalArgumentException ("orientation must be one of: VERTICAL, HORIZONTAL");\r
-}\r
-}, "java.awt.Rectangle,~N");\r
-Clazz.overrideMethod (c$, "getPreferredScrollableViewportSize", \r
-function () {\r
-if (this.getLayoutOrientation () != 0) {\r
-return this.getPreferredSize ();\r
-}var insets = this.getInsets ();\r
-var dx = insets.left + insets.right;\r
-var dy = insets.top + insets.bottom;\r
-var visibleRowCount = this.getVisibleRowCount ();\r
-var fixedCellWidth = this.getFixedCellWidth ();\r
-var fixedCellHeight = this.getFixedCellHeight ();\r
-if ((fixedCellWidth > 0) && (fixedCellHeight > 0)) {\r
-var width = fixedCellWidth + dx;\r
-var height = (visibleRowCount * fixedCellHeight) + dy;\r
-return  new java.awt.Dimension (width, height);\r
-} else if (this.getModel ().getSize () > 0) {\r
-var width = this.getPreferredSize ().width;\r
-var height;\r
-var r = this.getCellBounds (0, 0);\r
-if (r != null) {\r
-height = (visibleRowCount * r.height) + dy;\r
-} else {\r
-height = 1;\r
-}return  new java.awt.Dimension (width, height);\r
-} else {\r
-fixedCellWidth = (fixedCellWidth > 0) ? fixedCellWidth : 256;\r
-fixedCellHeight = (fixedCellHeight > 0) ? fixedCellHeight : 16;\r
-return  new java.awt.Dimension (fixedCellWidth, fixedCellHeight * visibleRowCount);\r
-}});\r
-Clazz.overrideMethod (c$, "getScrollableUnitIncrement", \r
-function (visibleRect, orientation, direction) {\r
-this.checkScrollableParameters (visibleRect, orientation);\r
-if (orientation == 1) {\r
-var row = this.locationToIndex (visibleRect.getLocation ());\r
-if (row == -1) {\r
-return 0;\r
-} else {\r
-if (direction > 0) {\r
-var r = this.getCellBounds (row, row);\r
-return (r == null) ? 0 : r.height - (visibleRect.y - r.y);\r
-} else {\r
-var r = this.getCellBounds (row, row);\r
-if ((r.y == visibleRect.y) && (row == 0)) {\r
-return 0;\r
-} else if (r.y == visibleRect.y) {\r
-var loc = r.getLocation ();\r
-loc.y--;\r
-var prevIndex = this.locationToIndex (loc);\r
-var prevR = this.getCellBounds (prevIndex, prevIndex);\r
-if (prevR == null || prevR.y >= r.y) {\r
-return 0;\r
-}return prevR.height;\r
-} else {\r
-return visibleRect.y - r.y;\r
-}}}} else if (orientation == 0 && this.getLayoutOrientation () != 0) {\r
-var leftToRight = this.getComponentOrientation ().isLeftToRight ();\r
-var index;\r
-var leadingPoint;\r
-if (leftToRight) {\r
-leadingPoint = visibleRect.getLocation ();\r
-} else {\r
-leadingPoint =  new java.awt.Point (visibleRect.x + visibleRect.width - 1, visibleRect.y);\r
-}index = this.locationToIndex (leadingPoint);\r
-if (index != -1) {\r
-var cellBounds = this.getCellBounds (index, index);\r
-if (cellBounds != null && cellBounds.contains (leadingPoint)) {\r
-var leadingVisibleEdge;\r
-var leadingCellEdge;\r
-if (leftToRight) {\r
-leadingVisibleEdge = visibleRect.x;\r
-leadingCellEdge = cellBounds.x;\r
-} else {\r
-leadingVisibleEdge = visibleRect.x + visibleRect.width;\r
-leadingCellEdge = cellBounds.x + cellBounds.width;\r
-}if (leadingCellEdge != leadingVisibleEdge) {\r
-if (direction < 0) {\r
-return Math.abs (leadingVisibleEdge - leadingCellEdge);\r
-} else if (leftToRight) {\r
-return leadingCellEdge + cellBounds.width - leadingVisibleEdge;\r
-} else {\r
-return leadingVisibleEdge - cellBounds.x;\r
-}}return cellBounds.width;\r
-}}}var f = this.getFont ();\r
-return (f != null) ? f.getSize () : 1;\r
-}, "java.awt.Rectangle,~N,~N");\r
-Clazz.overrideMethod (c$, "getScrollableBlockIncrement", \r
-function (visibleRect, orientation, direction) {\r
-this.checkScrollableParameters (visibleRect, orientation);\r
-if (orientation == 1) {\r
-var inc = visibleRect.height;\r
-if (direction > 0) {\r
-var last = this.locationToIndex ( new java.awt.Point (visibleRect.x, visibleRect.y + visibleRect.height - 1));\r
-if (last != -1) {\r
-var lastRect = this.getCellBounds (last, last);\r
-if (lastRect != null) {\r
-inc = lastRect.y - visibleRect.y;\r
-if ((inc == 0) && (last < this.getModel ().getSize () - 1)) {\r
-inc = lastRect.height;\r
-}}}} else {\r
-var newFirst = this.locationToIndex ( new java.awt.Point (visibleRect.x, visibleRect.y - visibleRect.height));\r
-var first = this.getFirstVisibleIndex ();\r
-if (newFirst != -1) {\r
-if (first == -1) {\r
-first = this.locationToIndex (visibleRect.getLocation ());\r
-}var newFirstRect = this.getCellBounds (newFirst, newFirst);\r
-var firstRect = this.getCellBounds (first, first);\r
-if ((newFirstRect != null) && (firstRect != null)) {\r
-while ((newFirstRect.y + visibleRect.height < firstRect.y + firstRect.height) && (newFirstRect.y < firstRect.y)) {\r
-newFirst++;\r
-newFirstRect = this.getCellBounds (newFirst, newFirst);\r
-}\r
-inc = visibleRect.y - newFirstRect.y;\r
-if ((inc <= 0) && (newFirstRect.y > 0)) {\r
-newFirst--;\r
-newFirstRect = this.getCellBounds (newFirst, newFirst);\r
-if (newFirstRect != null) {\r
-inc = visibleRect.y - newFirstRect.y;\r
-}}}}}return inc;\r
-} else if (orientation == 0 && this.getLayoutOrientation () != 0) {\r
-var leftToRight = this.getComponentOrientation ().isLeftToRight ();\r
-var inc = visibleRect.width;\r
-if (direction > 0) {\r
-var x = visibleRect.x + (leftToRight ? (visibleRect.width - 1) : 0);\r
-var last = this.locationToIndex ( new java.awt.Point (x, visibleRect.y));\r
-if (last != -1) {\r
-var lastRect = this.getCellBounds (last, last);\r
-if (lastRect != null) {\r
-if (leftToRight) {\r
-inc = lastRect.x - visibleRect.x;\r
-} else {\r
-inc = visibleRect.x + visibleRect.width - (lastRect.x + lastRect.width);\r
-}if (inc < 0) {\r
-inc += lastRect.width;\r
-} else if ((inc == 0) && (last < this.getModel ().getSize () - 1)) {\r
-inc = lastRect.width;\r
-}}}} else {\r
-var x = visibleRect.x + (leftToRight ? -visibleRect.width : visibleRect.width - 1 + visibleRect.width);\r
-var first = this.locationToIndex ( new java.awt.Point (x, visibleRect.y));\r
-if (first != -1) {\r
-var firstRect = this.getCellBounds (first, first);\r
-if (firstRect != null) {\r
-var firstRight = firstRect.x + firstRect.width;\r
-if (leftToRight) {\r
-if ((firstRect.x < visibleRect.x - visibleRect.width) && (firstRight < visibleRect.x)) {\r
-inc = visibleRect.x - firstRight;\r
-} else {\r
-inc = visibleRect.x - firstRect.x;\r
-}} else {\r
-var visibleRight = visibleRect.x + visibleRect.width;\r
-if ((firstRight > visibleRight + visibleRect.width) && (firstRect.x > visibleRight)) {\r
-inc = firstRect.x - visibleRight;\r
-} else {\r
-inc = firstRight - visibleRight;\r
-}}}}}return inc;\r
-}return visibleRect.width;\r
-}, "java.awt.Rectangle,~N,~N");\r
-Clazz.overrideMethod (c$, "getScrollableTracksViewportWidth", \r
-function () {\r
-if (this.getLayoutOrientation () == 2 && this.getVisibleRowCount () <= 0) {\r
-return true;\r
-}if (Clazz.instanceOf (this.getParent (), javax.swing.JViewport)) {\r
-return ((this.getParent ()).getWidth () > this.getPreferredSize ().width);\r
-}return false;\r
-});\r
-Clazz.overrideMethod (c$, "getScrollableTracksViewportHeight", \r
-function () {\r
-if (this.getLayoutOrientation () == 1 && this.getVisibleRowCount () <= 0) {\r
-return true;\r
-}if (Clazz.instanceOf (this.getParent (), javax.swing.JViewport)) {\r
-return ((this.getParent ()).getHeight () > this.getPreferredSize ().height);\r
-}return false;\r
-});\r
-Clazz.defineMethod (c$, "paramString", \r
-function () {\r
-var selectionForegroundString = (this.selectionForeground != null ? this.selectionForeground.toString () : "");\r
-var selectionBackgroundString = (this.selectionBackground != null ? this.selectionBackground.toString () : "");\r
-return Clazz.superCall (this, javax.swing.JList, "paramString", []) + ",fixedCellHeight=" + this.fixedCellHeight + ",fixedCellWidth=" + this.fixedCellWidth + ",horizontalScrollIncrement=" + this.horizontalScrollIncrement + ",selectionBackground=" + selectionBackgroundString + ",selectionForeground=" + selectionForegroundString + ",visibleRowCount=" + this.visibleRowCount + ",layoutOrientation=" + this.layoutOrientation;\r
-});\r
-c$.$JList$ListSelectionHandler$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.JList, "ListSelectionHandler", null, javax.swing.event.ListSelectionListener);\r
-Clazz.overrideMethod (c$, "valueChanged", \r
-function (a) {\r
-this.b$["javax.swing.JList"].fireSelectionValueChanged (a.getFirstIndex (), a.getLastIndex (), a.getValueIsAdjusting ());\r
-}, "javax.swing.event.ListSelectionEvent");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$JList$1$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (javax.swing, "JList$1", javax.swing.AbstractListModel);\r
-Clazz.defineMethod (c$, "getSize", \r
-function () {\r
-return this.f$.listData.length;\r
-});\r
-Clazz.defineMethod (c$, "getElementAt", \r
-function (i) {\r
-return this.f$.listData[i];\r
-}, "~N");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$JList$2$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (javax.swing, "JList$2", javax.swing.AbstractListModel);\r
-Clazz.defineMethod (c$, "getSize", \r
-function () {\r
-return this.f$.listData.size ();\r
-});\r
-Clazz.defineMethod (c$, "getElementAt", \r
-function (i) {\r
-return this.f$.listData.elementAt (i);\r
-}, "~N");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$JList$3$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (javax.swing, "JList$3", javax.swing.AbstractListModel);\r
-Clazz.defineMethod (c$, "getSize", \r
-function () {\r
-return 0;\r
-});\r
-Clazz.defineMethod (c$, "getElementAt", \r
-function (i) {\r
-return "No Data Model";\r
-}, "~N");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$JList$4$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (javax.swing, "JList$4", javax.swing.AbstractListModel);\r
-Clazz.defineMethod (c$, "getSize", \r
-function () {\r
-return this.f$.listData.length;\r
-});\r
-Clazz.defineMethod (c$, "getElementAt", \r
-function (i) {\r
-return this.f$.listData[i];\r
-}, "~N");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$JList$5$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (javax.swing, "JList$5", javax.swing.AbstractListModel);\r
-Clazz.defineMethod (c$, "getSize", \r
-function () {\r
-return this.f$.listData.size ();\r
-});\r
-Clazz.defineMethod (c$, "getElementAt", \r
-function (i) {\r
-return this.f$.listData.elementAt (i);\r
-}, "~N");\r
-c$ = Clazz.p0p ();\r
-};\r
-Clazz.defineStatics (c$,\r
-"$uiClassID", "ListUI",\r
-"VERTICAL", 0,\r
-"VERTICAL_WRAP", 1,\r
-"HORIZONTAL_WRAP", 2);\r
-});\r
+Clazz.declarePackage ("javax.swing");
+Clazz.load (["javax.swing.JComponent", "$.Scrollable", "javax.swing.event.ListSelectionListener"], "javax.swing.JList", ["java.lang.IllegalArgumentException", "java.awt.Component", "$.Dimension", "$.Point", "java.awt.event.MouseEvent", "javax.swing.AbstractListModel", "$.DefaultListSelectionModel", "$.JViewport", "$.SwingUtilities", "$.UIManager", "javax.swing.event.ListSelectionEvent", "javax.swing.text.Position"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.fixedCellWidth = -1;
+this.fixedCellHeight = -1;
+this.horizontalScrollIncrement = -1;
+this.prototypeCellValue = null;
+this.visibleRowCount = 8;
+this.selectionForeground = null;
+this.selectionBackground = null;
+this.dragEnabled = false;
+this.selectionModel = null;
+this.dataModel = null;
+this.cellRenderer = null;
+this.selectionListener = null;
+this.layoutOrientation = 0;
+if (!Clazz.isClassDefined ("javax.swing.JList.ListSelectionHandler")) {
+javax.swing.JList.$JList$ListSelectionHandler$ ();
+}
+Clazz.instantialize (this, arguments);
+}, javax.swing, "JList", javax.swing.JComponent, javax.swing.Scrollable);
+Clazz.makeConstructor (c$, 
+function (dataModel) {
+Clazz.superConstructor (this, javax.swing.JList, []);
+if (dataModel == null) {
+throw  new IllegalArgumentException ("dataModel must be non null");
+}this.layoutOrientation = 0;
+this.dataModel = dataModel;
+this.selectionModel = this.createSelectionModel ();
+this.setAutoscrolls (true);
+this.setOpaque (true);
+this.updateUI ();
+}, "javax.swing.ListModel");
+Clazz.makeConstructor (c$, 
+function (listData) {
+this.construct (((Clazz.isClassDefined ("javax.swing.JList$1") ? 0 : javax.swing.JList.$JList$1$ ()), Clazz.innerTypeInstance (javax.swing.JList$1, this, Clazz.cloneFinals ("listData", listData))));
+}, "~A");
+Clazz.makeConstructor (c$, 
+function (listData) {
+this.construct (((Clazz.isClassDefined ("javax.swing.JList$2") ? 0 : javax.swing.JList.$JList$2$ ()), Clazz.innerTypeInstance (javax.swing.JList$2, this, Clazz.cloneFinals ("listData", listData))));
+}, "java.util.Vector");
+Clazz.makeConstructor (c$, 
+function () {
+this.construct (((Clazz.isClassDefined ("javax.swing.JList$3") ? 0 : javax.swing.JList.$JList$3$ ()), Clazz.innerTypeInstance (javax.swing.JList$3, this, null)));
+});
+Clazz.overrideMethod (c$, "getUI", 
+function () {
+return this.ui;
+});
+Clazz.overrideMethod (c$, "updateUI", 
+function () {
+this.setUI (javax.swing.UIManager.getUI (this));
+var renderer = this.getCellRenderer ();
+if (Clazz.instanceOf (renderer, java.awt.Component)) {
+javax.swing.SwingUtilities.updateComponentTreeUI (renderer);
+}});
+Clazz.overrideMethod (c$, "getUIClassID", 
+function () {
+return "ListUI";
+});
+Clazz.defineMethod (c$, "updateFixedCellSize", 
+ function () {
+var cr = this.getCellRenderer ();
+var value = this.getPrototypeCellValue ();
+if ((cr != null) && (value != null)) {
+var c = cr.getListCellRendererComponent (this, value, 0, false, false);
+var f = c.getFont ();
+c.setFont (this.getFont ());
+var d = c.getPreferredSize ();
+this.fixedCellWidth = d.width;
+this.fixedCellHeight = d.height;
+c.setFont (f);
+}});
+Clazz.defineMethod (c$, "getPrototypeCellValue", 
+function () {
+return this.prototypeCellValue;
+});
+Clazz.defineMethod (c$, "setPrototypeCellValue", 
+function (prototypeCellValue) {
+var oldValue = this.prototypeCellValue;
+this.prototypeCellValue = prototypeCellValue;
+if ((prototypeCellValue != null) && !prototypeCellValue.equals (oldValue)) {
+this.updateFixedCellSize ();
+}this.firePropertyChangeObject ("prototypeCellValue", oldValue, prototypeCellValue);
+}, "~O");
+Clazz.defineMethod (c$, "getFixedCellWidth", 
+function () {
+return this.fixedCellWidth;
+});
+Clazz.defineMethod (c$, "setFixedCellWidth", 
+function (width) {
+var oldValue = this.fixedCellWidth;
+this.fixedCellWidth = width;
+this.firePropertyChangeInt ("fixedCellWidth", oldValue, this.fixedCellWidth);
+}, "~N");
+Clazz.defineMethod (c$, "getFixedCellHeight", 
+function () {
+return this.fixedCellHeight;
+});
+Clazz.defineMethod (c$, "setFixedCellHeight", 
+function (height) {
+var oldValue = this.fixedCellHeight;
+this.fixedCellHeight = height;
+this.firePropertyChangeInt ("fixedCellHeight", oldValue, this.fixedCellHeight);
+}, "~N");
+Clazz.defineMethod (c$, "getCellRenderer", 
+function () {
+return this.cellRenderer;
+});
+Clazz.defineMethod (c$, "setCellRenderer", 
+function (cellRenderer) {
+var oldValue = this.cellRenderer;
+this.cellRenderer = cellRenderer;
+if ((cellRenderer != null) && !cellRenderer.equals (oldValue)) {
+this.updateFixedCellSize ();
+}this.firePropertyChangeObject ("cellRenderer", oldValue, cellRenderer);
+}, "javax.swing.ListCellRenderer");
+Clazz.defineMethod (c$, "getSelectionForeground", 
+function () {
+return this.selectionForeground;
+});
+Clazz.defineMethod (c$, "setSelectionForeground", 
+function (selectionForeground) {
+var oldValue = this.selectionForeground;
+this.selectionForeground = selectionForeground;
+this.firePropertyChangeObject ("selectionForeground", oldValue, selectionForeground);
+}, "java.awt.Color");
+Clazz.defineMethod (c$, "getSelectionBackground", 
+function () {
+return this.selectionBackground;
+});
+Clazz.defineMethod (c$, "setSelectionBackground", 
+function (selectionBackground) {
+var oldValue = this.selectionBackground;
+this.selectionBackground = selectionBackground;
+this.firePropertyChangeObject ("selectionBackground", oldValue, selectionBackground);
+}, "java.awt.Color");
+Clazz.defineMethod (c$, "getVisibleRowCount", 
+function () {
+return this.visibleRowCount;
+});
+Clazz.defineMethod (c$, "setVisibleRowCount", 
+function (visibleRowCount) {
+var oldValue = this.visibleRowCount;
+this.visibleRowCount = Math.max (0, visibleRowCount);
+this.firePropertyChangeInt ("visibleRowCount", oldValue, visibleRowCount);
+}, "~N");
+Clazz.defineMethod (c$, "getLayoutOrientation", 
+function () {
+return this.layoutOrientation;
+});
+Clazz.defineMethod (c$, "setLayoutOrientation", 
+function (layoutOrientation) {
+var oldValue = this.layoutOrientation;
+switch (layoutOrientation) {
+case 0:
+case 1:
+case 2:
+this.layoutOrientation = layoutOrientation;
+this.firePropertyChangeInt ("layoutOrientation", oldValue, layoutOrientation);
+break;
+default:
+throw  new IllegalArgumentException ("layoutOrientation must be one of: VERTICAL, HORIZONTAL_WRAP or VERTICAL_WRAP");
+}
+}, "~N");
+Clazz.defineMethod (c$, "getFirstVisibleIndex", 
+function () {
+var r = this.getVisibleRect ();
+var first;
+if (this.getComponentOrientation ().isLeftToRight ()) {
+first = this.locationToIndex (r.getLocation ());
+} else {
+first = this.locationToIndex ( new java.awt.Point ((r.x + r.width) - 1, r.y));
+}if (first != -1) {
+var bounds = this.getCellBounds (first, first);
+if (bounds != null) {
+javax.swing.SwingUtilities.computeIntersection (r.x, r.y, r.width, r.height, bounds);
+if (bounds.width == 0 || bounds.height == 0) {
+first = -1;
+}}}return first;
+});
+Clazz.defineMethod (c$, "getLastVisibleIndex", 
+function () {
+var leftToRight = this.getComponentOrientation ().isLeftToRight ();
+var r = this.getVisibleRect ();
+var lastPoint;
+if (leftToRight) {
+lastPoint =  new java.awt.Point ((r.x + r.width) - 1, (r.y + r.height) - 1);
+} else {
+lastPoint =  new java.awt.Point (r.x, (r.y + r.height) - 1);
+}var location = this.locationToIndex (lastPoint);
+if (location != -1) {
+var bounds = this.getCellBounds (location, location);
+if (bounds != null) {
+javax.swing.SwingUtilities.computeIntersection (r.x, r.y, r.width, r.height, bounds);
+if (bounds.width == 0 || bounds.height == 0) {
+var isHorizontalWrap = (this.getLayoutOrientation () == 2);
+var visibleLocation = isHorizontalWrap ?  new java.awt.Point (lastPoint.x, r.y) :  new java.awt.Point (r.x, lastPoint.y);
+var last;
+var visIndex = -1;
+var lIndex = location;
+location = -1;
+do {
+last = visIndex;
+visIndex = this.locationToIndex (visibleLocation);
+if (visIndex != -1) {
+bounds = this.getCellBounds (visIndex, visIndex);
+if (visIndex != lIndex && bounds != null && bounds.contains (visibleLocation)) {
+location = visIndex;
+if (isHorizontalWrap) {
+visibleLocation.y = bounds.y + bounds.height;
+if (visibleLocation.y >= lastPoint.y) {
+last = visIndex;
+}} else {
+visibleLocation.x = bounds.x + bounds.width;
+if (visibleLocation.x >= lastPoint.x) {
+last = visIndex;
+}}} else {
+last = visIndex;
+}}} while (visIndex != -1 && last != visIndex);
+}}}return location;
+});
+Clazz.defineMethod (c$, "ensureIndexIsVisible", 
+function (index) {
+var cellBounds = this.getCellBounds (index, index);
+if (cellBounds != null) {
+this.scrollRectToVisible (cellBounds);
+}}, "~N");
+Clazz.defineMethod (c$, "setDragEnabled", 
+function (b) {
+this.dragEnabled = b;
+}, "~B");
+Clazz.defineMethod (c$, "getDragEnabled", 
+function () {
+return this.dragEnabled;
+});
+Clazz.defineMethod (c$, "getNextMatch", 
+function (prefix, startIndex, bias) {
+var model = this.getModel ();
+var max = model.getSize ();
+if (prefix == null) {
+throw  new IllegalArgumentException ();
+}if (startIndex < 0 || startIndex >= max) {
+throw  new IllegalArgumentException ();
+}prefix = prefix.toUpperCase ();
+var increment = (bias === javax.swing.text.Position.Bias.Forward) ? 1 : -1;
+var index = startIndex;
+do {
+var o = model.getElementAt (index);
+if (o != null) {
+var string;
+if (Clazz.instanceOf (o, String)) {
+string = (o).toUpperCase ();
+} else {
+string = o.toString ();
+if (string != null) {
+string = string.toUpperCase ();
+}}if (string != null && string.startsWith (prefix)) {
+return index;
+}}index = (index + increment + max) % max;
+} while (index != startIndex);
+return -1;
+}, "~S,~N,javax.swing.text.Position.Bias");
+Clazz.defineMethod (c$, "getToolTipText", 
+function (event) {
+if (event != null) {
+var p = event.getPoint ();
+var index = this.locationToIndex (p);
+var r = this.getCellRenderer ();
+var cellBounds;
+if (index != -1 && r != null && (cellBounds = this.getCellBounds (index, index)) != null && cellBounds.contains (p.x, p.y)) {
+var lsm = this.getSelectionModel ();
+var rComponent = r.getListCellRendererComponent (this, this.getModel ().getElementAt (index), index, lsm.isSelectedIndex (index), (this.hasFocus () && (lsm.getLeadSelectionIndex () == index)));
+if (Clazz.instanceOf (rComponent, javax.swing.JComponent)) {
+var newEvent;
+p.translate (-cellBounds.x, -cellBounds.y);
+newEvent =  new java.awt.event.MouseEvent (rComponent, event.getID (), event.getWhen (), event.getModifiers (), p.x, p.y, event.getXOnScreen (), event.getYOnScreen (), event.getClickCount (), event.isPopupTrigger (), 0);
+var tip = (rComponent).getToolTipText (newEvent);
+if (tip != null) {
+return tip;
+}}}}return Clazz.superCall (this, javax.swing.JList, "getToolTipText", []);
+}, "java.awt.event.MouseEvent");
+Clazz.defineMethod (c$, "locationToIndex", 
+function (location) {
+var ui = this.getUI ();
+return (ui != null) ? ui.locationToIndex (this, location) : -1;
+}, "java.awt.Point");
+Clazz.defineMethod (c$, "indexToLocation", 
+function (index) {
+var ui = this.getUI ();
+return (ui != null) ? ui.indexToLocation (this, index) : null;
+}, "~N");
+Clazz.defineMethod (c$, "getCellBounds", 
+function (index0, index1) {
+var ui = this.getUI ();
+return (ui != null) ? ui.getCellBounds (this, index0, index1) : null;
+}, "~N,~N");
+Clazz.defineMethod (c$, "getModel", 
+function () {
+return this.dataModel;
+});
+Clazz.defineMethod (c$, "setModel", 
+function (model) {
+if (model == null) {
+throw  new IllegalArgumentException ("model must be non null");
+}var oldValue = this.dataModel;
+this.dataModel = model;
+this.firePropertyChangeObject ("model", oldValue, this.dataModel);
+this.clearSelection ();
+}, "javax.swing.ListModel");
+Clazz.defineMethod (c$, "setListData", 
+function (listData) {
+this.setModel (((Clazz.isClassDefined ("javax.swing.JList$4") ? 0 : javax.swing.JList.$JList$4$ ()), Clazz.innerTypeInstance (javax.swing.JList$4, this, Clazz.cloneFinals ("listData", listData))));
+}, "~A");
+Clazz.defineMethod (c$, "setListData", 
+function (listData) {
+this.setModel (((Clazz.isClassDefined ("javax.swing.JList$5") ? 0 : javax.swing.JList.$JList$5$ ()), Clazz.innerTypeInstance (javax.swing.JList$5, this, Clazz.cloneFinals ("listData", listData))));
+}, "java.util.Vector");
+Clazz.defineMethod (c$, "createSelectionModel", 
+function () {
+return  new javax.swing.DefaultListSelectionModel ();
+});
+Clazz.defineMethod (c$, "getSelectionModel", 
+function () {
+return this.selectionModel;
+});
+Clazz.defineMethod (c$, "fireSelectionValueChanged", 
+function (firstIndex, lastIndex, isAdjusting) {
+var listeners = this.listenerList.getListenerList ();
+var e = null;
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.ListSelectionListener) {
+if (e == null) {
+e =  new javax.swing.event.ListSelectionEvent (this, firstIndex, lastIndex, isAdjusting);
+}(listeners[i + 1]).valueChanged (e);
+}}
+}, "~N,~N,~B");
+Clazz.defineMethod (c$, "addListSelectionListener", 
+function (listener) {
+if (this.selectionListener == null) {
+this.selectionListener = Clazz.innerTypeInstance (javax.swing.JList.ListSelectionHandler, this, null);
+this.getSelectionModel ().addListSelectionListener (this.selectionListener);
+}this.listenerList.add (javax.swing.event.ListSelectionListener, listener);
+}, "javax.swing.event.ListSelectionListener");
+Clazz.defineMethod (c$, "removeListSelectionListener", 
+function (listener) {
+this.listenerList.remove (javax.swing.event.ListSelectionListener, listener);
+}, "javax.swing.event.ListSelectionListener");
+Clazz.defineMethod (c$, "getListSelectionListeners", 
+function () {
+return this.listenerList.getListeners (javax.swing.event.ListSelectionListener);
+});
+Clazz.defineMethod (c$, "setSelectionModel", 
+function (selectionModel) {
+if (selectionModel == null) {
+throw  new IllegalArgumentException ("selectionModel must be non null");
+}if (this.selectionListener != null) {
+this.selectionModel.removeListSelectionListener (this.selectionListener);
+selectionModel.addListSelectionListener (this.selectionListener);
+}var oldValue = this.selectionModel;
+this.selectionModel = selectionModel;
+this.firePropertyChangeObject ("selectionModel", oldValue, selectionModel);
+}, "javax.swing.ListSelectionModel");
+Clazz.defineMethod (c$, "setSelectionMode", 
+function (selectionMode) {
+this.getSelectionModel ().setSelectionMode (selectionMode);
+}, "~N");
+Clazz.defineMethod (c$, "getSelectionMode", 
+function () {
+return this.getSelectionModel ().getSelectionMode ();
+});
+Clazz.defineMethod (c$, "getAnchorSelectionIndex", 
+function () {
+return this.getSelectionModel ().getAnchorSelectionIndex ();
+});
+Clazz.defineMethod (c$, "getLeadSelectionIndex", 
+function () {
+return this.getSelectionModel ().getLeadSelectionIndex ();
+});
+Clazz.defineMethod (c$, "getMinSelectionIndex", 
+function () {
+return this.getSelectionModel ().getMinSelectionIndex ();
+});
+Clazz.defineMethod (c$, "getMaxSelectionIndex", 
+function () {
+return this.getSelectionModel ().getMaxSelectionIndex ();
+});
+Clazz.defineMethod (c$, "isSelectedIndex", 
+function (index) {
+return this.getSelectionModel ().isSelectedIndex (index);
+}, "~N");
+Clazz.defineMethod (c$, "isSelectionEmpty", 
+function () {
+return this.getSelectionModel ().isSelectionEmpty ();
+});
+Clazz.defineMethod (c$, "clearSelection", 
+function () {
+this.getSelectionModel ().clearSelection ();
+});
+Clazz.defineMethod (c$, "setSelectionInterval", 
+function (anchor, lead) {
+this.getSelectionModel ().setSelectionInterval (anchor, lead);
+}, "~N,~N");
+Clazz.defineMethod (c$, "addSelectionInterval", 
+function (anchor, lead) {
+this.getSelectionModel ().addSelectionInterval (anchor, lead);
+}, "~N,~N");
+Clazz.defineMethod (c$, "removeSelectionInterval", 
+function (index0, index1) {
+this.getSelectionModel ().removeSelectionInterval (index0, index1);
+}, "~N,~N");
+Clazz.defineMethod (c$, "setValueIsAdjusting", 
+function (b) {
+this.getSelectionModel ().setValueIsAdjusting (b);
+}, "~B");
+Clazz.defineMethod (c$, "getValueIsAdjusting", 
+function () {
+return this.getSelectionModel ().getValueIsAdjusting ();
+});
+Clazz.defineMethod (c$, "getSelectedIndices", 
+function () {
+var sm = this.getSelectionModel ();
+var iMin = sm.getMinSelectionIndex ();
+var iMax = sm.getMaxSelectionIndex ();
+if ((iMin < 0) || (iMax < 0)) {
+return  Clazz.newIntArray (0, 0);
+}var rvTmp =  Clazz.newIntArray (1 + (iMax - iMin), 0);
+var n = 0;
+for (var i = iMin; i <= iMax; i++) {
+if (sm.isSelectedIndex (i)) {
+rvTmp[n++] = i;
+}}
+var rv =  Clazz.newIntArray (n, 0);
+System.arraycopy (rvTmp, 0, rv, 0, n);
+return rv;
+});
+Clazz.defineMethod (c$, "setSelectedIndex", 
+function (index) {
+if (index >= this.getModel ().getSize ()) {
+return;
+}this.getSelectionModel ().setSelectionInterval (index, index);
+}, "~N");
+Clazz.defineMethod (c$, "setSelectedIndices", 
+function (indices) {
+var sm = this.getSelectionModel ();
+sm.clearSelection ();
+var size = this.getModel ().getSize ();
+for (var i = 0; i < indices.length; i++) {
+if (indices[i] < size) {
+sm.addSelectionInterval (indices[i], indices[i]);
+}}
+}, "~A");
+Clazz.defineMethod (c$, "getSelectedValues", 
+function () {
+var sm = this.getSelectionModel ();
+var dm = this.getModel ();
+var iMin = sm.getMinSelectionIndex ();
+var iMax = sm.getMaxSelectionIndex ();
+if ((iMin < 0) || (iMax < 0)) {
+return  new Array (0);
+}var rvTmp =  new Array (1 + (iMax - iMin));
+var n = 0;
+for (var i = iMin; i <= iMax; i++) {
+if (sm.isSelectedIndex (i)) {
+rvTmp[n++] = dm.getElementAt (i);
+}}
+var rv =  new Array (n);
+System.arraycopy (rvTmp, 0, rv, 0, n);
+return rv;
+});
+Clazz.defineMethod (c$, "getSelectedIndex", 
+function () {
+return this.getMinSelectionIndex ();
+});
+Clazz.defineMethod (c$, "getSelectedValue", 
+function () {
+var i = this.getMinSelectionIndex ();
+return (i == -1) ? null : this.getModel ().getElementAt (i);
+});
+Clazz.defineMethod (c$, "setSelectedValue", 
+function (anObject, shouldScroll) {
+if (anObject == null) this.setSelectedIndex (-1);
+ else if (!anObject.equals (this.getSelectedValue ())) {
+var i;
+var c;
+var dm = this.getModel ();
+for (i = 0, c = dm.getSize (); i < c; i++) if (anObject.equals (dm.getElementAt (i))) {
+this.setSelectedIndex (i);
+if (shouldScroll) this.ensureIndexIsVisible (i);
+this.repaint ();
+return;
+}
+this.setSelectedIndex (-1);
+}this.repaint ();
+}, "~O,~B");
+Clazz.defineMethod (c$, "checkScrollableParameters", 
+ function (visibleRect, orientation) {
+if (visibleRect == null) {
+throw  new IllegalArgumentException ("visibleRect must be non-null");
+}switch (orientation) {
+case 1:
+case 0:
+break;
+default:
+throw  new IllegalArgumentException ("orientation must be one of: VERTICAL, HORIZONTAL");
+}
+}, "java.awt.Rectangle,~N");
+Clazz.overrideMethod (c$, "getPreferredScrollableViewportSize", 
+function () {
+if (this.getLayoutOrientation () != 0) {
+return this.getPreferredSize ();
+}var insets = this.getInsets ();
+var dx = insets.left + insets.right;
+var dy = insets.top + insets.bottom;
+var visibleRowCount = this.getVisibleRowCount ();
+var fixedCellWidth = this.getFixedCellWidth ();
+var fixedCellHeight = this.getFixedCellHeight ();
+if ((fixedCellWidth > 0) && (fixedCellHeight > 0)) {
+var width = fixedCellWidth + dx;
+var height = (visibleRowCount * fixedCellHeight) + dy;
+return  new java.awt.Dimension (width, height);
+} else if (this.getModel ().getSize () > 0) {
+var width = this.getPreferredSize ().width;
+var height;
+var r = this.getCellBounds (0, 0);
+if (r != null) {
+height = (visibleRowCount * r.height) + dy;
+} else {
+height = 1;
+}return  new java.awt.Dimension (width, height);
+} else {
+fixedCellWidth = (fixedCellWidth > 0) ? fixedCellWidth : 256;
+fixedCellHeight = (fixedCellHeight > 0) ? fixedCellHeight : 16;
+return  new java.awt.Dimension (fixedCellWidth, fixedCellHeight * visibleRowCount);
+}});
+Clazz.overrideMethod (c$, "getScrollableUnitIncrement", 
+function (visibleRect, orientation, direction) {
+this.checkScrollableParameters (visibleRect, orientation);
+if (orientation == 1) {
+var row = this.locationToIndex (visibleRect.getLocation ());
+if (row == -1) {
+return 0;
+} else {
+if (direction > 0) {
+var r = this.getCellBounds (row, row);
+return (r == null) ? 0 : r.height - (visibleRect.y - r.y);
+} else {
+var r = this.getCellBounds (row, row);
+if ((r.y == visibleRect.y) && (row == 0)) {
+return 0;
+} else if (r.y == visibleRect.y) {
+var loc = r.getLocation ();
+loc.y--;
+var prevIndex = this.locationToIndex (loc);
+var prevR = this.getCellBounds (prevIndex, prevIndex);
+if (prevR == null || prevR.y >= r.y) {
+return 0;
+}return prevR.height;
+} else {
+return visibleRect.y - r.y;
+}}}} else if (orientation == 0 && this.getLayoutOrientation () != 0) {
+var leftToRight = this.getComponentOrientation ().isLeftToRight ();
+var index;
+var leadingPoint;
+if (leftToRight) {
+leadingPoint = visibleRect.getLocation ();
+} else {
+leadingPoint =  new java.awt.Point (visibleRect.x + visibleRect.width - 1, visibleRect.y);
+}index = this.locationToIndex (leadingPoint);
+if (index != -1) {
+var cellBounds = this.getCellBounds (index, index);
+if (cellBounds != null && cellBounds.contains (leadingPoint)) {
+var leadingVisibleEdge;
+var leadingCellEdge;
+if (leftToRight) {
+leadingVisibleEdge = visibleRect.x;
+leadingCellEdge = cellBounds.x;
+} else {
+leadingVisibleEdge = visibleRect.x + visibleRect.width;
+leadingCellEdge = cellBounds.x + cellBounds.width;
+}if (leadingCellEdge != leadingVisibleEdge) {
+if (direction < 0) {
+return Math.abs (leadingVisibleEdge - leadingCellEdge);
+} else if (leftToRight) {
+return leadingCellEdge + cellBounds.width - leadingVisibleEdge;
+} else {
+return leadingVisibleEdge - cellBounds.x;
+}}return cellBounds.width;
+}}}var f = this.getFont ();
+return (f != null) ? f.getSize () : 1;
+}, "java.awt.Rectangle,~N,~N");
+Clazz.overrideMethod (c$, "getScrollableBlockIncrement", 
+function (visibleRect, orientation, direction) {
+this.checkScrollableParameters (visibleRect, orientation);
+if (orientation == 1) {
+var inc = visibleRect.height;
+if (direction > 0) {
+var last = this.locationToIndex ( new java.awt.Point (visibleRect.x, visibleRect.y + visibleRect.height - 1));
+if (last != -1) {
+var lastRect = this.getCellBounds (last, last);
+if (lastRect != null) {
+inc = lastRect.y - visibleRect.y;
+if ((inc == 0) && (last < this.getModel ().getSize () - 1)) {
+inc = lastRect.height;
+}}}} else {
+var newFirst = this.locationToIndex ( new java.awt.Point (visibleRect.x, visibleRect.y - visibleRect.height));
+var first = this.getFirstVisibleIndex ();
+if (newFirst != -1) {
+if (first == -1) {
+first = this.locationToIndex (visibleRect.getLocation ());
+}var newFirstRect = this.getCellBounds (newFirst, newFirst);
+var firstRect = this.getCellBounds (first, first);
+if ((newFirstRect != null) && (firstRect != null)) {
+while ((newFirstRect.y + visibleRect.height < firstRect.y + firstRect.height) && (newFirstRect.y < firstRect.y)) {
+newFirst++;
+newFirstRect = this.getCellBounds (newFirst, newFirst);
+}
+inc = visibleRect.y - newFirstRect.y;
+if ((inc <= 0) && (newFirstRect.y > 0)) {
+newFirst--;
+newFirstRect = this.getCellBounds (newFirst, newFirst);
+if (newFirstRect != null) {
+inc = visibleRect.y - newFirstRect.y;
+}}}}}return inc;
+} else if (orientation == 0 && this.getLayoutOrientation () != 0) {
+var leftToRight = this.getComponentOrientation ().isLeftToRight ();
+var inc = visibleRect.width;
+if (direction > 0) {
+var x = visibleRect.x + (leftToRight ? (visibleRect.width - 1) : 0);
+var last = this.locationToIndex ( new java.awt.Point (x, visibleRect.y));
+if (last != -1) {
+var lastRect = this.getCellBounds (last, last);
+if (lastRect != null) {
+if (leftToRight) {
+inc = lastRect.x - visibleRect.x;
+} else {
+inc = visibleRect.x + visibleRect.width - (lastRect.x + lastRect.width);
+}if (inc < 0) {
+inc += lastRect.width;
+} else if ((inc == 0) && (last < this.getModel ().getSize () - 1)) {
+inc = lastRect.width;
+}}}} else {
+var x = visibleRect.x + (leftToRight ? -visibleRect.width : visibleRect.width - 1 + visibleRect.width);
+var first = this.locationToIndex ( new java.awt.Point (x, visibleRect.y));
+if (first != -1) {
+var firstRect = this.getCellBounds (first, first);
+if (firstRect != null) {
+var firstRight = firstRect.x + firstRect.width;
+if (leftToRight) {
+if ((firstRect.x < visibleRect.x - visibleRect.width) && (firstRight < visibleRect.x)) {
+inc = visibleRect.x - firstRight;
+} else {
+inc = visibleRect.x - firstRect.x;
+}} else {
+var visibleRight = visibleRect.x + visibleRect.width;
+if ((firstRight > visibleRight + visibleRect.width) && (firstRect.x > visibleRight)) {
+inc = firstRect.x - visibleRight;
+} else {
+inc = firstRight - visibleRight;
+}}}}}return inc;
+}return visibleRect.width;
+}, "java.awt.Rectangle,~N,~N");
+Clazz.overrideMethod (c$, "getScrollableTracksViewportWidth", 
+function () {
+if (this.getLayoutOrientation () == 2 && this.getVisibleRowCount () <= 0) {
+return true;
+}if (Clazz.instanceOf (this.getParent (), javax.swing.JViewport)) {
+return ((this.getParent ()).getWidth () > this.getPreferredSize ().width);
+}return false;
+});
+Clazz.overrideMethod (c$, "getScrollableTracksViewportHeight", 
+function () {
+if (this.getLayoutOrientation () == 1 && this.getVisibleRowCount () <= 0) {
+return true;
+}if (Clazz.instanceOf (this.getParent (), javax.swing.JViewport)) {
+return ((this.getParent ()).getHeight () > this.getPreferredSize ().height);
+}return false;
+});
+Clazz.defineMethod (c$, "paramString", 
+function () {
+var selectionForegroundString = (this.selectionForeground != null ? this.selectionForeground.toString () : "");
+var selectionBackgroundString = (this.selectionBackground != null ? this.selectionBackground.toString () : "");
+return Clazz.superCall (this, javax.swing.JList, "paramString", []) + ",fixedCellHeight=" + this.fixedCellHeight + ",fixedCellWidth=" + this.fixedCellWidth + ",horizontalScrollIncrement=" + this.horizontalScrollIncrement + ",selectionBackground=" + selectionBackgroundString + ",selectionForeground=" + selectionForegroundString + ",visibleRowCount=" + this.visibleRowCount + ",layoutOrientation=" + this.layoutOrientation;
+});
+c$.$JList$ListSelectionHandler$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+Clazz.instantialize (this, arguments);
+}, javax.swing.JList, "ListSelectionHandler", null, javax.swing.event.ListSelectionListener);
+Clazz.overrideMethod (c$, "valueChanged", 
+function (a) {
+this.b$["javax.swing.JList"].fireSelectionValueChanged (a.getFirstIndex (), a.getLastIndex (), a.getValueIsAdjusting ());
+}, "javax.swing.event.ListSelectionEvent");
+c$ = Clazz.p0p ();
+};
+c$.$JList$1$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (javax.swing, "JList$1", javax.swing.AbstractListModel);
+Clazz.defineMethod (c$, "getSize", 
+function () {
+return this.f$.listData.length;
+});
+Clazz.defineMethod (c$, "getElementAt", 
+function (i) {
+return this.f$.listData[i];
+}, "~N");
+c$ = Clazz.p0p ();
+};
+c$.$JList$2$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (javax.swing, "JList$2", javax.swing.AbstractListModel);
+Clazz.defineMethod (c$, "getSize", 
+function () {
+return this.f$.listData.size ();
+});
+Clazz.defineMethod (c$, "getElementAt", 
+function (i) {
+return this.f$.listData.elementAt (i);
+}, "~N");
+c$ = Clazz.p0p ();
+};
+c$.$JList$3$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (javax.swing, "JList$3", javax.swing.AbstractListModel);
+Clazz.defineMethod (c$, "getSize", 
+function () {
+return 0;
+});
+Clazz.defineMethod (c$, "getElementAt", 
+function (i) {
+return "No Data Model";
+}, "~N");
+c$ = Clazz.p0p ();
+};
+c$.$JList$4$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (javax.swing, "JList$4", javax.swing.AbstractListModel);
+Clazz.defineMethod (c$, "getSize", 
+function () {
+return this.f$.listData.length;
+});
+Clazz.defineMethod (c$, "getElementAt", 
+function (i) {
+return this.f$.listData[i];
+}, "~N");
+c$ = Clazz.p0p ();
+};
+c$.$JList$5$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (javax.swing, "JList$5", javax.swing.AbstractListModel);
+Clazz.defineMethod (c$, "getSize", 
+function () {
+return this.f$.listData.size ();
+});
+Clazz.defineMethod (c$, "getElementAt", 
+function (i) {
+return this.f$.listData.elementAt (i);
+}, "~N");
+c$ = Clazz.p0p ();
+};
+Clazz.defineStatics (c$,
+"$uiClassID", "ListUI",
+"VERTICAL", 0,
+"VERTICAL_WRAP", 1,
+"HORIZONTAL_WRAP", 2);
+});