<commit_before>package auckland.cs;

/**
 * SimpleConnectionSkin is extended to add more features   
 * @author mkha153 
 */

import java.util.List;
import java.util.Map;

import de.tesis.dynaware.grapheditor.core.skins.defaults.DefaultConnectionSkin;
import de.tesis.dynaware.grapheditor.model.GConnection;
import javafx.geometry.Point2D;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import auckland.cs.Popup;

public class TitledConnectionSkin extends DefaultConnectionSkin {
	 private static final String STYLE_CLASS = "titled-connection";	 
	 private static double normal_strok_width;
	 private static double higlighted_strok_width;
	 
	 private int  dependencyIndex;
    /**
     * Creates a new simple connection skin instance with mouse event .
     *
     * @param connection the {@link GConnection} the skin is being created for
     */
    public TitledConnectionSkin(final GConnection connection) {

        super(connection);	              
        path.setMouseTransparent(true);
        root.setOnMouseClicked(this::handleMouseClicked);
        root.setOnMouseEntered(this::handleMouseEntered);
        root.setOnMouseExited(this::handleMouseExited); 
        
        path.getStyleClass().setAll(STYLE_CLASS);
        
        normal_strok_width = path.getStrokeWidth(); 
        higlighted_strok_width = normal_strok_width + 2.0;        
    }          
    
    @Override
    public void draw(final List<Point2D> points, final Map<GConnection, List<Point2D>> allPoints) {
        super.draw(points, allPoints);	        
    }    
  
    private void handleMouseClicked(final MouseEvent event) {
        if(event.getButton()== MouseButton.SECONDARY){
     	   Popup popup= new Popup(event.getScreenX(), event.getScreenY(), (Stage)root.getScene().getWindow(), 
     			                  getConnection().getId(), "Connection",  StageStyle.DECORATED);     
     	   popup.show();
     	  
        }
     }
    
    private void handleMouseEntered(final MouseEvent event){
    	this.path.setStrokeWidth(higlighted_strok_width);   	
    }
    
    private void handleMouseExited(final MouseEvent event){
    	this.path.setStrokeWidth(normal_strok_width);    	
    }

	public int getDependencyIndex() {
		return dependencyIndex;
	}

	public void setDependencyIndex(int dependencyIndex) {
		this.dependencyIndex = dependencyIndex;
	}
    

}<commit_msg>Now you can get root and path ref from connection skin<commit_after>package auckland.cs;

/**
 * SimpleConnectionSkin is extended to add more features   
 * @author mkha153 
 */

import java.util.List;
import java.util.Map;

import de.tesis.dynaware.grapheditor.core.skins.defaults.DefaultConnectionSkin;
import de.tesis.dynaware.grapheditor.model.GConnection;
import javafx.geometry.Point2D;
import javafx.scene.Group;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.shape.Path;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import auckland.cs.Popup;

public class TitledConnectionSkin extends DefaultConnectionSkin {
	 private static final String STYLE_CLASS = "titled-connection";	 
	 private static double normal_strok_width;
	 private static double higlighted_strok_width;
	 
	 private int  dependencyIndex;
    /**
     * Creates a new simple connection skin instance with mouse event .
     *
     * @param connection the {@link GConnection} the skin is being created for
     */
    public TitledConnectionSkin(final GConnection connection) {

        super(connection);	              
        path.setMouseTransparent(true);
        root.setOnMouseClicked(this::handleMouseClicked);
        root.setOnMouseEntered(this::handleMouseEntered);
        root.setOnMouseExited(this::handleMouseExited); 
        
        path.getStyleClass().setAll(STYLE_CLASS);
        
        normal_strok_width = path.getStrokeWidth(); 
        higlighted_strok_width = normal_strok_width + 2.0;        
    }          
    
    @Override
    public void draw(final List<Point2D> points, final Map<GConnection, List<Point2D>> allPoints) {
        super.draw(points, allPoints);	        
    }    
  
    private void handleMouseClicked(final MouseEvent event) {
        if(event.getButton()== MouseButton.SECONDARY){
     	   Popup popup= new Popup(event.getScreenX(), event.getScreenY(), (Stage)root.getScene().getWindow(), 
     			                  getConnection().getId(), "Connection",  StageStyle.DECORATED);     
     	   popup.show();
     	  
        }
     }
    
    private void handleMouseEntered(final MouseEvent event){
    	this.path.setStrokeWidth(higlighted_strok_width);   	
    }
    
    private void handleMouseExited(final MouseEvent event){
    	this.path.setStrokeWidth(normal_strok_width);    	
    }

	public int getDependencyIndex() {
		return dependencyIndex;
	}

	public void setDependencyIndex(int dependencyIndex) {
		this.dependencyIndex = dependencyIndex;
	}
    
	public Group getRoot(){
		return root;
	}
	public Path getPath(){
		return path;
	}

}
{'fraction_non_alphanumeric': 0.08898055391868002, 'fraction_numerical': 0.003142801021410332, 'mean_word_length': 3.1601307189542482, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '249904', 'n_tokens_mistral': 1549, 'n_tokens_neox': 1489, 'n_words': 306}