protected JScrollBar getScrollBar() { if(popupScrollBar == null) { popupScrollBar = new JScrollBar(JScrollBar.VERTICAL); popupScrollBar.addAdjustmentListener(new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent e) {
/** * Creates a new {@code ScrollingSwingTerminal} with customizable settings. * @param deviceConfiguration How to configure the terminal virtual device * @param fontConfiguration What kind of fonts to use * @param colorConfiguration Which color schema to use for ANSI colors */ @SuppressWarnings({"SameParameterValue", "WeakerAccess"}) public ScrollingSwingTerminal( TerminalEmulatorDeviceConfiguration deviceConfiguration, SwingTerminalFontConfiguration fontConfiguration, TerminalEmulatorColorConfiguration colorConfiguration) { this.scrollBar = new JScrollBar(JScrollBar.VERTICAL); this.swingTerminal = new SwingTerminal( deviceConfiguration, fontConfiguration, colorConfiguration, new ScrollController()); setLayout(new BorderLayout()); add(swingTerminal, BorderLayout.CENTER); add(scrollBar, BorderLayout.EAST); this.scrollBar.setMinimum(0); this.scrollBar.setMaximum(20); this.scrollBar.setValue(0); this.scrollBar.setVisibleAmount(20); this.scrollBar.addAdjustmentListener(new ScrollbarListener()); this.scrollModelUpdateBySystem = false; }
private JScrollBar sb1 = new JScrollBar(){ @Override public Dimension getPreferredSize() { return new Dimension( super.getPreferredSize().width, ta1.getPreferredSize().height); } };
@Override JPanel initSwingComponent() { JPanel jsp = new JPanel(); verticalSB = new JScrollBar(JScrollBar.VERTICAL); horizontalSB = new JScrollBar(JScrollBar.HORIZONTAL); jsp.add(verticalSB); jsp.add(horizontalSB); jsp.setLayout(null); // We do the layout in the peer directly. return jsp; }
/** * Create the panel editing the time (hour, min, sec). * * @return the panel editing the time (hour, min, sec) */ private JPanel createHourPanel() { JPanel hourPanel = new JPanel(new GridBagLayout()); hourTextField = new JTextField(3); hourUpDn = new JScrollBar(); addSelector(hourPanel, hourTextField, hourUpDn, 0, "Hour:", Calendar.HOUR_OF_DAY, 'H', 23); minuteTextField = new JTextField(3); minuteUpDn = new JScrollBar(); addSelector(hourPanel, minuteTextField, minuteUpDn, 3, "Min.:", Calendar.MINUTE, 'M', 59); secondTextField = new JTextField(3); secondUpDn = new JScrollBar(); addSelector(hourPanel, secondTextField, secondUpDn, 6, "Sec.:", Calendar.SECOND, 'S', 59); return hourPanel; }
protected void createScrollbar() { $objectMap.put("scrollbar", scrollbar = new JScrollBar()); scrollbar.setName("scrollbar"); SwingUtil.setComponentHeight(scrollbar,400); }
protected JScrollBar createScrollBar() { JScrollBar scrollBar = new JScrollBar(); scrollBar.setUI(new FindResultScrollBarUI()); return scrollBar; }
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; }
@Override JScrollBar initSwingComponent() { Scrollbar sb = getAWTComponent(); int orientation = sb.getOrientation(); int swingOrientation; if (orientation == Scrollbar.HORIZONTAL) { swingOrientation = JScrollBar.HORIZONTAL; } else { assert orientation == Scrollbar.VERTICAL; swingOrientation = JScrollBar.VERTICAL; } return new JScrollBar(swingOrientation); }
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; }
private 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 class TouchApp extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { JPanel swingContent = new JPanel(); swingContent.add(new JButton("Hello world")); swingContent.add(new JScrollBar()); BorderPane content = new BorderPane(); SwingNode swingNode = new SwingNode(); swingNode.setContent(swingContent); content.setCenter(swingNode); Scene scene = new Scene(content); scene.setOnTouchPressed((e) -> { System.out.println(e); }); primaryStage.setScene(scene); primaryStage.show(); } }
/** Initialize full support for horizontal scrolling. */ private void initializeTreeScrollSupport() { scrollPane = new JScrollPane(); scrollPane.setName("TreeTableView.scrollpane"); //NOI18N scrollPane.setBorder(BorderFactory.createEmptyBorder()); scrollPane.setViewportBorder(BorderFactory.createEmptyBorder()); if (UIManager.getColor("Table.background") != null) { // NOI18N scrollPane.getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N } hScrollBar = new JScrollBar(JScrollBar.HORIZONTAL); hScrollBar.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE); hScrollBar.setVisible(false); listener = new ScrollListener(); treeTable.addPropertyChangeListener(listener); scrollPane.getViewport().addComponentListener(listener); tree.addPropertyChangeListener(listener); hScrollBar.getModel().addChangeListener(listener); }
/** Initialize full support for horizontal scrolling. */ private void initializeTreeScrollSupport() { scrollPane = new JScrollPane(); scrollPane.setName("TreeTableView.scrollpane"); //NOI18N scrollPane.setBorder(BorderFactory.createEmptyBorder()); scrollPane.setViewportBorder(BorderFactory.createEmptyBorder()); if (UIManager.getColor("Table.background") != null) { // NOI18N scrollPane.getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N } hScrollBar = new JScrollBar(JScrollBar.HORIZONTAL); hScrollBar.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE); hScrollBar.setVisible(false); listener = new ScrollListener(); treeTable.addPropertyChangeListener(listener); scrollPane.getViewport().addComponentListener(listener); tree.addPropertyChangeListener(listener); hScrollBar.getModel().addChangeListener(listener); }
private void createScrollBars() { this.horizontalScrollBar = new JScrollBar(JScrollBar.HORIZONTAL, 0, 0, 0, 0); this.horizontalScrollBar.setBlockIncrement(this.configurationContext.getCellWidth()); this.horizontalScrollBar.setUnitIncrement(this.configurationContext.getCellWidth()); this.verticalScrollBar = new JScrollBar(JScrollBar.VERTICAL, 0, 0, 0, 0); this.verticalScrollBar.setBlockIncrement(this.configurationContext.getCellHeight()); this.verticalScrollBar.setUnitIncrement(this.configurationContext.getCellHeight()); }
/** Initialize full support for horizontal scrolling. */ private void initializeTreeScrollSupport() { scrollPane = new JScrollPane(); scrollPane.setName("TreeTableView.scrollpane"); //NOI18N scrollPane.setBorder(BorderFactory.createEmptyBorder()); scrollPane.setViewportBorder(BorderFactory.createEmptyBorder()); if (UIManager.getColor("Table.background") != null) { // NOI18N scrollPane.getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N } hScrollBar = new JScrollBar(JScrollBar.HORIZONTAL); hScrollBar.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE); hScrollBar.setVisible(false); listener = new ScrollListener(); treeTable.addPropertyChangeListener(listener); scrollPane.getViewport().addComponentListener(listener); tree.addPropertyChangeListener(listener); hScrollBar.getModel().addChangeListener(listener); }
private JPanel createTargetPanel() { targetNodesModel = new DefaultComboBoxModel<>(); targetNodes = new JComboBox<>(targetNodesModel); targetNodes.setPrototypeDisplayValue(""); // $NON-NLS-1$ // Bug 56303 fixed the width of combo list JPopupMenu popup = (JPopupMenu) targetNodes.getUI().getAccessibleChild(targetNodes, 0); // get popup element JScrollPane scrollPane = findScrollPane(popup); if(scrollPane != null) { scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL)); // add scroll pane if label element is too long scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); } targetNodes.setActionCommand(CHANGE_TARGET); // Action listener will be added later JLabel label = new JLabel(JMeterUtils.getResString("proxy_target")); // $NON-NLS-1$ label.setLabelFor(targetNodes); HorizontalPanel panel = new HorizontalPanel(); panel.add(label); panel.add(targetNodes); return panel; }
private static void initScrollBars(JPanel renderPane) { horizontalScroll = new JScrollBar(JScrollBar.HORIZONTAL); renderPane.add(horizontalScroll, BorderLayout.SOUTH); verticalScroll = new JScrollBar(JScrollBar.VERTICAL); renderPane.add(verticalScroll, BorderLayout.EAST); horizontalScroll.addAdjustmentListener(e -> { if (EditorScreen.instance().getMapComponent().isLoading()) { return; } Point2D newFocus = new Point2D.Double(horizontalScroll.getValue(), Game.world().camera().getFocus().getY()); Game.world().camera().setFocus(newFocus); }); verticalScroll.addAdjustmentListener(e -> { if (EditorScreen.instance().getMapComponent().isLoading()) { return; } Point2D newFocus = new Point2D.Double(Game.world().camera().getFocus().getX(), verticalScroll.getValue()); Game.world().camera().setFocus(newFocus); }); }
/** * Creates a scroll widget. * @param scene */ public SwingScrollWidget (Scene scene) { super (scene); setLayout (new SwingScrollWidget.ScrollLayout ()); setCheckClipping (true); viewport = new Widget (scene); viewport.setCheckClipping (true); addChild (viewport); verticalScroll = new JScrollBar (JScrollBar.VERTICAL); verticalScroll.setUnitIncrement (16); verticalScroll.setBlockIncrement (64); verticalWidget = new ComponentWidget (scene, verticalScroll); horizontalScroll = new JScrollBar (JScrollBar.HORIZONTAL); horizontalScroll.setUnitIncrement (16); horizontalScroll.setBlockIncrement (64); horizontalWidget = new ComponentWidget (scene, horizontalScroll); }
/** * Creates a scroll widget. * @param scene */ public SwingScrollWidget (Scene scene) { super (scene); setLayout (new SwingScrollWidget.ScrollLayout ()); setCheckClipping (true); viewport = new Widget (scene); viewport.setCheckClipping (true); addChild (viewport); verticalScroll = new JScrollBar (JScrollBar.VERTICAL); verticalScroll.setUnitIncrement (16); verticalScroll.setBlockIncrement (64); verticalWidget = new ComponentWidget (scene, verticalScroll); horizontalScroll = new JScrollBar (JScrollBar.HORIZONTAL); horizontalScroll.setUnitIncrement (16); horizontalScroll.setBlockIncrement (64); horizontalWidget = new ComponentWidget (scene, horizontalScroll); }