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


Java JScrollPane.setRowHeaderView方法代码示例

本文整理汇总了Java中javax.swing.JScrollPane.setRowHeaderView方法的典型用法代码示例。如果您正苦于以下问题:Java JScrollPane.setRowHeaderView方法的具体用法?Java JScrollPane.setRowHeaderView怎么用?Java JScrollPane.setRowHeaderView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JScrollPane的用法示例。


在下文中一共展示了JScrollPane.setRowHeaderView方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createExtComponent

import javax.swing.JScrollPane; //导入方法依赖的package包/类
protected JComponent createExtComponent() {
    setLineNumberEnabled(true); // enable line numbering

    // extComponent will be a panel
    JComponent ec = new JPanel(new BorderLayout());
    ec.putClientProperty(JTextComponent.class, component);

    // Add the scroll-pane with the component to the center
    JScrollPane scroller = new JScrollPane(component);
    scroller.getViewport().setMinimumSize(new Dimension(4,4));
    
    // remove default scroll-pane border, winsys will handle borders itself           
    scroller.setBorder(null);
    
    setGlyphGutter(new GlyphGutter(this));
    scroller.setRowHeaderView(glyphGutter);

    initGlyphCorner(scroller);
    
    ec.add(scroller);

    // Install the status-bar panel to the bottom
    ec.add(getStatusBar().getPanel(), BorderLayout.SOUTH);
    
    return ec;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:EditorUI.java

示例2: unconfigureEnclosingScrollPane

import javax.swing.JScrollPane; //导入方法依赖的package包/类
@Override
protected void unconfigureEnclosingScrollPane() {
	Container p = getParent();
	if (p instanceof JViewport) {
		Container gp = p.getParent();
		if (gp instanceof JScrollPane) {
			JScrollPane scrollPane = (JScrollPane) gp;
			// Make certain we are the viewPort's view and not, for
			// example, the rowHeaderView of the scrollPane -
			// an implementor of fixed columns might do this.
			JViewport viewport = scrollPane.getViewport();
			if (viewport == null || viewport.getView() != this) {
				return;
			}
			scrollPane.setColumnHeaderView(null);
			scrollPane.setRowHeaderView(null);

			viewport.removeChangeListener(scrollListener);
			rowHeader.uninstall();
		}
	}
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:23,代码来源:ExactTable.java

示例3: unconfigureEnclosingScrollPane

import javax.swing.JScrollPane; //导入方法依赖的package包/类
@Override
protected void unconfigureEnclosingScrollPane() {
	Container p = getParent();
	if (p instanceof JViewport) {
		Container gp = p.getParent();
		if (gp instanceof JScrollPane) {
			JScrollPane scrollPane = (JScrollPane) gp;
			// Make certain we are the viewPort's view and not, for
			// example, the rowHeaderView of the scrollPane -
			// an implementor of fixed columns might do this.
			JViewport viewport = scrollPane.getViewport();
			if (viewport == null || viewport.getView() != this) {
				return;
			}
			scrollPane.setColumnHeaderView(null);
			scrollPane.setRowHeaderView(null);

			viewport.removeChangeListener(scrollListener);
			rowHeader.uninstall();
		}
	}

}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:24,代码来源:ExactTable.java

示例4: initComponent

import javax.swing.JScrollPane; //导入方法依赖的package包/类
protected void initComponent() {
    this.setLayout(new BorderLayout());
    
    jScrollPane1 = new JScrollPane();
    jScrollPane1.setBorder(null);
    jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    codePane = new JEditorTextPane();
    textLineNumber = new TextLineNumber(codePane);
    codePane.setBorder(null);

    jScrollPane1.setViewportView(codePane);
    jScrollPane1.setRowHeaderView(textLineNumber);

    add(jScrollPane1, java.awt.BorderLayout.CENTER);

    rightPane = new RightEditorPane();
    rightPane.setMaximumSize(new java.awt.Dimension(16, 32767));
    rightPane.setMinimumSize(new java.awt.Dimension(16, 100));
    rightPane.setPreferredSize(new java.awt.Dimension(16, 469));

    add(rightPane, BorderLayout.EAST);
}
 
开发者ID:iapafoto,项目名称:DicomViewer,代码行数:25,代码来源:JCompilableCodeEditor.java

示例5: getComponent

import javax.swing.JScrollPane; //导入方法依赖的package包/类
@Override
public JComponent getComponent() {
    pane = new JScrollPane();
    pane.setViewportView(editorTable);

    header = new TableHeader(editorTable, model);

    header.setDragEnabled(true);
    header.setTransferHandler(new RowTransferHandle());
    header.setDropMode(DropMode.INSERT);

    pane.setRowHeaderView(header);


    editorTable.setDropMode(DropMode.INSERT_ROWS);
    editorTable.setTransferHandler(new RowTransferHandle());

    return pane;
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:20,代码来源:TableEditor.java

示例6: QualifierSelectComponent

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public QualifierSelectComponent(Engine engine, boolean uniqueSelected,
                                boolean all) {
    super(new BorderLayout());
    this.engine = engine;

    RowSet rs = new RowSet(engine, StandardAttributesPlugin
            .getQualifiersQualifier(engine),
            new Attribute[]{StandardAttributesPlugin
                    .getAttributeNameAttribute(engine)});

    List<Qualifier> qualifiers;
    if (all)
        qualifiers = engine.getQualifiers();
    else {
        qualifiers = new ArrayList<Qualifier>();
        List<Row> rows = rs.getAllRows();
        for (Row row : rows) {
            if (row.getChildCount() == 0) {
                qualifiers.add(StandardAttributesPlugin.getQualifier(
                        engine, row.getElement()));
            }
        }
    }

    this.qualifiers = qualifiers.toArray(new Qualifier[qualifiers.size()]);

    Arrays.sort(this.qualifiers, new Comparator<Qualifier>() {

        private Collator collator = Collator.getInstance();

        @Override
        public int compare(Qualifier o1, Qualifier o2) {
            return collator.compare(o1.getName(), o2.getName());
        }
    });

    JScrollPane pane = new JScrollPane();
    QualifierTable table = new QualifierTable();

    model = new QualifierModel(rs.getRoot());

    table.setTreeTableModel(model);

    TableRowHeader view = new TableRowHeader(table, model);

    view.setGroupSelect(all);

    SelectType selectType = (uniqueSelected) ? SelectType.RADIO
            : SelectType.CHECK;
    view.setSelectType(selectType);
    model.setSelectType(selectType);

    pane.setRowHeaderView(view);

    Row root = rs.getRoot();
    ArrayList<Row> children = new ArrayList<Row>(root.getChildren());

    rs.close();

    root.setChildren(children);

    table.expandAll();

    pane.setViewportView(table);
    this.setPreferredSize(new Dimension(500, 300));
    this.add(pane, BorderLayout.CENTER);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:68,代码来源:QualifierSelectComponent.java

示例7: init

import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void init() {
    txpText = new JTextPane();
    txpLines = new JTextPane();

    // needed for correct layouting
    Insets ins = txpLines.getInsets();
    txpLines.setMargin(new Insets(ins.top + 1, ins.left, ins.bottom, ins.right));

    textHighlighter = new BookmarkHighlighter();
    lineHighlighter = new BookmarkHighlighter();

    txpText.setHighlighter(textHighlighter);
    //txpText.setMinimumSize(new Dimension(100, 100));
    txpText.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
    txpText.setEditable(false);

    txpLines.setHighlighter(lineHighlighter);
    txpLines.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
    txpLines.setBackground(Color.LIGHT_GRAY);
    txpLines.setEnabled(false);
    txpLines.setForeground(Color.BLACK);
    txpLines.addMouseListener(mouseInputListener);

    fm = txpText.getFontMetrics(txpText.getFont());

    JPanel pnlBookmarks = new JPanel();
    pnlBookmarks.setLayout(new BorderLayout());
    pnlBookmarks.add(txpText, BorderLayout.CENTER);

    JScrollPane jspBookmarks = new JScrollPane(pnlBookmarks);
    jspBookmarks.setRowHeaderView(txpLines);
    jspBookmarks.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    jspBookmarks.getVerticalScrollBar().setUnitIncrement(15);

    this.setLayout(new BorderLayout());
    this.add(jspBookmarks, BorderLayout.CENTER);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:38,代码来源:BookmarkableLogViewer.java

示例8: processSideBars

import javax.swing.JScrollPane; //导入方法依赖的package包/类
private static void processSideBars(Map sideBars, JComponent ec, JScrollPane scroller) {
        // Remove all existing sidebars
        ec.removeAll();

        // Add the scroller and the new sidebars
        ec.add(scroller);
        scroller.setRowHeader(null);
        scroller.setColumnHeaderView(null);
//        final MouseDispatcher mouse = new MouseDispatcher((JTextComponent) ec.getClientProperty(JTextComponent.class));
        for (Iterator entries = sideBars.entrySet().iterator(); entries.hasNext(); ) {
            Map.Entry entry = (Map.Entry) entries.next();
            SideBarPosition position = (SideBarPosition) entry.getKey();
            JComponent sideBar = (JComponent) entry.getValue();
            
//            if (position.getPosition() == SideBarPosition.WEST) {
//                JPanel p = new JPanel(new BorderLayout()) {
//
//                    @Override
//                    public void addNotify() {
//                        super.addNotify();
//                        infiltrateContainer(this, mouse, true);
//                    }
//
//                    @Override
//                    public void removeNotify() {
//                        infiltrateContainer(this, mouse, false);
//                        super.removeNotify();
//                    }
//
//                };
//                p.add(sideBar, BorderLayout.CENTER);
//                sideBar = p;
//            }
            
            if (position.isScrollable()) {
                if (position.getPosition() == SideBarPosition.WEST) {
                    scroller.setRowHeaderView(sideBar);
                } else {
                    if (position.getPosition() == SideBarPosition.NORTH) {
                        scroller.setColumnHeaderView(sideBar);
                    } else {
                        throw new IllegalArgumentException("Unsupported side bar position, scrollable = true, position=" + position.getBorderLayoutPosition()); // NOI18N
                    }
                }
            } else {
                ec.add(sideBar, position.getBorderLayoutPosition());
            }
        }
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:50,代码来源:NbEditorUI.java


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