微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javax.swing.SizeSequence的实例源码

项目:Prism-gsoc16    文件GUITextModelEditorGutter.java   
/** Updates the line heights,if needed. */
private void updateLineHeights()
{
    // We only want to update if the document has been changed since
    // the last time the line heights were updated.
    if (updatedLine < 0) {
        return;
    }

    // If multiple lines were changed then update all the line heights.
    if (multipleLinesChanged) {
        // Recreate the line sizes info for the whole document.
        int lineCount = getAdjustedLineCount();
        lineHeights = new SizeSequence(lineCount);
        for (int i = 0; i < lineCount; i++) {
            lineHeights.setSize(i,getLineHeight(i));
        }
        multipleLinesChanged = false;
    } else {
        lineHeights.setSize(updatedLine,getLineHeight(updatedLine));
    }

    updatedLine = -1;
}
项目:CoCoViLa    文件LineNumberView.java   
/** Update the line heights as needed. */
private void updateSizes()
{
    if ( startLine < 0 )
    {
        return;
    }

    if ( structureChanged )
    {
        adjustedLineCount = getAdjustedLineCount();
        //System.out.println( "lines: " + adjustedLineCount );
        sizes = new SizeSequence( adjustedLineCount );
        for ( int i = 0; i < adjustedLineCount; i++ )
        {
            sizes.setSize( i,getLineHeight( i ) );
        }
        structureChanged = false;
    }
    else
    {
        sizes.setSize( startLine,getLineHeight( startLine ) );
    }

    startLine = -1;
}
项目:Koopa    文件LineNumberView.java   
/** Update the line heights as needed. */
private void updateSizes() {
    if (startLine < 0) {
        return;
    }

    if (structureChanged) {
        int count = getAdjustedLineCount();
        sizes = new SizeSequence(count);
        for (int i = 0; i < count; i++) {
            sizes.setSize(i,getLineHeight(i));
        }
        structureChanged = false;
    } else {
        sizes.setSize(startLine,getLineHeight(startLine));
    }

    startLine = -1;
}
项目:aibench-project    文件JXTable.java   
/**
 * additionally updates filtered state. {@inheritDoc}
 */
@Override
public void tableChanged(TableModelEvent e) {
    if (getSelectionModel().getValueIsAdjusting()) {
        // this may happen if the uidelegate/editor changed selection
        // and adjusting state
        // before firing a editingStopped
        // need to enforce update of model selection
        getSelectionModel().setValueIsAdjusting(false);
    }
    // JW: make SelectionMapper deaf ... super doesn't kNow about row
    // mapping and sets rowSelection in model coordinates
    // causing complete confusion.
    boolean wasEnabled = getSelectionMapper().isEnabled();
    getSelectionMapper().setEnabled(false);
    try {
        SizeSequence rowModel = nullSuperRowModel(e);
        super.tableChanged(e);
        if (rowModel != null) {
            retoreSuperRowModel(rowModel);
        }
        updateSelectionAndRowModel(e);
    } finally {
        getSelectionMapper().setEnabled(wasEnabled);
    }
    if (shouldSortOnChange(e)) {
        use(filters);
    }
    if (isstructureChanged(e) && getautocreateColumnsFromModel()) {
        initializeColumnWidths();
        resetCalculatedScrollableSize(true);
    }
}
项目:aibench-project    文件JXTable.java   
/**
 * Called if individual row height mapping need to be updated.
 * This implementation guards against unnessary access of 
 * super's private rowModel field.
 */
protected void updateViewSizeSequence() {
    SizeSequence sizeSequence = null;
    if (isRowHeightEnabled()) {
        sizeSequence = getSuperRowModel();
    }
    getRowmodelmapper().setViewSizeSequence(sizeSequence,getRowHeight());
}
项目:aibench-project    文件SizeSequenceMapper.java   
public void setViewSizeSequence(SizeSequence selection,int height) {
    SizeSequence old = this.viewSizes;
    if (old != null) {
        clearModelSizes();
    }
    this.viewSizes = selection;
    this.defaultHeight = height;
    mapTowardsModel();
}
项目:aibench-project    文件SizeSequenceMapper.java   
private void mapTowardsModel() {
    if (viewSizes == null) return;
    modelSizes = new SizeSequence(getInputSize(),defaultHeight);
    int[] selected = viewSizes.getSizes(); 
    for (int i = 0; i < selected.length; i++) {
        int modelIndex = convertToModel(i);
        modelSizes.setSize(modelIndex,selected[i]); 
    }
}
项目:aibench-project    文件SizeSequenceMapper.java   
/**
 * 
 * @param pipeline
 * @param selection
 */
public SizeSequenceMapper(FilterPipeline pipeline,SizeSequence selection,int defaultHeight) {
    this();
    setViewSizeSequence(selection,defaultHeight);
    setFilters(pipeline);
}
项目:aibench-project    文件SizeSequenceMapper.java   
public SizeSequence getViewSizeSequence() {
    return viewSizes;
}
项目:nextreports-designer    文件DefaultHeaderModel.java   
public DefaultHeaderModel(int numEntries,int defaultSize,int orientation) {
    delegate = new SizeSequence(numEntries,defaultSize);
    count = numEntries;
    this.defaultSize = defaultSize;
    this.orientation = orientation;
}
项目:aibench-project    文件JXTable.java   
/**
 * Nulls super's rowModel and returns the old one if rowHeightEnabled and
 * the event is either a remove or a insert. Does nothing and returns null
 * otherwise.
 * 
 * Hack around #924-swingx.
 * 
 * @param e the TableModelEvent used to decide whether a nulling is needed.
 * @return super's old SizeSequence or null 
 */
private SizeSequence nullSuperRowModel(TableModelEvent e) {
    if (!isRowHeightEnabled())
        return null;
    if (!isInsertRemove(e))
        return null;
    SizeSequence result = getSuperRowModel();
    setSuperRowModel(null);
    return result;
}
项目:aibench-project    文件JXTable.java   
/**
 * Sets super's rowModel to the given SizeSequence if not null,* does nothing if null.
 * 
 * Hack around #924-swingx.
 * @param rowModel the SizeSequence to set super's rowModel to.
 */
private void retoreSuperRowModel(SizeSequence rowModel) {
    if (rowModel == null) return;
    setSuperRowModel(rowModel);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。