/** * Adds an action to the view header. * @param name The name of the action. * @param icon An icon to display in the view header for the action. * @param runnable The code that should be called when the action is executed. */ public void addAction(@Nonnull String name, @Nonnull Icon icon, @Nonnull final Runnable runnable) { addAction(new AbstractAction(name, icon) { @Override public void actionPerformed(ActionEvent e) { runnable.run(); } }); }
/** * Sets the background color of the header. * @param color The color to be set. */ public void setBannerColor(Color color) { backgroundColor = color; labelPanel.setBackground(backgroundColor); toolBarPanel.setBackground(backgroundColor); revalidate(); }
/** * Sets this view as being pinned. If a view is pinned then it will not synchronise with the global selection. * @param pinned true if the view should be pinned, otherwise false. */ public void setPinned(boolean pinned) { if (pinned) { setBannerColor(Color.GRAY); } else { setBannerColor(defaultBackgroundColor); } }
this.backgroundColor = bannerColor; setLayout(new BorderLayout()); setOpaque(true); setBackground(backgroundColor); labelPanel = new JPanel(new BorderLayout()); add(labelPanel, BorderLayout.NORTH); labelPanel.setBackground(null); labelPanel.setOpaque(true); label.setForeground(foregroundColor); label.setFont(label.getFont().deriveFont(14f)); setText(""); toolBar.setBorderPainted(false); toolBar.setFloatable(false);
/** * Sets the text on the view header. This can be used to * override the label that is specified in the plugin.xml * file. * @param text The header text. */ public void setHeaderText(String text) { viewBarComponent.getViewBar().getViewBanner().setText(text); }
public ViewBar(String bannerText, Color bannerColor) { setLayout(new BorderLayout(2, 2)); viewBanner = new ViewBanner(bannerText, bannerColor); add(viewBanner, BorderLayout.NORTH); JPanel southPanel = new JPanel(new BorderLayout(7, 7)); toolBar = new JToolBar(); southPanel.add(toolBar, BorderLayout.WEST); add(southPanel, BorderLayout.SOUTH); toolBar.setOpaque(false); toolBar.setFloatable(false); toolBar.setBorderPainted(false); toolBar.setBorder(null); viewModeComboBox = new JComboBox<>(); viewModeComboBox.addActionListener(e -> fireViewModeChanged()); viewModeComboBox.setVisible(false); southPanel.add(viewModeComboBox, BorderLayout.EAST); }
public void setEnabled(boolean enabled) { super.setEnabled(enabled); viewBanner.setEnabled(enabled); }
this.foregroundColor = Color.WHITE; this.labelText = labelText; setLayout(new BorderLayout()); setOpaque(true); setBackground(backgroundColor); labelPanel = new JPanel(new BorderLayout()); add(labelPanel, BorderLayout.NORTH); label.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3)); label.setForeground(foregroundColor); setText(""); toolBar = new JToolBar(); toolBar.setBorderPainted(false);
/** * Sets the text on the view header. This can be used to * override the label that is specified in the plugin.xml * file. * @param text The header text. */ public void setHeaderText(String text) { viewBarComponent.getViewBar().getViewBanner().setText(text); }
public ViewBar(String bannerText, Color bannerColor) { setLayout(new BorderLayout(2, 2)); viewBanner = new ViewBanner(bannerText, bannerColor); add(viewBanner, BorderLayout.NORTH); toolBar = new JToolBar(); add(toolBar, BorderLayout.SOUTH); toolBar.setOpaque(false); toolBar.setFloatable(false); toolBar.setBorderPainted(false); toolBar.setBorder(null); }
public void setEnabled(boolean enabled) { super.setEnabled(enabled); viewBanner.setEnabled(enabled); }
this.foregroundColor = Color.WHITE; this.labelText = labelText; setLayout(new BorderLayout()); setOpaque(true); setBackground(backgroundColor); labelPanel = new JPanel(new BorderLayout()); add(labelPanel, BorderLayout.NORTH); label.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3)); label.setForeground(foregroundColor); setText(""); toolBar = new JToolBar(); toolBar.setBorderPainted(false);
/** * Sets the text on the view header. This can be used to * override the label that is specified in the plugin.xml * file. * @param text The header text. */ public void setHeaderText(String text) { viewBarComponent.getViewBar().getViewBanner().setText(text); }
public void setPinned(boolean b) { if (b) { setBannerColor(Color.GRAY); } else { setBannerColor(defaultBackgroundColor); } }
private void addViewManipulationActions() { // View manipulation toolbar ViewBanner viewBanner = viewBarComponent.getViewBar().getViewBanner(); plugin.getHelpLink().ifPresent(u -> viewBanner.addAction("Help", HelpIcon.get(), this::showHelpIfPresent)); viewBanner.addAction("Split vertically", SplitVerticallyIcon.get(), this::splitVertically); viewBanner.addAction("Split horizontally", SplitHorizontallyIcon.get(), this::splitHorizontally); viewBanner.addAction("Float", FloatIcon.get(), this::copyAndFloatView); viewBanner.addAction("Close", CloseIcon.get(), this::closeView); }
/** * Sets the background color of the header. * @param color The color to be set. */ public void setBannerColor(Color color) { backgroundColor = color; labelPanel.setBackground(backgroundColor); toolBarPanel.setBackground(backgroundColor); revalidate(); }
public ViewBar(String bannerText, Color bannerColor) { setLayout(new BorderLayout(2, 2)); viewBanner = new ViewBanner(bannerText, bannerColor); add(viewBanner, BorderLayout.NORTH); toolBar = new JToolBar(); add(toolBar, BorderLayout.SOUTH); toolBar.setOpaque(false); toolBar.setFloatable(false); toolBar.setBorderPainted(false); toolBar.setBorder(null); }
public void setEnabled(boolean enabled) { super.setEnabled(enabled); viewBanner.setEnabled(enabled); }
.getInstance() .getProperty(ProtegeProperties.ONTOLOGY_COLOR_KEY), Color.GRAY), panel); vbc.getViewBar().getViewBanner().setText(catalogFile.getAbsolutePath()); setLayout(new BorderLayout()); add(vbc);
public void setPinned(boolean b) { if (b) { setBannerColor(Color.GRAY); } else { setBannerColor(defaultBackgroundColor); } }