本文整理汇总了Java中com.trollworks.toolkit.ui.layout.FlexRow.add方法的典型用法代码示例。如果您正苦于以下问题:Java FlexRow.add方法的具体用法?Java FlexRow.add怎么用?Java FlexRow.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.trollworks.toolkit.ui.layout.FlexRow
的用法示例。
在下文中一共展示了FlexRow.add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rebuildSelf
import com.trollworks.toolkit.ui.layout.FlexRow; //导入方法依赖的package包/类
@Override
protected void rebuildSelf(FlexGrid grid, FlexRow right) {
CostReduction feature = (CostReduction) getFeature();
FlexRow row = new FlexRow();
row.add(addChangeBaseTypeCombo());
String[] names = new String[CostReduction.TYPES.length];
for (int i = 0; i < CostReduction.TYPES.length; i++) {
names[i] = CostReduction.TYPES[i].toString();
}
row.add(addComboBox(CHANGE_ATTRIBUTE, names, feature.getAttribute().name()));
String[] percents = new String[16];
for (int i = 0; i < 16; i++) {
percents[i] = MessageFormat.format(BY, Integer.valueOf((i + 1) * 5));
}
row.add(addComboBox(CHANGE_PERCENTAGE, percents, percents[Math.min(80, Math.max(0, feature.getPercentage())) / 5 - 1]));
row.add(new FlexSpacer(0, 0, true, false));
grid.add(row, 0, 0);
}
示例2: rebuildSelf
import com.trollworks.toolkit.ui.layout.FlexRow; //导入方法依赖的package包/类
@Override
protected void rebuildSelf(FlexGrid grid, FlexRow right) {
ContainedWeightReduction feature = (ContainedWeightReduction) getFeature();
FlexRow row = new FlexRow();
row.add(addChangeBaseTypeCombo());
EditorField field = new EditorField(new DefaultFormatterFactory(new WeightReductionFormatter()), (event) -> {
EditorField source = (EditorField) event.getSource();
if ("value".equals(event.getPropertyName())) { //$NON-NLS-1$
feature.setValue(source.getValue());
notifyActionListeners();
}
}, SwingConstants.LEFT, feature.getValue(), new WeightValue(999999999, SheetPreferences.getWeightUnits()), WEIGHT_OR_PERCENTAGE);
UIUtilities.setOnlySize(field, field.getPreferredSize());
add(field);
row.add(field);
row.add(new FlexSpacer(0, 0, true, false));
grid.add(row, 0, 0);
}
示例3: rebuild
import com.trollworks.toolkit.ui.layout.FlexRow; //导入方法依赖的package包/类
/** Rebuilds the contents of this panel with the current prerequisite settings. */
protected final void rebuild() {
removeAll();
FlexGrid grid = new FlexGrid();
FlexRow left = new FlexRow();
FlexRow right = new FlexRow();
if (mPrereq.getParent() != null) {
AndOrLabel andOrLabel = new AndOrLabel(mPrereq);
add(andOrLabel);
left.add(andOrLabel);
}
grid.add(left, 0, 0);
rebuildSelf(left, grid, right);
if (mDepth > 0) {
IconButton button = new IconButton(StdImage.REMOVE, mPrereq instanceof PrereqList ? REMOVE_PREREQ_LIST_TOOLTIP : REMOVE_PREREQ_TOOLTIP, () -> remove());
add(button);
right.add(button);
}
grid.add(right, 0, 2);
grid.apply(this);
revalidate();
repaint();
}
示例4: createDamageFields
import com.trollworks.toolkit.ui.layout.FlexRow; //导入方法依赖的package包/类
private void createDamageFields(FlexGrid grid, int rowIndex) {
FlexRow row = new FlexRow();
row.setHorizontalAlignment(Alignment.CENTER);
createDamageLabelAndField(row, GURPSCharacter.ID_BASIC_THRUST, BASIC_THRUST, BASIC_THRUST_TOOLTIP);
row.add(new FlexSpacer(0, 0, false, false));
createDamageLabelAndField(row, GURPSCharacter.ID_BASIC_SWING, BASIC_SWING, BASIC_SWING_TOOLTIP);
grid.add(row, rowIndex, 0, 1, 2);
}
示例5: createDamageLabelAndField
import com.trollworks.toolkit.ui.layout.FlexRow; //导入方法依赖的package包/类
private void createDamageLabelAndField(FlexRow row, String key, String title, String tooltip) {
PageField field = new PageField(mSheet, key, SwingConstants.RIGHT, false, tooltip);
PageLabel label = new PageLabel(title, field);
add(label);
add(field);
row.add(new FlexComponent(label, true));
row.add(new FlexComponent(field, true));
}