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

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

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

JDesktopPane.getHeight介绍

暂无

代码示例

代码示例来源:origin: chewiebug/GCViewer

public void actionPerformed(final ActionEvent e) {
    final JInternalFrame[] frames = gcViewer.getDesktopPane().getAllFrames();
    final DesktopManager desktopManager = gcViewer.getDesktopPane().getDesktopManager();
    for (int i=0; i<frames.length; i++) {
      final JInternalFrame frame = frames[i];
      desktopManager.deiconifyFrame(frame);
      try {
        frame.setMaximum(false);
      } 
      catch (PropertyVetoException e1) {
        e1.printStackTrace();
      }
      final int height = gcViewer.getDesktopPane().getHeight()/frames.length;
      desktopManager.setBoundsForFrame(frame, 0, height * i, gcViewer.getDesktopPane().getWidth(), height);
    }
  }
}

代码示例来源:origin: magefree/mage

private void updateCurrentFrameSize() {
  if (activeFrame != null) {
    activeFrame.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
  }
}

代码示例来源:origin: magefree/mage

activeFrame = frame;
desktopPane.moveToFront(frame);
activeFrame.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
activeFrame.revalidate();
activeFrame.activated();

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

@ScriptFunction(jsDoc = HEIGHT_JSDOC)
@Override
public int getHeight() {
  return super.getHeight();
}

代码示例来源:origin: de.sciss/scisslib

protected Rectangle calcOuterBounds()
{
  final Rectangle	outerBounds;
  final boolean	isMacOS = System.getProperty( "os.name" ).indexOf( "Mac OS" ) >= 0;
  if( desktop == null ) {
    outerBounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getBounds();
    if( isMacOS ) {
      outerBounds.y     += 22;
      outerBounds.width -= 80;
      outerBounds.height-= 22;
    }
  } else {
    outerBounds = new Rectangle( 0, 0, desktop.getWidth(), desktop.getHeight() );
  }
  return outerBounds;
}

代码示例来源:origin: xyz.cofe/docking-frames-core

public boolean isFullscreen( ScreenDockWindow window ){
  Rectangle bounds = window.getWindowBounds();
  return bounds.x <= 0 && bounds.y <= 0 && bounds.width + bounds.x >= desktop.getWidth() && bounds.height + bounds.y >= desktop.getHeight();
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

public boolean isFullscreen( ScreenDockWindow window ){
  Rectangle bounds = window.getWindowBounds();
  return bounds.x <= 0 && bounds.y <= 0 && bounds.width + bounds.x >= desktop.getWidth() && bounds.height + bounds.y >= desktop.getHeight();
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
  public void actionPerformed(ActionEvent e) {
    int desktopWidth = desktopPane.getWidth();
    int desktopHeight = desktopPane.getHeight();
    int windowCount = frameToTabMap.size();
    int windowHeight = desktopHeight / windowCount;
    List<TabData> tabs = tabbedContainer.getModel().getTabs();
    for (int windowIndex = 0; windowIndex < windowCount; windowIndex++) {
      TabData tab = tabs.get(windowIndex);
      JInternalFrame internalFrame = tabToFrameMap.get(tab);
      internalFrame.setBounds(0, windowIndex * windowHeight, desktopWidth, windowHeight);
    }
  }
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
  public void actionPerformed(ActionEvent e) {
    int desktopWidth = desktopPane.getWidth();
    int desktopHeight = desktopPane.getHeight();
    int windowCount = frameToTabMap.size();
    int windowWidth = desktopWidth / windowCount;
    List<TabData> tabs = tabbedContainer.getModel().getTabs();
    for (int windowIndex = 0; windowIndex < windowCount; windowIndex++) {
      TabData tab = tabs.get(windowIndex);
      JInternalFrame internalFrame = tabToFrameMap.get(tab);
      internalFrame.setBounds(windowIndex * windowWidth, 0, windowWidth, desktopHeight);
    }
  }
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
  public void actionPerformed(ActionEvent e) {
    int desktopWidth = desktopPane.getWidth();
    int desktopHeight = desktopPane.getHeight();
    JInternalFrame[] internalFrames = desktopPane.getAllFrames();
    for (JInternalFrame internalFrame : internalFrames) {
      internalFrame.setBounds(0, 0, desktopWidth, desktopHeight);
    }
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-cli

private void inner_start(){
  //HACK, location needs to be set twice...
  targetDisplay.setVisible(false);
  targetDisplay.add(display);
  setLocation((display.getWidth() - getWidth()) / 2, (display.getHeight() - getHeight()) / 2);
  tfURL.setText(DEFAULT_REMOTE);
  try {
    // Bring to front of other dialogs
    setSelected(true);
  } catch (PropertyVetoException e) {
  }
  targetDisplay.setVisible(true);
  targetDisplay.revalidate();
  targetDisplay.repaint();
  setVisible(true);
  setLocation((display.getWidth() - getWidth()) / 2, (display.getHeight() - getHeight()) / 2);
  started = true;
}

代码示例来源:origin: bcdev/beam

public void moveFrameToVisible(final JDesktopPane desktopPane, final JInternalFrame internalFrame) {
  final int delta = 128;
  int x = internalFrame.getX();
  if (x > desktopPane.getWidth() - delta) {
    x = desktopPane.getWidth() - delta;
  }
  if (x < 0) {
    x = 0;
  }
  int y = internalFrame.getY();
  if (y > desktopPane.getHeight() - delta) {
    y = desktopPane.getHeight() - delta;
  }
  if (y < 0) {
    y = 0;
  }
  internalFrame.setLocation(x, y);
}

代码示例来源:origin: wildfly/wildfly-core

private void inner_start(){
  //HACK, location needs to be set twice...
  targetDisplay.setVisible(false);
  targetDisplay.add(display);
  setLocation((display.getWidth() - getWidth()) / 2, (display.getHeight() - getHeight()) / 2);
  tfURL.setText(DEFAULT_REMOTE);
  try {
    // Bring to front of other dialogs
    setSelected(true);
  } catch (PropertyVetoException e) {
  }
  targetDisplay.setVisible(true);
  targetDisplay.revalidate();
  targetDisplay.repaint();
  setVisible(true);
  setLocation((display.getWidth() - getWidth()) / 2, (display.getHeight() - getHeight()) / 2);
  started = true;
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
  public void actionPerformed(ActionEvent e) {
    int desktopWidth = desktopPane.getWidth();
    int desktopHeight = desktopPane.getHeight();
    int windowCount = frameToTabMap.size();
    Dimension matrixSize = TileUtilities.computeMatrixSizeForEqualAreaTiling(windowCount);
    int windowWidth = desktopWidth / matrixSize.width;
    int windowHeight = desktopHeight / matrixSize.height;
    List<TabData> tabs = tabbedContainer.getModel().getTabs();
    int windowIndex = 0;
    for (int j = 0; j < matrixSize.height; j++) {
      for (int i = 0; i < matrixSize.width; i++) {
        if (windowIndex < windowCount) {
          TabData tab = tabs.get(windowIndex);
          JInternalFrame internalFrame = tabToFrameMap.get(tab);
          internalFrame.setBounds(i * windowWidth, j * windowHeight, windowWidth, windowHeight);
        }
        windowIndex++;
      }
    }
  }
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

public void setFullscreen( ScreenDockWindow window, boolean fullscreen ){
    if( fullscreen ){
      window.setNormalBounds( window.getWindowBounds() );
      window.setWindowBounds( new Rectangle( 0, 0, desktop.getWidth(), desktop.getHeight() ) );
    }
    else{
      Rectangle bounds = window.getNormalBounds();
      if( bounds != null ){
        window.setWindowBounds( bounds );
        window.setNormalBounds( null );
      }
    }
  }
}

代码示例来源:origin: xyz.cofe/docking-frames-core

public void setFullscreen( ScreenDockWindow window, boolean fullscreen ){
    if( fullscreen ){
      window.setNormalBounds( window.getWindowBounds() );
      window.setWindowBounds( new Rectangle( 0, 0, desktop.getWidth(), desktop.getHeight() ) );
    }
    else{
      Rectangle bounds = window.getNormalBounds();
      if( bounds != null ){
        window.setWindowBounds( bounds );
        window.setNormalBounds( null );
      }
    }
  }
}

代码示例来源:origin: khuxtable/seaglass

void adjustSize() {
  JDesktopPane desktop = (JDesktopPane) getParent();
  if (desktop != null) {
    int height = getPreferredSize().height;
    Insets insets = getInsets();
    if (height == insets.top + insets.bottom) {
      if (getHeight() <= height) {
        // Initial size, because we have no buttons yet
        height += 21;
      } else {
        // We already have a good height
        height = getHeight();
      }
    }
    setBounds(0, desktop.getHeight() - height, desktop.getWidth(), height);
    revalidate();
    repaint();
  }
}

代码示例来源:origin: com.mgmtp.gcviewer/gcviewer

public void actionPerformed(final ActionEvent e) {
    final JInternalFrame[] frames = gcViewer.getDesktopPane().getAllFrames();
    final DesktopManager desktopManager = gcViewer.getDesktopPane().getDesktopManager();
    for (int i=0; i<frames.length; i++) {
      final JInternalFrame frame = frames[i];
      desktopManager.deiconifyFrame(frame);
      try {
        frame.setMaximum(false);
      } catch (PropertyVetoException e1) {
        e1.printStackTrace();
      }
      final int height = gcViewer.getDesktopPane().getHeight()/frames.length;
      desktopManager.setBoundsForFrame(frame, 0, height * i, gcViewer.getDesktopPane().getWidth(), height);
    }
  }
}

代码示例来源:origin: Geomatys/geotoolkit

/**
 * Creates and shows a new internal frame for the given image.
 */
final void addImage(final RenderedImage image, final String title) {
  final JInternalFrame internal = new JInternalFrame(title, true, true);
  internal.add(new ImagePanel(image));
  internal.pack();
  internal.show();
  desktop.add(internal);
  if (location > min(desktop.getWidth()  - internal.getWidth(),
            desktop.getHeight() - internal.getHeight()))
  {
    location = 0;
  }
  internal.setLocation(location, location);
  location += 30;
  internal.toFront();
}

代码示例来源:origin: apache/sis

/**
 * Creates and shows a new internal frame for the given image.
 */
private void addImage(final RenderedImage image, final String title) {
  final JInternalFrame internal = new JInternalFrame(title, true, true);
  internal.add(new ImagePanel(image));
  internal.pack();
  internal.show();
  desktop.add(internal);
  if (location > min(desktop.getWidth()  - internal.getWidth(),
            desktop.getHeight() - internal.getHeight()))
  {
    location = 0;
  }
  internal.setLocation(location, location);
  location += 30;
  internal.toFront();
}

相关文章