private Insets getInnerInsets() { Insets res = super.getInsets(); if( null == res ) { res = new Insets(0,0,0,0); } return res; }
private Insets getInnerInsets() { Insets res = super.getInsets(); if( null == res ) { res = new Insets(0,0,0,0); } return res; }
public static boolean isValidCellBoundary(Component aTarget) { JScrollPane scroll = getFirstScrollPane(aTarget); if (scroll != null && (scroll.getHorizontalScrollBar() == null || !scroll.getHorizontalScrollBar().isVisible())) { Point rightOnScroll = SwingUtilities.convertPoint(aTarget, new Point(aTarget.getWidth(), 1), scroll); int scrollRightBoundary = (scroll.getWidth() - (scroll.getInsets() != null ? scroll.getInsets().right : 0)); return (scrollRightBoundary - rightOnScroll.x) > MultiLevelHeader.PICK_MARGIN_SIZE; } return true; } }
protected JScrollPane _createList() { JScrollPane list = new JScrollPane(); _accessControlTable = new AccessControlTable(_id, _config); JViewport viewport = list.getViewport(); viewport.add(_accessControlTable); viewport.setBackground(Color.white); list.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // Set preferred size Insets insets = list.getInsets(); Dimension scrollBarSize = list.getVerticalScrollBar().getPreferredSize(); Dimension tableSize = _accessControlTable.getPreferredSize(); int width = insets.left + scrollBarSize.width + tableSize.width + insets.right; list.setPreferredSize(new Dimension(width, DEFAULT_HEIGHT)); return list; }
protected JScrollPane _createList() { _parameterTable = new ParameterTable(_id, _config); _scrollPane = new JScrollPane(); JViewport viewport = _scrollPane.getViewport(); viewport.add(_parameterTable); viewport.setBackground(Color.white); _scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // Set preferred size Insets insets = _scrollPane.getInsets(); Dimension scrollBarSize = _scrollPane.getVerticalScrollBar().getPreferredSize(); Dimension tableSize = _parameterTable.getPreferredSize(); int width = insets.left + scrollBarSize.width + tableSize.width + insets.right; _scrollPane.setPreferredSize(new Dimension(width, DEFAULT_HEIGHT)); return _scrollPane; }
protected JScrollPane _createList() { JScrollPane scrollPane = new JScrollPane(); _sailTable = new SailTable(_id, _config); JViewport viewport = scrollPane.getViewport(); viewport.add(_sailTable); viewport.setBackground(Color.white); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // Set preferred size Insets insets = scrollPane.getInsets(); Dimension scrollBarSize = scrollPane.getVerticalScrollBar().getPreferredSize(); Dimension tableSize = _sailTable.getPreferredSize(); int width = insets.left + scrollBarSize.width + tableSize.width + insets.right; scrollPane.setPreferredSize(new Dimension(width, DEFAULT_HEIGHT)); return scrollPane; }
+ settingsPane.getInsets().right + 20, settingsPanel .getPreferredSize().height);
public void resizeAndRepaint() { filtersPanel.reconstructFiltersPanel(); int h = filtersPanel.getPreferredSize().height + scrollPane.getHorizontalScrollBar().getPreferredSize().height + scrollPane.getInsets().bottom + scrollPane.getInsets().top; int nbInvisible = 0; for (SearchFilter sf : filterModel.getFilters(true, true)) { if (sf.getTypeVisible() == TypeVisible.Invisible) { nbInvisible++; } } int diff = filterModel.getFilterCount(true) - filterModel.getFilterCount(false) - nbInvisible; if (diff > 0) { if (diff == 1) { informationPanel.setText(SearchMessages.getString("JSearchHeader.16")); //$NON-NLS-1$ } else { informationPanel.setText(SearchMessages.getString("JSearchHeader.17")); //$NON-NLS-1$ } informationPanel.setVisible(true); } else { informationPanel.setText(null); informationPanel.setVisible(false); } informationPanel.setPreferredSize(new Dimension(10, h)); this.setPreferredSize(new Dimension(10, h)); revalidate(); repaint(); }
public void stateChanged(ChangeEvent e) { // only proceed when we already know the containing scroll pane if (scrollPane == null) { return; } // determine the currently available size, subtracting the // insets occupied by borders Dimension newSize = scrollPane.getSize(); Insets insets = scrollPane.getInsets(); newSize.width -= (insets.left + insets.right); newSize.height -= (insets.top + insets.bottom); // fetch the currently set available size ClusterMap map = panel.getClusterMap(); RenderingProperties properties = map.getRenderingProperties(); Dimension currentSize = properties.getAvailableSize(); // see if the current size is valid and different if (newSize.width > 0 && newSize.height > 0 && !newSize.equals(currentSize)) { // apply the new available size properties.setAvailableSize(newSize); map.updateRenderer(); } } }
initialHeight = extentSize.height; Insets insets = scrollPane.getInsets(); initialWidth -= insets.left; initialWidth -= insets.right;
JBInsets.removeFrom(bounds, pane.getInsets());