Package javax.swing

Examples of javax.swing.JScrollBar$ModelListener


  public void scrollPageLeft() {
    scrollPageHorizontal(-1);
  }

  private void scrollPageHorizontal(int direction) {
    JScrollBar scrollBar = getHorizontalScrollBar();
    int pos = scrollBar.getValue() + direction * getFullColumns() * mProgramTable.getColumnWidth();
    int max = scrollBar.getMaximum() - scrollBar.getVisibleAmount();
    if (pos > max) {
      pos = max;
    }
    if (pos < 0) {
      pos = 0;
    }
    scrollBar.setValue(pos);
  }
View Full Code Here


    HistoryStackElement newSite = new HistoryStackElement();
    newSite.mText = mEditorPane.getText();
    newSite.mSourcePath = mSourcePath;
    newSite.mSourceClass = mSourceClass;

    JScrollBar scrollBar = mScrollPane.getVerticalScrollBar();
    newSite.mVerticalScrollBarRelValue = ((double) scrollBar.getValue()) / ((double) scrollBar.getMaximum());

    mHistoryStack.push(newSite);

    mBackButton.setEnabled(true);
  }
View Full Code Here

    public ScrollBarUpdater (double updateScrollBarTo) {
      mUpdateScrollBarTo = updateScrollBarTo;
    }
   
    public void run() {
      JScrollBar bar = mScrollPane.getVerticalScrollBar();
      bar.setValue((int) (mUpdateScrollBarTo * bar.getMaximum()));
    }
View Full Code Here

        try {
            // Fix for the continuous scrolling issue (not very elegant..)
           
            JViewport vp = (JViewport) getParent();
            JScrollPane sp = (JScrollPane) vp.getParent();
            JScrollBar sb = sp.getVerticalScrollBar();
           
            if (increment != 0)
                sb.setUnitIncrement(increment);
        } catch (Exception e) {
            logger.warn("Could not set the incrememt for the scrollbar", e);
        }
    }
View Full Code Here

   
    public ViewScrollPane(View view) {
        super((JComponent) view.getViewComponent());

        this.component = view.getViewComponent();
        JScrollBar sb = getVerticalScrollBar();
       
        if (sb != null)
            sb.addAdjustmentListener(this);
    }
View Full Code Here

  /**
   * Create the console widget
   */
  public JConsole() {
    /* Add a scrollbar */
    scrollBar = new JScrollBar();
    scrollBar.addAdjustmentListener(new ScrollBarListener());
    addMouseWheelListener(new WheelListener());
    add(scrollBar);

    /* Construct the buffer */
 
View Full Code Here

        // Scroll up or down as necessary to keep selected row
        // viewable
        if (selectedRow >= 0) {
            int spheight = scrollPane.getHeight();
            JScrollBar sb = scrollPane.getVerticalScrollBar();
            int sv = sb.getValue();
            int paneheight = ((LayerPane) panes.get(selectedRow)).getHeight();
            int rowvalue = selectedRow * paneheight;
            // Don't reset scrollBar unless the selected row
            // is not in the viewable range
            if (!((rowvalue > sv) && (rowvalue < spheight + sv))) {
                sb.setValue(rowvalue);
            }
        }

        Object[] layerArray = layerList.toArray();
        int length = layerArray.length;
View Full Code Here

        text = Installer.resources.getString(key+os);
      } catch (MissingResourceException e1) {
        text = Installer.resources.getString(key);
      }
      tipPane.setText(text);
      JScrollBar sb = tipScroll.getVerticalScrollBar();
      if (sb!=null) sb.setValue(sb.getMinimum());
    }
View Full Code Here

  /**  Constructor, sets up AWT components  */
  public ATRView() {
    super();

    panel = new JPanel();
    scrollbar = new JScrollBar(JScrollBar.VERTICAL, 0, 1, 0, 1);
    destRect = new Rectangle();

    panel.setLayout(new BorderLayout());
    panel.add(this, BorderLayout.CENTER);
    panel.add(scrollbar, BorderLayout.EAST);
View Full Code Here

  /**  Constructor, sets up AWT components  */
  public ATRZoomView() {
    super();

    panel = new JPanel();
    scrollbar = new JScrollBar(JScrollBar.VERTICAL, 0, 1, 0, 1);
    destRect = new Rectangle();

    panel.setLayout(new BorderLayout());
    panel.add(this, BorderLayout.CENTER);
    panel.add(scrollbar, BorderLayout.EAST);
View Full Code Here

TOP

Related Classes of javax.swing.JScrollBar$ModelListener

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.