javax.swing.JTabbedPane.getSelectedComponent()方法的使用及代码示例

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

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

JTabbedPane.getSelectedComponent介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

public MessageView getCurrentView() {
  return (MessageView)tabs.getSelectedComponent();
}

代码示例来源:origin: 4thline/cling

public void stateChanged(ChangeEvent evt) {
    Component comp = tabbedPane.getSelectedComponent();
    if (comp == null) return;
    for (Map.Entry<DeviceView, Component> entry : tabs.entrySet()) {
      if (entry.getValue().equals(comp)) {
        presenter.onDeviceViewChanged(entry.getKey());
        break;
      }
    }
  }
});

代码示例来源:origin: opentripplanner/OpenTripPlanner

@Override
  public void stateChanged(ChangeEvent e) {
    if( tabbedPane.getSelectedComponent().equals(mainTab) ){
      showGraph.loop();    
    } else{
      showGraph.noLoop();
    }
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui

private static JSplitPane getCurrentResultView(){
  if(tabPane == null) {
    // Test Results Window is not opened yet
    return null;
  }
  return (JSplitPane)tabPane.getSelectedComponent();
}

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

/**
 * @see net.sourceforge.squirrel_sql.client.session.mainpanel.ISQLResultExecuter#getSelectedResultTab()
 */
public IResultTab getSelectedResultTab() {
  return (IResultTab)_tabbedExecutionsPanel.getSelectedComponent();
}

代码示例来源:origin: protegeproject/protege

private void handleVerifyEditorContents() {
  if (tabbedPane.getSelectedComponent() == propertySelectorPanel) {
    for (InputVerificationStatusChangedListener l : listeners){
      l.verifiedStatusChanged(true);
    }
  }
}

代码示例来源:origin: protegeproject/protege

protected String getSelectedPanel() {
  Component c = tabbedPane.getSelectedComponent();
  if (c instanceof JScrollPane){
    c = ((JScrollPane)c).getViewport().getView();
  }
  for (String tabName : map.keySet()){
    if (c.equals(map.get(tabName))){
      return tabName;
    }
  }
  return null;
}

代码示例来源:origin: protegeproject/protege

protected String getSelectedPanel() {
  Component c = tabbedPane.getSelectedComponent();
  if (c instanceof JScrollPane){
    c = ((JScrollPane)c).getViewport().getView();
  }
  for (String tabName : map.keySet()){
    if (c.equals(map.get(tabName))){
      return tabName;
    }
  }
  return null;
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application

public void stateChanged(ChangeEvent event) {
    PluginTable table = (PluginTable)tabbedPane.getSelectedComponent();
    updateInfoPanel(table.getCurrentUpdateInfo());
  }
});

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

public void stateChanged(ChangeEvent e) {
    Component selectedComponent = _tabbedPane.getSelectedComponent();
    if (selectedComponent instanceof AbstractDialogPage) {
      setCurrentPage((AbstractDialogPage) selectedComponent, _tabbedPane);
    }
  }
});

代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application

protected String getSelectedPanel() {
  Component c = tabbedPane.getSelectedComponent();
  if (c instanceof JScrollPane){
    c = ((JScrollPane)c).getViewport().getView();
  }
  for (String tabName : map.keySet()){
    if (c.equals(map.get(tabName))){
      return tabName;
    }
  }
  return null;
}

代码示例来源:origin: sc.fiji/TrakEM2_

Utils.invokeLater(new Runnable() { @Override
  public void run() {
    final Component c = tabs.getSelectedComponent();
    if (c instanceof RollingPanel) {
      ((RollingPanel)c).updateList();
    }
  }});
}

代码示例来源:origin: org.freehep/freehep-graphicsio-tests

public void copy() {
  Clipboard clipBoard = Toolkit.getDefaultToolkit().getSystemClipboard();
  VectorGraphicsTransferable transferable = new VectorGraphicsTransferable(
      multiPanel == null ? singlePanel : multiPanel
          .getSelectedComponent());
  clipBoard.setContents(transferable, transferable);
}

代码示例来源:origin: Slowpoke101/FTBLaunch

@Override
  public void stateChanged (ChangeEvent event) {
    if (tabbedPane.getSelectedComponent() instanceof ILauncherPane) {
      ((ILauncherPane) tabbedPane.getSelectedComponent()).onVisible();
      // When called by swapTabs currentPane will be THIRDPARTY until this ActionListener is called again
      currentPane = Panes.values()[tabbedPane.getSelectedIndex()];
      updateFooter();
    }
  }
});

代码示例来源:origin: protegeproject/protege

private boolean isValid(){
  if (tabbedPane != null && tabbedPane.getSelectedComponent().equals(classSelectorPanel)) {
    return classSelectorPanel.getSelectedObject() != null;
  }
  else{
    return expressionEditor.isWellFormed();
  }
}

代码示例来源:origin: protegeproject/protege

@Nullable
public Set<OWLObjectPropertyExpression> getEditedObject() {
  if (tabbedPane.getSelectedComponent() == propertySelectorPanel) {
    return (Set) propertySelectorPanel.getSelectedObjects();
  }
  else {
    return descriptionEditor.getEditedObject();
  }
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

private boolean isValid(){
  if (tabbedPane != null && tabbedPane.getSelectedComponent().equals(classSelectorPanel)) {
    return classSelectorPanel.getSelectedObject() != null;
  }
  else{
    return expressionEditor.isWellFormed();
  }
}

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

public synchronized void closeAllButCurrentResultTabs()
{
 Component selectedTab = _tabbedExecutionsPanel.getSelectedComponent();
 ArrayList<Component> allTabs = getAllTabs();
 for (Component tab : allTabs)
 {
   if(tab != selectedTab)
   {
    closeTab(tab);
   }
 }
}

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

private static ManagementModelNode findSelectedNode(CliGuiContext cliGuiCtx) {
  Component selectedComponent = cliGuiCtx.getTabs().getSelectedComponent();
  if (selectedComponent == null) return null;
  if (!(selectedComponent instanceof ManagementModel)) return null;
  return ((ManagementModel)selectedComponent).getSelectedNode();
}

代码示例来源:origin: sc.fiji/TrakEM2_

/** Repaint the given Rectangle in all Displays showing the layer, optionally updating the offscreen image (if any). */
static public void repaint(final Layer layer, final Rectangle r, final int extra, final boolean update_graphics) {
  if (repaint_disabled) return;
  for (final Display d : al_displays) {
    if (layer == d.layer) {
      d.canvas.setUpdateGraphics(update_graphics);
      d.canvas.repaint(r, extra);
      d.navigator.repaint(update_graphics);
      if (update_graphics) Utils.updateComponent(d.tabs.getSelectedComponent());
    }
  }
}

相关文章

JTabbedPane类方法