- java.lang.Object
-
- com.googlecode.lanterna.gui2.AbstractComponent<T>
-
- com.googlecode.lanterna.gui2.AbstractComposite<Border>
-
- com.googlecode.lanterna.gui2.AbstractBorder
-
- All Implemented Interfaces:
Border
,Component
,Composite
,Container
,TextGUIElement
- Direct Known Subclasses:
Borders.StandardBorder
public abstract class AbstractBorder extends AbstractComposite<Border> implements Border
Abstract implementation ofBorder
interface that has some of the methods filled out. If you want to create your ownBorder
implementation, should should probably extend from this.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.googlecode.lanterna.gui2.Border
Border.BorderRenderer
-
-
Constructor Summary
Constructors Constructor Description AbstractBorder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LayoutData
getLayoutData()
Returns the layout data associated with this component.Border.BorderRenderer
getRenderer()
Returns the renderer used to draw this component and measure its preferred size.private TerminalSize
getWrappedComponentSize(TerminalSize borderSize)
private TerminalPosition
getWrappedComponentTopLeftOffset()
void
setComponent(Component component)
Sets the component which is inside this Composite.Border
setLayoutData(LayoutData ld)
Sets optional layout data associated with this component.Border
setSize(TerminalSize size)
This method will be called by the layout manager when it has decided how large the component will be.TerminalPosition
toBasePane(TerminalPosition position)
Translates a position local to the container to the base pane's coordinate space.TerminalPosition
toGlobal(TerminalPosition position)
Translates a position local to the container to global coordinate space.-
Methods inherited from class com.googlecode.lanterna.gui2.AbstractComposite
containsComponent, getChildCount, getChildren, getChildrenList, getComponent, handleInput, invalidate, isInvalid, nextFocus, previousFocus, removeComponent, updateLookupMap
-
Methods inherited from class com.googlecode.lanterna.gui2.AbstractComponent
addTo, calculatePreferredSize, createDefaultRenderer, draw, getBasePane, getGlobalPosition, getParent, getPosition, getPreferredSize, getSize, getTextGUI, getTheme, getThemeDefinition, hasParent, isInside, isVisible, onAdded, onAfterDrawing, onBeforeDrawing, onRemoved, runOnGUIThreadIfExistsOtherwiseRunDirect, self, setPosition, setPreferredSize, setRenderer, setTheme, setVisible, withBorder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.googlecode.lanterna.gui2.Component
addTo, getBasePane, getGlobalPosition, getParent, getPosition, getPreferredSize, getSize, getTextGUI, getTheme, getThemeDefinition, hasParent, invalidate, isInside, isVisible, onAdded, onRemoved, setPosition, setPreferredSize, setTheme, setVisible, withBorder
-
Methods inherited from interface com.googlecode.lanterna.gui2.Composite
getComponent
-
Methods inherited from interface com.googlecode.lanterna.gui2.Container
containsComponent, getChildCount, getChildren, getChildrenList, handleInput, nextFocus, previousFocus, removeComponent, updateLookupMap
-
Methods inherited from interface com.googlecode.lanterna.gui2.TextGUIElement
draw, isInvalid
-
-
-
-
Method Detail
-
setComponent
public void setComponent(Component component)
Description copied from interface:Composite
Sets the component which is inside this Composite. If you call this method with null, it removes the component wrapped by this Composite.- Specified by:
setComponent
in interfaceComposite
- Overrides:
setComponent
in classAbstractComposite<Border>
- Parameters:
component
- Component to wrap
-
getRenderer
public Border.BorderRenderer getRenderer()
Description copied from interface:Component
Returns the renderer used to draw this component and measure its preferred size. You probably won't need to call this method unless you know exactly which ComponentRenderer implementation is used and you need to customize it.- Specified by:
getRenderer
in interfaceComponent
- Overrides:
getRenderer
in classAbstractComponent<Border>
- Returns:
- Renderer this component is using
-
setSize
public Border setSize(TerminalSize size)
Description copied from interface:Component
This method will be called by the layout manager when it has decided how large the component will be. If you call this method yourself, prepare for unexpected results.- Specified by:
setSize
in interfaceComponent
- Overrides:
setSize
in classAbstractComponent<Border>
- Parameters:
size
- Current size of the component- Returns:
- Itself
-
getLayoutData
public LayoutData getLayoutData()
Description copied from interface:Component
Returns the layout data associated with this component. This data will optionally be used by the layout manager, see the documentation for each layout manager for more details on valid values and their meaning.- Specified by:
getLayoutData
in interfaceComponent
- Overrides:
getLayoutData
in classAbstractComponent<Border>
- Returns:
- This component's layout data
-
setLayoutData
public Border setLayoutData(LayoutData ld)
Description copied from interface:Component
Sets optional layout data associated with this component. This meaning of this data is up to the layout manager to figure out, see each layout manager for examples of how to use it.- Specified by:
setLayoutData
in interfaceComponent
- Overrides:
setLayoutData
in classAbstractComponent<Border>
- Parameters:
ld
- Layout data associated with this component- Returns:
- Itself
-
toBasePane
public TerminalPosition toBasePane(TerminalPosition position)
Description copied from interface:Component
Translates a position local to the container to the base pane's coordinate space. For a window-based GUI, this be a coordinate in the window's coordinate space. If the component belongs to no base pane, it will returnnull
.- Specified by:
toBasePane
in interfaceComponent
- Overrides:
toBasePane
in classAbstractComponent<Border>
- Parameters:
position
- Position to translate (relative to the container's top-left corner)- Returns:
- Position in base pane space, or
null
if the component is an orphan
-
toGlobal
public TerminalPosition toGlobal(TerminalPosition position)
Description copied from interface:Component
Translates a position local to the container to global coordinate space. This should be the absolute coordinate in the terminal screen, taking no windows or containers into account. If the component belongs to no base pane, it will returnnull
.- Specified by:
toGlobal
in interfaceComponent
- Overrides:
toGlobal
in classAbstractComponent<Border>
- Parameters:
position
- Position to translate (relative to the container's top-left corner)- Returns:
- Position in global (or absolute) coordinates, or
null
if the component is an orphan
-
getWrappedComponentTopLeftOffset
private TerminalPosition getWrappedComponentTopLeftOffset()
-
getWrappedComponentSize
private TerminalSize getWrappedComponentSize(TerminalSize borderSize)
-
-