本文整理汇总了Java中com.kotcrab.vis.ui.widget.VisTable.pack方法的典型用法代码示例。如果您正苦于以下问题:Java VisTable.pack方法的具体用法?Java VisTable.pack怎么用?Java VisTable.pack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.kotcrab.vis.ui.widget.VisTable
的用法示例。
在下文中一共展示了VisTable.pack方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: layout
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
public synchronized void layout() {
// this.setDebug(true, false);
if (!needsLayout) {
super.layout();
return;
}
this.clear();
VisTable iconTable = new VisTable();
iconTable.add(type.getCacheWidget(style.typeStyle, null, null));
iconTable.pack();
iconTable.layout();
this.add(iconTable).left().top().padRight(CB.scaledSizes.MARGINx4);
Table contentTable = new Table();
contentTable.add(nameLabel).left().expandX().fillX();
contentTable.row();
contentTable.add(descriptionLabel).left().expandX().fillX();
contentTable.row();
contentTable.add(coordLabel).left().expandX().fillX();
this.add(contentTable).top().expandX().fillX();
VisTable arrowTable = new VisTable();
arrowImage.setOrigin(this.style.arrow.getMinWidth() / 2, this.style.arrow.getMinHeight() / 2);
arrowTable.add(arrowImage);
arrowTable.row();
arrowTable.add(distanceLabel).padTop(CB.scaledSizes.MARGIN);
this.add(arrowTable).right();
super.layout();
needsLayout = false;
}
示例2: layout
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
@Override
public synchronized void layout() {
// this.setDebug(true, false);
if (!needsLayout) {
super.layout();
return;
}
this.clear();
VisTable headerTable = new VisTable();
headerTable.add(new Image(this.logEntry.Type.getDrawable(style.typeStyle)));
Label.LabelStyle nameLabelStyle = new Label.LabelStyle();
nameLabelStyle.font = this.style.headerFont;
nameLabelStyle.fontColor = this.style.headerFontColor;
VisLabel nameLabel = new VisLabel(this.logEntry.Finder, nameLabelStyle);
nameLabel.setWrap(true);
headerTable.add(nameLabel).left().padLeft(CB.scaledSizes.MARGINx4).expandX().fillX();
//TODO replace with formatter from localisation settings
SimpleDateFormat postFormater = new SimpleDateFormat("dd.MM.yyyy");
String dateString = postFormater.format(logEntry.Timestamp);
VisLabel dateLabel = new VisLabel(dateString, nameLabelStyle);
headerTable.add(dateLabel).padRight(CB.scaledSizes.MARGINx4).right();
//TODO set Background for header over style
headerTable.pack();
headerTable.layout();
this.add(headerTable).left().expandX().fillX();
this.row().padTop(CB.scaledSizes.MARGINx4);
Label.LabelStyle commentLabelStyle = new Label.LabelStyle();
commentLabelStyle.font = this.style.descriptionFont;
commentLabelStyle.fontColor = this.style.descriptionFontColor;
VisLabel commentLabel = new VisLabel(logEntry.Comment, commentLabelStyle);
commentLabel.setWrap(true);
this.add(commentLabel).expand().fill();
super.layout();
needsLayout = false;
}
示例3: layout
import com.kotcrab.vis.ui.widget.VisTable; //导入方法依赖的package包/类
@Override
public synchronized void layout() {
// this.setDebug(true, false);
if (!needsLayout) {
super.layout();
return;
}
this.clear();
Label.LabelStyle headerLabelStyle = new Label.LabelStyle();
headerLabelStyle.font = this.style.headerFont;
headerLabelStyle.fontColor = this.style.headerFontColor;
Label.LabelStyle commentLabelStyle = new Label.LabelStyle();
commentLabelStyle.font = this.style.descriptionFont;
commentLabelStyle.fontColor = this.style.descriptionFontColor;
headerTable = new VisTable();
headerTable.add(new Image(this.entry.type.getDrawable(style.typeStyle)));
headerTable.add((Actor) null).left().padLeft(CB.scaledSizes.MARGINx4).expandX().fillX();
String foundNumber = "";
if (entry.foundNumber > 0) {
foundNumber = "#" + entry.foundNumber + " @ ";
}
VisLabel dateLabel = new VisLabel(foundNumber + postFormatter.format(entry.timestamp), headerLabelStyle);
headerTable.add(dateLabel).padRight(CB.scaledSizes.MARGINx4).right();
headerTable.pack();
headerTable.layout();
this.add(headerTable).left().expandX().fillX();
this.row().padTop(CB.scaledSizes.MARGINx4);
VisTable cacheTable = new VisTable();
VisTable iconTable = new VisTable();
iconTable.add(entry.cacheType.getCacheWidget(style.cacheTypeStyle, null, null));
iconTable.pack();
iconTable.layout();
cacheTable.add(iconTable).left().padRight(CB.scaledSizes.MARGINx4);
VisLabel nameLabel = new VisLabel(entry.CacheName, headerLabelStyle);
nameLabel.setWrap(true);
cacheTable.add(nameLabel).padRight(CB.scaledSizes.MARGIN).expandX().fillX();
cacheTable.row();
cacheTable.add((Actor) null).left().padRight(CB.scaledSizes.MARGINx4);
VisLabel gcLabel = new VisLabel(entry.gcCode, headerLabelStyle);
gcLabel.setWrap(true);
cacheTable.add(gcLabel).padRight(CB.scaledSizes.MARGIN).expandX().fillX();
this.add(cacheTable).top().expandX().fillX();
this.row().padTop(CB.scaledSizes.MARGINx4);
VisLabel commentLabel = new VisLabel(entry.comment, commentLabelStyle);
commentLabel.setWrap(true);
this.add(commentLabel).expand().fill();
super.layout();
needsLayout = false;
}