javax.swing.JScrollPane.getInsets()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中javax.swing.JScrollPane.getInsets()方法的一些代码示例,展示了JScrollPane.getInsets()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.getInsets()方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:getInsets

JScrollPane.getInsets介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-explorer

private Insets getInnerInsets() {
  Insets res = super.getInsets();
  if( null == res ) {
    res = new Insets(0,0,0,0);
  }
  return res;
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

private Insets getInnerInsets() {
  Insets res = super.getInsets();
  if( null == res ) {
    res = new Insets(0,0,0,0);
  }
  return res;
}

代码示例来源:origin: com.eas.platypus/platypus-js-grid

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;
  }
}

代码示例来源:origin: org.openrdf/sesame

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;
}

代码示例来源:origin: org.openrdf/sesame

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;
}

代码示例来源:origin: org.openrdf/sesame

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;
}

代码示例来源:origin: MegaMek/megamek

+ settingsPane.getInsets().right + 20, settingsPanel
.getPreferredSize().height);

代码示例来源:origin: com.synaptix/SynaptixSwing

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();
}

代码示例来源:origin: info.aduna.clustermap/aduna-clustermap-core

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();
    }
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-designer

initialHeight = extentSize.height;
Insets insets = scrollPane.getInsets();
initialWidth -= insets.left;
initialWidth -= insets.right;

代码示例来源:origin: JetBrains/jediterm

JBInsets.removeFrom(bounds, pane.getInsets());

相关文章

JScrollPane类方法