Class BoxView
java.lang.Object
org.springframework.shell.component.view.control.AbstractControl
org.springframework.shell.component.view.control.AbstractView
org.springframework.shell.component.view.control.BoxView
- Direct Known Subclasses:
AppView,ButtonView,GridView,InputView,ListView,MenuBarView,MenuView,ProgressView,StatusBarView
BoxView is a View with an empty background and optional
border and title. All "boxed" views can use this as their base
implementation by either subclassing or wrapping.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawBackground(Screen screen) Internal drawing method for background.protected voiddrawInternal(Screen screen) Possibly draws a box around this view and title in a box top boundary.protected Stringprotected RectangleGets an inner rectangle of this view.booleanReturns if border is shown.voidsetBackgroundColor(int backgroundColor) Sets a background color.setBorderPadding(int paddingTop, int paddingBottom, int paddingLeft, int paddingRight) Sets a paddings for this view.voidsetFocusedTitleColor(int focusedTitleColor) Sets a focused title color.voidsetFocusedTitleStyle(int focusedTitleStyle) Sets a focused title style.voidsetRect(int x, int y, int width, int height) Sets bounds where thisControlshould operate.voidsetShowBorder(boolean showBorder) Defines if border is shown.voidSets a title.voidsetTitleAlign(HorizontalAlign titleAlign) Sets a title align.voidsetTitleColor(int titleColor) Sets a title color.voidsetTitleStyle(int titleStyle) Sets a title style.Methods inherited from class org.springframework.shell.component.view.control.AbstractView
destroy, dispatch, dispatchKeyRunCommand, dispatchMouseRunCommand, dispatchRunnable, draw, focus, getDrawFunction, getEventLoop, getHotKeyBindings, getHotKeyHandler, getKeyBindings, getKeyHandler, getLayer, getMouseBindings, getMouseHandler, getViewCommands, getViewService, hasFocus, init, initInternal, onDestroy, registerHotKeyBinding, registerHotKeyBinding, registerHotKeyBinding, registerKeyBinding, registerKeyBinding, registerKeyBinding, registerMouseBinding, registerMouseBinding, registerMouseBinding, registerViewCommand, runViewCommand, setDrawFunction, setEventLoop, setLayer, setViewService, shortcutMethods inherited from class org.springframework.shell.component.view.control.AbstractControl
getRect, getThemeName, getThemeResolver, resolveThemeBackground, resolveThemeForeground, resolveThemeSpinner, resolveThemeStyle, setThemeName, setThemeResolverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.shell.component.view.control.Control
getRect, setThemeName, setThemeResolver
-
Constructor Details
-
BoxView
public BoxView()
-
-
Method Details
-
setRect
public void setRect(int x, int y, int width, int height) Description copied from interface:ControlSets bounds where thisControlshould operate.- Specified by:
setRectin interfaceControl- Overrides:
setRectin classAbstractControl- Parameters:
x- a x coord of a bounded boxy- an y coord of a bounded boxwidth- a width of a bounded boxheight- a height of a bounded box
-
setBorderPadding
public BoxView setBorderPadding(int paddingTop, int paddingBottom, int paddingLeft, int paddingRight) Sets a paddings for this view.- Parameters:
paddingTop- the top paddingpaddingBottom- the bottom paddingpaddingLeft- the left paddingpaddingRight- the right padding- Returns:
- a BoxView for chaining
-
setShowBorder
public void setShowBorder(boolean showBorder) Defines if border is shown.- Parameters:
showBorder- the flag showing border
-
isShowBorder
public boolean isShowBorder()Returns if border is shown.- Returns:
- true if border is shown
-
setTitle
Sets a title.titleis shown within a top-level border boundary and will not be visible if border itself is not visible.- Parameters:
title- the border title
-
setBackgroundColor
public void setBackgroundColor(int backgroundColor) Sets a background color. If color is set tonullit indicates that background should be set to beemptycausing possible layer to be non-transparent.- Parameters:
backgroundColor- the background color
-
setTitleColor
public void setTitleColor(int titleColor) Sets a title color.- Parameters:
titleColor- the title color
-
setTitleStyle
public void setTitleStyle(int titleStyle) Sets a title style.- Parameters:
titleStyle- the title style
-
setFocusedTitleColor
public void setFocusedTitleColor(int focusedTitleColor) Sets a focused title color. Takes precedence set fromsetTitleColor(int).- Parameters:
focusedTitleColor- the title color
-
setFocusedTitleStyle
public void setFocusedTitleStyle(int focusedTitleStyle) Sets a focused title style. Takes precedence set fromsetTitleStyle(int).- Parameters:
focusedTitleStyle- the title style
-
setTitleAlign
Sets a title align.- Parameters:
titleAlign- the title align
-
getBackgroundStyle
-
drawBackground
Description copied from class:AbstractViewInternal drawing method for background.- Overrides:
drawBackgroundin classAbstractView- Parameters:
screen- the screen
-
drawInternal
Possibly draws a box around this view and title in a box top boundary. Also calls adraw functionif defined.- Specified by:
drawInternalin classAbstractView- Parameters:
screen- the screen
-
getInnerRect
Gets an inner rectangle of this view.- Returns:
- an inner rectangle of this view
-