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

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

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

JDesktopPane.getSelectedFrame介绍

暂无

代码示例

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

public GCDocument getSelectedGCDocument() {
  return (GCDocument)desktopPane.getSelectedFrame();
}

代码示例来源:origin: pentaho/mondrian

/**
 * returns the currently selected schema explorer object
 *
 * @return current schema explorer object
 */
public SchemaExplorer getCurrentSchemaExplorer() {
  JInternalFrame jf = desktopPane.getSelectedFrame();
  if (jf != null && jf.getContentPane().getComponentCount() > 0 && jf
    .getContentPane().getComponent(0) instanceof SchemaExplorer)
  {
    return (SchemaExplorer) jf.getContentPane().getComponent(0);
  }
  return null;
}

代码示例来源:origin: pentaho/mondrian

public void actionPerformed(ActionEvent e) {
    JInternalFrame jf = desktopPane.getSelectedFrame();
    if (jf != null && jf.getContentPane()
      .getComponent(0) instanceof SchemaExplorer)
    {
      SchemaExplorer se =
        (SchemaExplorer) jf.getContentPane()
          .getComponent(0);
      TreePath tpath = se.tree.getSelectionPath();
      se.delete(tpath);
    }
  }
});

代码示例来源:origin: pentaho/mondrian

private void viewXMLMenuItemActionPerformed(ActionEvent evt) {
  JInternalFrame jf = desktopPane.getSelectedFrame();
  boolean oldValue = viewXmlMenuItem.getState();
  if (jf != null
    && jf.getContentPane().getComponent(0) instanceof SchemaExplorer)
  {
    SchemaExplorer se =
      (SchemaExplorer) jf.getContentPane().getComponent(0);
    // Call schema explorer's view xml event and update the workbench's
    // view menu accordingly'
    ((JCheckBoxMenuItem) evt.getSource()).setSelected(se.editMode(evt));
    return;
  }
  viewXmlMenuItem.setSelected(!oldValue);
}

代码示例来源:origin: pentaho/mondrian

private void saveAsMenuItemActionPerformed(ActionEvent evt) {
  JInternalFrame jf = desktopPane.getSelectedFrame();

代码示例来源:origin: pentaho/mondrian

public void saveMenuItemActionPerformed(ActionEvent evt) {
  JInternalFrame jf = desktopPane.getSelectedFrame();

代码示例来源:origin: pentaho/mondrian

desktopPane.getSelectedFrame());

代码示例来源:origin: pentaho/mondrian

private void newQueryMenuItemActionPerformed(ActionEvent evt) {
  JMenuItem schemaMenuItem =
    schemaWindowMap.get(desktopPane.getSelectedFrame());

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

JDesktopPane desktop = ...;

PDFFrame frame = (PDFFrame) desktop.getSelectedFrame();
frame.setDefaultColor(Color.BLUE);

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

public GCDocument getSelectedGCDocument() {
  return (GCDocument)desktopPane.getSelectedFrame();
}

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

public JInternalFrame getSelectedFrame() {
  return desktopPane.getSelectedFrame();
}

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

@Override
  public boolean inMaximizedMode(Component comp) {
    JInternalFrame internalFrame = desktopPane.getSelectedFrame();
    return internalFrame != null && internalFrame.isMaximum();
  }
}

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

/**
 * @return The currently active window.
 */
public TopComponent getActiveTopComponent() {
  JInternalFrame selectedFrame = desktopPane.getSelectedFrame();
  return selectedFrame != null ? getTopComponent(selectedFrame) : null;
}

代码示例来源:origin: robo-code/robocode

/**
 * Determines if this menu item should currently show as "selected".
 * <p>
 * The item should be seleced if the window it's tied to has focus.
 */
@Override
public boolean isSelected() {
  return (type != SPECIAL_MORE) && (window != null && window.getDesktopPane() != null)
      && window.getDesktopPane().getSelectedFrame() == window;
}

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

public void deactivateFrame(JInternalFrame f) {
  JDesktopPane d = f.getDesktopPane();
  JInternalFrame currentlyActiveFrame =
      (d == null) ? null : d.getSelectedFrame();
  if (currentlyActiveFrame == f)
    d.setSelectedFrame(null);
}

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

@Override
protected void componentDeactivated() {
  JInternalFrame selectedFrame = desktopPane.getSelectedFrame();
  if (selectedFrame != null) {
    notifyDeactivated(getTopComponent(selectedFrame));
  }
}

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

/**
 * Returns the image of the currently selected frame.
 */
private RenderedImage getSelectedImage() {
  final JInternalFrame frame = desktop.getSelectedFrame();
  if (frame != null) {
    return ((ImagePanel) frame.getContentPane().getComponent(0)).image;
  }
  return null;
}

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

/**
 * Returns the image of the currently selected frame.
 */
private RenderedImage getSelectedImage() {
  final JInternalFrame frame = desktop.getSelectedFrame();
  if (frame != null) {
    return ((ImagePanel) frame.getContentPane().getComponent(0)).image;
  }
  return null;
}

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

public JInternalFrame getSelectedFrame() {
 JInternalFrame r = null;
 if (BuLib.swing() >= 1.2) {
  r = super.getSelectedFrame();
 } else {
  JInternalFrame[] f = getNormalFrames();
  for (int i = 0; i < f.length; i++)
   if (f[i].isSelected()) {
    r = f[i];
    break;
   }
 }
 return r;
}

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

@Override
protected void componentActivated() {
  JInternalFrame selectedFrame = desktopPane.getSelectedFrame();
  if (selectedFrame != null) {
    TabData tab = frameToTabMap.get(selectedFrame);
    int tabIndex = tabbedContainer.getModel().indexOf(tab);
    if (tabIndex >= 0) {
      tabbedContainer.getSelectionModel().setSelectedIndex(tabIndex);
    }
    selectedFrame.requestFocusInWindow();
    notifyActivated(getTopComponent(selectedFrame));
  } else {
    int tabIndex = tabbedContainer.getSelectionModel().getSelectedIndex();
    if (tabIndex >= 0) {
      TabData tab = tabbedContainer.getModel().getTab(tabIndex);
      selectedFrame = tabToFrameMap.get(tab);
      if (!selectedFrame.isSelected()) {
        try {
          selectedFrame.setSelected(true);
        } catch (PropertyVetoException e) {
          // ok
        }
      }
    }
  }
}

相关文章