javax.swing.JInternalFrame.getBounds()方法的使用及代码示例

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

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

JInternalFrame.getBounds介绍

暂无

代码示例

代码示例来源:origin: org.cytoscape/swing-application-impl

@Override
public Rectangle getBounds (CyNetworkView view) {
  try {
    JInternalFrame frame = viewManager.getInternalFrame(view);
    if (frame != null)
      return frame.getBounds();
  } catch (Exception e) {
    // Fall through
  }
  return null;
}

代码示例来源:origin: antlr/antlrworks

public boolean isVisibleOnScreen() {
  GraphicsEnvironment ge =
      GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice[] gs = ge.getScreenDevices();
  Rectangle fr = (useDesktop?jInternalFrame.getBounds():jFrame.getBounds());
  for (GraphicsDevice g : gs) {
    GraphicsConfiguration dc = g.getDefaultConfiguration();
    if (fr.intersects(dc.getBounds())) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/graph

private void onRectSelected(Point dragBeginPoint, Point dragEndPoint)
{
 for (JInternalFrame f : _desktopPane.getAllFrames())
 {
   if (f instanceof TableFrame && RectangleSelectionHandler.rectHit(f.getBounds(), dragBeginPoint, dragEndPoint))
   {
    _desktopPane.addGroupFrame((TableFrame) f);
   }
 }
}

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

public void maximizeFrame(JInternalFrame f) {
  if (f.isIcon()) {
    try {
      f.setIcon(false);
    } catch (PropertyVetoException e2) {
    }
  } else {
    f.setNormalBounds(f.getBounds());
    Component desktop = f.getParent();
    setBoundsForFrame(f, 0, 0, desktop.getWidth(), desktop.getHeight() - taskBar.getHeight());
  }
  try {
    f.setSelected(true);
  } catch (PropertyVetoException e2) {
  }
}

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

private TopComponent closeInternalFrame(JInternalFrame internalFrame, boolean removeTab) {
  internalFrame.removeInternalFrameListener(internalFrameListener);
  TopComponent topComponent = getTopComponent(internalFrame);
  topComponent.removePropertyChangeListener(propertyChangeListener);
  Object internalFrameID = getInternalFrameID(topComponent);
  idToBoundsMap.put(internalFrameID, new Rectangle(internalFrame.getBounds()));
  TabData tab = frameToTabMap.get(internalFrame);
  if (tab != null) {
    if (removeTab) {
      int tabIndex = tabbedContainer.getModel().indexOf(tab);
      if (tabIndex >= 0) {
        tabbedContainer.getModel().removeTab(tabIndex);
      }
    }
    tabToFrameMap.remove(tab);
  }
  frameToTabMap.remove(internalFrame);
  internalFrame.dispose();
  desktopPane.remove(internalFrame);
  if (desktopPane.getComponentCount() == 0) {
    tabbedContainer.setVisible(false);
  }
  // make sure the topComponent's parent is not the internalFrame which we just closed
  internalFrame.setContentPane(new TopComponent());
  return topComponent;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf

/**
 * Sets the Shaded attribute of the InternalFrameWindow object
 * 
 * @param b The new Shaded value
 */
public void setShaded(boolean b) {
 if (b == shaded) { return; }
 if (b == true) {
  Rectangle bounds = frame.getBounds();
  Rectangle p = new Rectangle(bounds.x, bounds.y, bounds.width,
    bounds.height);
  frame.putClientProperty(SHADE_BOUNDS_PROPERTY, p);
  frame.setBounds(p.x, p.y, p.width, frame.getMinimumSize().height - 2);
 } else {
  Point location = frame.getLocation();
  Rectangle p = (Rectangle)frame.getClientProperty(SHADE_BOUNDS_PROPERTY);
  frame.getDesktopPane().getDesktopManager().setBoundsForFrame(frame,
    location.x, location.y, p.width, p.height);
  frame.putClientProperty(SHADE_BOUNDS_PROPERTY, null);
 }
 shaded = b;
}

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

public void iconifyFrame(JInternalFrame f) {
  Container c = f.getParent();
  boolean findNext = f.isSelected();
  if (c == null) {
    return;
  }
  if (!f.isMaximum()) {
    f.setNormalBounds(f.getBounds());
  }
  c.remove(f);
  c.repaint(f.getX(), f.getY(), f.getWidth(), f.getHeight());
  try {
    f.setSelected(false);
  } catch (PropertyVetoException e2) {
  }
  // Get topmost of the remaining frames
  if (findNext) {
    for (Component comp : c.getComponents()) {
      if (comp instanceof JInternalFrame) {
        try {
          ((JInternalFrame) comp).setSelected(true);
        } catch (PropertyVetoException e2) {
        }
        ((JInternalFrame) comp).moveToFront();
        return;
      }
    }
  }
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void maximizeFrame(JInternalFrame f) {
  if (f.isIcon()) {
    try {
      // In turn calls deiconifyFrame in the desktop manager.
      // That method will handle the maximization of the frame.
      f.setIcon(false);
    } catch (PropertyVetoException e2) {
    }
  } else {
    f.setNormalBounds(f.getBounds());
    Rectangle desktopBounds = f.getParent().getBounds();
    setBoundsForFrame(f, 0, 0,
             desktopBounds.width, desktopBounds.height);
  }
  // Set the maximized frame as selected.
  try {
    f.setSelected(true);
  } catch (PropertyVetoException e2) {
  }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

_f.setNormalBounds(_f.getBounds());

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

inBounds = toolWindowManager.getBoundsToScreen(internalFrame.getBounds(),
                        desktopPane);

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

f.setNormalBounds(f.getBounds());

相关文章

JInternalFrame类方法