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

javax.swing.ScrollPaneLayout的实例源码

项目:swingx    文件JXTableunitTest.java   
/**
     * Issue #1392-swingx: ColumnControl lost on change of CO and LAF
     */
    @Test
    public void testColumnControlOnUpdateUI() {
        JXTable table = new JXTable(10,2);
        JScrollPane scrollPane = new JScrollPane(table);
        table.setColumnControlVisible(true);
        scrollPane.setLayout(new ScrollPaneLayout());
        assertSame("sanity: column control survives setLayout",table.getColumnControl(),scrollPane.getCorner(JScrollPane.UPPER_TRAILING_CORNER));
        toggleComponentOrientation(scrollPane);
//        scrollPane.setLayout(new ScrollPaneLayout());
        assertSame("sanity: column control in trailing corner",scrollPane.getCorner(JScrollPane.UPPER_TRAILING_CORNER));
        assertNull("column control must not be in leading corner",scrollPane.getCorner(JScrollPane.UPPER_LEADING_CORNER));

    }
项目:swingx    文件JXTableVisualCheck.java   
/**
 * Issue #1392- swingx: columnControl lost on toggle CO and LAF
 * 
 * Not easily reproducible - happens
 * if the scrollPane's layout is re-created on updateUI.
 */
public void interactiveColumnControlLAF() {
    JXTable table = new JXTable(new AncientSwingTeam());
    table.setColumnControlVisible(true);
    JScrollPane scrollPane = new JScrollPane(table) {

        /** 
         * @inherited <p>
         */
        @Override
        public void updateUI() {
            super.updateUI();
            setLayout(new ScrollPaneLayout());
        }

    };
    JTable rowHeader = new JTable(10,1);
    scrollPane.setRowHeaderView(rowHeader);
    JLabel label = new JLabel("rowHeader");
    scrollPane.setCorner(JScrollPane.UPPER_LEADING_CORNER,label);
    JXFrame frame = wrapInFrame(scrollPane,"xTable,coreScrollPane");
    addComponentOrientationToggle(frame);
    show(frame);
}
项目:typebest    文件RecordsWindow.java   
/**
 * Shows the top n records in the database.
 * 
 * @param n
 *            The number of records to show from the top.
 */
public void showTop(int n) {
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel,BoxLayout.PAGE_AXIS));

    // Header
    panel.add(recordPanelHeaderBuilder());

    for (Record record : records.getTopRecords(n))
        panel.add(oneRecordPanelBuilder(record));

    JScrollPane pane = new JScrollPane(panel);
    pane.setLayout(new ScrollPaneLayout());
    add(pane);

    add(buttonsBuilder(),BorderLayout.soUTH);
    showWindow();
}
项目:opendocs    文件AbstractList.java   
public AbstractList() {
    GridBagLayout gbl = new GridBagLayout();
    this.setLayout(gbl);

    toolbarPanel.setLayout(gbl_toolbarPanel);
    bottombarPanel.setLayout(gbl_bottombarPanel);

    final JScrollPane scrollPane = new JScrollPane(this.content);
    ScrollPaneLayout spl = new ScrollPaneLayout();
    scrollPane.setLayout(spl);

    scrollPane.setBackground(Color.WHITE);
    scrollPane.setopaque(true);

    JScrollBar vertScrollBar = new JScrollBar();
    vertScrollBar.setUnitIncrement(100);
    JScrollBar horScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
    horScrollBar.setUnitIncrement(100);

    scrollPane.setVerticalScrollBar(vertScrollBar);
    scrollPane.setHorizontalScrollBar(horScrollBar);

    endPanel.setBackground(Color.WHITE);

    SwingUtil.addComponent(this,gbl,toolbarPanel,1,1.0,0.0,GridBagConstraints.norTHWEST,GridBagConstraints.BOTH);
    SwingUtil.addComponent(this,scrollPane,bottombarPanel,2,GridBagConstraints.BOTH);
    border = BorderFactory.createEmptyBorder();
    this.setBorder(border);

    // border = BorderFactory.createLineBorder(new Color(0,100,70));
    this.content.setBackground(Color.WHITE);

}
项目:cn1    文件BasicScrollPaneUI.java   
public void installUI(final JComponent c) {
    scrollpane = (JScrollPane)c;
    installDefaults(scrollpane);
    installListeners(scrollpane);
    installKeyboardActions(scrollpane);

    scrollpane.setLayout(new ScrollPaneLayout());
}
项目:freeVM    文件BasicScrollPaneUI.java   
public void installUI(final JComponent c) {
    scrollpane = (JScrollPane)c;
    installDefaults(scrollpane);
    installListeners(scrollpane);
    installKeyboardActions(scrollpane);

    scrollpane.setLayout(new ScrollPaneLayout());
}
项目:djigger    文件ThreadSelectionPane.java   
@SuppressWarnings("serial")
public ThreadSelectionPane(Session main) {
    super(new BorderLayout());
    this.main = main;
    this.store = main.getStore();
    this.selectionHistory = new Stack<Selection>();
    this.blocks = new ArrayList<ThreadBlock>();
    this.popup = new ThreadSelectionPanePopupMenu(this);

    threadSelectionType = ThreadSelectionType.ALL;
    selectionHistory.push(new Selection());

    label = new JLabel();
    label.setFont(new Font("Arial",Font.PLAIN,10));
    label.setopaque(true);
    label.setBackground(Color.WHITE);

    axis = new ThreadSelectionTimeAxis(this);
    blocksPane = new BlocksPane();      

    blocksPane.addMouseMotionListener(this);
    blocksPane.addMouseListener(this);
    blocksPane.setFocusable(true);
    blocksPane.addKeyListener(this);
    blocksPane.addComponentListener(this);
    blocksPane.setComponentPopupMenu(popup);

    threadnameFilterTextField = new EnhancedTextField(THREADNAME_FILTER);
    threadnameFilterTextField.setToolTipText(THREADNAME_FILTER);
    threadnameFilterTextField.setMaximumSize(new Dimension(Integer.MAX_VALUE,20));
    threadnameFilterTextField.addActionListener(new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            refresh();
            selectionChanged();
        }
    });
    add(threadnameFilterTextField,BorderLayout.PAGE_START);

    JPanel threadTimelinePane = new JPanel(new BorderLayout());
    threadTimelinePane.add(axis,BorderLayout.PAGE_START);
    scrollPane = new JScrollPane(blocksPane,ScrollPaneLayout.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneLayout.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setBorder(new EmptyBorder(new Insets(0,0)));
    threadTimelinePane.add(scrollPane,BorderLayout.CENTER);
    threadTimelinePane.add(label,BorderLayout.PAGE_END);
    add(threadTimelinePane,BorderLayout.CENTER);

    refresh();
}
项目:javify    文件BasicScrollPaneUI.java   
public Dimension getMinimumSize(JComponent c)
{
  JScrollPane p = (JScrollPane) c;
  ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
  return sl.minimumLayoutSize(c);
}
项目:jvm-stm    文件BasicScrollPaneUI.java   
public Dimension getMinimumSize(JComponent c) 
{
  JScrollPane p = (JScrollPane) c;
  ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
  return sl.minimumLayoutSize(c);
}
项目:JamVM-PH    文件BasicScrollPaneUI.java   
public Dimension getMinimumSize(JComponent c) 
{
  JScrollPane p = (JScrollPane) c;
  ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
  return sl.minimumLayoutSize(c);
}
项目:classpath    文件BasicScrollPaneUI.java   
public Dimension getMinimumSize(JComponent c)
{
  JScrollPane p = (JScrollPane) c;
  ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
  return sl.minimumLayoutSize(c);
}
项目:djigger    文件BlockView.java   
protected void createViewComponents() {

        contentPanel.setLayout(new BorderLayout());

        popup = new TreePopupMenu(this);

        graph = new GraPHPane();
        graph.setPreferredSize(new Dimension(5000,0));
        graph.addMouseListener(this);
        graph.addMouseMotionListener(this);
        graph.setComponentPopupMenu(popup);



        scrollPane = new JScrollPane(graph,ScrollPaneLayout.VERTICAL_SCROLLBAR_AS_NEEDED,ScrollPaneLayout.HORIZONTAL_SCROLLBAR_ALWAYS);
        scrollPane.getHorizontalScrollBar().addAdjustmentListener(this);
        contentPanel.add(scrollPane,BorderLayout.CENTER);

        JPanel legendPane = new JPanel(new BorderLayout());

        methodTextArea = new JTextArea();
        methodTextArea.setMaximumSize(new Dimension(Integer.MAX_VALUE,25));
        legendPane.add(methodTextArea,BorderLayout.PAGE_START);

        legend = new FrameworkLegendPane(blockColorer);
        legend.setMaximumSize(new Dimension(Integer.MAX_VALUE,40));
        legend.setPreferredSize(new Dimension(Integer.MAX_VALUE,40));
        legendPane.add(legend,BorderLayout.CENTER);

        contentPanel.add(legendPane,BorderLayout.PAGE_END);
    }

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