<commit_before>/*******************************************************************************
 * Caleydo - visualization for molecular biology - http://caleydo.org
 * 
 * Copyright(C) 2005, 2012 Graz University of Technology, <NAME>, Alexander
 * Lex, <NAME>, <NAME> Linz </p>
 * 
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>
 *******************************************************************************/
package org.caleydo.view.enroute;

import gleem.linalg.Vec3f;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.glu.GLU;
import org.caleydo.core.data.datadomain.IDataDomain;
import org.caleydo.core.data.datadomain.IDataSupportDefinition;
import org.caleydo.core.data.perspective.table.TablePerspective;
import org.caleydo.core.data.selection.EventBasedSelectionManager;
import org.caleydo.core.data.selection.IEventBasedSelectionManagerUser;
import org.caleydo.core.event.view.SetMinViewSizeEvent;
import org.caleydo.core.event.view.TablePerspectivesChangedEvent;
import org.caleydo.core.id.IDType;
import org.caleydo.core.manager.GeneralManager;
import org.caleydo.core.serialize.ASerializedMultiTablePerspectiveBasedView;
import org.caleydo.core.view.IMultiTablePerspectiveBasedView;
import org.caleydo.core.view.listener.AddTablePerspectivesEvent;
import org.caleydo.core.view.listener.AddTablePerspectivesListener;
import org.caleydo.core.view.listener.RemoveTablePerspectiveEvent;
import org.caleydo.core.view.listener.RemoveTablePerspectiveListener;
import org.caleydo.core.view.opengl.camera.ViewFrustum;
import org.caleydo.core.view.opengl.canvas.AGLView;
import org.caleydo.core.view.opengl.canvas.EDetailLevel;
import org.caleydo.core.view.opengl.mouse.GLMouseListener;
import org.caleydo.core.view.opengl.util.connectionline.ClosedArrowRenderer;
import org.caleydo.core.view.opengl.util.connectionline.ConnectionLineRenderer;
import org.caleydo.core.view.opengl.util.connectionline.LineCrossingRenderer;
import org.caleydo.core.view.opengl.util.connectionline.LineEndArrowRenderer;
import org.caleydo.core.view.opengl.util.connectionline.LineEndStaticLineRenderer;
import org.caleydo.core.view.opengl.util.connectionline.LineLabelRenderer;
import org.caleydo.core.view.opengl.util.text.CaleydoTextRenderer;
import org.caleydo.datadomain.genetic.GeneticDataSupportDefinition;
import org.caleydo.datadomain.genetic.GeneticDataDomain;
import org.caleydo.datadomain.pathway.graph.PathwayGraph;
import org.caleydo.datadomain.pathway.graph.PathwayPath;
import org.caleydo.datadomain.pathway.graph.item.edge.EPathwayReactionEdgeType;
import org.caleydo.datadomain.pathway.graph.item.edge.EPathwayRelationEdgeSubType;
import org.caleydo.datadomain.pathway.graph.item.edge.PathwayReactionEdgeRep;
import org.caleydo.datadomain.pathway.graph.item.edge.PathwayRelationEdgeRep;
import org.caleydo.datadomain.pathway.graph.item.vertex.EPathwayVertexType;
import org.caleydo.datadomain.pathway.graph.item.vertex.PathwayVertexGroupRep;
import org.caleydo.datadomain.pathway.graph.item.vertex.PathwayVertexRep;
import org.caleydo.view.enroute.event.FitToViewWidthEvent;
import org.caleydo.view.enroute.event.RemoveEnRouteNodeEvent;
import org.caleydo.view.enroute.listener.EnRoutePathEventListener;
import org.caleydo.view.enroute.listener.FitToViewWidthEventListener;
import org.caleydo.view.enroute.listener.RemoveEnRouteNodeEventListener;
import org.caleydo.view.enroute.mappeddataview.MappedDataRenderer;
import org.caleydo.view.enroute.node.ALinearizableNode;
import org.caleydo.view.enroute.node.ANode;
import org.caleydo.view.enroute.node.BranchSummaryNode;
import org.caleydo.view.enroute.node.ComplexNode;
import org.caleydo.view.enroute.node.CompoundNode;
import org.caleydo.view.enroute.node.GeneNode;
import org.caleydo.view.pathway.event.EnRoutePathEvent;
import org.eclipse.swt.widgets.Composite;
import org.jgrapht.GraphPath;
import org.jgrapht.Graphs;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.GraphPathImpl;

/**
 * Main view class for the linearized pathway view.
 * 
 * @author <NAME>
 * @author <NAME>
 */

public class GLEnRoutePathway
	extends AGLView
	implements IMultiTablePerspectiveBasedView, IEventBasedSelectionManagerUser {

	public static String VIEW_TYPE = "org.caleydo.view.enroute";
	public static String VIEW_NAME = "enRoute";

	protected final static String EMPTY_VIEW_TEXT_LINE_ONE = "Please select a path of nodes and assign data to enRoute using the Data View Integrater (DVI) View.";
	protected final static String EMPTY_VIEW_TEXT_LINE_TWO = "in the pathway view.";

	protected final static int DEFAULT_DATA_ROW_HEIGHT_PIXELS = 60;
	protected final static int BRANCH_COLUMN_WIDTH_PIXELS = 100;
	protected final static int PATHWAY_COLUMN_WIDTH_PIXELS = 150;
	protected final static int DATA_COLUMN_WIDTH_PIXELS = 350;
	protected final static int MIN_NODE_SPACING_PIXELS = 50;
	protected final static int TOP_SPACING_PIXELS = 60;
	protected final static int TOP_SPACING_MAPPED_DATA = 10;
	protected final static int SIDE_SPACING_MAPPED_DATA = 10;
	protected final static int BOTTOM_SPACING_PIXELS = 60;
	protected final static int PREVIEW_NODE_DATA_ROW_HEIGHT_PIXELS = 40;
	protected final static int BRANCH_SUMMARY_NODE_TO_LINEARIZED_NODE_VERTICAL_DISTANCE_PIXELS = 20;
	protected final static int EXPANDED_BRANCH_NODE_SPACING_PIXELS = 20;
	protected final static int EXPANDED_BRANCH_NODE_WIDTH_PIXELS = 150;
	protected final static int SPACING_PIXELS = 2;<commit_msg>Fixed typo in enroute message.<commit_after>/*******************************************************************************
 * Caleydo - visualization for molecular biology - http://caleydo.org
 * 
 * Copyright(C) 2005, 2012 Graz University of Technology, <NAME>, Alexander
 * Lex, <NAME>, <NAME> University Linz </p>
 * 
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>
 *******************************************************************************/
package org.caleydo.view.enroute;

import gleem.linalg.Vec3f;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.glu.GLU;
import org.caleydo.core.data.datadomain.IDataDomain;
import org.caleydo.core.data.datadomain.IDataSupportDefinition;
import org.caleydo.core.data.perspective.table.TablePerspective;
import org.caleydo.core.data.selection.EventBasedSelectionManager;
import org.caleydo.core.data.selection.IEventBasedSelectionManagerUser;
import org.caleydo.core.event.view.SetMinViewSizeEvent;
import org.caleydo.core.event.view.TablePerspectivesChangedEvent;
import org.caleydo.core.id.IDType;
import org.caleydo.core.manager.GeneralManager;
import org.caleydo.core.serialize.ASerializedMultiTablePerspectiveBasedView;
import org.caleydo.core.view.IMultiTablePerspectiveBasedView;
import org.caleydo.core.view.listener.AddTablePerspectivesEvent;
import org.caleydo.core.view.listener.AddTablePerspectivesListener;
import org.caleydo.core.view.listener.RemoveTablePerspectiveEvent;
import org.caleydo.core.view.listener.RemoveTablePerspectiveListener;
import org.caleydo.core.view.opengl.camera.ViewFrustum;
import org.caleydo.core.view.opengl.canvas.AGLView;
import org.caleydo.core.view.opengl.canvas.EDetailLevel;
import org.caleydo.core.view.opengl.mouse.GLMouseListener;
import org.caleydo.core.view.opengl.util.connectionline.ClosedArrowRenderer;
import org.caleydo.core.view.opengl.util.connectionline.ConnectionLineRenderer;
import org.caleydo.core.view.opengl.util.connectionline.LineCrossingRenderer;
import org.caleydo.core.view.opengl.util.connectionline.LineEndArrowRenderer;
import org.caleydo.core.view.opengl.util.connectionline.LineEndStaticLineRenderer;
import org.caleydo.core.view.opengl.util.connectionline.LineLabelRenderer;
import org.caleydo.core.view.opengl.util.text.CaleydoTextRenderer;
import org.caleydo.datadomain.genetic.GeneticDataSupportDefinition;
import org.caleydo.datadomain.genetic.GeneticDataDomain;
import org.caleydo.datadomain.pathway.graph.PathwayGraph;
import org.caleydo.datadomain.pathway.graph.PathwayPath;
import org.caleydo.datadomain.pathway.graph.item.edge.EPathwayReactionEdgeType;
import org.caleydo.datadomain.pathway.graph.item.edge.EPathwayRelationEdgeSubType;
import org.caleydo.datadomain.pathway.graph.item.edge.PathwayReactionEdgeRep;
import org.caleydo.datadomain.pathway.graph.item.edge.PathwayRelationEdgeRep;
import org.caleydo.datadomain.pathway.graph.item.vertex.EPathwayVertexType;
import org.caleydo.datadomain.pathway.graph.item.vertex.PathwayVertexGroupRep;
import org.caleydo.datadomain.pathway.graph.item.vertex.PathwayVertexRep;
import org.caleydo.view.enroute.event.FitToViewWidthEvent;
import org.caleydo.view.enroute.event.RemoveEnRouteNodeEvent;
import org.caleydo.view.enroute.listener.EnRoutePathEventListener;
import org.caleydo.view.enroute.listener.FitToViewWidthEventListener;
import org.caleydo.view.enroute.listener.RemoveEnRouteNodeEventListener;
import org.caleydo.view.enroute.mappeddataview.MappedDataRenderer;
import org.caleydo.view.enroute.node.ALinearizableNode;
import org.caleydo.view.enroute.node.ANode;
import org.caleydo.view.enroute.node.BranchSummaryNode;
import org.caleydo.view.enroute.node.ComplexNode;
import org.caleydo.view.enroute.node.CompoundNode;
import org.caleydo.view.enroute.node.GeneNode;
import org.caleydo.view.pathway.event.EnRoutePathEvent;
import org.eclipse.swt.widgets.Composite;
import org.jgrapht.GraphPath;
import org.jgrapht.Graphs;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.GraphPathImpl;

/**
 * Main view class for the linearized pathway view.
 * 
 * @author <NAME>
 * @author <NAME>
 */

public class GLEnRoutePathway
	extends AGLView
	implements IMultiTablePerspectiveBasedView, IEventBasedSelectionManagerUser {

	public static String VIEW_TYPE = "org.caleydo.view.enroute";
	public static String VIEW_NAME = "enRoute";

	protected final static String EMPTY_VIEW_TEXT_LINE_ONE = "Please select a path of nodes using the pathway view ";
	protected final static String EMPTY_VIEW_TEXT_LINE_TWO = "and assign data to enRoute using the Data-View Integrater View.";

	protected final static int DEFAULT_DATA_ROW_HEIGHT_PIXELS = 60;
	protected final static int BRANCH_COLUMN_WIDTH_PIXELS = 100;
	protected final static int PATHWAY_COLUMN_WIDTH_PIXELS = 150;
	protected final static int DATA_COLUMN_WIDTH_PIXELS = 350;
	protected final static int MIN_NODE_SPACING_PIXELS = 50;
	protected final static int TOP_SPACING_PIXELS = 60;
	protected final static int TOP_SPACING_MAPPED_DATA = 10;
	protected final static int SIDE_SPACING_MAPPED_DATA = 10;
	protected final static int BOTTOM_SPACING_PIXELS = 60;
	protected final static int PREVIEW_NODE_DATA_ROW_HEIGHT_PIXELS = 40;
	protected final static int BRANCH_SUMMARY_NODE_TO_LINEARIZED_NODE_VERTICAL_DISTANCE_PIXELS = 20;
	protected final static int EXPANDED_BRANCH_NODE_SPACING_PIXELS = 20;
	protected final static int EXPANDED_BRANCH_NODE_WIDTH_PIXELS = 150;
	protected final static int SPACING_PIXELS = 2;
{'fraction_non_alphanumeric': 0.10847001030029316, 'fraction_numerical': 0.0066555740432612314, 'mean_word_length': 6.389929742388759, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5046300', 'n_tokens_mistral': 4331, 'n_tokens_neox': 4093, 'n_words': 806}