本文整理汇总了Java中com.googlecode.lanterna.TerminalSize.ZERO属性的典型用法代码示例。如果您正苦于以下问题:Java TerminalSize.ZERO属性的具体用法?Java TerminalSize.ZERO怎么用?Java TerminalSize.ZERO使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.googlecode.lanterna.TerminalSize
的用法示例。
在下文中一共展示了TerminalSize.ZERO属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPreferredSize
@Override
public TerminalSize getPreferredSize(List<Component> components) {
TerminalSize preferredSize = TerminalSize.ZERO;
if(components.isEmpty()) {
return preferredSize.withRelative(
leftMarginSize + rightMarginSize,
topMarginSize + bottomMarginSize);
}
Component[][] table = buildTable(components);
table = eliminateUnusedRowsAndColumns(table);
//Figure out each column first, this can be done independently of the row heights
int preferredWidth = 0;
int preferredHeight = 0;
for(int width: getPreferredColumnWidths(table)) {
preferredWidth += width;
}
for(int height: getPreferredRowHeights(table)) {
preferredHeight += height;
}
preferredSize = preferredSize.withRelative(preferredWidth, preferredHeight);
preferredSize = preferredSize.withRelativeColumns(leftMarginSize + rightMarginSize + (table[0].length - 1) * horizontalSpacing);
preferredSize = preferredSize.withRelativeRows(topMarginSize + bottomMarginSize + (table.length - 1) * verticalSpacing);
return preferredSize;
}
示例2: updateScreen
@Override
public synchronized void updateScreen() throws IOException {
TerminalSize minimumTerminalSize = TerminalSize.ZERO;
for(Window window: windows) {
if(window.getHints().contains(Window.Hint.FULL_SCREEN) ||
window.getHints().contains(Window.Hint.FIT_TERMINAL_WINDOW)) {
//Don't take full screen windows or auto-sized windows into account
continue;
}
TerminalPosition lastPosition = window.getPosition();
minimumTerminalSize = minimumTerminalSize.max(
//Add position to size to get the bottom-right corner of the window
window.getPreferredSize().withRelative(lastPosition.getColumn(), lastPosition.getRow()));
}
virtualScreen.setMinimumSize(minimumTerminalSize);
super.updateScreen();
}
示例3: AnimatedLabel
public AnimatedLabel(String firstFrameText) {
super(firstFrameText);
frames = new ArrayList<String[]>();
currentFrame = 0;
combinedMaximumPreferredSize = TerminalSize.ZERO;
String[] lines = splitIntoMultipleLines(firstFrameText);
frames.add(lines);
ensurePreferredSize(lines);
}
示例4: getPreferredSize
@Override
public TerminalSize getPreferredSize(Border component) {
StandardBorder border = (StandardBorder)component;
Component wrappedComponent = border.getComponent();
TerminalSize preferredSize;
if (wrappedComponent == null) {
preferredSize = TerminalSize.ZERO;
} else {
preferredSize = wrappedComponent.getPreferredSize();
}
preferredSize = preferredSize.withRelativeColumns(2).withRelativeRows(2);
String borderTitle = border.getTitle();
return preferredSize.max(new TerminalSize((borderTitle.isEmpty() ? 2 : borderTitle.length() + 4), 2));
}
示例5: AbstractComponent
public AbstractComponent() {
size = TerminalSize.ZERO;
position = TerminalPosition.TOP_LEFT_CORNER;
explicitPreferredSize = null;
layoutData = null;
invalid = true;
parent = null;
renderer = null; //Will be set on the first call to getRenderer()
}
示例6: getPreferredSize
@Override
public TerminalSize getPreferredSize(List<Component> components) {
TerminalSize size = TerminalSize.ZERO;
for(Component component: components) {
size = size.max(
new TerminalSize(
component.getPosition().getColumn() + component.getSize().getColumns(),
component.getPosition().getRow() + component.getSize().getRows()));
}
return size;
}
示例7: Label
public Label(String text) {
this.lines = null;
this.preferredSize = TerminalSize.ZERO;
this.foregroundColor = null;
this.backgroundColor = null;
this.additionalStyles = EnumSet.noneOf(SGR.class);
setText(text);
}
示例8: getBounds
protected TerminalSize getBounds(String[] lines, TerminalSize currentBounds) {
if(currentBounds == null) {
currentBounds = TerminalSize.ZERO;
}
currentBounds = currentBounds.withRows(lines.length);
int preferredWidth = 0;
for(String line: lines) {
int lineWidth = CJKUtils.getTrueWidth(line);
if(preferredWidth < lineWidth) {
preferredWidth = lineWidth;
}
}
currentBounds = currentBounds.withColumns(preferredWidth);
return currentBounds;
}
示例9: getSize
public TerminalSize getSize() {
if (lookupMap.length==0) { return TerminalSize.ZERO; }
return new TerminalSize(lookupMap[0].length, lookupMap.length);
}