本文整理汇总了Java中com.googlecode.lanterna.TerminalSize.max方法的典型用法代码示例。如果您正苦于以下问题:Java TerminalSize.max方法的具体用法?Java TerminalSize.max怎么用?Java TerminalSize.max使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.googlecode.lanterna.TerminalSize
的用法示例。
在下文中一共展示了TerminalSize.max方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateScreen
import com.googlecode.lanterna.TerminalSize; //导入方法依赖的package包/类
@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();
}
示例2: getPreferredSize
import com.googlecode.lanterna.TerminalSize; //导入方法依赖的package包/类
@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));
}
示例3: getPreferredSize
import com.googlecode.lanterna.TerminalSize; //导入方法依赖的package包/类
@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;
}