javax.swing.JLayeredPane.getHeight()方法的使用及代码示例

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

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

JLayeredPane.getHeight介绍

暂无

代码示例

代码示例来源:origin: edu.toronto.cs.savant/savant-core

/**
 * Check to see if the frame needs to be resized. Only required if we're not
 * using scaledToFit mode, and thus have a pre-existing notion of what the
 * unit-height (or interval height) should be.
 *
 * @return true if pane needs to be resized
 */
@Override
public boolean needsToResize() {
  if (!scaledToFit) {
    int currentHeight = getHeight();
    int expectedHeight = (int) ((yMax - yMin) * unitHeight);
    expectedHeight = Math.max(expectedHeight, parentFrame.getFrameLandscape().getHeight());
    if (expectedHeight != currentHeight) {
      requestHeight(expectedHeight);
      return true;
    }
  }
  return false;
}

代码示例来源:origin: org.orbisgis/mapeditor

private void doUpdateMapControlSize() {
      mapControl.setBounds(0,0,layeredPane.getWidth(),layeredPane.getHeight());
      if(mapsManager.isVisible()) {
          Dimension mapsManagerPreferredSize = mapsManager.getMinimalComponentDimension();
          int hPos = layeredPane.getWidth() - Math.min(mapsManagerPreferredSize.width,layeredPane.getWidth());
          mapsManager.setBounds(hPos,0,Math.min(mapsManagerPreferredSize.width,layeredPane.getWidth()),Math.min(mapsManagerPreferredSize.height,layeredPane.getHeight()));
          mapsManager.revalidate();
      }
  }
/**

代码示例来源:origin: stackoverflow.com

@Override
public void componentResized(ComponentEvent e) {
  lblPane.setBounds(0, 0, layeredPane.getWidth(), layeredPane.getHeight());
  btnPane.setBounds(0, 0, layeredPane.getWidth(), layeredPane.getHeight());

代码示例来源:origin: org.japura/japura-gui

layeredPane.setBounds(x, y, width, height);
y = Math.min(layeredPane.getHeight() - dim.height, 0);
if (isFillMode()) {
 component.setBounds(0, 0, width, height);
} else {
 component.setBounds(0, y, width, layeredPane.getHeight() - y);
 modal.setBounds(0, y, width, layeredPane.getHeight() - y);
} else {
 modal.setBounds(0, 0, 0, 0);

代码示例来源:origin: org.fosstrak.hal/hal-impl-sim

pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;

代码示例来源:origin: org.fosstrak.hal/hal-impl-sim

public void mouseReleased(MouseEvent e) {
    JDialog aboutDialog = new JDialog(GraphicSimulator.this, guiTextConfig.getString("AboutDialogTitle"), true);
    Point pos = new Point();
    pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2;
    pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;
    aboutDialog.setLocation(pos);
    aboutDialog.setSize(getProperty("DialogWindowWidth"), getProperty("DialogWindowHeight"));
    aboutDialog.setTitle(guiTextConfig.getString("AboutDialogTitle"));
    JLabel text = new JLabel(guiTextConfig.getString("AboutDialogContent"));
    text.setHorizontalAlignment(JLabel.CENTER);
    aboutDialog.add(text);
    aboutDialog.setVisible(true);
  }
});

代码示例来源:origin: org.fosstrak.hal/hal-impl-sim

pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;

代码示例来源:origin: org.fosstrak.hal/hal-impl-sim

public void mouseReleased(MouseEvent e) {
    JDialog aboutDialog = new JDialog(GraphicSimulatorServer.this, guiTextConfig.getString("AboutDialogTitle"), true);
    Point pos = new Point();
    pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2;
    pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;
    aboutDialog.setLocation(pos);
    aboutDialog.setSize(getProperty("DialogWindowWidth"), getProperty("DialogWindowHeight"));
    aboutDialog.setTitle(guiTextConfig.getString("AboutDialogTitle"));
    JLabel text = new JLabel(guiTextConfig.getString("AboutDialogContent"));
    text.setHorizontalAlignment(JLabel.CENTER);
    aboutDialog.add(text);
    aboutDialog.setVisible(true);
  }
});

代码示例来源:origin: org.fosstrak.hal/hal-impl-sim

Point pos = new Point();
pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2;
pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;

代码示例来源:origin: org.fosstrak.hal/hal-impl-sim

/**
 * Shows the management simulator dialog for the selected antenna.
 */
private void showMgmtSimDialog() {
  // compute position of the dialog
  final Point pos = new Point();
  pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2;
  pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;
  
  String readPointName = selectedAntenna.getId();
  // create dialog if it does not already exists
  MgmtSimDialog mgmtSimDialog = mgmtSimDialogs.get(readPointName);
  if(mgmtSimDialog == null) {
    mgmtSimDialog = new MgmtSimDialog(readPointName, controller);
    mgmtSimDialogs.put(readPointName, mgmtSimDialog);
  }
  mgmtSimDialog.setLocation(pos);
  mgmtSimDialog.setModal(true);
  mgmtSimDialog.setVisible(true);
}

代码示例来源:origin: omegat-org/omegat

/**
 * Makes the alphabetical markers visible.
 */
public void showMarkers() {
  UIThreadsUtil.mustBeSwingThread();
  markers = createMarkers(getViewableSegmentLocations());
  if (markers.isEmpty()) {
    return;
  }
  setSize(parent.getWidth() - 1, parent.getHeight() - 1);
  parent.add(this, JLayeredPane.POPUP_LAYER, 0); // top most
  parent.validate();
  parent.repaint();
}

代码示例来源:origin: tinyMediaManager/tinyMediaManager

private void show() {
 frame.getLayeredPane().add(backgroundPanel, JLayeredPane.PALETTE_LAYER);
 imagePanel.setLocation(((frame.getLayeredPane().getWidth() - imagePanel.getWidth()) / 2),
   (frame.getLayeredPane().getHeight() - imagePanel.getHeight()) / 2);
 frame.getLayeredPane().add(imagePanel, JLayeredPane.POPUP_LAYER);
}

代码示例来源:origin: com.jidesoft/jide-oss

if (!isHeavyweightComponentEnabled()) {
  SwingUtilities.convertPointFromScreen(componentLocation, _layeredPane);
  if ((componentLocation.y + size.height > _layeredPane.getHeight())) {
    componentLocation.y = _layeredPane.getHeight() - size.height;

代码示例来源:origin: stackoverflow.com

JLayeredPane lp = JLayeredPane.getLayeredPaneAbove(f);
lp.setLayer(modalInterceptor, JLayeredPane.MODAL_LAYER.intValue());
modalInterceptor.setBounds(0, 0, lp.getWidth(), lp.getHeight());
modalInterceptor.addMouseListener(new MouseAdapter(){});
modalInterceptor.addMouseMotionListener(new MouseMotionAdapter(){});

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

int paneHeight = pane.getHeight();

代码示例来源:origin: edu.toronto.cs.savant/savant-core

boolean sameSize = prevSize != null && getSize().equals(prevSize) && parentFrame.getFrameLandscape().getWidth() == oldWidth && parentFrame.getFrameLandscape().getHeight() == oldHeight;
boolean sameRef = prevRef != null && lc.getReferenceName().equals(prevRef);
boolean withinScrollBounds = bufferedImage != null && scroller.getValue() >= getOffset() && scroller.getValue() < getOffset() + getViewportHeight() * 2;
  oldHeight = parentFrame.getFrameLandscape().getHeight();

相关文章