<commit_before>// PathVisio,
// a tool for data visualization and analysis using Biological Pathways
// Copyright 2006-2007 BiGCaT Bioinformatics
//
// Licensed under the Apache License, Version 2.0 (the "License"); 
// you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at 
// 
// http://www.apache.org/licenses/LICENSE-2.0 
//  
// Unless required by applicable law or agreed to in writing, software 
// distributed under the License is distributed on an "AS IS" BASIS, 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
// See the License for the specific language governing permissions and 
// limitations under the License.
//
package org.pathvisio.view;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.Arc2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Rectangle2D;

import org.pathvisio.model.AnchorType;

class BasicShapes
{
	static void registerShapes()
	{
		ShapeRegistry.registerShape (
			"Arc", new Arc2D.Double (0, 0, 10, 10, 0, -180, Arc2D.OPEN));

		GeneralPath p = new GeneralPath();
		p.moveTo(0, 4);
		p.quadTo(0, 2, 3, 2);
		p.quadTo(6, 2, 6, 0);
		p.quadTo(6, 2, 9, 2);
		p.quadTo(12, 2, 12, 4);		
		ShapeRegistry.registerShape (
			"Brace", p);

		ShapeRegistry.registerShape (
			"Oval", new Ellipse2D.Double (0, 0, 10, 10));
		ShapeRegistry.registerShape (
			"Rectangle", new Rectangle (0, 0, 10, 10));

		ShapeRegistry.registerArrow ("Arrow", getArrowHead(), ArrowShape.CLOSED);
		ShapeRegistry.registerArrow ("TBar", getTBar(), getTBarFill(), ArrowShape.OPEN);
		ShapeRegistry.registerArrow ("LigandRound", getLRound(), ArrowShape.CLOSED);
		ShapeRegistry.registerArrow ("ReceptorRound", getRRound(), ArrowShape.WIRE);
		ShapeRegistry.registerArrow ("Receptor", getReceptor(), ArrowShape.WIRE);
		ShapeRegistry.registerArrow ("ReceptorSquare", getReceptorSquare(), ArrowShape.WIRE);
		ShapeRegistry.registerArrow ("LigandSquare", getLigand(), ArrowShape.CLOSED);	
		
		ShapeRegistry.registerAnchor (AnchorType.NONE.getName(), getAnchorDefault());
		ShapeRegistry.registerAnchor (AnchorType.CIRCLE.getName(), getAnchorCircle());
	}

	/**
	   These are all model coordinates:
	 */
	private static final int ARROWHEIGHT = 65;
	private static final int ARROWWIDTH = 140;
	private static final int TBARHEIGHT = 225;
	private static final int TBARWIDTH = 15;
	private static final int TBAROFFSET = 150;
	private static final int LRDIAM = 175;
	private static final int RRDIAM = LRDIAM + 50;
	private static final int LIGANDWIDTH = 125;
	private static final int LIGANDHEIGHT = 175;
	private static final int RECEPWIDTH = LIGANDWIDTH + 30;
	private static final int RECEPHEIGHT = LIGANDHEIGHT + 30;

	private static final int ANCHOR_DEFAULT_SIZE = 50;
	private static final int ANCHOR_CIRCLE_SIZE = 125;
	
	private static Shape getArrowHead()
	{
		int[] xpoints = new int[] { 0, -ARROWWIDTH, -ARROWWIDTH };
		int[] ypoints = new int[] { 0, -ARROWHEIGHT, ARROWHEIGHT };	   
		return new Polygon(xpoints, ypoints, 3);
	}
	
	private static Shape getTBar()
	{
		return new Rectangle2D.Double(
			-TBAROFFSET, -TBARHEIGHT / 2,
			TBARWIDTH, TBARHEIGHT
			);
	}
	
	private static Shape getTBarFill() 
	{
		return new Rectangle2D.Double(
			-TBAROFFSET + TBARWIDTH, -TBARHEIGHT / 2,
			TBAROFFSET * 2 - TBARWIDTH, TBARHEIGHT
		);
	}
		
	private static Shape getLRound()
	{	
		return new Ellipse2D.Double(-LRDIAM / 2, -LRDIAM / 2, LRDIAM, LRDIAM);
	}
		
	private static Shape getRRound()
	{
		return new Arc2D.Double (0, - RRDIAM / 2, RRDIAM, RRDIAM, 90, 180, Arc2D.OPEN);
	}
		
	private static Shape getReceptorSquare()
	{					<commit_msg>fixed #521 and improved mask fill for TBar a bit<commit_after>// PathVisio,
// a tool for data visualization and analysis using Biological Pathways
// Copyright 2006-2007 BiGCaT Bioinformatics
//
// Licensed under the Apache License, Version 2.0 (the "License"); 
// you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at 
// 
// http://www.apache.org/licenses/LICENSE-2.0 
//  
// Unless required by applicable law or agreed to in writing, software 
// distributed under the License is distributed on an "AS IS" BASIS, 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
// See the License for the specific language governing permissions and 
// limitations under the License.
//
package org.pathvisio.view;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.Arc2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Rectangle2D;

import org.pathvisio.model.AnchorType;

class BasicShapes
{
	static void registerShapes()
	{
		ShapeRegistry.registerShape (
			"Arc", new Arc2D.Double (0, 0, 10, 10, 0, -180, Arc2D.OPEN));

		GeneralPath p = new GeneralPath();
		p.moveTo(0, 4);
		p.quadTo(0, 2, 3, 2);
		p.quadTo(6, 2, 6, 0);
		p.quadTo(6, 2, 9, 2);
		p.quadTo(12, 2, 12, 4);		
		ShapeRegistry.registerShape (
			"Brace", p);

		ShapeRegistry.registerShape (
			"Oval", new Ellipse2D.Double (0, 0, 10, 10));
		ShapeRegistry.registerShape (
			"Rectangle", new Rectangle (0, 0, 10, 10));

		ShapeRegistry.registerArrow ("Arrow", getArrowHead(), ArrowShape.CLOSED);
		ShapeRegistry.registerArrow ("TBar", getTBar(), getTBarFill(), ArrowShape.OPEN);
		ShapeRegistry.registerArrow ("LigandRound", getLRound(), ArrowShape.CLOSED);
		ShapeRegistry.registerArrow ("ReceptorRound", getRRound(), ArrowShape.WIRE);
		ShapeRegistry.registerArrow ("Receptor", getReceptor(), ArrowShape.WIRE);
		ShapeRegistry.registerArrow ("ReceptorSquare", getReceptorSquare(), ArrowShape.WIRE);
		ShapeRegistry.registerArrow ("LigandSquare", getLigand(), ArrowShape.CLOSED);	
		
		ShapeRegistry.registerAnchor (AnchorType.NONE.getName(), getAnchorDefault());
		ShapeRegistry.registerAnchor (AnchorType.CIRCLE.getName(), getAnchorCircle());
	}

	/**
	   These are all model coordinates:
	 */
	private static final int ARROWHEIGHT = 65;
	private static final int ARROWWIDTH = 140;
	private static final int TBARHEIGHT = 225;
	private static final int TBARMASKHEIGHT = 15 * 3;
	private static final int TBARWIDTH = 1;
	private static final int TBAROFFSET = 150;
	private static final int LRDIAM = 175;
	private static final int RRDIAM = LRDIAM + 50;
	private static final int LIGANDWIDTH = 125;
	private static final int LIGANDHEIGHT = 175;
	private static final int RECEPWIDTH = LIGANDWIDTH + 30;
	private static final int RECEPHEIGHT = LIGANDHEIGHT + 30;

	private static final int ANCHOR_DEFAULT_SIZE = 50;
	private static final int ANCHOR_CIRCLE_SIZE = 125;
	
	private static Shape getArrowHead()
	{
		int[] xpoints = new int[] { 0, -ARROWWIDTH, -ARROWWIDTH };
		int[] ypoints = new int[] { 0, -ARROWHEIGHT, ARROWHEIGHT };	   
		return new Polygon(xpoints, ypoints, 3);
	}
	
	private static Shape getTBar()
	{
		return new Rectangle2D.Double(
			-TBAROFFSET, -TBARHEIGHT / 2,
			TBARWIDTH, TBARHEIGHT
			);
	}
	
	private static Shape getTBarFill() 
	{
		return new Rectangle2D.Double(
			-TBAROFFSET + TBARWIDTH, -TBARMASKHEIGHT / 2,
			TBAROFFSET * 2 - TBARWIDTH, TBARMASKHEIGHT
		);
	}
		
	private static Shape getLRound()
	{	
		return new Ellipse2D.Double(-LRDIAM / 2, -LRDIAM / 2, LRDIAM, LRDIAM);
	}
		
	private static Shape getRRound()
	{
		return new Arc2D.Double (0, - RRDIAM / 2, RRDIAM, RRDIAM, 90, 180, Arc2D.OPEN);
	}
		
	private static Shape getReceptorSquare()
	{					
{'fraction_non_alphanumeric': 0.11186216037110669, 'fraction_numerical': 0.03061630218687873, 'mean_word_length': 4.064429530201342, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3216104', 'n_tokens_mistral': 2885, 'n_tokens_neox': 2502, 'n_words': 758}