Java 类javax.swing.ScrollPaneConstants 实例源码

项目:openjdk-jdk10    文件:LWTextAreaPeer.java   
@Override
public Dimension getMinimumSize(final int rows, final int columns) {
    final Dimension size = super.getMinimumSize(rows, columns);
    synchronized (getDelegateLock()) {
        // JScrollPane insets
        final Insets pi = getDelegate().getInsets();
        size.width += pi.left + pi.right;
        size.height += pi.top + pi.bottom;
        // Take scrollbars into account.
        final int vsbPolicy = getDelegate().getVerticalScrollBarPolicy();
        if (vsbPolicy == ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS) {
            final JScrollBar vbar = getDelegate().getVerticalScrollBar();
            size.width += vbar != null ? vbar.getMinimumSize().width : 0;
        }
        final int hsbPolicy = getDelegate().getHorizontalScrollBarPolicy();
        if (hsbPolicy == ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS) {
            final JScrollBar hbar = getDelegate().getHorizontalScrollBar();
            size.height += hbar != null ? hbar.getMinimumSize().height : 0;
        }
    }
    return size;
}
项目:rapidminer    文件:DockableResultDisplay.java   
public DockableResultDisplay() {
    this.dockKey.setDockGroup(MainFrame.DOCK_GROUP_RESULTS);
    DockableActionCustomizer customizer = new DockableActionCustomizer() {

        @Override
        public void visitTabSelectorPopUp(JPopupMenu popUpMenu, Dockable dockable) {
            popUpMenu.add(new JMenuItem(new CloseAllResultsAction(RapidMinerGUI.getMainFrame())));
        }
    };
    customizer.setTabSelectorPopUpCustomizer(true); // enable tabbed dock custom popup menu
                                                     // entries
    this.dockKey.setActionCustomizer(customizer);
    setLayout(new BorderLayout());
    ExtendedJScrollPane overviewScrollpane = new ExtendedJScrollPane(overview);
    overviewScrollpane.setBorder(null);
    overviewScrollpane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    overviewScrollpane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    add(overviewScrollpane, BorderLayout.CENTER);
    tableUpdateQueue.start();
}
项目:rapidminer    文件:RemoteResultDisplay.java   
public RemoteResultDisplay() {
    this.dockKey.setDockGroup(MainFrame.DOCK_GROUP_RESULTS);
    DockableActionCustomizer customizer = new DockableActionCustomizer() {

        @Override
        public void visitTabSelectorPopUp(JPopupMenu popUpMenu, Dockable dockable) {
            popUpMenu.add(new JMenuItem(new CloseAllResultsAction(RapidMinerGUI.getMainFrame())));
        }
    };
    customizer.setTabSelectorPopUpCustomizer(true); // enable tabbed dock custom popup menu
                                                     // entries
    this.dockKey.setActionCustomizer(customizer);
    setLayout(new BorderLayout());
    ExtendedJScrollPane overviewScrollpane = new ExtendedJScrollPane(overview);
    overviewScrollpane.setBorder(null);
    overviewScrollpane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    overviewScrollpane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    add(overviewScrollpane, BorderLayout.CENTER);
    tableUpdateQueue.start();
}
项目:jmt    文件:ReferenceStationPanel.java   
/**
 * Set up the panel contents and layout
 */
private void initComponents() {
    stTable = new STTable();
    JPanel totalBox = new JPanel(new BorderLayout(10, 10));
    JLabel descrLabel = new JLabel(jmt.jmva.analytical.ExactConstants.DESCRIPTION_ReferenceStation);
    JPanel descrBox = new JPanel(new BorderLayout());
    descrBox.setPreferredSize(new Dimension(200, 1000));
    descrBox.add(descrLabel, BorderLayout.NORTH);

    JScrollPane visitTablePane = new JScrollPane(stTable);
    visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    totalBox.add(visitTablePane, BorderLayout.CENTER);
    totalBox.add(descrBox, BorderLayout.WEST);

    setLayout(new BorderLayout());
    add(totalBox, BorderLayout.CENTER);
    add(Box.createVerticalStrut(30), BorderLayout.NORTH);
    add(Box.createVerticalStrut(30), BorderLayout.SOUTH);
    add(Box.createHorizontalStrut(20), BorderLayout.EAST);
    add(Box.createHorizontalStrut(20), BorderLayout.WEST);  
}
项目:jmt    文件:SolutionPanel.java   
/**
 * Set up the panel contents and layout
 */
protected void initComponents() {
    table = new ResultsTable(getTableModel(), help);
               table.setRowHeight(CommonConstants.ROW_HEIGHT);
    statusLabel.setForeground(Color.RED);
    statusLabel.setFont(new Font("Arial", Font.BOLD, 14));
    statusLabel.setText("WARNING: parameters have been changed since this solution was computed!");
    statusLabel.setHorizontalAlignment(SwingConstants.CENTER);
    help.addHelp(statusLabel, "This solution is not current with the parameters of the model. Click solve to compute a new solution.");

    JPanel intPanel = new JPanel(new BorderLayout(10, 10));

    JScrollPane jsp = new JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    JLabel descrLabel = new JLabel(getDescriptionMessage());

    intPanel.add(descrLabel, BorderLayout.NORTH);
    intPanel.add(jsp, BorderLayout.CENTER);

    setLayout(new BorderLayout());
    add(intPanel, BorderLayout.CENTER);
    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));

}
项目:jmt    文件:SynopsisPanel.java   
private void initComponents() {
    Box vBox = Box.createVerticalBox();
    Box hBox = Box.createHorizontalBox();
    synView = new JTextPane();
    synView.setContentType("text/html");
    synView.setEditable(false);
    synScroll = new JScrollPane(synView);
    synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    vBox.add(Box.createVerticalStrut(30));
    vBox.add(hBox);
    vBox.add(Box.createVerticalStrut(30));
    hBox.add(Box.createHorizontalStrut(20));
    hBox.add(synScroll);
    hBox.add(Box.createHorizontalStrut(20));
    this.setLayout(new GridLayout(1, 1));
    this.add(vBox);
}
项目:openjdk-jdk10    文件:LWTextAreaPeer.java   
private void setScrollBarVisibility(final int visibility) {
    final ScrollableJTextArea pane = getDelegate();
    final JTextArea view = pane.getView();
    view.setLineWrap(false);

    switch (visibility) {
        case TextArea.SCROLLBARS_NONE:
            pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
            view.setLineWrap(true);
            break;
        case TextArea.SCROLLBARS_VERTICAL_ONLY:
            pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
            view.setLineWrap(true);
            break;
        case TextArea.SCROLLBARS_HORIZONTAL_ONLY:
            pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
            pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
            break;
        default:
            pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
            pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
            break;
    }
}
项目:jmt    文件:SectorsTextualPanel.java   
private void initComponents() {
    Box vBox = Box.createVerticalBox();
    Box hBox = Box.createHorizontalBox();
    synView = new JTextPane();
    synView.setContentType("text/html");
    synView.setEditable(false);
    synScroll = new JScrollPane(synView);
    synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    vBox.add(Box.createVerticalStrut(30));
    vBox.add(hBox);
    vBox.add(Box.createVerticalStrut(30));
    hBox.add(Box.createHorizontalStrut(20));
    hBox.add(synScroll);
    hBox.add(Box.createHorizontalStrut(20));
    this.setLayout(new GridLayout(1, 1));
    this.add(vBox);
    synView
            .setText("<html><body><center><font face=\"bold\" size=\"3\">Saturation Sectors will be here displayed once you solve the model.</font></center></body></html>");
}
项目:jdk8u-jdk    文件:LWTextAreaPeer.java   
@Override
public Dimension getMinimumSize(final int rows, final int columns) {
    final Dimension size = super.getMinimumSize(rows, columns);
    synchronized (getDelegateLock()) {
        // JScrollPane insets
        final Insets pi = getDelegate().getInsets();
        size.width += pi.left + pi.right;
        size.height += pi.top + pi.bottom;
        // Take scrollbars into account.
        final int vsbPolicy = getDelegate().getVerticalScrollBarPolicy();
        if (vsbPolicy == ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS) {
            final JScrollBar vbar = getDelegate().getVerticalScrollBar();
            size.width += vbar != null ? vbar.getMinimumSize().width : 0;
        }
        final int hsbPolicy = getDelegate().getHorizontalScrollBarPolicy();
        if (hsbPolicy == ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS) {
            final JScrollBar hbar = getDelegate().getHorizontalScrollBar();
            size.height += hbar != null ? hbar.getMinimumSize().height : 0;
        }
    }
    return size;
}
项目:jmt    文件:ExactTable.java   
private void installLabels(JScrollPane scrollPane) {
    moreColumnsLabel.setIcon(JMTImageLoader.loadImage("table_rightarrow"));
    moreColumnsLabel.setHorizontalAlignment(SwingConstants.CENTER);
    moreColumnsLabel.setToolTipText(moreColumnsTooltip);
    moreColumnsLabel.setVisible(false);

    moreRowsLabel.setIcon(JMTImageLoader.loadImage("table_downarrow"));
    moreRowsLabel.setHorizontalAlignment(SwingConstants.CENTER);
    moreRowsLabel.setToolTipText(moreRowsTooltip);
    moreRowsLabel.setVisible(false);

    scrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, moreColumnsLabel);
    scrollPane.setCorner(ScrollPaneConstants.LOWER_LEFT_CORNER, moreRowsLabel);

    if (displaysScrollLabels) {
        updateScrollLabels();
    }
}
项目:OpenJSharp    文件:LWTextAreaPeer.java   
private void setScrollBarVisibility(final int visibility) {
    final ScrollableJTextArea pane = getDelegate();
    final JTextArea view = pane.getView();
    view.setLineWrap(false);

    switch (visibility) {
        case TextArea.SCROLLBARS_NONE:
            pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
            view.setLineWrap(true);
            break;
        case TextArea.SCROLLBARS_VERTICAL_ONLY:
            pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
            view.setLineWrap(true);
            break;
        case TextArea.SCROLLBARS_HORIZONTAL_ONLY:
            pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
            pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
            break;
        default:
            pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
            pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
            break;
    }
}
项目:jmt    文件:PopulationMixPanel.java   
@Override
public void setEnabled(boolean enabled) {
    fromLabel.setEnabled(enabled);
    from.setEnabled(enabled);
    toLabel.setEnabled(enabled);
    to.setEnabled(enabled);
    stepsLabel.setEnabled(enabled);
    steps.setEnabled(enabled);
    classChooserLabel.setEnabled(enabled);
    classChooser.setEnabled(enabled);
    description.setEnabled(enabled);
    if (!enabled) {
        scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
        descrPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    } else {
        scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
        descrPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    }
    if (!enabled) {
        title.setTitleColor(Color.LIGHT_GRAY);
        descriptionTitle.setTitleColor(Color.LIGHT_GRAY);
    } else {
        title.setTitleColor(DEFAULT_TITLE_COLOR);
        descriptionTitle.setTitleColor(DEFAULT_TITLE_COLOR);
    }
}
项目:QN-ACTR-Release    文件:SectorsTextualPanel.java   
private void initComponents() {
    Box vBox = Box.createVerticalBox();
    Box hBox = Box.createHorizontalBox();
    synView = new JTextPane();
    synView.setContentType("text/html");
    synView.setEditable(false);
    synScroll = new JScrollPane(synView);
    synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    vBox.add(Box.createVerticalStrut(20));
    vBox.add(hBox);
    vBox.add(Box.createVerticalStrut(20));
    hBox.add(Box.createHorizontalStrut(20));
    hBox.add(synScroll);
    hBox.add(Box.createHorizontalStrut(20));
    this.setLayout(new GridLayout(1, 1));
    this.add(vBox);
    synView
            .setText("<html><body><center><font face=\"bold\" size=\"3\">Saturation Sectors will be here displayed once you solve the model.</font></center></body></html>");
}
项目:OpenJSharp    文件:LWTextAreaPeer.java   
@Override
public Dimension getMinimumSize(final int rows, final int columns) {
    final Dimension size = super.getMinimumSize(rows, columns);
    synchronized (getDelegateLock()) {
        // JScrollPane insets
        final Insets pi = getDelegate().getInsets();
        size.width += pi.left + pi.right;
        size.height += pi.top + pi.bottom;
        // Take scrollbars into account.
        final int vsbPolicy = getDelegate().getVerticalScrollBarPolicy();
        if (vsbPolicy == ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS) {
            final JScrollBar vbar = getDelegate().getVerticalScrollBar();
            size.width += vbar != null ? vbar.getMinimumSize().width : 0;
        }
        final int hsbPolicy = getDelegate().getHorizontalScrollBarPolicy();
        if (hsbPolicy == ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS) {
            final JScrollBar hbar = getDelegate().getHorizontalScrollBar();
            size.height += hbar != null ? hbar.getMinimumSize().height : 0;
        }
    }
    return size;
}
项目:QN-ACTR-Release    文件:SolutionPanel.java   
/**
 * Set up the panel contents and layout
 */
protected void initComponents() {
    table = new ResultsTable(getTableModel(), help);

    statusLabel.setForeground(Color.red);
    statusLabel.setFont(new Font("Arial", Font.BOLD, 14));
    statusLabel.setText("WARNING: parameters have been changed since this solution was computed!");
    statusLabel.setHorizontalAlignment(SwingConstants.CENTER);
    help.addHelp(statusLabel, "This solution is not current with the parameters of the model. Click solve to compute a new solution.");

    JPanel intPanel = new JPanel(new BorderLayout(10, 10));

    JScrollPane jsp = new JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    JLabel descrLabel = new JLabel(getDescriptionMessage());

    intPanel.add(descrLabel, BorderLayout.NORTH);
    intPanel.add(jsp, BorderLayout.CENTER);

    setLayout(new BorderLayout());
    add(intPanel, BorderLayout.CENTER);
    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));

}
项目:JuggleMasterPro    文件:LicenceJMenuItem.java   
/**
 * Constructs
 * 
 * @param objPcontrolJFrame
 */
public LicenceJMenuItem(ControlJFrame objPcontrolJFrame) {

    this.objGcontrolJFrame = objPcontrolJFrame;

    // Licence dialog :
    this.objGlicenceJDialog = new JDialog(this.objGcontrolJFrame, this.objGcontrolJFrame.getLanguageString(Language.intS_TITLE_LICENCE), true);
    final JTextArea objLlicenceJTextArea = new JTextArea();
    objLlicenceJTextArea.setFont(new Font("Courier", Font.PLAIN, 11));
    objLlicenceJTextArea.setOpaque(true);
    objLlicenceJTextArea.setEditable(false);
    final JScrollPane objLjScrollPane =
                                        new JScrollPane(objLlicenceJTextArea,
                                                        ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    objLjScrollPane.setOpaque(true);
    this.objGlicenceJDialog.add(objLjScrollPane);
    this.objGlicenceJDialog.validate();
    this.objGlicenceJDialog.pack();
    this.objGlicenceJDialog.addWindowListener(new JDialogWindowListener(this.objGcontrolJFrame, this.objGlicenceJDialog, false));
    this.setFont(this.objGcontrolJFrame.getFont());
    this.setOpaque(true);
    this.addActionListener(this);
    this.setAccelerator(Constants.keyS_LICENCE);
}
项目:QN-ACTR-Release    文件:SynopsisPanel.java   
private void initComponents() {
    Box vBox = Box.createVerticalBox();
    Box hBox = Box.createHorizontalBox();
    synView = new JTextPane();
    synView.setContentType("text/html");
    synView.setEditable(false);
    synScroll = new JScrollPane(synView);
    synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    vBox.add(Box.createVerticalStrut(20));
    vBox.add(hBox);
    vBox.add(Box.createVerticalStrut(20));
    hBox.add(Box.createHorizontalStrut(20));
    hBox.add(synScroll);
    hBox.add(Box.createHorizontalStrut(20));
    this.setLayout(new GridLayout(1, 1));
    this.add(vBox);
}
项目:QN-ACTR-Release    文件:ExactTable.java   
private void installLabels(JScrollPane scrollPane) {
    moreColumnsLabel.setIcon(JMTImageLoader.loadImage("table_rightarrow"));
    moreColumnsLabel.setHorizontalAlignment(SwingConstants.CENTER);
    moreColumnsLabel.setToolTipText(moreColumnsTooltip);
    moreColumnsLabel.setVisible(false);

    moreRowsLabel.setIcon(JMTImageLoader.loadImage("table_downarrow"));
    moreRowsLabel.setHorizontalAlignment(SwingConstants.CENTER);
    moreRowsLabel.setToolTipText(moreRowsTooltip);
    moreRowsLabel.setVisible(false);

    scrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, moreColumnsLabel);
    scrollPane.setCorner(ScrollPaneConstants.LOWER_LEFT_CORNER, moreRowsLabel);

    if (displaysScrollLabels) {
        updateScrollLabels();
    }

}
项目:QN-ACTR-Release    文件:SeedPanel.java   
@Override
public void setEnabled(boolean enabled) {
    stepsLabel.setEnabled(enabled);
    steps.setEnabled(enabled);
    description.setEnabled(enabled);
    if (!enabled) {
        scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
        descrPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    } else {
        scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
        descrPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    }
    if (!enabled) {
        title.setTitleColor(Color.LIGHT_GRAY);
        descriptionTitle.setTitleColor(Color.LIGHT_GRAY);
    } else {
        title.setTitleColor(DEFAULT_TITLE_COLOR);
        descriptionTitle.setTitleColor(DEFAULT_TITLE_COLOR);
    }
}
项目:oxygen-git-plugin    文件:CommitPanel.java   
private void addCommitMessageTextArea(GridBagConstraints gbc) {
    gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
            UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.gridx = 0;
    gbc.gridy = 2;
    gbc.weightx = 1;
    gbc.weighty = 1;
    gbc.gridwidth = 2;
    commitMessage = new JTextArea();
    commitMessage.setLineWrap(true);
    // Around 3 lines of text.
    int fontH = commitMessage.getFontMetrics(commitMessage.getFont()).getHeight();
    commitMessage.setWrapStyleWord(true);
    JScrollPane scrollPane = new JScrollPane(commitMessage);
    scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setMinimumSize(new Dimension(10, 3 * fontH));

    UndoSupportInstaller.installUndoManager(commitMessage);
    this.add(scrollPane, gbc);
}
项目:oxygen-dita-translation-package-builder    文件:ShowModifiedFilesDialog.java   
/**
* Private constructor
*/
private ShowModifiedFilesDialog() {
  setLayout(new GridBagLayout());
  modifiedFiles = new JTextArea(10, 40);
  modifiedFiles.setLineWrap(true);
  modifiedFiles.setWrapStyleWord(true);
  modifiedFiles.setEditable(false);

  JScrollPane scroll = new JScrollPane(modifiedFiles);
  scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);

  GridBagConstraints gbc = new GridBagConstraints();
  gbc.gridx = 0;
  gbc.gridy = 1;
  gbc.gridwidth = 1;
  gbc.gridheight = 1;
  gbc.weightx = 0;
  gbc.weighty = 0;
  gbc.fill = GridBagConstraints.BOTH;
  gbc.anchor = GridBagConstraints.LINE_START;
  add(scroll , gbc);
}
项目:incubator-netbeans    文件:RepositoryBrowserPanel.java   
public RepositoryBrowserPanel (final EnumSet<Option> options, File repository, File[] roots, RepositoryInfo info) {
    Parameters.notNull("roots", roots);
    this.currRepository = repository;
    this.root = options.contains(Option.DISPLAY_ALL_REPOSITORIES)
            ? new AbstractNode(new RepositoriesChildren()) {

                @Override
                public Action[] getActions (boolean context) {
                    if (options.contains(Option.ENABLE_POPUP)) {
                        return new Action[] {
                            new OpenRepositoryAction()
                        };
                    } else {
                        return super.getActions(context);
                    }
                }

            } : new RepositoryNode(repository, info);
    this.manager = new ExplorerManager();
    this.options = options;
    this.roots = roots;
    initComponents();
    if (!options.contains(Option.DISPLAY_TOOLBAR)) {
        toolbar.setVisible(false);
    }
    tree.setRootVisible(false);
    tree.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    if (!options.contains(Option.DISPLAY_REVISIONS)) {
        remove(jSplitPane1);
        add(tree, BorderLayout.CENTER);
    }
    if (options.contains(Option.ENABLE_POPUP)) {
        getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete"); // NOI18N
        getActionMap().put("delete", new DeleteAction()); // NOI18N
    }
}
项目:rapidminer    文件:CSVFormatSpecificationPanel.java   
/**
 * Fills the tablePane with content.
 */
private JComponent makePreviewTable() {
    previewTable = new ExtendedJTable(false, false, false);
    // ensure same background as JPanels in case of only few rows
    previewTable.setBackground(Colors.PANEL_BACKGROUND);
    previewTable.setColoredTableCellRenderer(new ColoredTableCellRenderer() {

        private final Font boldFont = getFont().deriveFont(Font.BOLD);

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
                int row, int column) {
            JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            adjustCell(row, label, boldFont);
            return label;
        }

    });

    loadingContentPane = new LoadingContentPane("loading_data", previewTable);

    tablePane = new JScrollPane(loadingContentPane);
    tablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    tablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    tablePane.setBorder(null);

    // add PREVIEW label in front of scrollpane
    JLayeredPane layeredPane = new JLayeredPane();
    layeredPane.setLayout(new OverlayLayout(layeredPane));
    layeredPane.add(tablePane, JLayeredPane.DEFAULT_LAYER);

    JPanel overlayPanel = new JPanel(new BorderLayout());
    overlayPanel.setOpaque(false);
    overlayLabel = new JLabel("", SwingConstants.CENTER);
    showPreviewLettering();
    overlayPanel.add(overlayLabel, BorderLayout.CENTER);

    layeredPane.add(overlayPanel, JLayeredPane.PALETTE_LAYER);
    return layeredPane;
}
项目:jmt    文件:DescriptionPanel.java   
/**
 * Set up the panel contents and layout
 */
private void initComponents() {
    textPane = new JTextPane();
    help.addHelp(textPane, "Enter any text describing this model");

    //BEGIN Federico Dall'Orso 14/3/2005
    //OLD
    /*
    setLayout(new BorderLayout());
    JScrollPane esp = new JScrollPane(textPane);
    esp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    add(esp, BorderLayout.CENTER);
    add(Box.createVerticalStrut(30), BorderLayout.NORTH);
    add(Box.createHorizontalStrut(20), BorderLayout.EAST);
    add(Box.createVerticalStrut(30), BorderLayout.SOUTH);
    add(Box.createHorizontalStrut(20), BorderLayout.WEST);
    */
    //NEW
    JPanel intPanel = new JPanel(new BorderLayout(10, 10));
    //Box intPanel = Box.createVerticalBox();

    JScrollPane jsp = new JScrollPane(textPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    JLabel descrLabel = new JLabel(DESCRIPTION_COMMENT);

    intPanel.add(descrLabel, BorderLayout.NORTH);
    intPanel.add(jsp, BorderLayout.CENTER);
    //intPanel.add(jsp);

    setLayout(new BorderLayout());
    add(intPanel, BorderLayout.CENTER);
    add(Box.createVerticalStrut(30), BorderLayout.NORTH);
    add(Box.createVerticalStrut(30), BorderLayout.SOUTH);
    add(Box.createHorizontalStrut(20), BorderLayout.EAST);
    add(Box.createHorizontalStrut(20), BorderLayout.WEST);

    //END Federico Dall'Orso 14/3/2005

}
项目:jmt    文件:ServiceDemandsPanel.java   
/**
 * Set up the panel contents and layout
 */
private void initComponents() {

    stTable = new STTable();

    /* and now some Box black magic */

    Box hBox = Box.createHorizontalBox();
    hBox.add(Box.createHorizontalStrut(20));
    //Horizontal box containing Description label and buttons
    Box descrBox = Box.createVerticalBox();
    descrBox.add(new JLabel(DESCRIPTION_SERVICEDEMANDS));
    descrBox.add(Box.createHorizontalStrut(10));
    descrBox.add(new JButton(SWITCH_TO_ST_V));
    descrBox.setPreferredSize(new Dimension(220, 1000));
    descrBox.setMinimumSize(new Dimension(200, 200));

    hBox.add(descrBox);
    hBox.add(Box.createHorizontalStrut(10));
    JScrollPane visitTablePane = new JScrollPane(stTable);
    visitTablePane.setPreferredSize(new Dimension(1000, 1000));
    visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    hBox.add(visitTablePane);
    hBox.add(Box.createHorizontalStrut(20));

    Box totalBox = Box.createVerticalBox();
    totalBox.add(Box.createVerticalStrut(30));
    totalBox.add(hBox);
    totalBox.add(Box.createVerticalStrut(30));

    setLayout(new BorderLayout());
    add(totalBox, BorderLayout.CENTER);

}
项目:jmt    文件:ServiceTimesPanel.java   
/**
 * Set up the panel contents and layout
 */
private void initComponents() {

    stTable = new STTable();

    Box hBox = Box.createHorizontalBox();
    hBox.add(Box.createHorizontalStrut(20));
    //Horizontal box containing Description label and buttons
    Box descrBox = Box.createVerticalBox();
    descrBox.add(new JLabel(DESCRIPTION_SERVICETIMES));
    descrBox.add(Box.createHorizontalStrut(10));
    descrBox.add(new JButton(SWITCH_TO_SD));
    descrBox.setPreferredSize(new Dimension(220, 1000));
    descrBox.setMinimumSize(new Dimension(200, 200));

    hBox.add(descrBox);
    hBox.add(Box.createHorizontalStrut(10));
    JScrollPane visitTablePane = new JScrollPane(stTable);
    visitTablePane.setPreferredSize(new Dimension(1000, 1000));
    visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    hBox.add(visitTablePane);
    hBox.add(Box.createHorizontalStrut(20));

    Box totalBox = Box.createVerticalBox();
    totalBox.add(Box.createVerticalStrut(30));
    totalBox.add(hBox);
    totalBox.add(Box.createVerticalStrut(30));

    setLayout(new BorderLayout());
    add(totalBox, BorderLayout.CENTER);

}
项目:jmt    文件:VisitsPanel.java   
/**
 * Set up the panel contents and layout
 */
private void initComponents() {

    visitTable = new VisitTable();

    JPanel totalBox = new JPanel(new BorderLayout(10, 10));

    //Horizontal box containing Description label and buttons
    JLabel descrLabel = new JLabel(DESCRIPTION_VISITS);
    JPanel descrBox = new JPanel(new BorderLayout());
    descrBox.setPreferredSize(new Dimension(200, 1000));
    descrBox.add(descrLabel, BorderLayout.NORTH);

    JScrollPane visitTablePane = new JScrollPane(visitTable);
    visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    totalBox.add(visitTablePane, BorderLayout.CENTER);
    totalBox.add(descrBox, BorderLayout.WEST);

    setLayout(new BorderLayout());
    add(totalBox, BorderLayout.CENTER);
    add(Box.createVerticalStrut(30), BorderLayout.NORTH);
    add(Box.createVerticalStrut(30), BorderLayout.SOUTH);
    add(Box.createHorizontalStrut(20), BorderLayout.EAST);
    add(Box.createHorizontalStrut(20), BorderLayout.WEST);

}
项目:bitnym    文件:ProofView.java   
public ProofView() {
    super();

    GridBagConstraints gbc = new GridBagConstraints();
    GridBagLayout layout = new GridBagLayout();
    this.setLayout(layout);

    display = new JTextArea(16, 58);
    display.setEditable(false);

    scroll = new JScrollPane(display);
    scroll.setVerticalScrollBarPolicy ( ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS );
    this.add(scroll);

}
项目:jmt    文件:DispQQPlotMatrix.java   
public DispQQPlotMatrix(ModelWorkloadAnalysis m, int clustering) {
    super(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.model = m;
    this.setPreferredSize(new Dimension(420, 420));
    panel = new DispersionPanel(model);
    panel.setPreferredSize(new Dimension(DispersionPanel.WIDTH_TOT * model.getMatrix().getNumVariables(), DispersionPanel.HEIGHT_TOT
            * model.getMatrix().getNumVariables()));
    this.setViewportView(panel);
    addListener();
}
项目:jmt    文件:DispKMeanMatrix.java   
public DispKMeanMatrix(WorkloadAnalysisSession session, int clustering) {
    /* Richiamo il costruttore della classe JScorllPanel impostando le barre di scorrimento solo se necessarie */
    super(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.model = (ModelWorkloadAnalysis) session.getDataModel();
    this.session = session;
    /* Settaggio delle proprieta' del pannello di scroll */
    this.setPreferredSize(new Dimension(420, 420));
    /* Creazione e aggiunta del Pannello di visualizzazione della matrice di dispersione */
    panel = new DispersionPanel(model, clustering);
    panel.setPreferredSize(new Dimension(DispersionPanel.WIDTH_TOT * model.getMatrix().getNumVariables(), DispersionPanel.HEIGHT_TOT
            * model.getMatrix().getNumVariables()));
    this.setViewportView(panel);
}
项目:Logisim    文件:PlaRomData.java   
public int editWindow() {
    this.drawing = new PlaRomPanel(this);
    panel = new JScrollPane(this.drawing, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    panel.setBorder(null);
    if (this.drawing.getPreferredSize().getWidth() >= (int) (screenSize.width * 0.75))
        panel.setPreferredSize(
                new Dimension((int) (screenSize.width * 0.75), (int) panel.getPreferredSize().getHeight()));
    if (this.drawing.getPreferredSize().getHeight() >= (int) (screenSize.height * 0.75))
        panel.setPreferredSize(
                new Dimension((int) panel.getPreferredSize().getWidth(), (int) (screenSize.height * 0.75)));
    return JOptionPane.showOptionDialog(null, panel, Strings.getter("ProgrammableGeneratorComponent").get(),
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, this.options, null);
}
项目:jmt    文件:DispFuzzyMatrix.java   
public DispFuzzyMatrix(WorkloadAnalysisSession m, int clustering) {
    /* Richiamo il costruttore della classe JScorllPanel impostando le barre di scorrimento solo se necessarie */
    super(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.model = (ModelWorkloadAnalysis) m.getDataModel();
    session = m;
    /* Settaggio delle proprieta' del pannello di scroll */
    this.setPreferredSize(new Dimension(420, 420));
    /* Creazione e aggiunta del Pannello di visualizzazione della matrice di dispersione */
    panel = new DispersionPanel(model, clustering);
    panel.setPreferredSize(new Dimension(DispersionPanel.WIDTH_TOT * model.getMatrix().getNumVariables(), DispersionPanel.HEIGHT_TOT
            * model.getMatrix().getNumVariables()));
    this.setViewportView(panel);
}
项目:jmt    文件:DispMatrix.java   
public DispMatrix(ModelWorkloadAnalysis m) {
    /* Richiamo il costruttore della classe JScorllPanel impostando le barre di scorrimento solo se necessarie */
    super(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.model = m;
    /* Settaggio delle proprieta' del pannello di scroll */
    this.setPreferredSize(new Dimension(420, 420));
    /* Creazione e aggiunta del Pannello di visualizzazione della matrice di dispersione */
    panel = new DispersionPanel(model);
    panel.setPreferredSize(new Dimension(DispersionPanel.WIDTH_TOT * model.getMatrix().getNumVariables(), DispersionPanel.HEIGHT_TOT
            * model.getMatrix().getNumVariables()));
    this.setViewportView(panel);
    addListener();
}
项目:Logisim    文件:ScrollPanel.java   
public ScrollPanel(LogFrame frame) {
    super(frame);
    this.table = new TablePanel(frame);
    JScrollPane pane = new JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    pane.setVerticalScrollBar(table.getVerticalScrollBar());
    setLayout(new BorderLayout());
    add(pane);
}
项目:jmt    文件:DispersionFuzzyPanel.java   
public DispersionFuzzyPanel(WorkloadAnalysisSession session, int clustering, int clusters) {
    this.setLayout(new BorderLayout());
    this.clusters = clusters;
    matrix = new DispFuzzyMatrix(session, -1);
    this.add(matrix, BorderLayout.CENTER);
    matrix.setClustering(clustering, clusters);
    this.add(new JScrollPane(new myPanel(), ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER),
            BorderLayout.EAST);
}
项目:jmt    文件:FuzzyInfoClustering.java   
private JScrollPane getUpperTable() {
    clusteringFinalTable = new JTable(new clustDetModel(infos.numElem, infos.percent));
    clusteringFinalTable.setSelectionBackground(new Color(83, 126, 126));
    clusteringFinalTable.setSelectionForeground(Color.BLACK);
    clusteringFinalTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    return new JScrollPane(clusteringFinalTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}
项目:openvisualtraceroute    文件:PacketDetailPanel.java   
/**
 * Constructor
 * @param services
 */
@SuppressWarnings("serial")
public PacketDetailPanel(final ServiceFactory services) {
    super(services);
    setPreferredSize(new Dimension(getPreferredSize().width, 250));
    _details = new JTextPane() {
        @Override
        public boolean getScrollableTracksViewportWidth() {
            return getUI().getPreferredSize(this).width <= getParent().getSize().width;
        }
    };
    final JScrollPane scroll = new JScrollPane(_details, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    add(scroll, BorderLayout.CENTER);
}
项目:jmt    文件:TextualPanel.java   
private void initComponents() {
    Box vBox = Box.createVerticalBox();
    Box hBox = Box.createHorizontalBox();
    Box h2Box = Box.createHorizontalBox();
    JLabel descrLabel = new JLabel(DESCRIPTION_PANEL);
    button_save = new JButton(ACTION_SAVE);
    button_save.setEnabled(false);

    synView = new JTextPane();
    synView.setContentType("text/html");
    synView.setEditable(false);

    synScroll = new JScrollPane(synView);
    synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    vBox.add(Box.createVerticalStrut(30));
    vBox.add(h2Box);
    vBox.add(Box.createVerticalStrut(30));
    vBox.add(synScroll);
    vBox.add(Box.createVerticalStrut(30));
    h2Box.add(descrLabel);
    h2Box.add(button_save);
    hBox.add(Box.createHorizontalStrut(20));
    hBox.add(vBox);
    hBox.add(Box.createHorizontalStrut(20));
    this.setLayout(new GridLayout(1, 1));
    this.add(hBox);
    synView.setText("<html><body><center><font face=\"bold\" size=\"3\">Burstiness values will be here displayed once you solve the problem.</font></center></body></html>");
}
项目:jmt    文件:SectorsGraphicPanel.java   
@Override
public void redraw() {
    // Redraws only if data has changed - Bertoli Marco
    if (!redrawNeeded)
        return;

    if (data.hasResults() && data.areResultsOK()
            && data.getResults().getSaturationSectors().size() > 0) {
        if (data.getClasses() == 2) {
            this.removeAll();
            s2dp = new Sectors2DGraph(data);
            this.setLayout(new BorderLayout());
            this.add(new JabaCanvas(s2dp), BorderLayout.CENTER);
            this.add(new JLabel(JabaConstants.DESCRIPITION_GRAPH),
                    BorderLayout.PAGE_END);
            repaint();
        } else if (data.getClasses() == 3) {
            this.removeAll();
            Sectors3DGraph s3dp = new Sectors3DGraph(data);
            this.setLayout(new BorderLayout());
            this.add(new JabaCanvas(s3dp), BorderLayout.CENTER);
            this.add(new JLabel(JabaConstants.DESCRIPITION_GRAPH),
                    BorderLayout.PAGE_END);
            repaint();
        }
    } else {
        this.removeAll();
        JEditorPane synView = new JTextPane();
        synView.setContentType("text/html");
        synView.setEditable(false);
        JScrollPane synScroll = new JScrollPane(synView);
        synScroll
                .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        synScroll
                .setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
        synView.setText("<html><body><center><font face=\"bold\" size=\"3\">Saturation Sectors will be here displayed once you solve the model.</font></center></body></html>");
        this.add(synScroll, BorderLayout.CENTER);
    }
    redrawNeeded = false;
}
项目:jmt    文件:ServiceDemandsPanel.java   
/**
 * Set up the panel contents and layout
 */
private void initComponents() {

    stTable = new STTable();

    /* and now some Box black magic */

    Box hBox = Box.createHorizontalBox();
    hBox.add(Box.createHorizontalStrut(20));
    //Horizontal box containing Description label and buttons
    Box descrBox = Box.createVerticalBox();
    descrBox.add(new JLabel(DESCRIPTION_SERVICEDEMANDS));
    descrBox.add(Box.createHorizontalStrut(10));
    descrBox.add(new JButton(SWITCH_TO_ST_V));
    descrBox.setPreferredSize(new Dimension(220, 1000));
    descrBox.setMinimumSize(new Dimension(200, 200));

    hBox.add(descrBox);
    hBox.add(Box.createHorizontalStrut(10));
    JScrollPane visitTablePane = new JScrollPane(stTable);
    visitTablePane.setPreferredSize(new Dimension(1000, 1000));
    visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    hBox.add(visitTablePane);
    hBox.add(Box.createHorizontalStrut(20));

    Box totalBox = Box.createVerticalBox();
    totalBox.add(Box.createVerticalStrut(30));
    totalBox.add(hBox);
    totalBox.add(Box.createVerticalStrut(30));

    setLayout(new BorderLayout());
    add(totalBox, BorderLayout.CENTER);

}