Java 类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", 
                table.getColumnControl(), 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,     0, 0, 1, 1, 1.0, 0.0,
            GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH);
    SwingUtil.addComponent(this, gbl, scrollPane,       0, 1, 1, 1, 0.0, 1.0,
            GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH);
    SwingUtil.addComponent(this, gbl, bottombarPanel,   0, 2, 1, 1, 1.0, 0.0,
            GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH);
    border = BorderFactory.createEmptyBorder();
    this.setBorder(border);

    // border = BorderFactory.createLineBorder(new Color(0, 100, 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());
}
项目: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, 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);
    }