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

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

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

JToolBar.setOrientation介绍

暂无

代码示例

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

@Override
public void setOrientation(int o) {
  super.setOrientation(o);
  setupOverflowButton();
}

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

private void handleOverflowAddittion(int visibleButtons) {
  Component[] comps = getAllComponents();
  removeAll();
  overflowToolbar.setOrientation(getOrientation() == HORIZONTAL ? VERTICAL : HORIZONTAL);
  popup.removeAll();
  for (Component comp : comps) {
    if (visibleButtons > 0) {
      add(comp);
      if (comp.isVisible()) {
        visibleButtons--;
      }
    } else {
      overflowToolbar.add(comp);
    }
  }
  popup.add(overflowToolbar);
  add(overflowButton);
}

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

toolBar.setOrientation(JToolBar.HORIZONTAL);
toolBar.setFloatable(false);

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

public void setOrientation(int orientation) {
  toolBar.setOrientation(orientation);
  if (dragWindow != null) {
    dragWindow.setOrientation(orientation);
  }
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

public ToolBarPrefsHandler(JToolBar toolbar, String prefsPrefix, Preferences prefs) {
  this.toolbar = toolbar;
  this.prefsPrefix = prefsPrefix;
  this.prefs = prefs;
  
  String constraint = prefs.get(prefsPrefix+".constraint", BorderLayout.NORTH);
  int orientation = (constraint.equals(BorderLayout.NORTH) || constraint.equals(BorderLayout.SOUTH)) ? JToolBar.HORIZONTAL : JToolBar.VERTICAL;
  toolbar.setOrientation(orientation);
  toolbar.getParent().add(constraint, toolbar);
  toolbar.setVisible(prefs.getBoolean(prefsPrefix+".visible", true));
  /*
  if (prefs.getBoolean(prefsPrefix+".isFloating", false)) {
    makeToolBarFloat();
  }*/
  
  toolbar.addComponentListener(this);
  toolbar.addAncestorListener(this);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-xml-nbprefuse

jToolBar1.setOrientation(1);
layoutBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/netbeans/modules/xml/nbprefuse/resources/relayout.png")));
layoutBtn.setToolTipText(java.util.ResourceBundle.getBundle("org/netbeans/modules/xml/nbprefuse/Bundle").getString("LBL_Relayout_graph"));

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

holder.setBorder(BorderFactory.createTitledBorder("Image"));
JToolBar tools = new JToolBar();
tools.setOrientation(JToolBar.HORIZONTAL);
JButton zoomInB =
 new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

holder.setBorder(BorderFactory.createTitledBorder("Image"));
JToolBar tools = new JToolBar();
tools.setOrientation(JToolBar.HORIZONTAL);
JButton zoomInB =
 new JButton(new ImageIcon(loadImage(StepVisual.BASE_ICON_PATH

代码示例来源:origin: Jamling/SmartIM

private void initUI() {
  
  JPanel pLeft = new JPanel();
  pLeft.setLayout(new BorderLayout(0, 0));
  JToolBar toolBar1 = new JToolBar();
  toolBar1.setFloatable(false);
  toolBar1.setOrientation(SwingConstants.VERTICAL);
  initToolBar1(toolBar1);
  pLeft.add(toolBar1, BorderLayout.WEST);
  
  left = createContactsUI();
  left.onLoadContacts(false);
  pLeft.add(left, BorderLayout.CENTER);
  setLeftComponent(pLeft);
  
  JPanel pRight = new JPanel();
  pRight.setLayout(new BorderLayout(0, 0));
  
  tabbedChat = new ClosableTabHost(this);
  pRight.add(tabbedChat, BorderLayout.CENTER);
  
  setRightComponent(pRight);
  
  setResizeWeight(0.3);
  setDividerLocation(250);
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

/** Adds a new JToolBar to the Panel at the given row. Multiple VLToolBars
 * are constructed using Separators in the original JToolBar
 */
public void add(JToolBar toolbar, int major) {
  toolbar.setOrientation(orientation);
  VLToolBar[] bars = getVLToolBarsFromJToolBar(toolbar);
  for(int i = 0; i < bars.length; i++) {
    ToolBarConstraints toolBarConstraints = new ToolBarConstraints(major, i);
    add(bars[i], toolBarConstraints);
  }
}

代码示例来源:origin: uk.ac.ebi.pride.toolsuite/inspector-swing-utils

sideToolBar.setOrientation(JToolBar.VERTICAL);
  sideBarPanel.add(sideToolBar, BorderLayout.LINE_END);
  centralSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralComponent, sideBarPanel);
  break;
case WEST:
  sideToolBar.setOrientation(JToolBar.VERTICAL);
  sideBarPanel.add(sideToolBar, BorderLayout.LINE_START);
  centralSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sideBarPanel, centralComponent);
  break;
case NORTH:
  sideToolBar.setOrientation(JToolBar.HORIZONTAL);
  sideBarPanel.add(sideToolBar, BorderLayout.PAGE_START);
  centralSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, sideBarPanel, centralComponent);
  break;
case SOUTH:
  sideToolBar.setOrientation(JToolBar.HORIZONTAL);
  sideBarPanel.add(sideToolBar, BorderLayout.PAGE_END);
  centralSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, centralComponent, sideBarPanel);

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

public void setOrientation(int orientation)
{
  toolBar.setOrientation(orientation);
  if(toolBar.getOrientation()==JToolBar.HORIZONTAL)
    toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
  else
    toolBar.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0));
  
  if (dragWindow != null)
    dragWindow.setOrientation(orientation);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-notifications

/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  java.awt.GridBagConstraints gridBagConstraints;
  splitPane = new javax.swing.JSplitPane();
  toolBar = new javax.swing.JToolBar();
  setLayout(new java.awt.GridBagLayout());
  splitPane.setContinuousLayout(true);
  gridBagConstraints = new java.awt.GridBagConstraints();
  gridBagConstraints.gridx = 1;
  gridBagConstraints.gridy = 0;
  gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
  gridBagConstraints.weightx = 1.0;
  gridBagConstraints.weighty = 1.0;
  add(splitPane, gridBagConstraints);
  toolBar.setOrientation(javax.swing.SwingConstants.VERTICAL);
  toolBar.setRollover(true);
  gridBagConstraints = new java.awt.GridBagConstraints();
  gridBagConstraints.gridx = 0;
  gridBagConstraints.gridy = 0;
  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
  gridBagConstraints.weighty = 1.0;
  add(toolBar, gridBagConstraints);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-terminal-nb

protected void initComponents() {
  setLayout(new BorderLayout());
  actionBar = new JToolBar();
  actionBar.setOrientation(JToolBar.VERTICAL);
  actionBar.setLayout(new BoxLayout(actionBar, BoxLayout.Y_AXIS));
  actionBar.setFloatable(false);
  fixSize(actionBar);
  add(actionBar, BorderLayout.WEST);
// Make actionBar initially invisible. setButtons will make it visible
// if actions are defined.
// This will prevent 'blinking' of the toolbar (see IZ 233206)
actionBar.setVisible(false);
  findBar = new FindBar(new FindBar.Owner() {
      
  @Override
    public void close(FindBar fb) {
      findBar.getState().setVisible(false);
      // OLD TerminalContainerImpl.super.remove(findBar);
      componentRemove(findBar);
      validate();
      requestFocus();
    }
  });
}

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

toolBarVertical.setOrientation(SwingConstants.VERTICAL);
toolBarVertical.add(panelOrange);
toolBarVertical.add(panelBlue);

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

toolBar.setOrientation(JToolBar.HORIZONTAL);
toolBar.setFloatable(false);

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

"edit.createRectangle",
    labels);
tb.setOrientation(JToolBar.VERTICAL);

代码示例来源:origin: Jamling/SmartIM

JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.setOrientation(SwingConstants.VERTICAL);
initToolBar(toolBar);
add(toolBar, BorderLayout.WEST);

代码示例来源:origin: org.xworker/xworker_core

comp.setOrientation(orientation);

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

i++;
tb.setFloatable(false);
tb.setOrientation(JToolBar.VERTICAL);
tb.setFocusable(false);

相关文章

JToolBar类方法