Package javax.swing

Examples of javax.swing.JToolBar$AccessibleJToolBar


    setGlassPane(new GlassPane(this));
    _fileChooser.setFileFilter(new FileChooserFilter(
        Messages.getString("MainFrame.config.files"),
        new String[] {".xml", ".cfg"}));

    _toolBar = new JToolBar();
    _toolBar.setFloatable(false);
    _toolBar.setRollover(true);
    addButton("images/new.png",  Messages.getString("MainFrame.new.config"),
        new NewActionListener());
    addButton("images/open.png", Messages.getString("MainFrame.open.config"),
View Full Code Here


              MoteDataWrapper.updateMoteList();
            }
          }
        };

        JToolBar jToolBar = new JToolBar();
        jToolBar.setFloatable(false);
        jToolBar.add(ReMote.createButton("refresh",
            IconResources.VIEW_REFRESH, "Refresh the mote list.",
            actionListener));

        JToolBar jBottomBar = new JToolBar();
        jBottomBar.setFloatable(false);
        JComboBox comboBoxes[] = new JComboBox[4];
        for (int i = 0; i < 4; i++) {
          comboBoxes[i] = new JComboBox();
          jBottomBar.add(comboBoxes[i]);
        }
        MoteDataWrapper.setSession(this.getSession());
        MoteDataWrapper.updateMoteList();
        Table table = MoteDataWrapper.getMoteTable();
        TableBasedTree treeModel = new TableBasedTree(table, "Root",
View Full Code Here

        };

        treeModel.addTreeModelListener(treeModelListener);

        JToolBar jBottomBar = new JToolBar();
        jBottomBar.setFloatable(false);
        JComboBox comboBoxes[] = new JComboBox[4];
        for (int i = 0; i < 4; i++) {
          comboBoxes[i] = new JComboBox();
          jBottomBar.add(comboBoxes[i]);
        }

        JToolBar jToolBar = new JToolBar();
        jToolBar.setFloatable(false);
        jToolBar.add(ReMote.createButton("release",
            IconResources.MOTE_RELEASE,
            "Stop using the selected mote(s).", actionListener));
        jToolBar.addSeparator();
        jToolBar.add(ReMote.createButton("console",
            IconResources.MOTE_CONSOLE,
            "Open console windows for the selected mote(s).",
            actionListener));
        jToolBar.addSeparator();
        jToolBar.add(ReMote.createButton("program",
            IconResources.FLASH_MOTE,
            "Upload a program to the selected mote(s).",
            actionListener));
        jToolBar.add(ReMote.createButton("start",
            IconResources.START_MOTE,
            "Start the selected mote(s).", actionListener));
        jToolBar.add(ReMote.createButton("stop",
            IconResources.STOP_MOTE, "Stop the selected mote(s).",
            actionListener));
        jToolBar.add(ReMote.createButton("reset",
            IconResources.RESET_MOTE,
            "Reset the selected mote(s).", actionListener));

        JScrollPane scrollPane = new JScrollPane(jTree);
        JPanel jPanel = new JPanel(new BorderLayout());
View Full Code Here

        };
        String mac = moteControlRow.get("macaddress").toString();
        String net = moteControlRow.get("netaddress").toString();
        String site = moteControlRow.get("site").toString();

        JToolBar jToolBar = new JToolBar();
        jToolBar.setFloatable(false);
        jToolBar.add(ReMote.createButton("program",
            IconResources.FLASH_MOTE,
            "Upload a program to the mote.", actionListener));
        jToolBar.add(ReMote.createButton("cancelprogram",
            IconResources.CANCEL_FLASH_MOTE,
            "Cancel the programming of the mote.", actionListener));
        jToolBar.add(ReMote.createButton("start",
            IconResources.START_MOTE, "Start the mote.",
            actionListener));
        jToolBar.add(ReMote.createButton("stop",
            IconResources.STOP_MOTE, "Stop the mote.",
            actionListener));
        jToolBar.add(ReMote.createButton("reset",
            IconResources.RESET_MOTE, "Reset the mote.",
            actionListener));
        jToolBar.addSeparator();
        jToolBar.add(ReMote.createButton("log_local",
            IconResources.START_LOG,
            "Create a local output log for the mote.", actionListener));
        jToolBar.add(ReMote.createButton("log_local_stop",
            IconResources.STOP_LOG,
            "Stop local logging.", actionListener));
        jToolBar.addSeparator();
        jToolBar.add(ReMote.createButton("clear",
            IconResources.CONSOLE_CLEAR,
            "Clear the console window.", actionListener));

        JPanel jPanel = new JPanel(new BorderLayout());
        JPanel jBottomPanel = new JPanel(new BorderLayout());
View Full Code Here

  }


  private static void flipSeparators(final Component c, final int orientation) {
    if (c != null && c instanceof JToolBar/* && UIManager.getLookAndFeel().getName().toLowerCase().contains("windows")*/) {
      final JToolBar jtb = (JToolBar) c;

      final Component[] comps = jtb.getComponents();
      if (comps != null && comps.length > 0) {
        for (int i = 0; i < comps.length; i++) {
          try {
            final Component component = comps[i];
            if (component != null) {
              if (component instanceof JSeparator) {
                final boolean isVisible = component.isVisible();
                jtb.remove(component);
                final JSeparator separ = new JSeparator();
                separ.setVisible(isVisible);
                if (orientation == SwingConstants.VERTICAL) {
                  jtb.setOrientation(SwingConstants.VERTICAL);
                  separ.setOrientation(SwingConstants.VERTICAL);
                  separ.setMinimumSize(new Dimension(2, 6));
                  separ.setPreferredSize(new Dimension(2, 6));
                  separ.setMaximumSize(new Dimension(2, 100));
                } else {
                  jtb.setOrientation(SwingConstants.HORIZONTAL);
                  separ.setOrientation(SwingConstants.HORIZONTAL);
                  separ.setMinimumSize(new Dimension(6, 20));
                  separ.setPreferredSize(new Dimension(6, 20));
                  separ.setMaximumSize(new Dimension(100, 20));
                }
                jtb.add(separ, i);
              }
            }
          } catch (final Exception e) {
            throw new AWTError(e.getMessage());
          }
View Full Code Here

            p = new JPanel(new BorderLayout());

            // Create the toolbar
            ToolBarFactory tbf = new ToolBarFactory(bundle, this);
            JToolBar tb = tbf.createJToolBar("ToolBar");
            tb.setFloatable(false);
            getContentPane().add(p, BorderLayout.NORTH);
            p.add(tb, BorderLayout.NORTH);
            p.add(new javax.swing.JSeparator(), BorderLayout.CENTER);
            p.add(locationBar = new LocationBar(), BorderLayout.SOUTH);
View Full Code Here

        assertTrue(ButtonBorder.borderInsets == border.getBorderInsets(newJComponent()));
        checkInsets(border);
    }

    public void testToolBarBorderClass() {
        JToolBar testToolBar = new JToolBar();
        MetalBorders.ToolBarBorder border = new MetalBorders.ToolBarBorder();
        assertFalse(border.isBorderOpaque());
        if (isHarmony()) {
            assertEquals(new Insets(2, 16, 2, 2), border.getBorderInsets(testToolBar));
        } else {
            assertEquals(new Insets(1, 16, 3, 2), border.getBorderInsets(testToolBar));
        }
        testToolBar.setOrientation(SwingConstants.VERTICAL);
        if (isHarmony()) {
            assertEquals(new Insets(16, 2, 2, 2), border.getBorderInsets(testToolBar));
        } else {
            assertEquals(new Insets(16, 2, 3, 2), border.getBorderInsets(testToolBar));
        }
        testToolBar.setFloatable(false);
        if (isHarmony()) {
            assertEquals(new Insets(2, 2, 2, 2), border.getBorderInsets(testToolBar));
        } else {
            assertEquals(new Insets(1, 2, 3, 2), border.getBorderInsets(testToolBar));
        }
        testToolBar.setOrientation(SwingConstants.HORIZONTAL);
        if (isHarmony()) {
            assertEquals(new Insets(2, 2, 2, 2), border.getBorderInsets(testToolBar));
        } else {
            assertEquals(new Insets(1, 2, 3, 2), border.getBorderInsets(testToolBar));
        }
View Full Code Here

    }

    protected JToolBar createToolBar() {

        // Build jtoolbar and jtoolbar Buttons
        JToolBar jtoolbar = new JToolBar();

        jtoolbar.putClientProperty("JToolBar.isRollover", Boolean.TRUE);

        // I'm dropping "Statement" from  "Execute SQL Statement", etc.,
        // because it may or may not be "one statement", but it is SQL.
        // Build jbuttonClear Buttons - blaine
        jbuttonClear =
            new JButton("Clear SQL",
                        new ImageIcon(CommonSwing.getIcon("Clear")));

        jbuttonClear.putClientProperty("is3DEnabled", Boolean.TRUE);
        tipMap.put(jbuttonClear, "Clear SQL");
        jbuttonClear.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent actionevent) {

                if (sqlScriptBuffer == null
                        && txtCommand.getText().length() < 1) {
                    CommonSwing.errorMessage("No SQL to clear");

                    return;
                }

                clear();
            }
        });

        jbuttonExecute =
            new JButton("Execute SQL",
                        new ImageIcon(CommonSwing.getIcon("Execute")));

        tipMap.put(jbuttonExecute, "Execute SQL");
        jbuttonExecute.putClientProperty("is3DEnabled", Boolean.TRUE);
        jbuttonExecute.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent actionevent) {
                executeCurrentSQL();
            }
        });
        jtoolbar.addSeparator();
        jtoolbar.add(jbuttonClear);
        jtoolbar.addSeparator();
        jtoolbar.add(jbuttonExecute);
        jtoolbar.addSeparator();
        jbuttonClear.setAlignmentY(0.5F);
        jbuttonClear.setAlignmentX(0.5F);
        jbuttonExecute.setAlignmentY(0.5F);
        jbuttonExecute.setAlignmentX(0.5F);
View Full Code Here

    return textPanel;
  }

  protected JToolBar createOperatorPanel()
  {
    final JToolBar operatorButtonPanel = new JToolBar();
    operatorButtonPanel.setFloatable(false);
    operatorButtonPanel.setOpaque(false);
    operatorButtonPanel.setLayout(new HorizontalLayout(2));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("+", Messages.getInstance().getString("FormulaEditorDialog.Operator.Add"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("-", Messages.getInstance().getString("FormulaEditorDialog.Operator.Subtract"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("*", Messages.getInstance().getString("FormulaEditorDialog.Operator.Multiply"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("/", Messages.getInstance().getString("FormulaEditorDialog.Operator.Divide"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("^", Messages.getInstance().getString("FormulaEditorDialog.Operator.Power"))));
    operatorButtonPanel.add(Box.createRigidArea(new Dimension(10, 1)));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("=", Messages.getInstance().getString("FormulaEditorDialog.Operator.Equal"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("<>", Messages.getInstance().getString("FormulaEditorDialog.Operator.NotEqual"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("<", Messages.getInstance().getString("FormulaEditorDialog.Operator.Lesser"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction(">", Messages.getInstance().getString("FormulaEditorDialog.Operator.Greater"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("<=", Messages.getInstance().getString("FormulaEditorDialog.Operator.LesserEqual"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction(">=", Messages.getInstance().getString("FormulaEditorDialog.Operator.GreaterEqual"))));
    operatorButtonPanel.add(Box.createRigidArea(new Dimension(10, 1)));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("%", Messages.getInstance().getString("FormulaEditorDialog.Operator.Percentage"))));
    operatorButtonPanel.add(new ToolbarButton
        (new InsertOperatorAction("&", Messages.getInstance().getString("FormulaEditorDialog.Operator.Concatenation"))));
    operatorButtonPanel.add(Box.createRigidArea(new Dimension(10, 1)));
    operatorButtonPanel.add(new ToolbarButton(selectFieldsAction));
    return operatorButtonPanel;
  }
View Full Code Here

    sizeSelectorComponent.setReportDesignerContext(designerContext);

    final FontColorSelectorComponent colorSelectorComponent = new FontColorSelectorComponent();
    colorSelectorComponent.setReportDesignerContext(designerContext);

    final JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.setOpaque(true);
    toolBar.add(new ToolbarButton(previewAction));
    toolBar.add(new JToolBar.Separator());
    toolBar.add(familySelectorComponent);
    toolBar.add(sizeSelectorComponent);
    toolBar.add(new JToolBar.Separator());
    toolBar.add(createButton(new BoldAction()));
    toolBar.add(createButton(new ItalicsAction()));
    toolBar.add(createButton(new UnderlineAction()));
    toolBar.add(new JToolBar.Separator());
    toolBar.add(colorSelectorComponent);
    toolBar.add(new JToolBar.Separator());
    toolBar.add(createButton(new TextAlignmentLeftAction()));
    toolBar.add(createButton(new TextAlignmentCenterAction()));
    toolBar.add(createButton(new TextAlignmentRightAction()));
    toolBar.add(createButton(new TextAlignmentJustifyAction()));
    toolBar.add(new JToolBar.Separator());
    toolBar.add(new ToolbarButton(hyperlinkAction));

    // Add special crosstab band selection icon
    if (getRenderContext().getReportDefinition() instanceof CrosstabElement)
    {
      final SelectCrosstabBandAction selectCrosstabBandAction = new SelectCrosstabBandAction();
      selectCrosstabBandAction.setReportDesignerContext(designerContext);
      toolBar.add(new ToolbarButton(selectCrosstabBandAction));
      toolBar.add(new JToolBar.Separator());
    }

    return toolBar;
  }
View Full Code Here

TOP

Related Classes of javax.swing.JToolBar$AccessibleJToolBar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.