Skip to content
Snippets Groups Projects
Select Git revision
  • 2132a14bc5ec0241a0c8095a8896c2c646d5464b
  • master default protected
  • emoUS
  • add_default_vectorizer_and_pretrained_loading
  • clean_code
  • readme
  • issue127
  • generalized_action_dicts
  • ppo_num_dialogues
  • crossowoz_ddpt
  • issue_114
  • robust_masking_feature
  • scgpt_exp
  • e2e-soloist
  • convlab_exp
  • change_system_act_in_env
  • pre-training
  • nlg-scgpt
  • remapping_actions
  • soloist
20 results

setup.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    MainPanel.java 2.18 KiB
    package de.hhu.ba.yoshikoWrapper.gui;
    
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    
    import javax.swing.Icon;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JPanel;
    import org.cytoscape.application.swing.CytoPanelComponent;
    import org.cytoscape.application.swing.CytoPanelName;
    
    import de.hhu.ba.yoshikoWrapper.core.YoshikoInterface;
    
    /**This class describes the Swing Panel that the user interacts with in cytoscape
     * @author Philipp Spohr, Aug 6, 2017
     *
     */
    public class MainPanel extends JPanel implements CytoPanelComponent {
    
    	/**
    	 * Unique identifier for serialization
    	 */
    	private static final long serialVersionUID = 6214827920591046457L;
    	
    	//SYMBOLIC LINKS
    	private YoshikoInterface yoshikoInterface = YoshikoInterface.getInstance();
    	private MainPanel self = this; //for lambda function references
    	//SWING COMPONENTS
    	
    	private LibStatusPanel libStatusPanel;
    	private JButton searchLibButton;
    
    	/**
    	 * Main constructor, creates a new Panel and intializes subcomponents
    	 */
    	public MainPanel() {
    		
    		//SWING COMPONENT INITIALIZATION
    		
    		libStatusPanel = new LibStatusPanel();
    		libStatusPanel.setStyle(yoshikoInterface.isLibraryLoaded());
    		this.add(libStatusPanel);
    		
    		searchLibButton = new JButton("SHOW YOSHIKO LIB");
    		searchLibButton.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				final YLibChooser c = new YLibChooser();
    				int returnVal = c.showOpenDialog(self);
    				if (returnVal == JFileChooser.APPROVE_OPTION) {
    					yoshikoInterface.loadLibrary(c.getSelectedFile().getAbsolutePath());
    				}
    			}
    			
    		});
    		this.add(searchLibButton);
    		
    		this.setVisible(true);
    	}
    
    
    	public Component getComponent() {
    		return this;
    	}
    
    
    	/* (non-Javadoc)