javax.swing.JToolBar.getComponents()方法的使用及代码示例

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

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

JToolBar.getComponents介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-awt

private void handleIconResize() {
  for (Component comp : overflowToolbar.getComponents()) {
    boolean smallToolbarIcons = getClientProperty(PROP_PREF_ICON_SIZE) == null;
    if (smallToolbarIcons) {
      ((JComponent) comp).putClientProperty(PROP_PREF_ICON_SIZE, null);
    } else {
      ((JComponent) comp).putClientProperty(PROP_PREF_ICON_SIZE, Integer.valueOf(24));
    }
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

private void handleOverflowRemoval() {
  if (overflowToolbar.getComponents().length > 0) {
    remove(overflowButton);
    handleIconResize();
    for (Component comp : overflowToolbar.getComponents()) {
      add(comp);
    }
    overflowToolbar.removeAll();
    popup.removeAll();
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

private Component[] getAllComponents() {
    Component[] toolbarComps;
    Component[] overflowComps = overflowToolbar.getComponents();
    if (overflowComps.length == 0) {
      toolbarComps = getComponents();
    } else {
      if (getComponentCount() > 0) {
        toolbarComps = new Component[getComponents().length - 1];
        System.arraycopy(getComponents(), 0, toolbarComps, 0, toolbarComps.length);
      } else {
        toolbarComps = new Component[0];
      }
    }
    Component[] comps = new Component[toolbarComps.length + overflowComps.length];
    System.arraycopy(toolbarComps, 0, comps, 0, toolbarComps.length);
    System.arraycopy(overflowComps, 0, comps, toolbarComps.length, overflowComps.length);
    return comps;
  }
}

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

private void setGUISize() {
    Font font = GUISizeHelper.menuFont;
    mageToolbar.setFont(font);
    int newHeight = font.getSize() + 6;
    Dimension mageToolbarDimension = mageToolbar.getPreferredSize();
    mageToolbarDimension.height = newHeight + 6;
    mageToolbar.setMinimumSize(mageToolbarDimension);
    mageToolbar.setMaximumSize(mageToolbarDimension);
    mageToolbar.setPreferredSize(mageToolbarDimension);
    for (Component component : mageToolbar.getComponents()) {
      if (component instanceof JButton || component instanceof JLabel || component instanceof JToggleButton) {
        component.setFont(font);
        Dimension d = component.getPreferredSize();
        d.height = newHeight;
        component.setMinimumSize(d);
        component.setMaximumSize(d);

      }
      if (component instanceof javax.swing.JToolBar.Separator) {
        Dimension d = component.getPreferredSize();
        d.height = newHeight;
        component.setMinimumSize(d);
        component.setMaximumSize(d);
      }
    }
    balloonTip.setFont(GUISizeHelper.balloonTooltipFont);

    addTooltipContainer();
  }
}

代码示例来源:origin: CognizantQAHub/Cognizant-Intelligent-Test-Scripter

/**
 * enable / disable components
 *
 * @param t
 * @param s
 */
private void eComponents(JToolBar t, boolean s) {
  for (Component c : t.getComponents()) {
    c.setEnabled(s);
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void restoreBorders() {
  Component[] components = toolBar.getComponents();
  for (int i = 0; i < components.length; ++i) {
    Component comp = components[i];
    if (comp instanceof AbstractButton) {
      restoreButtonBorder((AbstractButton) comp);
    }
  }
}

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

public static void setCheckedForAction
 (JToolBar _bar, String _action, boolean _state)
{
 if(_bar==null) return;
 Component[] c=_bar.getComponents();
 for(int i=0; i<c.length; i++)
  if(c[i] instanceof JToggleButton)
 setCheckedForAction((JToggleButton)c[i],_action,_state);
}

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

public static void setEnabledForAction
 (JToolBar _bar, String _action, boolean _state)
{
 if(_bar==null) return;
 Component[] c=_bar.getComponents();
 for(int i=0; i<c.length; i++)
  if(c[i] instanceof JButton)
 setEnabledForAction((JButton)c[i],_action,_state);
}

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

public boolean haveSelectorAction() {
  for (Component comp : extraTools.getComponents()) {
    if (comp instanceof AbstractButton) {
      AbstractButton ab = (AbstractButton) comp;
      if (ab.getAction() instanceof ModelComponentDecorator.ValueSelectorAction) {
        return true;
      }
    }
  }
  return false;
}

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

public boolean haveNullerAction() {
  for (Component comp : extraTools.getComponents()) {
    if (comp instanceof AbstractButton) {
      AbstractButton ab = (AbstractButton) comp;
      if (ab.getAction() instanceof ModelComponentDecorator.NullerAction) {
        return true;
      }
    }
  }
  return false;
}

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

public static void removeAction(JToolBar _bar, String _action)
{
 if(_bar==null) return;
 Component[] c=_bar.getComponents();
 for(int i=0; i<c.length; i++)
  if(c[i] instanceof JButton)
 removeAction((JButton)c[i],_action);
}

代码示例来源:origin: com.nelkinda.japi/nelkinda-japi-swing

static void makeToolbarComponentsNotFocusable(final JToolBar toolBar) {
  for (final Component c : toolBar.getComponents()) {
    c.setFocusable(false);
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void changeBorders() {
  Component[] components = toolBar.getComponents();
  for (int i = 0; i < components.length; ++i) {
    Component comp = components[i];
    if (comp instanceof AbstractButton) {
      changeButtonBorder((AbstractButton) comp);
    }
  }
}

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

public Component[] getComponents () {
  waitFinished ();
  return super.getComponents ();
}

代码示例来源:origin: com.github.insubstantial/substance

public void removeAllColorChooserPanels() {
  Component[] tb = toolBar.getComponents();
  for (int i = 0; i < tb.length; i++) {
    if (tb[i] instanceof AbstractButton) {
      toolBarButtonGroup.remove((AbstractButton) tb[i]);
    }
  }
  toolBar.removeAll();
  chooserPanelHolder.removeAll();
  northPanel.removeAll();
  northPanel.add(previewPanelHolder);
}

代码示例来源:origin: org.java.net.substance/substance

public void removeAllColorChooserPanels() {
  Component[] tb = toolBar.getComponents();
  for (int i = 0; i < tb.length; i++) {
    if (tb[i] instanceof AbstractButton) {
      toolBarButtonGroup.remove((AbstractButton) tb[i]);
    }
  }
  toolBar.removeAll();
  chooserPanelHolder.removeAll();
  northPanel.removeAll();
  northPanel.add(previewPanelHolder);
}

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

@ScriptFunction
@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  gapLabel.setEnabled(enabled);
  iconLabel.setEnabled(enabled);
  decorated.setEnabled(enabled);
  extraTools.setEnabled(enabled);
  for (Component comp : extraTools.getComponents()) {
    comp.setEnabled(enabled);
  }
}

代码示例来源:origin: net.sf.taverna.t2.ui-impl/workbench-impl

private void selectFirstPerspective() {
  boolean set = false;
  for (Component c : toolBar.getComponents()) {
    if (c instanceof AbstractButton && c.isVisible()) {
      ((AbstractButton) c).doClick();
      set = true;
      break;
    }
  }
  if (!set) // no visible perspectives were found
  {
    logger.info("No visible perspectives.");
    modelMap.setModel(ModelMapConstants.CURRENT_PERSPECTIVE,
        new BlankPerspective());
  }
}

代码示例来源:origin: uk.org.mygrid.taverna/taverna-workbench

private void selectFirstPerspective() {
  boolean set = false;
  for (Component c : toolBar.getComponents()) {
    if (c instanceof AbstractButton && c.isVisible()) {
      ((AbstractButton) c).doClick();
      set = true;
      break;
    }
  }
  if (!set) // no visible perspectives were found
  {
    logger.info("No visible perspectives.");
    modelMap.setModel(ModelMap.CURRENT_PERSPECTIVE,
      new BlankPerspective());
  }
}

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

private void configurarCursorBotoes()
{
  barraFerramentas.setOpaque(false);
  for (Component componente : barraFerramentas.getComponents()) {
    if (componente instanceof JButton) {
      JButton botao = (JButton) componente;
      botao.setOpaque(false);
      botao.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    }
  }
}

相关文章

JToolBar类方法