javax.swing.Box.getComponentCount()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(152)

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

Box.getComponentCount介绍

暂无

代码示例

代码示例来源:origin: icza/scelight

@Override
public int getHiddenTabCount() {
  return titlesPark.getComponentCount();
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

/**
   * {@inheritDoc}
   */
  @Override
  public Component add(Component c) {
    // This won't work right if we remove components. But we don't, so I'm
    // not going to worry about it right now.
    if (hgap > 0 && subPanel.getComponentCount() > 0) {
      subPanel.add(Box.createHorizontalStrut(hgap));
    }

    if (c instanceof JComponent) {
      ((JComponent) c).setAlignmentY(verticalAlign);
    }
    return subPanel.add(c);
  }
}

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Find option panel.
 *
 * @param box the box
 * @param panel the panel
 * @return the int
 */
private int findOptionPanel(Box box, FieldPanel panel) {
  int index;
  for (index = 0; index < box.getComponentCount(); index++) {
    if (box.getComponent(index) == panel) {
      return index;
    }
  }
  return -1;
}

代码示例来源:origin: net.sf.mmax2/mmax2

public final void clear()
{
  int count = leftBox.getComponentCount();
  for (int i=0;i<count;i++)
  {
    ((JPanel) leftBox.getComponent(i)).removeAll();
  }
  
  count = middleBox.getComponentCount();
  for (int i=0;i<count;i++)
  {
    ((JPanel) middleBox.getComponent(i)).removeAll();
  }
  
  count = rightBox.getComponentCount();
  for (int i=0;i<count;i++)
  {
    ((JPanel) rightBox.getComponent(i)).removeAll();
  }        
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

/**
   * {@inheritDoc}
   */
  @Override
  public Component add(Component c) {
    // This won't work right if we remove components. But we don't, so I'm
    // not going to worry about it right now.
    if (vgap > 0 && subPanel.getComponentCount() > 0) {
      subPanel.add(Box.createVerticalStrut(vgap));
    }

    if (c instanceof JComponent) {
      ((JComponent) c).setAlignmentX(horizontalAlign);
    }

    return subPanel.add(c);
  }
}

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

private void updateCurrentAlternative() {
  if(view.getCurrentGraph() instanceof GGraphGroup) {
    if(pathButtonSelectionBox != null && pathButtonSelectionBox.getComponentCount() == 0)
      createPathSelectionButtons();
  }
}

代码示例来源:origin: net.sf.mmax2/mmax2

public final MMAX2Attribute getLastAttribute()
{
  Box tempbox = (Box) modifiablePanel.getComponent(0);
  Box schemebox = (Box) tempbox.getComponent(0);
  System.err.println(((MMAX2Attribute) schemebox.getComponent(schemebox.getComponentCount()-1)).getDisplayAttributeName());
  return (MMAX2Attribute) schemebox.getComponent(schemebox.getComponentCount()-1);
}

代码示例来源:origin: net.sf.mmax2/mmax2

private final boolean allMarkableLevelsSpecified()
{
  boolean allSpecified=true;
  for (int z=2;z<markableLevelBox.getComponentCount()-1;z++)
  {
    Box currentBox =(Box) ((JPanel)markableLevelBox.getComponent(z)).getComponent(0);
    if (((JTextField) currentBox.getComponent(1)).getText().trim().equals(""))
    {
      allSpecified=false;
      break;
    }
    if (((JTextField) currentBox.getComponent(5)).getText().trim().equals("") && 
       ((String)((JComboBox) currentBox.getComponent(3)).getSelectedItem()).equals("other ..."))
    {
      allSpecified=false;
      break;                
    }            
  }
  return allSpecified;
}

代码示例来源:origin: net.sf.mmax2/mmax2

/** Returns an ArrayList of all MMAX2Attribute objects currently displayed on this panel, 
  incl. member and pointer. */
public final ArrayList getAllCurrentAttributes()
{
  ArrayList result = new ArrayList();
  MMAX2Attribute currentAttribute = null;
  
  Box tempbox = (Box) modifiablePanel.getComponent(0);
  Box attributebox = (Box) tempbox.getComponent(0);
  
  /* Get number of MMAX2Attribute objects in Box */
  int compCount = attributebox.getComponentCount();
      
  /* Iterate over all available MMAX2Attribute objects */
  for (int e=0;e<compCount;e++)
  {
    /* Get Attribute object at current position */
    currentAttribute = (MMAX2Attribute) attributebox.getComponent(e);
    result.add(currentAttribute);
  }        
  return result;        
}

代码示例来源:origin: org.opencadc/cadc-download-manager

public void actionPerformed(ActionEvent e) {
  log.debug("ClearAction.actionPerformed()");
  ArrayList removals = new ArrayList();
  for (int i = 0; i < downloads.getComponentCount(); i++) {
    JDownload jdl = (JDownload) downloads.getComponent(i);
    TransferEvent te = jdl.getLastEvent();
    if (te != null && doClear(te.getState())) {
      removals.add(jdl);
    }
  }
  for (int i = 0; i < removals.size(); i++) {
    downloads.remove((Component) removals.get(i));
  }
  validateTree();
  repaint();
}

代码示例来源:origin: robward-scisys/sldeditor

for (int index = 0; index < boxToUpdate.getComponentCount(); index++) {
  Component component = boxToUpdate.getComponent(index);
  if (fieldConfig.getPanel() == component) {

代码示例来源:origin: net.sf.mmax2/mmax2

if (command.equals("none"))
  for (int b=0;b<outerBox.getComponentCount()-1;b++)
  for (int b=0;b<outerBox.getComponentCount()-1;b++)
  for (int b=0;b<outerBox.getComponentCount()-1;b++)
  for (int b=0;b<outerBox.getComponentCount()-1;b++)

代码示例来源:origin: net.sf.mmax2/mmax2

int compCount = attributebox.getComponentCount();

代码示例来源:origin: net.sf.mmax2/mmax2

for (int z=1;z<levelNameBox.getComponentCount();z++)
for (int z=1;z<sourceBox.getComponentCount();z++)
for (int z=1;z<handleBox.getComponentCount();z++)
for (int z=1;z<colorBox.getComponentCount();z++)
for (int z=1;z<styleBox.getComponentCount();z++)
for (int z=1;z<crBox.getComponentCount();z++)

代码示例来源:origin: net.sf.mmax2/mmax2

/** Removes and returns MMAX2Attributes dependent on lastAttribute, or empty list. */
public final MMAX2Attribute[] removeTrailingDependentAttributes(MMAX2Attribute lastAttribute)
{
  MMAX2Attribute currentAttribute = null;
  ArrayList removedAsList = new ArrayList();
  Box tempbox = (Box) modifiablePanel.getComponent(0);
  Box attributebox = (Box) tempbox.getComponent(0);
  
  /* Get number of MMAX2Attribute objects in Box */
  int compCount = attributebox.getComponentCount();
  // Iterate over all attributes in attributebox, backwards
  for (int e=compCount-1;e>=0;e--)
  {            
    /* Get attribute object at current position */
    currentAttribute = (MMAX2Attribute) attributebox.getComponent(e);
    if (currentAttribute.dependsOn(lastAttribute))
    {
      removedAsList.add(currentAttribute);
      attributebox.remove(e);
    }
  }        
  MMAX2Attribute[] result = (MMAX2Attribute[]) removedAsList.toArray(new MMAX2Attribute[removedAsList.size()]);        
  {
    container.repaint();
  }
  return result;        
}

代码示例来源:origin: net.sf.mmax2/mmax2

Box schemebox = null;
if (tempbox.getComponentCount() !=1)
for (int o=0;o<schemebox.getComponentCount();o++)

代码示例来源:origin: net.sf.mmax2/mmax2

public final void addAttributes(MMAX2Attribute[] attributes)
{        
  Box tempbox = (Box) this.modifiablePanel.getComponent(0);
  Box schemebox = null;
  
  if (tempbox.getComponentCount() !=1)
  {
    schemebox = Box.createVerticalBox();
    schemebox.setBackground(Color.yellow);
    tempbox.add(schemebox);
  }
  else 
  {
    schemebox = (Box) tempbox.getComponent(0);
  }
      
  for (int z=0;z<attributes.length;z++)
  {            
    schemebox.add(attributes[z]);            
  }
  
  rebuild();
  container.invalidate();
}

代码示例来源:origin: net.sf.mmax2/mmax2

int count = markableLevelBox.getComponentCount();
markableLevelBox.repaint();
numMarkableLevels++;            
Box sourceContainer = (Box)headerBox.getComponent(19);
int levelToRemove = 0;            
for (int z=0;z<sourceContainer.getComponentCount();z++)
for (int b=1;b<headerBox.getComponentCount();b+=2)
for (int z=0;z<sourceContainer.getComponentCount();z++)
for (int z=2;z<markableLevelBox.getComponentCount();z++)
for (int z=2;z<markableLevelBox.getComponentCount();z++)
  if (currentBox.getComponentCount()>3)
Box sourceContainer = (Box)headerBox.getComponent(15);
int levelToMove = 0;            
for (int z=0;z<sourceContainer.getComponentCount();z++)
  for (int b=1;b<headerBox.getComponentCount();b+=2)
Box sourceContainer = (Box)headerBox.getComponent(17);
int levelToMove = 0;            
for (int z=0;z<sourceContainer.getComponentCount();z++)
if (levelToMove<sourceContainer.getComponentCount()-1)

代码示例来源:origin: freeplane/freeplane

buttonBox.add(formatChooser);
for (int i = 0; i < buttonBox.getComponentCount(); i++) {
  buttonBox.getComponent(i).setMaximumSize(btnSize);

相关文章