java.lang.Object
it.polimi.ingsw.view.cli.console.graphics.components.Rectangle
it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
it.polimi.ingsw.view.cli.console.graphics.components.DetailPane
- All Implemented Interfaces:
LiveRefreshItemInterface
public class DetailPane extends WindowItem implements LiveRefreshItemInterface
A window showing details about an item in its parent
-
Field Summary
Fields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
activeItems, id, parent, passiveItems
-
Constructor Summary
Constructors Constructor Description DetailPane(WindowItem parent, int width, int height, java.lang.String id)
Custom constructorDetailPane(Window parent, java.lang.String id)
Default constructor -
Method Summary
Modifier and Type Method Description java.util.List<java.lang.String>
adaptStrings(java.util.List<java.lang.String> details)
Adapts the list of details to the pane size, creating empty lines if necessaryprotected void
drawShadows()
Draws right and bottom shadows
Uses the parent's parent color scheme, to merge seamlessly with the backgroundvoid
refresh(java.util.List<java.lang.String> info)
Refreshes its contentMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
addActiveItem, addPassiveItem, currentActiveItem, getCli, getID, getParent, hideShadows, maxStringLength, nextActiveItem, previousActiveItem, remove, show
Methods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.Rectangle
drawBackground, drawBorders, findCenter, getBackgroundColor, getColor, getHeight, getInitCoord, getTextColor, getWidth, hideBorders, loadPropertiesFile
-
Constructor Details
-
DetailPane
Default constructorCreates an item using its default settings;
The initial coordinates are relative to the object's parent- Parameters:
parent
- the Window containing thisid
- the object id
-
DetailPane
Custom constructorCreates an item using custom settings
The initial coordinates are relative to the object's parent- Parameters:
parent
- the Dialog containing thiswidth
- the object widthheight
- the object heightid
- the object id
-
-
Method Details
-
drawShadows
protected void drawShadows()Draws right and bottom shadows
Uses the parent's parent color scheme, to merge seamlessly with the background- Overrides:
drawShadows
in classWindowItem
-
refresh
public void refresh(java.util.List<java.lang.String> info)Refreshes its content- Specified by:
refresh
in interfaceLiveRefreshItemInterface
- Parameters:
info
- the details
-
adaptStrings
public java.util.List<java.lang.String> adaptStrings(java.util.List<java.lang.String> details)Adapts the list of details to the pane size, creating empty lines if necessary- Parameters:
details
- the list o f details
-