All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codetome.zircon.internal.component.InternalComponent.kt Maven / Gradle / Ivy

package org.codetome.zircon.internal.component

import org.codetome.zircon.api.Position
import org.codetome.zircon.api.behavior.Drawable
import org.codetome.zircon.api.component.Component
import org.codetome.zircon.internal.behavior.Focusable
import java.util.*

/**
 * A [InternalComponent] is a GUI element which is used either to display information to the user
 * or to enable the user to interact with the program.
 * Components are basically a tree structure of GUI elements nested in each other.
 * The component hierarchy **always** has a [Container] as its root. A child [InternalComponent]
 * is **always** bounded by its parent. Containers are branches in this tree while components
 * are leaves. So for example a panel which is intended to be able to hold other components
 * like a label or a check box is a [Container] while a label which is only intended to
 * display information is a [InternalComponent].
 */
interface InternalComponent : Component, Drawable, Focusable {

    /**
     * Returns the innermost [InternalComponent] for a given [Position].
     * This means that if you call this method on a [Container] and it
     * contains a [InternalComponent] which intersects with `position` the
     * component will be returned instead of the container itself.
     * If no [InternalComponent] intersects with the given `position` an
     * empty [Optional] is returned.
     */
    fun fetchComponentByPosition(position: Position): Optional

    fun setPosition(position: Position)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy