private void displayHorizontalScrollBarIfNecessary(JViewport viewPort) { Rectangle viewRect = viewPort.getViewRect(); Dimension viewSize = viewPort.getViewSize(); boolean isDisplayingHorizontalScrollBar = viewSize.getWidth() > viewRect.getWidth(); this.horizontalScrollBar.setVisible(isDisplayingHorizontalScrollBar); }
private void displayVerticalScrollBarIfNecessary(JViewport viewPort) { Rectangle viewRect = viewPort.getViewRect(); Dimension viewSize = viewPort.getViewSize(); boolean isDisplayingVerticalScrollBar = viewSize.getHeight() > viewRect.getHeight(); this.verticalScrollBar.setVisible(isDisplayingVerticalScrollBar); }
this.verticalScrollBar.setVisible(false); this.verticalScrollBar.setOpaque(false); this.verticalScrollBar.setUI(new MyScrollBarUI()); this.horizontalScrollBar.setVisible(false); this.horizontalScrollBar.setOpaque(false); this.horizontalScrollBar.setUI(new MyScrollBarUI());
@Override public void actionPerformed(ActionEvent e) { controlsVisible = !controlsVisible; horizontalSB.setVisible(controlsVisible); verticalSB.setVisible(controlsVisible); topPanel.setVisible(controlsVisible); } });
@Override public void setHorizontalScrollBarPolicy(int policy) { hideHScrollBar = (policy == JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); if (hideHScrollBar) { hScrollBar.setVisible(false); ((TreeTable) treeTable).setTreeHScrollingEnabled(false); } }
public void setHorizontalScrollBarPolicy(int policy) { hideHScrollBar = ( policy == JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); if ( hideHScrollBar ) { hScrollBar.setVisible( false ); ((TreeTable)treeTable).setTreeHScrollingEnabled( false ); } }
protected void updateScrollbarState(boolean hNeeded, boolean vNeeded) { horizontal.setEnabled(hNeeded); vertical .setEnabled(vNeeded); if (scrollbarsAlwaysVisible) { horizontalPanel.setVisible(true); vertical .setVisible(true); cornerBox .setVisible(true); } else { horizontalPanel.setVisible(hNeeded); vertical .setVisible(vNeeded); cornerBox .setVisible(hNeeded&&vNeeded); } }
public void setHorizontalScrollBarPolicy(int policy) { hideHScrollBar = ( policy == JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); if ( hideHScrollBar ) { hScrollBar.setVisible( false ); ((TreeTable)treeTable).setTreeHScrollingEnabled( false ); } }
protected void updateScrollbarState(boolean hNeeded, boolean vNeeded) { horizontal.setEnabled(hNeeded); vertical .setEnabled(vNeeded); if (scrollbarsAlwaysVisible) { horizontalPanel.setVisible(true); vertical .setVisible(true); cornerBox .setVisible(true); } else { horizontalPanel.setVisible(hNeeded); vertical .setVisible(vNeeded); cornerBox .setVisible(hNeeded&&vNeeded); } }
@Override @OnAwt public void setAllowRangeAxisScroll(boolean flag) { this.allowRangeAxisScroll = flag; JScrollBar scroll = getRangeAxisScroll(); scroll.setVisible(flag); }
@Override @OnAwt public void setAllowDomainAxisScroll(boolean flag) { this.allowDomainAxisScroll = flag; JScrollBar scroll = getDomainAxisScroll(); scroll.setVisible(flag); }
protected JScrollBar getScrollBar() { if (popupScrollBar == null) { popupScrollBar = new JScrollBar(Adjustable.VERTICAL); popupScrollBar.addAdjustmentListener(new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent e) { doLayout(); repaint(); } }); popupScrollBar.setVisible(false); } return popupScrollBar; }
protected JScrollBar getScrollBar() { if(popupScrollBar == null) { popupScrollBar = new JScrollBar(JScrollBar.VERTICAL); popupScrollBar.addAdjustmentListener(new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent e) { doLayout(); repaint(); } }); popupScrollBar.setVisible(false); } return popupScrollBar; }
public void remove(int index) { // can't remove the scrollbar ++index; super.remove(index); if(maximumVisibleRows >= getComponentCount()-1) { getScrollBar().setVisible(false); } }
@Override protected void addImpl(Component comp, Object constraints, int index) { super.addImpl(comp, constraints, index); if (maximumVisibleRows < getComponentCount() - 1) { getScrollBar().setVisible(true); } }
protected void addImpl(Component comp, Object constraints, int index) { super.addImpl(comp, constraints, index); if (maximumVisibleRows < getComponentCount() - 1) { getScrollBar().setVisible(true); } }
protected void addImpl(Component comp, Object constraints, int index) { super.addImpl(comp, constraints, index); if(maximumVisibleRows < getComponentCount()-1) { getScrollBar().setVisible(true); } }
@Override public void remove(int index) { // can't remove the scrollbar ++index; super.remove(index); if (maximumVisibleRows >= getComponentCount() - 1) { getScrollBar().setVisible(false); } }
public void remove(int index) { // can't remove the scrollbar ++index; super.remove(index); if (maximumVisibleRows >= getComponentCount() - 1) { getScrollBar().setVisible(false); } }
@Override public void run() { final boolean zoomed = rangeMin != 0 || rangeMax != elapsedGameLoops; final double factor = (double) ( elapsedGameLoops + 1 ) / ( rangeMax - rangeMin + 1 ); zoomFactorLabel.setText( Env.LANG.formatNumber( factor, 1 ) + "x" ); chartsCanvasScrollBar.getModel().setRangeProperties( rangeMin, rangeMax - rangeMin, 0, elapsedGameLoops, false ); chartsCanvasScrollBar.setUnitIncrement( Math.max( 1, ( rangeMax - rangeMin ) >> 7 ) ); chartsCanvasScrollBar.setBlockIncrement( Math.max( 1, ( rangeMax - rangeMin ) >> 2 ) ); zoomFactorLabel.setVisible( zoomed ); resetZoomButton.setEnabled( zoomed ); chartsCanvasScrollBar.setVisible( zoomed ); } };