Package javax.swing

Examples of javax.swing.JScrollPane$AccessibleJScrollPane


    JTextArea textArea = new JTextArea(infoText);
    textArea.setEditable(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);

    JScrollPane scrollPane = new JScrollPane(textArea);

    scrollPane.setPreferredSize(new Dimension(width,150));

    Object[] msg = {header,scrollPane};
    JOptionPane.showMessageDialog(this,msg,Localizer.getLocalization(Localizer.I18N_INFO),JOptionPane.INFORMATION_MESSAGE);
  }
View Full Code Here


    JPanel content = new JPanel(new BorderLayout());

    mScriptEditor = new BeanShellEditor();
    mScriptEditor.setText(mScriptSource);

    JScrollPane scrollPane = new JScrollPane(mScriptEditor);
    scrollPane.setBackground(Color.WHITE);
    LineNumberHeader header = new LineNumberHeader(mScriptEditor);
    scrollPane.setRowHeaderView(header);

    content.add(scrollPane, BorderLayout.CENTER);

    JPanel buttonp = new JPanel(new FlowLayout(FlowLayout.RIGHT));
View Full Code Here

    mButtonPanel.setLayout(new GridLayout(0, 4, 2, 2));
    mButtonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);


    // Make the buttonPanel scrollable
    JScrollPane pane = new JScrollPane(mButtonPanel);
    pane.setAlignmentX(Component.LEFT_ALIGNMENT);
    pane.getVerticalScrollBar().setUnitIncrement(73);
    pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    addMouseAdapterForHandCursorToComponent(pane);

    // Initialize the Panel for selecting toolBars visibility
    final JPanel tVisPanel = new JPanel();
    tVisPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
View Full Code Here

    // left list box
    JPanel listBoxPnLeft = new JPanel(new BorderLayout());
    mAllChannels = new ChannelJList(new DefaultListModel());
    mAllChannels.setCellRenderer(new ChannelListCellRenderer(true, true, true, true));

    listBoxPnLeft.add(new JScrollPane(mAllChannels), BorderLayout.CENTER);
/*
    mAllChannels.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        if ((mAllChannels.getModel().getSize() == 1)
            && (mAllChannels.getSelectedIndex() >= 0)
            && (mAllChannels.getSelectedValue() instanceof String)) {
          mAllChannels.setSelectedIndices(new int[] {});
        }
      }
    });
*/
    centerPn.add(listBoxPnLeft);

    mRightButton = new JButton(TVBrowserIcons.right(TVBrowserIcons.SIZE_LARGE));

    mRightButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        moveChannelsToRight();
      }
    });

    mLeftButton = new JButton(TVBrowserIcons.left(TVBrowserIcons.SIZE_LARGE));

    mLeftButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        moveChannelsToLeft();
      }
    });

    JPanel btnPanel = createButtonPn(mRightButton, mLeftButton);
    btnPanel.setBorder(BorderFactory.createEmptyBorder(0, Sizes
        .dialogUnitXAsPixel(3, btnPanel), 0, Sizes.dialogUnitXAsPixel(3,
        btnPanel)));
    listBoxPnLeft.add(btnPanel, BorderLayout.EAST);

    // right list box
    JPanel listBoxPnRight = new JPanel(new BorderLayout());
    SortableItemList channelList = new SortableItemList(new ChannelJList());

    mSubscribedChannels = channelList.getList();
    mFilter = new ChannelFilter();
    mSubscribedChannels.setCellRenderer(new FilteredChannelListCellRenderer(mFilter));

    // Register DnD on the lists.
    mDnDHandler = new ListDragAndDropHandler(mAllChannels, mSubscribedChannels, this);
    mDnDHandler.setPaintCueLine(false, true);

    // Register the listener for DnD on the lists.
    new DragAndDropMouseListener(mAllChannels, mSubscribedChannels, this,
        mDnDHandler);
    mSubscribedChannelListener = new DragAndDropMouseListener(
        mSubscribedChannels, mAllChannels, this, mDnDHandler);

    restoreForPopup();

    listBoxPnRight.add(new JScrollPane(mSubscribedChannels),
        BorderLayout.CENTER);

    final JButton configureChannels = new JButton(mLocalizer.msg(
        "configSelectedChannels", "Configure selected channels"));
    configureChannels.setEnabled(false);
View Full Code Here

      }
    });

    mFindAsYouType = new TextComponentFindAction(mInfoEP, true);

    final JScrollPane scrollPane = new JScrollPane(mInfoEP);
    scrollPane.getVerticalScrollBar().setUnitIncrement(30);

    // ScrollActions
    mUpAction = new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
        scrollPane.getVerticalScrollBar().setValue(
            scrollPane.getVerticalScrollBar().getValue()
                - scrollPane.getVerticalScrollBar().getUnitIncrement());
      }
    };

    mDownAction = new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
        scrollPane.getVerticalScrollBar().setValue(
            scrollPane.getVerticalScrollBar().getValue()
                + scrollPane.getVerticalScrollBar().getUnitIncrement());
      }
    };

    mPluginsPane = new JTaskPane();
    mPluginsPane.add(mFunctionGroup);

    mActionsPane = new JScrollPane(mPluginsPane);

    mConfigBtn = new JButton(mLocalizer.msg("config", "Configure view"));
    mConfigBtn.setIcon(TVBrowserIcons.preferences(TVBrowserIcons.SIZE_SMALL));

    ButtonBarBuilder2 buttonBuilder = new ButtonBarBuilder2();

    buttonBuilder.addButton(mConfigBtn);
    mConfigBtn.setVisible(showSettings);

    if (pluginsSize == null) {
      mActionsPane.setPreferredSize(new Dimension(250, 500));
    } else {
      mActionsPane.setPreferredSize(pluginsSize);
    }

    if (ProgramInfo.getInstance().getSettings().getShowFunctions()) {
      JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
      split.setDividerSize(5);
      split.setContinuousLayout(true);
      split.setDividerLocation(mActionsPane.getPreferredSize().width + 1);
      split.setLeftComponent(mActionsPane);
      split.setRightComponent(scrollPane);
      mMainPanel.add(split, BorderLayout.CENTER);
      mFindAsYouType.installKeyListener(split);
    } else {
      final JButton functions = new JButton(mLocalizer.msg("functions",
          "Functions"));
      functions.setFocusable(false);

      functions.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
          if (e.getClickCount() == 1) {
            JPopupMenu popupMenu = PluginProxyManager.createPluginContextMenu(
                mProgram, ProgramInfoProxy.getInstance());
            popupMenu.show(functions, e.getX(), e.getY()
                - popupMenu.getPreferredSize().height);
          }
        }
      });

      buttonBuilder.addUnrelatedGap();
      buttonBuilder.addButton(functions);
      mMainPanel.add(scrollPane, BorderLayout.CENTER);
    }

    // buttons
    JPanel buttonPn = new JPanel(new BorderLayout(0, 5));
    buttonPn.add(mFindAsYouType.getSearchBar(), BorderLayout.NORTH);
    buttonPn.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));

    mMainPanel.add(buttonPn, BorderLayout.SOUTH);

    mConfigBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        exit();
        MainFrame.getInstance().showSettingsDialog(SettingsItem.PROGRAMINFO);
      }
    });

    mHighlight = new JCheckBox(mLocalizer
        .msg("highlight", "Highlight favorite"), ProgramInfo.getInstance()
        .getSettings().getHighlightFavorite());
    mHighlight.addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {
        ProgramInfo.getInstance().getSettings().setHighlightFavorite(
            mHighlight.isSelected());
        highlightFavorites();
      }
    });
    buttonBuilder.addUnrelatedGap();
    buttonBuilder.addFixed(mHighlight);

    mCloseBtn = new JButton(Localizer.getLocalization(Localizer.I18N_CLOSE));
    mCloseBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        exit();
      }
    });

    buttonBuilder.addGlue();
    buttonBuilder.addButton(mCloseBtn);

    buttonPn.add(buttonBuilder.getPanel(), BorderLayout.SOUTH);

    /*
     * The action for the search button in the function panel.
     */
    final Action searchAction = new AbstractAction() {
      private static final long serialVersionUID = 1L;

      public void actionPerformed(ActionEvent e) {
        // Open the SearchPanel
        if (mFindAsYouType.getCloseButton().isVisible()) {
          mFindAsYouType.interrupt();
          mFindAsYouType.getSearchBar().setVisible(false);
          mFindAsYouType.getCloseButton().setVisible(false);
        } else {
          mFindAsYouType.showSearchBar();
        }
      }
    };

    searchAction.putValue(Action.SMALL_ICON, TVBrowserIcons
        .search(TVBrowserIcons.SIZE_SMALL));
    searchAction.putValue(Action.ACTION_COMMAND_KEY, "action");
    searchAction.putValue(Action.NAME, mLocalizer.msg("search", "Search Text"));

    mSearchMenu = new ActionMenu(searchAction);

    mFindAsYouType.installKeyListener(scrollPane);
    mFindAsYouType.installKeyListener(mMainPanel);
    mFindAsYouType.installKeyListener(mConfigBtn);
    mFindAsYouType.installKeyListener(mCloseBtn);
    mFindAsYouType.installKeyListener(buttonPn);
    mFindAsYouType.installKeyListener(mPluginsPane);
    mFindAsYouType.installKeyListener(mActionsPane);
    mFindAsYouType.installKeyListener(mFunctionGroup);
    mFindAsYouType.installKeyListener(mActionsPane.getVerticalScrollBar());
    mFindAsYouType.installKeyListener(scrollPane.getVerticalScrollBar());

    mFindAsYouType.getCloseButton().addComponentListener(
        new ComponentAdapter() {
          @Override
          public void componentHidden(ComponentEvent e) {
            if (mTextSearch != null) {
              mTextSearch.setText(mLocalizer.msg("search", "Search Text"));
            }
            searchAction.putValue(Action.NAME, mLocalizer.msg("search",
                "Search Text"));
          }

          @Override
          public void componentShown(ComponentEvent e) {
            if (mTextSearch != null) {
              mTextSearch.setText(mLocalizer.msg("closeSearch",
                  "Close search bar"));
            }
            searchAction.putValue(Action.NAME, mLocalizer.msg("closeSearch",
                "Close search bar"));
          }
        });

    // Scroll to the beginning
    Runnable runnable = new Runnable() {
      public void run() {
        scrollPane.getVerticalScrollBar().setValue(0);
      }
    };
    SwingUtilities.invokeLater(runnable);

    if (ProgramInfo.getInstance().getSettings().getShowSearch()) {
View Full Code Here

          }
        }
      }
    });

    panel.add(new JScrollPane(infoPanel), cc.xyw(1,1,2));

    JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK));

    ok.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
View Full Code Here

    setLayout(new BorderLayout());
  }

  protected void setUpFinal() {
    removeAll();
    final JScrollPane hp = makePanel();
    add(hp, BorderLayout.CENTER);
   
    if (m_showClassCombo) {
      Vector<String> atts = new Vector<String>();
      for (int i = 0; i < m_visualizeDataSet.numAttributes(); i++) {
View Full Code Here

    Dimension d = new Dimension(830, gridHeight * 100);
    hp.setMinimumSize(d);
    hp.setMaximumSize(d);
    hp.setPreferredSize(d);
   
    JScrollPane scroller = new JScrollPane(hp);

    return scroller;
  }
View Full Code Here

    if (request.compareTo("Show summaries") == 0) {
      try {
  // popup matrix panel
  if (!m_framePoppedUp) {
    m_framePoppedUp = true;
    final JScrollPane holderP = makePanel();

    final javax.swing.JFrame jf =
      new javax.swing.JFrame("Visualize");
    jf.setSize(800,600);
    jf.getContentPane().setLayout(new BorderLayout());
View Full Code Here

  protected void setUpFinal() {
    setUpResultHistory();
    JPanel holder = new JPanel();
    holder.setLayout(new BorderLayout());
    JScrollPane js = new JScrollPane(m_outText);
    js.setBorder(BorderFactory.createTitledBorder("Text"));
    holder.add(js, BorderLayout.CENTER);
    holder.add(m_history, BorderLayout.WEST);

    add(holder, BorderLayout.CENTER);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JScrollPane$AccessibleJScrollPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.