- All Implemented Interfaces:
Border
,Component
,Composite
,Container
,TextGUIElement
- Direct Known Subclasses:
Borders.StandardBorder
Abstract implementation of
Border
interface that has some of the methods filled out. If you want to create
your own Border
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 -
Method Summary
Modifier and TypeMethodDescriptionReturns the layout data associated with this component.Returns the renderer used to draw this component and measure its preferred size.private TerminalSize
getWrappedComponentSize
(TerminalSize borderSize) private TerminalPosition
void
setComponent
(Component component) Sets the component which is inside this Composite.Sets optional layout data associated with this component.setSize
(TerminalSize size) This method will be called by the layout manager when it has decided how large the component will be.toBasePane
(TerminalPosition position) Translates a position local to the container to the base pane's coordinate space.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
-
Constructor Details
-
AbstractBorder
public AbstractBorder()
-
-
Method Details
-
setComponent
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
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
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
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
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
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
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
-
getWrappedComponentSize
-