当前位置: 首页>>代码示例>>Java>>正文


Java FlexRow类代码示例

本文整理汇总了Java中com.trollworks.toolkit.ui.layout.FlexRow的典型用法代码示例。如果您正苦于以下问题:Java FlexRow类的具体用法?Java FlexRow怎么用?Java FlexRow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FlexRow类属于com.trollworks.toolkit.ui.layout包,在下文中一共展示了FlexRow类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:19,代码来源:CostReductionEditor.java

示例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);
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:19,代码来源:ContainedWeightReductionEditor.java

示例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();
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:24,代码来源:PrereqEditor.java

示例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);
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:9,代码来源:AttributesPanel.java

示例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));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:9,代码来源:AttributesPanel.java

示例6: createToolBar

import com.trollworks.toolkit.ui.layout.FlexRow; //导入依赖的package包/类
/** Call to create the toolbar for this window. */
protected final void createToolBar() {
	JToolBar toolbar = new JToolBar();
	toolbar.setFloatable(false);
	FlexRow row = new FlexRow();
	row.setInsets(new Insets(2, 5, 2, 5));
	createToolBarContents(toolbar, row);
	row.apply(toolbar);
	add(toolbar, BorderLayout.NORTH);
}
 
开发者ID:Ayutac,项目名称:toolkit,代码行数:11,代码来源:AppWindow.java

示例7: rebuildSelf

import com.trollworks.toolkit.ui.layout.FlexRow; //导入依赖的package包/类
@Override
protected void rebuildSelf(FlexGrid grid, FlexRow right) {
    grid.add(new FlexSpacer(0, 0, true, false), 0, 0);
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:5,代码来源:NoFeature.java

示例8: rebuildSelf

import com.trollworks.toolkit.ui.layout.FlexRow; //导入依赖的package包/类
/**
 * Sub-classes must implement this method to add any components they want to be visible.
 *
 * @param grid The general {@link FlexGrid}. Add items in column 0.
 * @param right The right-side {@link FlexRow}, situated in grid row 0, column 1.
 */
protected abstract void rebuildSelf(FlexGrid grid, FlexRow right);
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:8,代码来源:FeatureEditor.java

示例9: rebuildSelf

import com.trollworks.toolkit.ui.layout.FlexRow; //导入依赖的package包/类
/**
 * Sub-classes must implement this method to add any components they want to be visible.
 *
 * @param left The left-side {@link FlexRow}, situated in grid row 0, column 0.
 * @param grid The general {@link FlexGrid}. Add items in column 1.
 * @param right The right-side {@link FlexRow}, situated in grid row 0, column 2.
 */
protected abstract void rebuildSelf(FlexRow left, FlexGrid grid, FlexRow right);
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:9,代码来源:PrereqEditor.java

示例10: createToolBarContents

import com.trollworks.toolkit.ui.layout.FlexRow; //导入依赖的package包/类
/**
 * Called to create the toolbar contents for this window.
 *
 * @param toolbar The {@link JToolBar} to add items to.
 * @param row The {@link FlexRow} layout to add items to.
 */
protected void createToolBarContents(JToolBar toolbar, FlexRow row) {
	// Does nothing by default.
}
 
开发者ID:Ayutac,项目名称:toolkit,代码行数:10,代码来源:AppWindow.java


注:本文中的com.trollworks.toolkit.ui.layout.FlexRow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。