Skip to content
Snippets Groups Projects
Select Git revision
  • 6b1ca84c0403e7f28872f3269f1e9b541b263279
  • master default
  • dev_general
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
8 results

EditCostPanel.java

  • user avatar
    Philipp Spohr authored
    6b1ca84c
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    EditCostPanel.java 1.29 KiB
    package de.hhu.ba.yoshikoWrapper.gui;
    
    import javax.swing.BorderFactory;
    import javax.swing.JLabel;
    import javax.swing.border.EtchedBorder;
    
    import org.cytoscape.model.CyColumn;
    
    @SuppressWarnings("serial") //Will never be serialized
    public class EditCostPanel extends ComfortPanel {
    	
    	//SWING COMPONENTS
    	private ModificationCostMapper modCostMapper;
    	private DoubleInputField  icField;
    	private DoubleInputField dcField;
    	private JLabel icLabel;
    	private JLabel dcLabel;
    	
    	public EditCostPanel() {
    		
    		//Initialize components
    		modCostMapper = new ModificationCostMapper();
    		icField = new DoubleInputField(Double.NEGATIVE_INFINITY,0);
    		dcField = new DoubleInputField(0,Double.POSITIVE_INFINITY);
    		icField.setText("-1.0");
    		dcField.setText("1.0");
    		icLabel = new JLabel("Insertion Cost:");
    		dcLabel = new JLabel("Deletion Cost:");
    		icLabel.setLabelFor(icField);
    		dcLabel.setLabelFor(dcField);
    		this.addAll(modCostMapper,icField,dcField,icLabel,dcLabel);
    		
    		//
    		this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
    	}
    	
    	//SETTER / GETTER
    
    	public CyColumn getWeightColumn() {
    		return modCostMapper.getValue();
    	}
    
    	public double getDefaultInsertionCost() {
    		return icField.getValueAsDouble();
    	}
    	
    	public double getDefaultDeletionCost() {
    		return dcField.getValueAsDouble();
    	}
    	
    }