当前位置: 首页>>代码示例>>Java>>正文


Java JToolBar.Separator方法代码示例

本文整理汇总了Java中javax.swing.JToolBar.Separator方法的典型用法代码示例。如果您正苦于以下问题:Java JToolBar.Separator方法的具体用法?Java JToolBar.Separator怎么用?Java JToolBar.Separator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JToolBar的用法示例。


在下文中一共展示了JToolBar.Separator方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addUserFunctions2JToolBar4UserFunction

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 * Adds the user functions to the locally specified jToolBar4UserFunction.
 * @param headerText the header text
 */
private void addUserFunctions2JToolBar4UserFunction(String headerText) {
	
	if (this.jToolBar4UserFunction==null) return;
	if (this.getStolenComponentsFromJToolBarOfOntologyClassEditorJPanel().size()==0) return;
	
	this.jSeparator4UserFunctions1 = new JToolBar.Separator();
	this.jToolBar4UserFunction.add(this.jSeparator4UserFunctions1);
	
	this.jLabelHeader4UserFunctions = new JLabel(headerText + ":");
	this.jLabelHeader4UserFunctions.setFont(new Font("Arial", Font.BOLD, 12));
	this.jToolBar4UserFunction.add(this.jLabelHeader4UserFunctions);
	
	this.jSeparator4UserFunctions2 = new JToolBar.Separator();
	this.jToolBar4UserFunction.add(this.jSeparator4UserFunctions2);
	
	Vector<Component> comps = this.getStolenComponentsFromJToolBarOfOntologyClassEditorJPanel();
	for (int i = 0; i < comps.size(); i++) {
		this.jToolBar4UserFunction.add(comps.get(i));
	}
	this.jToolBar4UserFunction.validate();
	this.jToolBar4UserFunction.repaint();
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:27,代码来源:DynTableJPanel.java

示例2: addImpl

import javax.swing.JToolBar; //导入方法依赖的package包/类
/** Overridden to set focusable to false for any AbstractButton
 * subclasses which are added */
@Override
protected void addImpl(Component c, Object constraints, int idx) {
    //issue 39896, after opening dialog from toolbar button, focus
    //remains on toolbar button.  Does not create an accessibility issue - 
    //all standard toolbar buttons are also available via the keyboard
    if (c instanceof AbstractButton) {
        c.setFocusable(false);
        ((JComponent) c).setOpaque(false);
        if (isMetalLaF) {
            //metal/ocean resets borders, so fix it this way
            ((AbstractButton) c).setBorderPainted(false);
            ((AbstractButton) c).setOpaque(false);
        }
        //This is active for GTK L&F. It should be fixed in JDK
        //but it is not fixed in JDK 6.0.
        if (!isMetalLaF) {
            ((AbstractButton) c).setMargin( emptyInsets );
        }
        if( null != label && c != label ) {
            remove( label );
            label = null;
        }
    } else if( c instanceof JToolBar.Separator ) {
        JToolBar.Separator separator = (JToolBar.Separator)c;
        if (getOrientation() == VERTICAL) {
            separator.setOrientation(JSeparator.HORIZONTAL);
        } else {
            separator.setOrientation(JSeparator.VERTICAL);
        }
    }
    
    super.addImpl (c, constraints, idx);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:36,代码来源:Toolbar.java

示例3: ToolbarAqua

import javax.swing.JToolBar; //导入方法依赖的package包/类
public ToolbarAqua() {
    super( new BorderLayout() );
    JSeparator sep = new JToolBar.Separator();
    sep.setOrientation(JSeparator.VERTICAL);
    sep.setForeground(UIManager.getColor("NbSplitPane.background")); //NOI18N
    add( sep, BorderLayout.CENTER );
    dim = new Dimension (GRIP_WIDTH, GRIP_WIDTH);
    max = new Dimension (GRIP_WIDTH, Integer.MAX_VALUE);
    setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 0));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ToolbarContainer.java

示例4: getSeparator

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 * Returns a reminded separator, so that separators can be removed later on.
 * @param numberOfSeperator the number of separator
 * @return the separator
 */
protected JToolBar.Separator getSeparator(int numberOfSeperator) {
	if (separatorVector==null) {
		separatorVector = new Vector<JToolBar.Separator>();
	}
	if (separatorVector.size()<numberOfSeperator) {
		for (int i = 0; i < numberOfSeperator; i++) {
			separatorVector.add(new JToolBar.Separator());
		}
	}
	return this.separatorVector.get(numberOfSeperator-1);
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:17,代码来源:TimeModelBaseExecutionElements.java

示例5: addSeparator

import javax.swing.JToolBar; //导入方法依赖的package包/类
public void addSeparator() {
    JToolBar.Separator separator = new JToolBar.Separator();
    separator.setOrientation(JToolBar.Separator.VERTICAL);
    addItem(separator);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:TransparentToolBar.java

示例6: createInstanceImpl

import javax.swing.JToolBar; //导入方法依赖的package包/类
protected JSeparator createInstanceImpl() {
    return separatorSize == null ? new JToolBar.Separator() :
            new JToolBar.Separator(separatorSize.createInstance());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:JComponentBuilders.java

示例7: addCustomToolbarComponent

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
   * Adds the specified custom toolbar component.
   * @param compDescription the component description
   */
  private void addCustomToolbarComponent(CustomToolbarComponentDescription compDescription) {
  	
  	if (compDescription==null || compDescription.getToolBarType()==null || compDescription.getToolBarSurrounding()==null) return;
  	// --------------------------------------------------------------------
  	// --- Check if the component should currently be added ---------------
  	// --------------------------------------------------------------------
  	boolean isExecutionTime = this.graphController.getProject()==null;
  	boolean addComponent = false;
  	switch (compDescription.getToolBarSurrounding()) {
case Both:
	addComponent = true;
	break;
case ConfigurationOnly:
	if (isExecutionTime==false) addComponent = true;
	break;
case RuntimeOnly:
	if (isExecutionTime==true) addComponent = true;
	break;
}
  	if (addComponent==false) return;
  	
  	// --------------------------------------------------------------------
  	// --- Get the needed JToolBar ----------------------------------------
  	// --------------------------------------------------------------------
  	JToolBar toolBar = null;
  	switch (compDescription.getToolBarType()) {
case EditControl:
	// --- Nothing to do in case of edit & execution --------
	if (isExecutionTime==true) return;
	toolBar = this.getJToolBarEdit();
	break;

case ViewControl:
	toolBar = this.getJToolBarView();
	break;
}

  	// --------------------------------------------------------------------
  	// --- Add the component, if not already there ------------------------
  	// --------------------------------------------------------------------
  	AbstractCustomToolbarComponent componentClass = compDescription.getToolBarComponent(this.graphController);
  	// --- Avoid double creation ------------------------------------------
  	if (componentClass!=null && componentClass.getCreatedCustomComponent()==null) {
	// --- Create and remind the custom component ---------------------
  		JComponent customComponent = componentClass.getCustomComponent();
	componentClass.setCreatedCustomComponent(customComponent);
      	// --- Does the component already exists --------------------------
	if (toolBar.getComponentIndex(customComponent)==-1) {
      		// --- Add a JSeparator first, if wished ----------------------
      		if (compDescription.isAddSeparatorFirst()==true) {
      			JToolBar.Separator separator = new JToolBar.Separator(); 
      			if (compDescription.getIndexPosition()==null) {
          			toolBar.add(separator);
          		} else {
          			toolBar.add(separator, (int)compDescription.getIndexPosition());
          		}	
      		}
      		// --- Add new component --------------------------------------
      		if (compDescription.getIndexPosition()==null) {
      			toolBar.add(customComponent);
      		} else {
      			if (compDescription.isAddSeparatorFirst()==true) {
      				toolBar.add(customComponent, (int)compDescription.getIndexPosition()+1);
      			} else {
      				toolBar.add(customComponent, (int)compDescription.getIndexPosition());
      			}
      		}
      		toolBar.validate();
      		toolBar.repaint();
      		// --- Remind added component ---------------------------------
      		this.getCustomToolbarComponentDescriptionAdded().add(compDescription);
      	}
  	}
  	
  }
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:80,代码来源:BasicGraphGuiTools.java


注:本文中的javax.swing.JToolBar.Separator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。