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

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

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

JLayeredPane.getWidth介绍

暂无

代码示例

代码示例来源: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: edu.toronto.cs.savant/savant-core

@Override
  public void componentResized(ComponentEvent e) {
    Dimension dim = getSize();
    if (dim != null) {
      // TODO: The following shouldn't be necessary, but it seems to be.
      int expectedWidth = frameLandscape.getWidth();
      if (expectedWidth != graphPane.getWidth()) {
        Dimension goodSize = new Dimension(expectedWidth, graphPane.getHeight());
        graphPane.setPreferredSize(goodSize);
        graphPane.setSize(goodSize);
      }
      setLegendVisible(true);
    }
  }
});

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

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

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

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

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

/**
 * 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: org.fosstrak.hal/hal-impl-sim

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

代码示例来源: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: 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

ownerCompBounds = SwingUtilities.convertRectangle( ownerComp.getParent(), ownerCompBounds, pane );
int paneWidth = pane.getWidth();
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;
    oldViewHeight = newViewHeight;
  oldWidth = parentFrame.getFrameLandscape().getWidth();
  oldHeight = parentFrame.getFrameLandscape().getHeight();

相关文章