本文整理匯總了Java中com.trollworks.toolkit.ui.widget.outline.OutlineModel類的典型用法代碼示例。如果您正苦於以下問題:Java OutlineModel類的具體用法?Java OutlineModel怎麽用?Java OutlineModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OutlineModel類屬於com.trollworks.toolkit.ui.widget.outline包,在下文中一共展示了OutlineModel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadList
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
@Override
protected void loadList(XMLReader reader, LoadState state) throws IOException {
OutlineModel model = getModel();
String marker = reader.getMarker();
do {
if (reader.next() == XMLNodeType.START_TAG) {
String name = reader.getName();
if (Modifier.TAG_MODIFIER.equals(name)) {
model.addRow(new Modifier(this, reader, state), true);
} else {
reader.skipTag(name);
}
}
} while (reader.withinMarker(marker));
}
示例2: 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();
}
示例3: convertDragRowsToSelf
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
@Override
public void convertDragRowsToSelf(List<Row> list) {
OutlineModel model = getModel();
Row[] rows = model.getDragRows();
boolean forSheetOrTemplate = mDataFile instanceof GURPSCharacter || mDataFile instanceof Template;
ArrayList<ListRow> process = new ArrayList<>();
for (Row element : rows) {
Equipment equipment = new Equipment(mDataFile, (Equipment) element, true);
model.collectRowsAndSetOwner(list, equipment, false);
if (forSheetOrTemplate) {
addRowsToBeProcessed(process, equipment);
}
}
if (forSheetOrTemplate && !process.isEmpty()) {
EventQueue.invokeLater(new RowPostProcessor(this, process));
}
}
示例4: convertDragRowsToSelf
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
@Override
public void convertDragRowsToSelf(List<Row> list) {
OutlineModel model = getModel();
Row[] rows = model.getDragRows();
boolean forSheetOrTemplate = mDataFile instanceof GURPSCharacter || mDataFile instanceof Template;
ArrayList<ListRow> process = forSheetOrTemplate ? new ArrayList<>() : null;
for (Row element : rows) {
ListRow row;
if (element instanceof Technique) {
row = new Technique(mDataFile, (Technique) element, forSheetOrTemplate);
} else {
row = new Skill(mDataFile, (Skill) element, true, forSheetOrTemplate);
}
model.collectRowsAndSetOwner(list, row, false);
if (forSheetOrTemplate) {
addRowsToBeProcessed(process, row);
}
}
if (forSheetOrTemplate) {
EventQueue.invokeLater(new RowPostProcessor(this, process));
}
}
示例5: loadList
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
@Override
protected void loadList(XMLReader reader, LoadState state) throws IOException {
OutlineModel model = getModel();
String marker = reader.getMarker();
do {
if (reader.next() == XMLNodeType.START_TAG) {
String name = reader.getName();
if (Skill.TAG_SKILL.equals(name) || Skill.TAG_SKILL_CONTAINER.equals(name)) {
model.addRow(new Skill(this, reader, state), true);
} else if (Technique.TAG_TECHNIQUE.equals(name)) {
model.addRow(new Technique(this, reader, state), true);
} else {
reader.skipTag(name);
}
}
} while (reader.withinMarker(marker));
}
示例6: createMeleeWeaponOutline
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
private void createMeleeWeaponOutline() {
if (mMeleeWeaponOutline == null) {
OutlineModel outlineModel;
String sortConfig;
mMeleeWeaponOutline = new WeaponOutline(MeleeWeaponStats.class);
outlineModel = mMeleeWeaponOutline.getModel();
sortConfig = outlineModel.getSortConfig();
for (WeaponDisplayRow row : collectWeapons(MeleeWeaponStats.class)) {
outlineModel.addRow(row);
}
outlineModel.applySortConfig(sortConfig);
initOutline(mMeleeWeaponOutline);
} else {
resetOutline(mMeleeWeaponOutline);
}
}
示例7: createRangedWeaponOutline
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
private void createRangedWeaponOutline() {
if (mRangedWeaponOutline == null) {
OutlineModel outlineModel;
String sortConfig;
mRangedWeaponOutline = new WeaponOutline(RangedWeaponStats.class);
outlineModel = mRangedWeaponOutline.getModel();
sortConfig = outlineModel.getSortConfig();
for (WeaponDisplayRow row : collectWeapons(RangedWeaponStats.class)) {
outlineModel.addRow(row);
}
outlineModel.applySortConfig(sortConfig);
initOutline(mRangedWeaponOutline);
} else {
resetOutline(mRangedWeaponOutline);
}
}
示例8: characterInitialize
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
private void characterInitialize(boolean full) {
mFeatureMap = new HashMap<>();
mAdvantages = new OutlineModel();
mSkills = new OutlineModel();
mSpells = new OutlineModel();
mEquipment = new OutlineModel();
mNotes = new OutlineModel();
mTotalPoints = SheetPreferences.getInitialPoints();
mStrength = 10;
mDexterity = 10;
mIntelligence = 10;
mHealth = 10;
mCurrentHitPoints = EMPTY;
mCurrentFatiguePoints = EMPTY;
mDescription = new Profile(this, full);
mArmor = new Armor(this);
mIncludePunch = true;
mIncludeKick = true;
mIncludeKickBoots = true;
mCachedWeightCarried = new WeightValue(0, SheetPreferences.getWeightUnits());
mPageSettings = OutputPreferences.getDefaultPageSettings();
mLastModified = System.currentTimeMillis();
mCreatedOn = mLastModified;
// This will force the long value to match the string value.
setCreatedOn(getCreatedOn());
}
示例9: convertDragRowsToSelf
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
@Override
public void convertDragRowsToSelf(List<Row> list) {
OutlineModel model = getModel();
Row[] rows = model.getDragRows();
boolean forSheetOrTemplate = mDataFile instanceof GURPSCharacter || mDataFile instanceof Template;
ArrayList<ListRow> process = new ArrayList<>();
for (Row element : rows) {
Spell spell = new Spell(mDataFile, (Spell) element, true, forSheetOrTemplate);
model.collectRowsAndSetOwner(list, spell, false);
if (forSheetOrTemplate) {
addRowsToBeProcessed(process, spell);
}
}
if (forSheetOrTemplate && !process.isEmpty()) {
EventQueue.invokeLater(new RowPostProcessor(this, process));
}
}
示例10: deleteSelection
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
@Override
public void deleteSelection() {
if (canDeleteSelection()) {
OutlineModel model = getModel();
StateEdit edit = new StateEdit(model, CLEAR_UNDO);
Row[] rows = model.getSelectionAsList(true).toArray(new Row[0]);
mDataFile.startNotify();
model.removeSelection();
for (int i = rows.length - 1; i >= 0; i--) {
rows[i].removeFromParent();
}
if (model.getRowCount() > 0) {
updateAllRows();
}
// Send it out again, since we have a few chicken-and-egg
// scenarios to deal with... <sigh>
mDataFile.notify(mRowSetChangedID, null);
mDataFile.endNotify();
edit.end();
postUndo(edit);
}
}
示例11: convertDragRowsToSelf
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
@Override
public void convertDragRowsToSelf(List<Row> list) {
OutlineModel model = getModel();
Row[] rows = model.getDragRows();
boolean forSheetOrTemplate = mDataFile instanceof GURPSCharacter || mDataFile instanceof Template;
ArrayList<ListRow> process = new ArrayList<>();
for (Row element : rows) {
Advantage advantage = new Advantage(mDataFile, (Advantage) element, true);
model.collectRowsAndSetOwner(list, advantage, false);
if (forSheetOrTemplate) {
addRowsToBeProcessed(process, advantage);
}
}
if (forSheetOrTemplate && !process.isEmpty()) {
EventQueue.invokeLater(new RowPostProcessor(this, process));
}
}
示例12: loadList
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
@Override
protected void loadList(XMLReader reader, LoadState state) throws IOException {
OutlineModel model = getModel();
String marker = reader.getMarker();
do {
if (reader.next() == XMLNodeType.START_TAG) {
String name = reader.getName();
if (Advantage.TAG_ADVANTAGE.equals(name) || Advantage.TAG_ADVANTAGE_CONTAINER.equals(name)) {
model.addRow(new Advantage(this, reader, state), true);
} else {
reader.skipTag(name);
}
}
} while (reader.withinMarker(marker));
}
示例13: createOutline
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
private Component createOutline(List<WeaponStats> weapons, Class<? extends WeaponStats> weaponClass) {
mOutline = new WeaponOutline();
OutlineModel model = mOutline.getModel();
WeaponColumn.addColumns(mOutline, weaponClass, true);
mOutline.setAllowColumnDrag(false);
mOutline.setAllowColumnResize(false);
mOutline.setAllowRowDrag(false);
for (WeaponStats weapon : weapons) {
if (mWeaponClass.isInstance(weapon)) {
model.addRow(new WeaponDisplayRow(weapon.clone(mOwner)));
}
}
mOutline.addActionListener(this);
Dimension size = mOutline.getMinimumSize();
if (size.height < 50) {
size.height = 50;
mOutline.setMinimumSize(size);
}
JScrollPane scroller = new JScrollPane(mOutline);
scroller.setColumnHeaderView(mOutline.getHeaderPanel());
return scroller;
}
示例14: convertDragRowsToSelf
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
@Override
public void convertDragRowsToSelf(List<Row> list) {
OutlineModel model = getModel();
Row[] rows = model.getDragRows();
boolean forSheetOrTemplate = mDataFile instanceof GURPSCharacter || mDataFile instanceof Template;
ArrayList<ListRow> process = new ArrayList<>();
for (Row element : rows) {
Note note = new Note(mDataFile, (Note) element, true);
model.collectRowsAndSetOwner(list, note, false);
if (forSheetOrTemplate) {
addRowsToBeProcessed(process, note);
}
}
if (forSheetOrTemplate && !process.isEmpty()) {
EventQueue.invokeLater(new RowPostProcessor(this, process));
}
}
示例15: getTarget
import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入依賴的package包/類
private static HasSourceReference getTarget() {
HasSourceReference ref = null;
Component comp = getFocusOwner();
if (comp instanceof Outline) {
OutlineModel model = ((Outline) comp).getModel();
if (model.hasSelection()) {
Selection selection = model.getSelection();
if (selection.getCount() == 1) {
Row row = model.getFirstSelectedRow();
if (row instanceof HasSourceReference) {
ref = (HasSourceReference) row;
}
}
}
}
return ref;
}