Tree

class Tree[A](var treeDataModel: TreeModel[A])(implicit evidence$1: ClassTag[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.

See also:

javax.swing.JTree

Companion:
object
trait Wrapper
trait Scrollable
trait EditableCells[A]
trait CellView[A]
class Component
trait UIElement
trait Publisher
trait Reactor
trait Proxy
class Object
trait Matchable
class Any
Tree[A]

Type members

Classlikes

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.

Inherited classlikes

trait CellSelection extends Publisher

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 from selection objects will derive from scala.swing.event.SelectionEvent.

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 from selection objects will derive from scala.swing.event.SelectionEvent.

Inherited from:
CellView
object keys extends Publisher
Inherited from:
Component
object mouse

Contains publishers for various mouse events. They are separated for efficiency reasons.

Contains publishers for various mouse events. They are separated for efficiency reasons.

Inherited from:
Component

Value members

Constructors

def this()

Concrete methods

def cancelEditing(): Unit
override def cellValues: Iterator[A]
Definition Classes
def collapseAll(): Unit

Collapses all visible rows.

Collapses all visible rows.

def collapsePath(path: IndexedSeq[A]): Unit
def collapseRow(row: Int): Unit
def dragEnabled: Boolean
def dragEnabled_=(b: Boolean): Unit
def editable: Boolean
def editable_=(b: Boolean): Unit
def editingPath: Option[IndexedSeq[A]]
def editor: Editor[A]
def editor_=(r: Editor[A]): Unit
def expandAll(): Unit

Expands every row. Will not terminate if the tree is of infinite depth.

Expands every row. Will not terminate if the tree is of infinite depth.

def expandPath(path: IndexedSeq[A]): Unit
def expandRow(row: Int): Unit
def expandsSelectedPaths_=(b: Boolean): Unit
def getClosestPathForLocation(x: Int, y: Int): Option[IndexedSeq[A]]
def getClosestRowForLocation(x: Int, y: Int): Int
def getRowForLocation(x: Int, y: Int): Int
def getRowForPath(path: IndexedSeq[A]): Int
def isCollapsed(path: IndexedSeq[A]): Boolean
def isEditing: Boolean
def isExpanded(path: IndexedSeq[A]): Boolean
def isVisible(path: IndexedSeq[A]): Boolean
def largeModel: Boolean
def lineStyle_=(style: Value): Unit
def makeVisible(path: IndexedSeq[A]): Unit
def model_=(tm: TreeModel[A]): Unit
def renderer_=(r: Renderer[A]): Unit
def rowCount: Int
def rowHeight: Int
def selectInterval(first: Int, last: Int): Unit
def selectPaths(paths: IndexedSeq[A]*): Unit
def selectRows(rows: Int*): Unit
def showsRootHandles: Boolean
def showsRootHandles_=(b: Boolean): Unit
def startEditingAtPath(path: IndexedSeq[A]): Unit
def stopEditing(): Boolean
def visibleRowCount_=(rows: Int): Unit

Inherited methods

def background: Color
Inherited from:
UIElement
def background_=(c: Color): Unit
Inherited from:
UIElement
def blockIncrement(visibleRect: Rectangle, orientation: Value, direction: Int): Int
Inherited from:
Wrapper
def border: Border
Inherited from:
Component
def border_=(b: Border): Unit
Inherited from:
Component
def bounds: Rectangle
Inherited from:
UIElement
def componentOrientation: ComponentOrientation
Inherited from:
UIElement
def componentOrientation_=(x: ComponentOrientation): Unit
Inherited from:
UIElement
def cursor: Cursor
Inherited from:
UIElement
def cursor_=(c: Cursor): Unit
Inherited from:
UIElement
def deafTo(ps: Publisher*): Unit

Installed reaction won't receive events from the given publisher anylonger.

Installed reaction won't receive events from the given publisher anylonger.

Inherited from:
Reactor
def displayable: Boolean
Inherited from:
UIElement
def enabled: Boolean
Inherited from:
Component
def enabled_=(b: Boolean): Unit
Inherited from:
Component
override def equals(that: Any): Boolean
Definition Classes
Proxy -> Any
Inherited from:
Proxy
def focusable: Boolean
Inherited from:
Component
def focusable_=(b: Boolean): Unit
Inherited from:
Component
def font: Font
Inherited from:
UIElement
def font_=(f: Font): Unit
Inherited from:
UIElement
def foreground: Color
Inherited from:
UIElement
def foreground_=(c: Color): Unit
Inherited from:
UIElement
def hasFocus: Boolean
Inherited from:
Component
override def hashCode(): Int
Definition Classes
Proxy -> Any
Inherited from:
Proxy
def ignoreRepaint: Boolean
Inherited from:
UIElement
def ignoreRepaint_=(b: Boolean): Unit
Inherited from:
UIElement
def inputVerifier: Component => Boolean
Inherited from:
Component
def inputVerifier_=(v: Component => Boolean): Unit
Inherited from:
Component
def listenTo(ps: Publisher*): Unit

Listen to the given publisher as long as deafTo isn't called for them.

Listen to the given publisher as long as deafTo isn't called for them.

Inherited from:
Reactor
def locale: Locale
Inherited from:
UIElement
def location: Point
Inherited from:
UIElement
def locationOnScreen: Point
Inherited from:
UIElement
def maximumSize: Dimension
Inherited from:
UIElement
def maximumSize_=(x: Dimension): Unit
Inherited from:
UIElement
def minimumSize: Dimension
Inherited from:
UIElement
def minimumSize_=(x: Dimension): Unit
Inherited from:
UIElement
def name: String
Inherited from:
Component
def name_=(s: String): Unit
Inherited from:
Component
def opaque: Boolean
Inherited from:
Component
def opaque_=(b: Boolean): Unit
Inherited from:
Component
def paint(g: Graphics2D): Unit
Inherited from:
Component
def preferredSize: Dimension
Inherited from:
UIElement
def preferredSize_=(x: Dimension): Unit
Inherited from:
UIElement
def preferredViewportSize: Dimension
Inherited from:
Wrapper
def publish(e: Event): Unit

Notify all registered reactions.

Notify all registered reactions.

Inherited from:
Publisher
def repaint(rect: Rectangle): Unit
Inherited from:
UIElement
def repaint(): Unit
Inherited from:
UIElement
def requestFocus(): Unit
Inherited from:
Component
def requestFocusInWindow(): Boolean
Inherited from:
Component
def revalidate(): Unit
Inherited from:
Component
def self: Any
Inherited from:
UIElement
def showing: Boolean
Inherited from:
UIElement
def size: Dimension
Inherited from:
UIElement
override def subscribe(listener: Reaction): Unit
Definition Classes
LazyPublisher -> Publisher
Inherited from:
LazyPublisher
override def toString: String
Definition Classes
Component -> Proxy -> Any
Inherited from:
Component
def toolkit: Toolkit
Inherited from:
UIElement
def tooltip: String
Inherited from:
Component
def tooltip_=(t: String): Unit
Inherited from:
Component
Inherited from:
Wrapper
def tracksViewportWidth: Boolean
Inherited from:
Wrapper
def unitIncrement(visibleRect: Rectangle, orientation: Value, direction: Int): Int
Inherited from:
Wrapper
override def unsubscribe(listener: Reaction): Unit
Definition Classes
LazyPublisher -> Publisher
Inherited from:
LazyPublisher
def validate(): Unit
Inherited from:
UIElement
def visible: Boolean
Inherited from:
UIElement
def visible_=(b: Boolean): Unit
Inherited from:
UIElement
def xLayoutAlignment: Double

Used by certain layout managers, e.g., BoxLayout or OverlayLayout to align components relative to each other.

Used by certain layout managers, e.g., BoxLayout or OverlayLayout to align components relative to each other.

Inherited from:
Component
def xLayoutAlignment_=(x: Double): Unit
Inherited from:
Component
def yLayoutAlignment: Double
Inherited from:
Component
def yLayoutAlignment_=(y: Double): Unit
Inherited from:
Component

Concrete fields

override val companion: Tree.type
lazy override val peer: JTree

Inherited fields

protected val listeners: RefSet[Reaction]
Inherited from:
Publisher
val reactions: Reactions

All reactions of this reactor.

All reactions of this reactor.

Inherited from:
Reactor

Implicits

Implicits

implicit def genericEditor[B]: Editor[B]

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.

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.

implicit def pathToTreePath(p: IndexedSeq[A]): TreePath

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.

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.

implicit def treePathToPath(tp: TreePath): IndexedSeq[A]

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.

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.