public interface Component
Modifier and Type | Interface and Description |
---|---|
static class |
Component.Alignment |
Modifier and Type | Method and Description |
---|---|
Component |
addBorder(Border border,
String title)
Surrounds this component with a specified border
|
void |
addComponentListener(ComponentListener cl) |
Component.Alignment |
getAlignment() |
TerminalSize |
getMinimumSize()
This method is called by the layout system to figure out what the
absolute minimum size is for this component.
|
Container |
getParent() |
TerminalSize |
getPreferredSize()
This method is called by the layout system to figure out how much space
each component will be assigned.
|
Window |
getWindow()
Returns the window which is directly or indirectly containing this component.
|
boolean |
isScrollable()
This method is used by the layout system when it needs to shrink components
because the available space is too small.
|
boolean |
isVisible() |
void |
removeComponentListener(ComponentListener cl) |
void |
repaint(TextGraphics graphics)
This is the main 'paint' method for a component, it's called when
lanterna wants the component to re-draw itself.
|
void |
setAlignment(Component.Alignment alignment)
Sets the alignment property on the Component which will serve as a hint to the rendering code
as to how to draw the component if it is assigned more space that it asked for.
|
void |
setPreferredSize(TerminalSize preferredSizeOverride)
If called with a non-null parameter, it will override the component's
own preferred size calculation and instead
getPreferredSize()
will return the value passed in. |
void |
setVisible(boolean visible)
If false, the GUI system will ignore this component in the layout and
drawing stage
|
Container getParent()
Window getWindow()
null
.null
void addComponentListener(ComponentListener cl)
void removeComponentListener(ComponentListener cl)
void repaint(TextGraphics graphics)
graphics
- TextGraphics object to use for drawing the component and
getting information about the drawing contextvoid setVisible(boolean visible)
visible
- true if you want the component to be visible, false to
make it hiddenboolean isVisible()
boolean isScrollable()
TerminalSize getPreferredSize()
TerminalSize getMinimumSize()
void setPreferredSize(TerminalSize preferredSizeOverride)
getPreferredSize()
will return the value passed in. If called with null
, the
calculation will be used again.preferredSizeOverride
- Value getPreferredSize()
should
return instead of calculating itvoid setAlignment(Component.Alignment alignment)
The default alignment is also up to each component to decide, see the documentation for the individual component you are using.
alignment
- Alignment of the componentComponent.Alignment getAlignment()
Copyright © 2015. All Rights Reserved.