Search in sources :

Example 6 with ToolUI

use of org.gephi.tools.spi.ToolUI in project gephi by gephi.

the class Painter method getUI.

@Override
public ToolUI getUI() {
    return new ToolUI() {

        @Override
        public JPanel getPropertiesBar(Tool tool) {
            painterPanel = new PainterPanel();
            painterPanel.setColor(new Color(color[0], color[1], color[2]));
            return painterPanel;
        }

        @Override
        public String getName() {
            return NbBundle.getMessage(Painter.class, "Painter.name");
        }

        @Override
        public Icon getIcon() {
            return new ImageIcon(getClass().getResource("/org/gephi/tools/plugin/resources/painter.png"));
        }

        @Override
        public String getDescription() {
            return NbBundle.getMessage(Painter.class, "Painter.description");
        }

        @Override
        public int getPosition() {
            return 100;
        }
    };
}
Also used : ImageIcon(javax.swing.ImageIcon) PainterPanel(org.gephi.ui.tools.plugin.PainterPanel) Color(java.awt.Color) ToolUI(org.gephi.tools.spi.ToolUI) Tool(org.gephi.tools.spi.Tool)

Aggregations

ImageIcon (javax.swing.ImageIcon)6 Tool (org.gephi.tools.spi.Tool)6 ToolUI (org.gephi.tools.spi.ToolUI)6 Color (java.awt.Color)2 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 ArrayList (java.util.ArrayList)1 Comparator (java.util.Comparator)1 HashMap (java.util.HashMap)1 JToggleButton (javax.swing.JToggleButton)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1 UnselectToolException (org.gephi.tools.spi.UnselectToolException)1 BrushPanel (org.gephi.ui.tools.plugin.BrushPanel)1 EdgePencilPanel (org.gephi.ui.tools.plugin.EdgePencilPanel)1 NodePencilPanel (org.gephi.ui.tools.plugin.NodePencilPanel)1 PainterPanel (org.gephi.ui.tools.plugin.PainterPanel)1 ShortestPathPanel (org.gephi.ui.tools.plugin.ShortestPathPanel)1 SelectionManager (org.gephi.visualization.api.selection.SelectionManager)1