Package javax.swing

Examples of javax.swing.JToolBar


      public void actionPerformed(ActionEvent e) {
        ReferenceDataDialog.this.dispose();
      }
    });

    final JToolBar toolBar = WidgetFactory.createToolBar();
    toolBar.add(new HumanInferenceToolbarButton());
    toolBar.add(WidgetFactory.createToolBarSeparator());
    toolBar.add(closeButton);

    final DCPanel toolBarPanel = new DCPanel(WidgetUtils.BG_COLOR_DARKEST, WidgetUtils.BG_COLOR_DARKEST);
    toolBarPanel.setLayout(new BorderLayout());
    toolBarPanel.add(toolBar, BorderLayout.CENTER);
View Full Code Here


    _addAnalyzerButton.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST);
    _addAnalyzerButton.setFocusPainted(false);
    _runButton.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST);
    _runButton.setFocusPainted(false);

    final JToolBar toolBar = WidgetFactory.createToolBar();
    toolBar.add(_saveButton);
    toolBar.add(_visualizeButton);
    toolBar.add(WidgetFactory.createToolBarSeparator());
    toolBar.add(_addTransformerButton);
    toolBar.add(_addAnalyzerButton);
    toolBar.add(WidgetFactory.createToolBarSeparator());
    toolBar.add(_runButton);

    final JXStatusBar statusBar = WidgetFactory.createStatusBar(_statusLabel);

    final LoginStatusLabel loggedInStatusLabel = _injectorWithGlassPane.getInstance(LoginStatusLabel.class);
    statusBar.add(loggedInStatusLabel);
View Full Code Here

      JPanel left = new JPanel(new BorderLayout());

      left.add(treeScroll, BorderLayout.CENTER);

      JToolBar leftTools = new JToolBar();
      leftTools.add(makeSortSelectionButton());
      leftTools.add(refreshButton);

      leftTools.add(installButton);
      leftTools.add(startButton);
      leftTools.add(repoButton);

      left.add(leftTools, BorderLayout.SOUTH);

      // create a context menu which copies the names
      // and actions from the start and stop buttons.
View Full Code Here

    info = new JDetail(entry);

    scrollPane = new JScrollPane(info);
    //    contentPane.setPreferredSize(new Dimension(400, 200));

    cmdPanel = new JToolBar(JToolBar.VERTICAL);
    cmdPanel.setFloatable(false);

    nextButton = new JButton(arrowDownIcon) {  {
      setToolTipText("Next log entry");
      addActionListener(new ActionListener() {
View Full Code Here

                        JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                        JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

      html.setPreferredSize(new Dimension(300, 300));

      JToolBar cmds = new JToolBar() {
          {
            add(backButton = new JButton(Activator.desktop.prevIcon) {
                {
                  addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent ev) {
                      if(!historyBack.isEmpty()) {
                        Long bid = (Long)historyBack.get(historyBack.size()-1);
                        historyBack.remove(historyBack.size()-1);

                        if(getCurrentBID() != -1) {
                          historyFwd.add(new Long(getCurrentBID()));
                        }

                        gotoBid(bid.longValue());
                      }
                      backButton.setEnabled(historyBack.size() > 0);
                      fwdButton.setEnabled(historyFwd.size() > 0);
                    }
                  });
                  setToolTipText(Strings.get("tt_html_back"));
                }
              });

            add(fwdButton = new JButton(Activator.desktop.nextIcon) {
                {
                  addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent ev) {
                      if(historyFwd.size() > 0) {
                        Long bid = (Long)historyFwd.get(historyFwd.size()-1);
                        historyFwd.remove(historyFwd.size()-1);

                        if(getCurrentBID() != -1) {
                          historyBack.add(new Long(getCurrentBID()));
                        }

                        gotoBid(bid.longValue());
                      }
                      backButton.setEnabled(historyBack.size() > 0);
                      fwdButton.setEnabled(historyFwd.size() > 0);
                    }
                  });
                  setToolTipText(Strings.get("tt_html_back"));
                }
              });
            backButton.setEnabled(historyBack.size() > 0);
            fwdButton.setEnabled(historyFwd.size() > 0);
          }
        };

      cmds.setFloatable(false);

      add(scroll, BorderLayout.CENTER);
      add(cmds, BorderLayout.SOUTH);

      valueChanged(null);
View Full Code Here

      menuImage.add(rotateRight);
      menuImage.add(rotateLeft);
      menuBar.add(menuImage);
      getRootPane().setJMenuBar(menuBar);

      JToolBar toolBar = new JToolBar("Toolbar", JToolBar.HORIZONTAL);
      toolBar.setFloatable(true);
      toolBar.setRollover(true);

      // zoom buttons
      JButton zoomInButton = new JButton(zoomIn);
      zoomInButton.setIcon(new ImageIcon(this.getClass().getResource("/images/zoomin.png")));
      zoomInButton.setText("");
      toolBar.add(zoomInButton);

      JButton zoomOutButton = new JButton(zoomOut);
      zoomOutButton.setIcon(new ImageIcon(this.getClass().getResource("/images/zoomout.png")));
      zoomOutButton.setText("");
      toolBar.add(zoomOutButton);

      JButton zoomNoneButton = new JButton(zoomReset);
      zoomNoneButton.setIcon(new ImageIcon(this.getClass().getResource("/images/zoomnone.png")));
      zoomNoneButton.setText("");
      toolBar.add(zoomNoneButton);

      toolBar.addSeparator();

      // rotate buttons
      JButton rotateRightButton = new JButton(rotateRightAction);
      rotateRightButton.setIcon(new ImageIcon(this.getClass().getResource("/images/clockwise.png")));
      rotateRightButton.setText("");
      toolBar.add(rotateRightButton);

      JButton rotateLeftButton = new JButton(rotateLeftAction);
      rotateLeftButton.setIcon(new ImageIcon(this.getClass().getResource("/images/anticlockwise.png")));
      rotateLeftButton.setText("");
      toolBar.add(rotateLeftButton);

      mainPanel.add(pagePreview);
      mainScrollPanel = new JScrollPane(mainPanel);

      statusPanel.setLayout(new BoxLayout(statusPanel, BoxLayout.X_AXIS));
View Full Code Here

  private void init(SaveEnvironmentAction saveAction, LoadEnvironmentAction loadAction) {
    try {
      setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
      setPreferredSize(new Dimension(600, 30));

      toolBar = new JToolBar("Toolbar", JToolBar.HORIZONTAL);
      toolBar.setFloatable(true);
      toolBar.setRollover(true);
      toolBar.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));

      buttonSaveEnv = new JButton();
View Full Code Here

        //add(hAxis, BorderLayout.WEST);
        //add(dataPanel.getColorBar(), BorderLayout.EAST);


        // tool bar
        toolbar = new JToolBar(JToolBar.HORIZONTAL);
        add(toolbar, BorderLayout.PAGE_START);
        // keep it anchored at the top
        toolbar.setFloatable(false);

        // toolbar buttons
View Full Code Here

      toolBarPanel.setLayout(new BorderLayout());

      // modifications by Zerbetto
      // first construct the toolbar for saving, loading etc
      if (m_showFileMenu) {
        JToolBar fixedTools = new JToolBar();
        fixedTools.setOrientation(JToolBar.HORIZONTAL);

        m_cutB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
            "cut.png")));
        m_cutB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_cutB.setToolTipText("Cut selected");
        m_copyB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "page_copy.png")));
        m_copyB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_copyB.setToolTipText("Copy selected");
        m_pasteB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "paste_plain.png")));
        m_pasteB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_pasteB.setToolTipText("Paste from clipboard");
        m_deleteB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "delete.png")));
        m_deleteB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_deleteB.setToolTipText("Delete selected");
        m_snapToGridB = new JToggleButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "shape_handles.png")));
        //m_snapToGridB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_snapToGridB.setToolTipText("Snap to grid");
        /*Dimension d = m_snapToGridB.getPreferredSize();
        d = new Dimension((int)d.getWidth() * 8, (int)d.getHeight()*8);
        m_snapToGridB.setPreferredSize(d);*/

        m_saveB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "disk.png")));     
        m_saveB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_saveB.setToolTipText("Save layout");
        m_saveBB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "disk_multiple.png")));
        m_saveBB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_saveBB.setToolTipText("Save layout with new name");

        m_loadB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "folder_add.png")));
        m_loadB.setToolTipText("Load layout");
        m_loadB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_newB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "page_add.png")));
        m_newB.setToolTipText("New layout");
        m_newB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_newB.setEnabled(getAllowMultipleTabs());

        m_helpB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
            "help.png")));
        m_helpB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_helpB.setToolTipText("Display help");
        m_togglePerspectivesB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
          "cog_go.png")));
        m_togglePerspectivesB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_togglePerspectivesB.setToolTipText("Show/hide perspectives toolbar");
       
        m_templatesB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
          "application_view_tile.png")));
        m_templatesB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_templatesB.setToolTipText("Load a template layout");

        m_noteB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "note_add.png")));
        m_noteB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_noteB.setToolTipText("Add a note to the layout");

        m_selectAllB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "shape_group.png")));
        m_selectAllB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_selectAllB.setToolTipText("Select all");

        m_undoB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
        "arrow_undo.png")));
        m_undoB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
        m_undoB.setToolTipText("Undo");


        fixedTools.add(m_selectAllB);
        fixedTools.add(m_cutB);
        fixedTools.add(m_copyB);
        fixedTools.add(m_deleteB);
        fixedTools.add(m_pasteB);
        fixedTools.add(m_undoB);
        fixedTools.add(m_noteB);
        fixedTools.addSeparator();
        fixedTools.add(m_snapToGridB);     
        fixedTools.addSeparator();
        fixedTools.add(m_newB);
        fixedTools.add(m_saveB);
        fixedTools.add(m_saveBB);
        fixedTools.add(m_loadB);
        fixedTools.add(m_templatesB);
        fixedTools.addSeparator();
        fixedTools.add(m_togglePerspectivesB);

        fixedTools.add(m_helpB);
        Dimension d = m_undoB.getPreferredSize();
        Dimension d2 = fixedTools.getMinimumSize();
        Dimension d3 = new Dimension(d2.width, d.height + 4);
        fixedTools.setPreferredSize(d3);
        fixedTools.setMaximumSize(d3);

        m_saveB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (m_mainKFPerspective.getCurrentTabIndex() >= 0) {
              saveLayout(m_mainKFPerspective.getCurrentTabIndex(), false);
            }
          }
        });

        m_saveBB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            saveLayout(m_mainKFPerspective.getCurrentTabIndex(), true);
          }
        });

        m_loadB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            m_flowEnvironment = new Environment();
            loadLayout();
          }
        });

        m_newB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            clearLayout();
          }
        });

        m_selectAllB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (BeanInstance.
                getBeanInstances(m_mainKFPerspective.getCurrentTabIndex()).size() > 0) {
              // select all beans
              Vector allBeans = BeanInstance.
              getBeanInstances(m_mainKFPerspective.getCurrentTabIndex());
              Vector newSelected = new Vector();
              for (int i = 0; i < allBeans.size(); i++) {
                newSelected.add(allBeans.get(i));
              }

              // toggle
              if (newSelected.size() ==
                m_mainKFPerspective.getSelectedBeans().size()) {
                // unselect all beans
                m_mainKFPerspective.setSelectedBeans(new Vector());
              } else {             
                // select all beans
                m_mainKFPerspective.setSelectedBeans(newSelected);            
              }
            }
          }
        });

        m_cutB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            // only delete if our copy was successful!
            if (copyToClipboard()) {             
              deleteSelectedBeans();
            }
          }
        });

        m_deleteB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            deleteSelectedBeans();
          }
        });

        m_copyB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            copyToClipboard();
            m_mainKFPerspective.setSelectedBeans(new Vector());
          }
        });

        m_pasteB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {

            KnowledgeFlowApp.this.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
            m_mode = PASTING;

            /* pasteFromClipboard(10, 10);

            if (m_mainKFPerspective.getSelectedBeans().size() > 0) {
              m_mainKFPerspective.setSelectedBeans(new Vector());
            } */
          }
        });

        m_snapToGridB.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (m_snapToGridB.isSelected()) {
              snapSelectedToGrid();
            }
          }
        });

        fixedTools.setFloatable(false);
        toolBarPanel.add(fixedTools, BorderLayout.EAST);
      }

      m_noteB.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          Note n = new Note();
          m_toolBarBean = n;

          KnowledgeFlowApp.this.setCursor(Cursor.
              getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
          m_mode = ADDING;
        }
      });

      m_undoB.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          Stack<File> undo = m_mainKFPerspective.getUndoBuffer();
          if (undo.size() > 0) {
            File undoF = undo.pop();
            if (undo.size() == 0) {
              m_undoB.setEnabled(false);
            }         
            loadLayout(undoF, false, true);         
          }       
        }
      });

      m_playB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
          "resultset_next.png")));
      m_playB.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
      m_playB.setToolTipText("Run this flow (all start points launched in parallel)");
      m_playB.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (BeanInstance.getBeanInstances(m_mainKFPerspective.
              getCurrentTabIndex()).size() == 0) {
            return;
          }
          runFlow(false);
        }
      });

      m_playBB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
          "resultset_last.png")));
      m_playBB.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
      m_playBB.setToolTipText("Run this flow (start points launched sequentially)");
      m_playBB.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (BeanInstance.getBeanInstances(m_mainKFPerspective.
              getCurrentTabIndex()).size() == 0) {
            return;
          }
          if (!Utils.getDontShowDialog("weka.gui.beans.KnowledgeFlow.SequentialRunInfo")) {
            JCheckBox dontShow = new JCheckBox("Do not show this message again");
            Object[] stuff = new Object[2];
            stuff[0] = "The order that data sources are launched in can be\n" +
            "specified by setting a custom name for each data source that\n" +
            "that includes a number. E.g. \"1:MyArffLoader\". To set a name,\n" +
            "right-click over a data source and select \"Set name\"\n\n" +
            "If the prefix is not specified, then the order of execution\n" +
            "will correspond to the order that the components were added\n" +
            "to the layout. Note that it is also possible to prevent a data\n" +
            "source from executing by prefixing its name with a \"!\". E.g\n" +
            "\"!:MyArffLoader\"";
            stuff[1] = dontShow;

            JOptionPane.showMessageDialog(KnowledgeFlowApp.this, stuff,
                "Sequential execution information", JOptionPane.OK_OPTION);

            if (dontShow.isSelected()) {
              try {
                Utils.setDontShowDialog("weka.gui.beans.KnowledgeFlow.SequentialRunInfo");
              } catch (Exception ex) {
                // quietly ignore
              }
            }
          }

          runFlow(true);
        }
      });

      m_stopB = new JButton(new ImageIcon(loadImage(BeanVisual.ICON_PATH +
      "shape_square.png")));
      m_stopB.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
      m_stopB.setToolTipText("Stop all execution");

      Image tempI = loadImage(BeanVisual.ICON_PATH + "cursor.png");
      m_pointerB = new JButton(new ImageIcon(tempI));
      m_pointerB.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
      m_pointerB.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          m_toolBarBean = null;
          m_mode = NONE;
          KnowledgeFlowApp.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
          m_componentTree.clearSelection();
        }
      });

      //    Dimension dP = m_saveB.getPreferredSize();
      //    Dimension dM = m_saveB.getMaximumSize();
      //    Dimension dP = m_stopB.getPreferredSize();
      //    Dimension dM = m_stopB.getMaximumSize();
      //    m_pointerB.setPreferredSize(dP);
      //    m_pointerB.setMaximumSize(dM);
      //m_toolBarGroup.add(m_pointerB);

      JToolBar fixedTools2 = new JToolBar();
      fixedTools2.setOrientation(JToolBar.HORIZONTAL);
      fixedTools2.setFloatable(false);
      fixedTools2.add(m_pointerB);
      fixedTools2.add(m_playB);
      fixedTools2.add(m_playBB);
      fixedTools2.add(m_stopB);

      Dimension d = m_playB.getPreferredSize();
      Dimension d2 = fixedTools2.getMinimumSize();
      Dimension d3 = new Dimension(d2.width, d.height + 4);
      fixedTools2.setPreferredSize(d3);
      fixedTools2.setMaximumSize(d3);


      //    m_helpB.setPreferredSize(dP);
      //    m_helpB.setMaximumSize(dP);
      //m_helpB.setSize(m_pointerB.getSize().width, m_pointerB.getSize().height);
View Full Code Here

    **/
    public DrawingFrame()
    {
        super("Extender-Based Host");

        m_toolbar = new JToolBar("Toolbar");
        m_panel = new JPanel();
        m_panel.setBackground(Color.WHITE);
        m_panel.setLayout(null);
        m_panel.setMinimumSize(new Dimension(400, 400));
        m_panel.addMouseListener(this);
View Full Code Here

TOP

Related Classes of javax.swing.JToolBar

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.