當前位置: 首頁>>代碼示例>>Java>>正文


Java OutlineModel.select方法代碼示例

本文整理匯總了Java中com.trollworks.toolkit.ui.widget.outline.OutlineModel.select方法的典型用法代碼示例。如果您正苦於以下問題:Java OutlineModel.select方法的具體用法?Java OutlineModel.select怎麽用?Java OutlineModel.select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.trollworks.toolkit.ui.widget.outline.OutlineModel的用法示例。


在下文中一共展示了OutlineModel.select方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addModifier

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
private void addModifier() {
    Modifier modifier = new Modifier(mOwner);
    OutlineModel model = mOutline.getModel();

    if (mOwner instanceof ListFile || mOwner instanceof LibraryFile) {
        modifier.setEnabled(false);
    }
    model.addRow(modifier);
    mOutline.sizeColumnsToFit();
    model.select(modifier, false);
    mOutline.revalidate();
    mOutline.scrollSelectionIntoView();
    mOutline.requestFocus();
    mModified = true;
    openDetailEditor();
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:17,代碼來源:ModifierListEditor.java

示例2: addWeapon

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
private void addWeapon() {
    WeaponDisplayRow weapon = new WeaponDisplayRow(createWeaponStats());
    OutlineModel model = mOutline.getModel();
    model.addRow(weapon);
    mOutline.sizeColumnsToFit();
    model.select(weapon, false);
    mOutline.revalidate();
    mOutline.scrollSelectionIntoView();
    mOutline.requestFocus();
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:11,代碼來源:WeaponEditor.java

示例3: actionPerformed

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent event) {
    Component focus = getFocusOwner();
    if (focus instanceof OutlineProxy) {
        focus = ((OutlineProxy) focus).getRealOutline();
    }
    ListOutline outline = (ListOutline) focus;
    OutlineModel model = outline.getModel();
    if (!model.isLocked() && model.hasSelection()) {
        ArrayList<Row> rows = new ArrayList<>();
        ArrayList<Row> topRows = new ArrayList<>();
        DataFile dataFile = outline.getDataFile();
        dataFile.startNotify();
        model.setDragRows(model.getSelectionAsList(true).toArray(new Row[0]));
        outline.convertDragRowsToSelf(rows);
        model.setDragRows(null);
        for (Row row : rows) {
            if (row.getDepth() == 0) {
                topRows.add(row);
            }
        }
        outline.addRow(topRows.toArray(new ListRow[0]), DUPLICATE_UNDO, true);
        dataFile.endNotify();
        model.select(topRows, false);
        outline.scrollSelectionIntoView();
    }
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:28,代碼來源:DuplicateCommand.java

示例4: addRows

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
/**
 * Adds rows to the sheet.
 *
 * @param rows The rows to add.
 */
public void addRows(List<Row> rows) {
    HashMap<ListOutline, StateEdit> map = new HashMap<>();
    HashMap<Outline, ArrayList<Row>> selMap = new HashMap<>();
    HashMap<Outline, ArrayList<ListRow>> nameMap = new HashMap<>();
    ListOutline outline = null;

    for (Row row : rows) {
        if (row instanceof Advantage) {
            outline = mSheet.getAdvantageOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Advantage(getDataFile(), (Advantage) row, true);
            addCompleteRow(outline, row, selMap);
        } else if (row instanceof Technique) {
            outline = mSheet.getSkillOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Technique(getDataFile(), (Technique) row, true);
            addCompleteRow(outline, row, selMap);
        } else if (row instanceof Skill) {
            outline = mSheet.getSkillOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Skill(getDataFile(), (Skill) row, true, true);
            addCompleteRow(outline, row, selMap);
        } else if (row instanceof Spell) {
            outline = mSheet.getSpellOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Spell(getDataFile(), (Spell) row, true, true);
            addCompleteRow(outline, row, selMap);
        } else if (row instanceof Equipment) {
            outline = mSheet.getEquipmentOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Equipment(getDataFile(), (Equipment) row, true);
            addCompleteRow(outline, row, selMap);
        } else if (row instanceof Note) {
            outline = mSheet.getNoteOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Note(getDataFile(), (Note) row, true);
            addCompleteRow(outline, row, selMap);
        } else {
            row = null;
        }
        if (row instanceof ListRow) {
            ArrayList<ListRow> process = nameMap.get(outline);
            if (process == null) {
                process = new ArrayList<>();
                nameMap.put(outline, process);
            }
            addRowsToBeProcessed(process, (ListRow) row);
        }
    }
    for (ListOutline anOutline : map.keySet()) {
        OutlineModel model = anOutline.getModel();
        model.select(selMap.get(anOutline), false);
        StateEdit edit = map.get(anOutline);
        edit.end();
        anOutline.postUndo(edit);
        anOutline.scrollSelectionIntoView();
        anOutline.requestFocus();
    }
    if (!nameMap.isEmpty()) {
        EventQueue.invokeLater(new RowPostProcessor(nameMap));
    }
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:80,代碼來源:SheetDockable.java

示例5: addRows

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
/**
 * Adds rows to the display.
 *
 * @param rows The rows to add.
 */
public void addRows(List<Row> rows) {
    HashMap<ListOutline, StateEdit> map = new HashMap<>();
    HashMap<Outline, ArrayList<Row>> selMap = new HashMap<>();
    HashMap<Outline, ArrayList<ListRow>> nameMap = new HashMap<>();
    ListOutline outline = null;

    for (Row row : rows) {
        if (row instanceof Advantage) {
            outline = mTemplate.getAdvantageOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Advantage(getDataFile(), (Advantage) row, true);
            addCompleteRow(outline, row, selMap);
        } else if (row instanceof Technique) {
            outline = mTemplate.getSkillOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Technique(getDataFile(), (Technique) row, true);
            addCompleteRow(outline, row, selMap);
        } else if (row instanceof Skill) {
            outline = mTemplate.getSkillOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Skill(getDataFile(), (Skill) row, true, true);
            addCompleteRow(outline, row, selMap);
        } else if (row instanceof Spell) {
            outline = mTemplate.getSpellOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Spell(getDataFile(), (Spell) row, true, true);
            addCompleteRow(outline, row, selMap);
        } else if (row instanceof Equipment) {
            outline = mTemplate.getEquipmentOutline();
            if (!map.containsKey(outline)) {
                map.put(outline, new StateEdit(outline.getModel(), ADD_ROWS));
            }
            row = new Equipment(getDataFile(), (Equipment) row, true);
            addCompleteRow(outline, row, selMap);
        } else {
            row = null;
        }
        if (row instanceof ListRow) {
            ArrayList<ListRow> process = nameMap.get(outline);

            if (process == null) {
                process = new ArrayList<>();
                nameMap.put(outline, process);
            }
            addRowsToBeProcessed(process, (ListRow) row);
        }
    }
    for (ListOutline anOutline : map.keySet()) {
        OutlineModel model = anOutline.getModel();

        model.select(selMap.get(anOutline), false);
        StateEdit edit = map.get(anOutline);
        edit.end();
        anOutline.postUndo(edit);
        anOutline.scrollSelectionIntoView();
        anOutline.requestFocus();
    }
    if (!nameMap.isEmpty()) {
        EventQueue.invokeLater(new RowPostProcessor(nameMap));
    }
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:75,代碼來源:TemplateDockable.java


注:本文中的com.trollworks.toolkit.ui.widget.outline.OutlineModel.select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。