class Tree[A] extends Component with CellView[A] with EditableCells[A] with RenderableCells[A] with Wrapper
Wrapper for a JTree. The tree model is represented by a lazy child expansion function that may or may not terminate in leaf nodes.
The tree publishes structural events, such as nodes being added or removed, on its main publisher, whereas selection changes are published to the dedicated Tree#selection object.
- Self Type
- Tree[A]
- See also
javax.swing.JTree
- Alphabetic
- By Inheritance
- Tree
- Wrapper
- Scrollable
- RenderableCells
- EditableCells
- CellView
- Component
- UIElement
- LazyPublisher
- Publisher
- Reactor
- Proxy
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Type Members
- trait CellSelection extends Publisher
Provides common functionality for the
selection
object found in CellView implementation.Provides common functionality for the
selection
object found in CellView implementation. Each will have one or more selection sets based on different types of cell coordinate, such as row, column, index or tree path. All events published fromselection
objects will derive from scala.swing.event.SelectionEvent.- Definition Classes
- CellView
- trait SuperMixin extends JComponent
- Attributes
- protected
- Definition Classes
- Component
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def background: Color
- Definition Classes
- UIElement
- def background_=(c: Color): Unit
- Definition Classes
- UIElement
- def blockIncrement(visibleRect: Rectangle, orientation: scala.swing.Orientation.Value, direction: Int): Int
- Definition Classes
- Wrapper → Scrollable
- def border: Border
- Definition Classes
- Component
- def border_=(b: Border): Unit
- Definition Classes
- Component
- def bounds: Rectangle
- Definition Classes
- UIElement
- def cancelEditing(): Unit
- def cellValues: Iterator[A]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def collapseAll(): Unit
Collapses all visible rows.
- def collapsePath(path: Path[A]): Unit
- def collapseRow(row: Int): Unit
- val companion: Tree.type
- Definition Classes
- Tree → RenderableCells → EditableCells
- def componentOrientation: ComponentOrientation
- Definition Classes
- UIElement
- def componentOrientation_=(x: ComponentOrientation): Unit
- Definition Classes
- UIElement
- def cursor: Cursor
- Definition Classes
- UIElement
- def cursor_=(c: Cursor): Unit
- Definition Classes
- UIElement
- def deafTo(ps: Publisher*): Unit
- Definition Classes
- Reactor
- def displayable: Boolean
- Definition Classes
- UIElement
- def dragEnabled: Boolean
- def dragEnabled_=(b: Boolean): Unit
- def editable: Boolean
- def editable_=(b: Boolean): Unit
- def editingPath: Option[Path[A]]
- def editor: Tree.Editor[A]
- Definition Classes
- Tree → EditableCells
- def editor_=(r: Tree.Editor[A]): Unit
- Definition Classes
- Tree → EditableCells
- def enabled: Boolean
- Definition Classes
- Component
- def enabled_=(b: Boolean): Unit
- Definition Classes
- Component
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(that: Any): Boolean
- Definition Classes
- Proxy → Any
- def expandAll(): Unit
Expands every row.
Expands every row. Will not terminate if the tree is of infinite depth.
- def expandPath(path: Path[A]): Unit
- def expandRow(row: Int): Unit
- def expandsSelectedPaths: Boolean
- def expandsSelectedPaths_=(b: Boolean): Unit
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def focusable: Boolean
- Definition Classes
- Component
- def focusable_=(b: Boolean): Unit
- Definition Classes
- Component
- def font: Font
- Definition Classes
- UIElement
- def font_=(f: Font): Unit
- Definition Classes
- UIElement
- def foreground: Color
- Definition Classes
- UIElement
- def foreground_=(c: Color): Unit
- Definition Classes
- UIElement
- implicit def genericEditor[B]: Tree.Editor[B] { ... /* 2 definitions in type refinement */ }
Implicit method to produce a generic editor.
Implicit method to produce a generic editor. This lives in the Tree class rather than the companion object because it requires an actual javax.swing.JTree instance to be initialised.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getClosestPathForLocation(x: Int, y: Int): Option[Path[A]]
- def getClosestRowForLocation(x: Int, y: Int): Int
- def getRowForLocation(x: Int, y: Int): Int
- def getRowForPath(path: Path[A]): Int
- def hasFocus: Boolean
- Definition Classes
- Component
- def hashCode(): Int
- Definition Classes
- Proxy → Any
- def ignoreRepaint: Boolean
- Definition Classes
- UIElement
- def ignoreRepaint_=(b: Boolean): Unit
- Definition Classes
- UIElement
- def inputVerifier: (Component) => Boolean
- Definition Classes
- Component
- def inputVerifier_=(v: (Component) => Boolean): Unit
- Definition Classes
- Component
- def isCollapsed(path: Path[A]): Boolean
- def isEditing: Boolean
- def isExpanded(path: Path[A]): Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isVisible(path: Path[A]): Boolean
- def largeModel: Boolean
- def lineStyle: Tree.LineStyle.Value
- def lineStyle_=(style: Tree.LineStyle.Value): Unit
- def listenTo(ps: Publisher*): Unit
- Definition Classes
- Reactor
- val listeners: RefSet[Reaction]
- Attributes
- protected
- Definition Classes
- Publisher
- def locale: Locale
- Definition Classes
- UIElement
- def location: Point
- Definition Classes
- UIElement
- def locationOnScreen: Point
- Definition Classes
- UIElement
- def makeVisible(path: Path[A]): Unit
- def maximumSize: Dimension
- Definition Classes
- UIElement
- def maximumSize_=(x: Dimension): Unit
- Definition Classes
- UIElement
- def minimumSize: Dimension
- Definition Classes
- UIElement
- def minimumSize_=(x: Dimension): Unit
- Definition Classes
- UIElement
- def model: TreeModel[A]
- val modelListener: TreeModelListener
- Attributes
- protected
- def model_=(tm: TreeModel[A]): Unit
- def name: String
- Definition Classes
- Component
- def name_=(s: String): Unit
- Definition Classes
- Component
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def onFirstSubscribe(): Unit
- Attributes
- protected
- Definition Classes
- Component → UIElement → LazyPublisher
- def onLastUnsubscribe(): Unit
- Attributes
- protected
- Definition Classes
- UIElement → LazyPublisher
- def opaque: Boolean
- Definition Classes
- Component
- def opaque_=(b: Boolean): Unit
- Definition Classes
- Component
- def paint(g: Graphics2D): Unit
- Definition Classes
- Component
- def paintBorder(g: Graphics2D): Unit
- Attributes
- protected
- Definition Classes
- Component
- def paintChildren(g: Graphics2D): Unit
- Attributes
- protected
- Definition Classes
- Component
- def paintComponent(g: Graphics2D): Unit
- Attributes
- protected
- Definition Classes
- Component
- implicit def pathToTreePath(p: Path[A]): TreePath
Implicitly converts Tree.Path[A] lists to TreePath objects understood by the underlying peer JTree.
Implicitly converts Tree.Path[A] lists to TreePath objects understood by the underlying peer JTree. In addition to the objects in the list, the JTree's hidden root node must be prepended.
- lazy val peer: JTree
- Definition Classes
- Tree → Component → UIElement
- def preferredSize: Dimension
- Definition Classes
- UIElement
- def preferredSize_=(x: Dimension): Unit
- Definition Classes
- UIElement
- def preferredViewportSize: Dimension
- Definition Classes
- Wrapper → Scrollable
- def publish(e: Event): Unit
- Definition Classes
- Publisher
- val reactions: Reactions
- Definition Classes
- Reactor
- def renderer: Tree.Renderer[A]
- Definition Classes
- Tree → RenderableCells
- def renderer_=(r: Tree.Renderer[A]): Unit
- Definition Classes
- Tree → RenderableCells
- def repaint(rect: Rectangle): Unit
- Definition Classes
- UIElement
- def repaint(): Unit
- Definition Classes
- UIElement
- def requestFocus(): Unit
- Definition Classes
- Component
- def requestFocusInWindow(): Boolean
- Definition Classes
- Component
- def revalidate(): Unit
- Definition Classes
- Component
- def rowCount: Int
- def rowHeight: Int
- def scrollablePeer: JTree
- Attributes
- protected
- Definition Classes
- Tree → Wrapper
- def scrollableTracksViewportHeight: Boolean
- def selectInterval(first: Int, last: Int): Unit
- def selectPaths(paths: Path[A]*): Unit
- def selectRows(rows: Int*): Unit
- def self: Any
- Definition Classes
- UIElement → Proxy
- def showing: Boolean
- Definition Classes
- UIElement
- def showsRootHandles: Boolean
- def showsRootHandles_=(b: Boolean): Unit
- def size: Dimension
- Definition Classes
- UIElement
- def startEditingAtPath(path: Path[A]): Unit
- def stopEditing(): Boolean
- def subscribe(listener: Reaction): Unit
- Definition Classes
- LazyPublisher → Publisher
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- Component → Proxy → AnyRef → Any
- def toolkit: Toolkit
- Definition Classes
- UIElement
- def tooltip: String
- Definition Classes
- Component
- def tooltip_=(t: String): Unit
- Definition Classes
- Component
- def tracksViewportHeight: Boolean
- Definition Classes
- Wrapper → Scrollable
- def tracksViewportWidth: Boolean
- Definition Classes
- Wrapper → Scrollable
- implicit def treePathToPath(tp: TreePath): Path[A]
Implicitly converts javax.swing.tree.TreePath objects to Tree.Path[A] lists recognised in Scala Swing.
Implicitly converts javax.swing.tree.TreePath objects to Tree.Path[A] lists recognised in Scala Swing. TreePaths will include the underlying JTree's hidden root node, which is omitted for Tree.Paths.
- def unitIncrement(visibleRect: Rectangle, orientation: scala.swing.Orientation.Value, direction: Int): Int
- Definition Classes
- Wrapper → Scrollable
- def unsubscribe(listener: Reaction): Unit
- Definition Classes
- LazyPublisher → Publisher
- def validate(): Unit
- Definition Classes
- UIElement
- def visible: Boolean
- Definition Classes
- UIElement
- def visibleRowCount: Int
- def visibleRowCount_=(rows: Int): Unit
- def visible_=(b: Boolean): Unit
- Definition Classes
- UIElement
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def xLayoutAlignment: Double
- Definition Classes
- Component
- def xLayoutAlignment_=(x: Double): Unit
- Definition Classes
- Component
- def yLayoutAlignment: Double
- Definition Classes
- Component
- def yLayoutAlignment_=(y: Double): Unit
- Definition Classes
- Component
- object selection extends CellSelection
Selection model for Tree.
Selection model for Tree.
To observe tree selections, make the reactor listen to this publishing object which will then dispatch instances of scalaswingcontrib.event.TreePathSelected.