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


Java OutlineModel.isLocked方法代碼示例

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


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

示例1: 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

示例2: LibraryDockable

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
/** Creates a new {@link LibraryDockable}. */
public LibraryDockable(ListFile file) {
    super(file);
    mOutline = createOutline();
    mOutline.setDynamicRowHeight(true);
    OutlineModel outlineModel = mOutline.getModel();
    outlineModel.applySortConfig(outlineModel.getSortConfig());
    outlineModel.setRowFilter(this);
    LibraryContent content = new LibraryContent(mOutline);
    LibraryHeader header = new LibraryHeader(mOutline.getHeaderPanel());
    mToolbar = new Toolbar();
    mScaleCombo = new JComboBox<>(Scales.values());
    mScaleCombo.setSelectedItem(SheetPreferences.getInitialUIScale());
    mScaleCombo.addActionListener((event) -> {
        Scale scale = ((Scales) mScaleCombo.getSelectedItem()).getScale();
        header.setScale(scale);
        content.setScale(scale);
    });
    mToolbar.add(mScaleCombo);
    createFilterField();
    createCategoryCombo();
    mLockButton = new IconButton(outlineModel.isLocked() ? StdImage.LOCKED : StdImage.UNLOCKED, TOGGLE_EDIT_MODE_TOOLTIP, () -> {
        OutlineModel model = mOutline.getModel();
        model.setLocked(!model.isLocked());
        mLockButton.setIcon(model.isLocked() ? StdImage.LOCKED : StdImage.UNLOCKED);
    });
    mToolbar.add(mLockButton);
    mToolbar.add(new IconButton(StdImage.TOGGLE_OPEN, TOGGLE_ROWS_OPEN_TOOLTIP, () -> mOutline.getModel().toggleRowOpenState()));
    mToolbar.add(new IconButton(StdImage.SIZE_TO_FIT, SIZE_COLUMNS_TO_FIT_TOOLTIP, () -> mOutline.sizeColumnsToFit()));
    add(mToolbar, BorderLayout.NORTH);
    mScroller = new JScrollPane(content);
    mScroller.setBorder(null);
    mScroller.setColumnHeaderView(header);
    add(mScroller, BorderLayout.CENTER);
    Preferences.getInstance().getNotifier().add(this, Fonts.FONT_NOTIFICATION_KEY);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:37,代碼來源:LibraryDockable.java

示例3: createTechLevelFields

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
private void createTechLevelFields(Container parent) {
    OutlineModel owner = mRow.getOwner();
    GURPSCharacter character = mRow.getCharacter();
    boolean enabled = !owner.isLocked();
    boolean hasTL;

    mSavedTechLevel = mRow.getTechLevel();
    hasTL = mSavedTechLevel != null;
    if (!hasTL) {
        mSavedTechLevel = ""; //$NON-NLS-1$
    }

    if (character != null) {
        JPanel wrapper = new JPanel(new ColumnLayout(2));

        mHasTechLevel = new JCheckBox(TECH_LEVEL, hasTL);
        mHasTechLevel.setToolTipText(Text.wrapPlainTextForToolTip(TECH_LEVEL_TOOLTIP));
        mHasTechLevel.setEnabled(enabled);
        mHasTechLevel.addActionListener(this);
        wrapper.add(mHasTechLevel);

        mTechLevel = new JTextField("9999"); //$NON-NLS-1$
        UIUtilities.setOnlySize(mTechLevel, mTechLevel.getPreferredSize());
        mTechLevel.setText(mSavedTechLevel);
        mTechLevel.setToolTipText(Text.wrapPlainTextForToolTip(TECH_LEVEL_TOOLTIP));
        mTechLevel.setEnabled(enabled && hasTL);
        wrapper.add(mTechLevel);
        parent.add(wrapper);

        if (!hasTL) {
            mSavedTechLevel = character.getDescription().getTechLevel();
        }
    } else {
        mTechLevel = new JTextField(mSavedTechLevel);
        mHasTechLevel = new JCheckBox(TECH_LEVEL_REQUIRED, hasTL);
        mHasTechLevel.setToolTipText(Text.wrapPlainTextForToolTip(TECH_LEVEL_REQUIRED_TOOLTIP));
        mHasTechLevel.setEnabled(enabled);
        mHasTechLevel.addActionListener(this);
        parent.add(mHasTechLevel);
    }
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:42,代碼來源:SkillEditor.java

示例4: canDeleteSelection

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
@Override
public boolean canDeleteSelection() {
    OutlineModel model = getModel();
    return !model.isLocked() && model.hasSelection();
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:6,代碼來源:ListOutline.java


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