Java Code Examples for com.jidesoft.swing.JideButton#addActionListener()

The following examples show how to use com.jidesoft.swing.JideButton#addActionListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GoToPanel.java    From JuiceboxLegacy with MIT License 4 votes vote down vote up
public GoToPanel(SuperAdapter superAdapter) {
    super();
    this.hic = superAdapter.getHiC();
    this.superAdapter = superAdapter;

    JLabel goLabel = new JLabel("Goto");
    goLabel.setHorizontalAlignment(SwingConstants.CENTER);

    JPanel goLabelPanel = new JPanel();
    goLabelPanel.setBackground(HiCGlobals.backgroundColor);
    goLabelPanel.setLayout(new BorderLayout());
    goLabelPanel.add(goLabel, BorderLayout.CENTER);

    positionChrTop = initializeGoToTextField();
    positionChrLeft = initializeGoToTextField();

    JPanel goPositionPanel = new JPanel();
    goPositionPanel.setLayout(new BorderLayout());
    goPositionPanel.add(positionChrTop, BorderLayout.PAGE_START);
    goPositionPanel.add(positionChrLeft, BorderLayout.PAGE_END);

    goButton = new JideButton();
    goButton.setEnabled(false);
    goButton.setIcon(new ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Refresh24.gif")));
    goButton.addActionListener(this);

    JPanel goButtonPanel = new JPanel();
    goButtonPanel.setBackground(new Color(238, 238, 238));
    goButtonPanel.setLayout(new BoxLayout(goButtonPanel, BoxLayout.X_AXIS));
    goButtonPanel.add(goPositionPanel, BorderLayout.PAGE_START);
    goButtonPanel.add(goButton);

    setBackground(new Color(238, 238, 238));
    setBorder(LineBorder.createGrayLineBorder());
    setLayout(new BorderLayout());
    add(goLabelPanel, BorderLayout.PAGE_START);
    add(goButtonPanel);
    setMinimumSize(new Dimension(100, 70));
    setPreferredSize(new Dimension(120, 70));
    setMaximumSize(new Dimension(200, 70));
}
 
Example 2
Source File: CategoryPanel.java    From JuiceboxLegacy with MIT License 4 votes vote down vote up
public CategoryPanel(String name, List<ResourceLocator> locatorList, Set<String> loadedTrackNames) {

        expanded = true;

        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
        setAlignmentX(LEFT_ALIGNMENT);
        //setLayout(null);

        labelBar = new JPanel();
        //labelBar.setBackground(Color.blue);
        labelBar.setLayout(new BoxLayout(labelBar, BoxLayout.X_AXIS));
        labelBar.setBorder(BorderFactory.createRaisedBevelBorder()); //  new LabelBorder(Color.black));
        labelBar.setAlignmentX(LEFT_ALIGNMENT);
        JideButton toggleButton = new JideButton(expanded ? " - " : " + ");
        toggleButton.setButtonStyle(ButtonStyle.HYPERLINK_STYLE);
        labelBar.add(toggleButton);

        labelBar.add(new JLabel(name));
        this.add(labelBar);


        listPanel = new JPanel();
        listPanel.setLayout(new GridLayout(0, 4));
        for (ResourceLocator loc : locatorList) {
            final String trackName = loc.getTrackName();
            JCheckBox cb = new JCheckBox(trackName);
            cb.setSelected(loadedTrackNames.contains(trackName));
            listPanel.add(cb);
        }
        this.add(listPanel);

        toggleButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                expanded = !expanded;
                listPanel.setVisible(expanded);
            }
        });
        labelBar.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent mouseEvent) {
                expanded = !expanded;
                listPanel.setVisible(expanded);
            }
        });

    }
 
Example 3
Source File: GoToPanel.java    From Juicebox with MIT License 4 votes vote down vote up
public GoToPanel(SuperAdapter superAdapter) {
    super();
    this.hic = superAdapter.getHiC();
    this.superAdapter = superAdapter;

    JLabel goLabel = new JLabel("Goto");
    goLabel.setHorizontalAlignment(SwingConstants.CENTER);

    JPanel goLabelPanel = new JPanel();
    goLabelPanel.setBackground(HiCGlobals.backgroundColor);
    goLabelPanel.setLayout(new BorderLayout());
    goLabelPanel.add(goLabel, BorderLayout.CENTER);

    positionChrTop = initializeGoToTextField();
    positionChrLeft = initializeGoToTextField();

    JPanel goPositionPanel = new JPanel();
    goPositionPanel.setLayout(new BorderLayout());
    goPositionPanel.add(positionChrTop, BorderLayout.PAGE_START);
    goPositionPanel.add(positionChrLeft, BorderLayout.PAGE_END);

    goButton = new JideButton();
    goButton.setEnabled(false);
    goButton.setIcon(new ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Refresh24.gif")));
    goButton.addActionListener(this);

    JPanel goButtonPanel = new JPanel();
    goButtonPanel.setBackground(HiCGlobals.diffGrayColor);
    goButtonPanel.setLayout(new BoxLayout(goButtonPanel, BoxLayout.X_AXIS));
    goButtonPanel.add(goPositionPanel, BorderLayout.PAGE_START);
    goButtonPanel.add(goButton);

    setBackground(HiCGlobals.diffGrayColor);
    setBorder(LineBorder.createGrayLineBorder());
    setLayout(new BorderLayout());
    add(goLabelPanel, BorderLayout.PAGE_START);
    add(goButtonPanel);
    setMinimumSize(new Dimension(100, 70));
    setPreferredSize(new Dimension(120, 70));
    setMaximumSize(new Dimension(200, 70));
}
 
Example 4
Source File: CategoryPanel.java    From Juicebox with MIT License 4 votes vote down vote up
public CategoryPanel(String name, List<ResourceLocator> locatorList, Set<String> loadedTrackNames) {

        expanded = true;

        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
        setAlignmentX(LEFT_ALIGNMENT);
        //setLayout(null);

        labelBar = new JPanel();
        //labelBar.setBackground(Color.blue);
        labelBar.setLayout(new BoxLayout(labelBar, BoxLayout.X_AXIS));
        labelBar.setBorder(BorderFactory.createRaisedBevelBorder()); //  new LabelBorder(Color.black));
        labelBar.setAlignmentX(LEFT_ALIGNMENT);
        JideButton toggleButton = new JideButton(expanded ? " - " : " + ");
        toggleButton.setButtonStyle(ButtonStyle.HYPERLINK_STYLE);
        labelBar.add(toggleButton);

        labelBar.add(new JLabel(name));
        this.add(labelBar);


        listPanel = new JPanel();
        listPanel.setLayout(new GridLayout(0, 4));
        for (ResourceLocator loc : locatorList) {
            final String trackName = loc.getTrackName();
            JCheckBox cb = new JCheckBox(trackName);
            cb.setSelected(loadedTrackNames.contains(trackName));
            listPanel.add(cb);
        }
        this.add(listPanel);

        toggleButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                expanded = !expanded;
                listPanel.setVisible(expanded);
            }
        });
        labelBar.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent mouseEvent) {
                expanded = !expanded;
                listPanel.setVisible(expanded);
            }
        });

    }