CoolFace
Datasetpublic

SciCodePile/SciCode-Domain-Code

DATA1: Domain-Specific Code Dataset Dataset Overview DATA1 is a large-scale domain-specific code dataset focusing on code samples from interdisciplinary fields such as biology, chemistry, materials science, and related areas. The dataset is collected and organized from GitHub repositories, covering 178 different domain topics with over 1.1 billion lines of code. Dataset Statistics Total Datasets: 178 CSV files Total Data Size: ~115 GB Total Lines… See the full description on the dataset page: https://huggingface.co/datasets/SciCodePile/SciCode-Domain-Code.

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
4likes2.4kdownloads
dataset_Nucleic_acids.csv83751 linesDownload Raw Back to data
1"keyword","repo_name","file_path","file_extension","file_size","line_count","content","language"
2"Nucleic acids","csoderlund/SyMAP","java/src/symap/Globals.java",".java","6528","121","package symap;3 4import java.awt.Color;5import java.awt.Cursor;6import java.awt.Font;7import java.io.File;8 9/******************************************10 * Global constants and prt routines11 * See util:Jhtml.java for more constants for Help pages12 * See SyMAPmanager:printVerions() for banner including java version13 * See DBconn2 for checking database variables14 * Search DIR_SELF for code snippets that depend on how isSelf is processed and displayed15 * Version changes may be in (1) database.Version, (2) in code calling DBconn2.tableCheckAddColumn or (3) Version.isVerLt16 */17public class Globals {18	public static final String 	VERSION = ""v5.7.9c"";    // see Version.isVerLt (if add char, must be single, e.g. v5.7.5b)19	public static final String 	DATE = "" (4-Jan-26)"";20	public static final String  VERDATE = VERSION + "" "" + DATE;21	public static final int 	DBVER = 7; 	// CAS512 v3, CAS520 v4, CAS522 v5, CAS543 v6, CAS546 v722	public static final String  DBVERSTR = ""db"" + DBVER;23	public static final String  JARVERION = ""17.0.11""; // verify with 'jar xvf symap.jar META-INF', view META_INF24	25	public static String  MAIN_PARAMS =   ""symap.config""; 	// default; changed on command line -c26	27	public static final  String PERSISTENT_PROPS_FILE = "".symap_saved_props""; // under user's directory; see props.PersistenProps28	29	// Set in SyMAPmanager 30	public static boolean INFO=false;		// -ii; popup indices, query overlap, case-insensitive; also set on -tt and -dd 31	public static boolean TRACE=false; 		// -tt; write files for query and anchor232	public static boolean DEBUG=false; 		// -dd; use for possible error33	public static boolean DBDEBUG=false;	// -dbd; adds fields to DB34 35	public static boolean bMySQL=false;		  // -sql; check MySQL 36	public static boolean bTrim=true;		  // -a do not trim 2D alignments; see closeup.AlignPool37	public static boolean bRedoSum=false;	  // -s redo summary 38	public static boolean bQueryOlap=false;   // -go show gene olap for algo2 instead of exon (was -q CAS578)39	public static boolean bQueryPgeneF=false; // -pg run old PgeneF algo instead of new Cluster; (was -g CAS578)40	public static boolean bQuerySaveLgClust=false;  // -ac Merge all clusters, regardless of size41 42	public static final String exonTag = ""Exon #"";	 // type exon43	public static final String geneTag = ""Gene #"";   // type gene44	45	// These are the pseudo_annot.type values46	public static final String geneType = ""gene"";	  // this is hard-coded many places; search 'gene'47	public static final String exonType = ""exon"";48	public static final String pseudoType = ""pseudo""; // pseudo type49	public static final String gapType = ""gap"";50	public static final String centType = ""centromere"";51	52	public static final String pseudoChar = ""~"";	 // pseudo tag;53	public static final String minorAnno = ""*"";      // used in Query and Anno popup for hit to non-assigned anno54	public static final String DOT = ""."", SDOT=""\\."";// separates block, collinear, gene#; second is for split55	public static final int abbrevLen = 5;			 // max length of abbreviation of project name; CAS578 56	57	public static final int MAX_CLOSEUP_BP=50000;	// Used in CloseUp and Query; 58	public static final String MAX_CLOSEUP_K = ""50kb"";59	public static final int MAX_2D_DISPLAY=30000;	// Query and Sfilter; 60	public static final String MAX_2D_DISPLAY_K = ""30kb"";61	public static final int MAX_YELLOW_BOX=50000; 	// used in SeqFilter for drawing yellow boxes62	63	public static final int T=0, Q=1;				// for target (2) and query (1); 64	65	public static final String IGN = ""IGN"";			// self-synteny; for Report66	public static final String SS_X = ""X"", SS_Z=""Y"";// Self-synteny opposite project ends with this67	68	public static final int NO_VALUE = Integer.MIN_VALUE;69 70    public static final int LEFT_ORIENT   = -1;71    public static final int CENTER_ORIENT = 0;72    public static final int RIGHT_ORIENT  = 1;73  74    // Cursor Types75    public static final Cursor DEFAULT_CURSOR   = Cursor.getDefaultCursor();76    public static final Cursor WAIT_CURSOR      = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);77    public static final Cursor HAND_CURSOR      = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);78    public static final Cursor S_RESIZE_CURSOR  = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);79    public static final Cursor MOVE_CURSOR      = Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR);80    public static final Cursor CROSSHAIR_CURSOR = Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);81  82    public static final Font textFont = new Font(Font.MONOSPACED,Font.PLAIN,12);83    public static final int textHeight = 12;84    public static final Color white = Color.white;85    86    // Exports87    public static String alignDir = ""queryMSA"";	88    public static String getExport() { 			89    	String saveDir = System.getProperty(""user.dir"") + ""/exports/"";90		File temp = new File(saveDir);91		if(!temp.exists()) {92			System.out.println(""Create "" + saveDir);93			temp.mkdir();94		}95		return saveDir;96    }97   98    // positive is the gap between (s1,e1) and (s2, e2); negative is the overlap99 	// works for contained; copied from anchor2.Arg.java 100    public static int pGap_nOlap(int s1, int e1, int s2, int e2) {101		return -(Math.min(e1,e2) - Math.max(s1,s2) + 1); 102	}103    104    // outputs105    public static String bToStr(boolean b) {return (b) ? ""T"" : ""F"";}106    public static void prt(String msg)  {System.out.println(msg);} // permanent message107    public static void prtStdErr(String msg)  {System.err.println(msg);} // permanent message; 108    public static void xprt(String msg) {System.out.println(msg);} // temp message109    public static void rprt(String msg) {System.err.print(""      "" + msg + ""...                   \r"");}// to stderr110    public static void rclear() {111    	System.err.print(""                                                                          \r"");} 112    public static void eprt(String msg) {System.err.println(""***Error: "" + msg);}113    public static void die(String msg)  {eprt(msg); System.exit(-1);}114    115    public static void dtprt(String msg)         {if (TRACE || DEBUG) System.out.println(msg);}116    public static void tprt(String msg)          {if (TRACE) System.out.println(msg);}117    public static void tprt(int num, String msg) {if (TRACE) System.out.format(""%,10d %s\n"",num, msg);}118    public static void dprt(String msg)          {if (DEBUG) System.out.println(msg);}119    public static void deprt(String msg)         {if (DEBUG) System.err.println(msg);} 120    public static String toTF(boolean b) {return (b) ? ""T"" : ""F"";}121}122","Java"
123"Nucleic acids","csoderlund/SyMAP","java/src/symap/Ext.java",".java","6725","204","package symap;124 125import java.io.File;126 127import util.ErrorReport;128import util.Jhtml;129 130/*****************************************************131 * This file checks what architecture and what /ext subdirectories to use.132 * extSubDir is set at startup, and cannot be changed; hence, it is okay these variables are static133 */134public class Ext {135	private static final String extDir = ""ext/""; // directory of external programs136	private static final String dirMummer=""mummer/"", dirMuscle=""muscle/"", dirMafft=""mafft/"";137	private static String archDir;				 // set on startup (linux64, mac, macM4); user can set in symap.config 138	139	private static String mummer4Path=null; 	 // can put full mummer4 path in symap.config; 140	141	public  static final String exNucmer=""nucmer"", exPromer=""promer"", exCoords=""show-coords""; // accessed in AlignMain142	private static final String exMuscle=""muscle"", exMafft=""mafft.bat"";143			 	144	public static String getPlatform() {145		return  System.getProperty(""os.name"") + "":"" + System.getProperty(""os.arch"");146	}147	/**************************************************************148	 *  SyMAPmanager reading config; can physically set; otherwise, will calculate149	 */150	public static boolean setArch(String userArch) {151		if (userArch!=null) {152			archDir = userArch;153			if (!archDir.endsWith(""/"")) archDir = archDir + ""/"";154			return checkMUMmer();155		}156		String plat =  System.getProperty(""os.name"").toLowerCase();157		158		if (plat.contains(""linux"")) {159			archDir = ""lintel64/"";	160			return true;161		}162		if (!plat.contains(""mac"")) { 163			System.err.println(""The os.name is not lintel64 or Mac OS X"");164			System.err.println(""There are no executables for your machine"");165			System.err.println(""See "" + Jhtml.SYS_GUIDE_URL + Jhtml.ext);166			return false;167		}168		// Mac OS X169		String arch =  System.getProperty(""os.arch"").toLowerCase();170		if (arch.equals(""aarch64"")) {171			archDir = ""macM4/"";		// checked in isMacM4172			return true;173		}174		if (arch.equals(""x86_64"")) {175			archDir = ""mac/"";176			return true;177		}178		System.err.println(""The Mac OS X architecture is not x86_64 or aarch64"");179		System.err.println(""There are no executables for your machine"");180		System.err.println(""See "" + Jhtml.SYS_GUIDE_URL + Jhtml.ext);181		return false;182	}183	/**************************************************************184	 *  SyMAPmanager reading config; add mummer4 stuff, which can be set in config file; 185	 */186	public static void setMummer4Path(String mummer) {187		mummer4Path=mummer;188		// /m4  /m4/  /m4/bin  /m4/bin/189		if (!mummer4Path.endsWith(""/bin"")) mummer4Path += ""/bin"";190		if (!mummer4Path.endsWith(""/"")) mummer4Path += ""/"";191		192		checkDir(mummer4Path);193		checkFile(mummer4Path+ exNucmer);194		checkFile(mummer4Path+ exPromer);195		checkFile(mummer4Path+ exCoords);196	}197	/***********************************************************************************/198	public static String getMuscleCmd() {199		String cmd = extDir + dirMuscle + archDir + exMuscle;200		if (!checkFile(cmd)) return null;201		return cmd;202	}203	public static String getMafftCmd()  {204		String cmd = extDir + dirMafft + archDir + exMafft;205		if (!checkFile(cmd)) return null;206		return cmd;207	}208	209	public static boolean isMummer4Path() {return mummer4Path!=null;}210	public static String getMummerPath() { // mummer 211		if (mummer4Path!=null) return mummer4Path;212		213		String path = extDir + dirMummer + archDir;214		if (!checkDir(path)) return """";215		216		return path; 217	}218	/***********************************************************************************/219	public static boolean isMac() {220		return System.getProperty(""os.name"").toLowerCase().contains(""mac"");221	}222	public static boolean isMacM4() {223		return archDir.equals(""macM4/"");224	}225	/**************************************************************226	 * Check ext directory when database is created or opened227	 * .. not checking blat since that is probably obsolete228	 */229	static public void checkExt() { // only called with database is created230		try {231			if (mummer4Path!=null) return; // already checked232			233			System.err.println(""Check external programs in "" + extDir + "" for "" + archDir);234			235			if (!checkDir(extDir)) {236				System.err.println(""No "" + extDir + "" directory.  Will not be able to run any external programs."");237				return;238			}239			checkMUMmer();240			241			if (getMafftCmd()==null) {242				System.err.println(""   Will not be able to run MAFFT from SyMAP Queries"");243				return;244			}245			246			if (getMuscleCmd()==null) {247				System.err.println(""   Will not be able to run MUSCLE from SyMAP Queries"");248				return;249			}250			251			if (isMac()) { 252				String m = 	""  On Mac, MUMmer executables needs to be verified for 1st time use; \n    see "";253				String u = Jhtml.TROUBLE_GUIDE_URL + Jhtml.macVerify;254				System.out.println(m+u);255			}256			System.out.println(""Check complete\n"");257		}258		catch (Exception e) {ErrorReport.print(e, ""Checking executables"");	}259	}260	// more mummer hard-coded in AlignRun.cleanup261	static private boolean checkMUMmer() {262		String mpath = getMummerPath();263		if (!checkDir(mpath)) {264			System.err.println(""   Will not be able to run MUMmer from SyMAP"");265			return false;266		}267		checkFile(mpath+ ""mummer"");268		checkFile(mpath+ exNucmer);269		checkFile(mpath+ exPromer);270		checkFile(mpath+ exCoords);271		272		if (mummer4Path==null) { // using supplied mummer v3; v4 already checked, but to be sure...273			checkFile(mpath+ ""mgaps"");274			checkDir(mpath+ ""aux_bin"");275			checkFile(mpath+ ""aux_bin/prepro""); 276			checkFile(mpath+ ""aux_bin/postpro""); 277			checkFile(mpath+ ""aux_bin/prenuc"");278			checkFile(mpath+ ""aux_bin/postnuc"");279			checkDir(mpath+""scripts"");280		}281	282		return true;283	}284	/**********************************************************/285	static private boolean checkFile(String fileName) {286		try {287			File file = new File(fileName);288 289			if (!file.exists()) {290				System.err.println(""*** file does not exists: "" + fileName);291				return false;292			}293			if (!file.isFile()) {294				System.err.println(""*** is not a file: "" + fileName);295				return false;296			}297			if (!file.canExecute()) {298				System.err.println(""*** file is not executable: "" + fileName);299				return false;300			}301			return true;302		}303		catch (Exception e) {ErrorReport.print(e, ""Checking file "" + fileName);	return false;}304	}305	static private boolean checkDir(String dirName) {306		try {307			File dir = new File(dirName);308 309			if (!dir.exists()) {310				System.err.println(""*** directory does not exists: "" + dirName);311				return false;312			}313			if (!dir.isDirectory()) {314				System.err.println(""*** is not a directory: "" + dirName);315				return false;316			}317			if (!dir.canRead()) {318				System.err.println(""*** directory is not readable: "" + dirName);319				return false;320			}321			return true;322		}323		catch (Exception e) {ErrorReport.print(e, ""Checking directory "" + dirName);	return false;}324	}325}326","Java"
327"Nucleic acids","csoderlund/SyMAP","java/src/symap/drawingpanel/FilterHandler.java",".java","1934","63","package symap.drawingpanel;328 329import java.awt.Insets;330import java.awt.event.ActionEvent;331import java.awt.event.ActionListener;332import java.awt.event.MouseEvent; 333import javax.swing.JButton;334 335import symap.mapper.Mapper;336import symap.mapper.Hfilter;337import symap.sequence.Sequence;338import symap.sequence.Sfilter;339 340/********************************************************************341 * Used to open Sfilter and Hfilter342 */343public class FilterHandler implements ActionListener { 344	protected DrawingPanel drawingPanel;345	protected Hfilter hFilter=null;346	protected Sfilter sFilter=null;347	protected JButton button;348 349	public FilterHandler(DrawingPanel dp) {350		button = new JButton();351		button.setMargin(new Insets(2,4,2,4));352		this.drawingPanel = dp;353		354		button.addActionListener(this);355	}356	public void setHfilter(Mapper mapperObj) { // called in Mapper357		if (hFilter != null) hFilter.closeFilter();358		hFilter = null;359		if (mapperObj != null) {360			hFilter = new Hfilter(drawingPanel.getFrame(),drawingPanel, mapperObj);361			button.setText(hFilter.getTitle());362		}363	}364	public void setSfilter(Object seqObj) { // the object is a sequence Track365		if (sFilter != null) sFilter.closeFilter();366		sFilter = null;367		if (seqObj != null) {368			sFilter = new Sfilter(drawingPanel.getFrame(),drawingPanel, (Sequence) seqObj);369			button.setText(""Sequence Filter""); 370		}371	}372	public void hide() {373		if (hFilter != null) hFilter.closeFilter();374		else if (sFilter != null) sFilter.closeFilter();375	}376	public void actionPerformed(ActionEvent e) {377		if (e.getSource() == button) {378			if (hFilter != null && hFilter.canShow()) hFilter.displayHitFilter(); 379			else if (sFilter != null && sFilter.canShow()) sFilter.displaySeqFilter();380		}381	}382	public void showPopup(MouseEvent e) {383		if (hFilter!=null) hFilter.showPopup(e);384		else if (sFilter!=null) sFilter.showPopup(e);385	}386	public void closeFilter() {hide();}387	public JButton getFilterButton() {return button;}388}389","Java"
390"Nucleic acids","csoderlund/SyMAP","java/src/symap/drawingpanel/ControlPanel.java",".java","15454","386","package symap.drawingpanel;391 392import java.awt.Component;393import java.awt.GridBagConstraints;394import java.awt.GridBagLayout;395import java.awt.event.ActionEvent;396import java.awt.event.ActionListener;397import java.awt.event.MouseAdapter;398import java.awt.event.MouseEvent;399 400import javax.swing.ButtonGroup;401import javax.swing.JButton;402import javax.swing.JCheckBox;403import javax.swing.JComboBox;404import javax.swing.JLabel;405import javax.swing.JMenuItem;406import javax.swing.JPanel;407import javax.swing.JPopupMenu;408import javax.swing.JRadioButtonMenuItem;409import javax.swing.JSeparator;410 411import colordialog.ColorDialogHandler;412import symap.Globals;413import symap.frame.HelpBar;414import symap.frame.HelpListener;415import util.ImageViewer;416import util.Jcomp;417import util.Jhtml;418 419/**420 * 2D drawingpanel Control Panel421 */422public class ControlPanel extends JPanel implements HelpListener {	423	private static final long serialVersionUID = 1L;424	// These are accessed in DrawingPanel to match button text with function425	protected static final String MOUSE_FUNCTION_ZOOM_ALL 		= ""Zoom All Tracks"";426	protected static final String MOUSE_FUNCTION_ZOOM_SINGLE 	= ""Zoom Select Track"";427	protected static final String MOUSE_FUNCTION_CLOSEUP 		= ""Align (Max "" + Globals.MAX_CLOSEUP_K + "")""; 428	protected static final String MOUSE_FUNCTION_SEQ 			= ""Seq Options"";429	430	private JButton homeButton, backButton, forwardButton; // Home does not clear highlighting431	private JButton zoomPopupButton;432	private JRadioButtonMenuItem zoomAllRadio	= new JRadioButtonMenuItem(MOUSE_FUNCTION_ZOOM_ALL);433	private JRadioButtonMenuItem zoomSelRadio	= new JRadioButtonMenuItem(MOUSE_FUNCTION_ZOOM_SINGLE);434	private JCheckBox zoomBox = new JCheckBox("""");435	436	private JButton showPopupButton;437	private JRadioButtonMenuItem showAlignRadio	= new JRadioButtonMenuItem(MOUSE_FUNCTION_CLOSEUP);438	private JRadioButtonMenuItem showSeqRadio	= new JRadioButtonMenuItem(MOUSE_FUNCTION_SEQ);439	private JCheckBox showBox = new JCheckBox("""");440	441	private JButton plusButton, minusButton, shrinkButton, scaleButton;442	private JButton showImageButton, editColorsButton, helpButtonLg, helpButtonSm;443	444	private DrawingPanel dp;445	private HistoryControl hc;446	private ColorDialogHandler cdh;447	448	public ControlPanel(DrawingPanel dp, HistoryControl hc, ColorDialogHandler cdh, HelpBar bar, boolean bIsCE){449		super();450		this.dp = dp;451		this.hc = hc;452		this.cdh = cdh;453 454		homeButton       = Jcomp.createIconButton(this,bar,null,""/images/home.gif"",455				""Home: Go to original zoom view."");456		backButton       =  Jcomp.createIconButton(this,bar,null,""/images/back.gif"",457				""Back: Go back in zoom history""); 458		forwardButton    = Jcomp.createIconButton(this,bar,null,""/images/forward.gif"",459				""Forward: Go forward in zoom history""); 460 461		if (hc != null) hc.setButtons(homeButton,backButton,forwardButton); // See HistoryControl462 463		minusButton     = Jcomp.createIconButton(this,bar,buttonListener,""/images/minus.gif"",464				""Decrease the bases shown"");465		plusButton       =  Jcomp.createIconButton(this,bar,buttonListener,""/images/plus.gif"",466				""Increase the bases shown"");467		shrinkButton   = Jcomp.createIconButton(this,bar,buttonListener,""/images/shrink.png"",468				""Shrink space between tracks"");469		scaleButton    =  Jcomp.createBorderIconButton(this,bar,buttonListener,""/images/scale.gif"",470				""Scale: Draw all of the tracks to bp scale"");471		showImageButton  =  Jcomp.createIconButton(this, bar,buttonListener,""/images/print.gif"",472				""Save: Save as image."");473		editColorsButton =  Jcomp.createIconButton(this,bar,buttonListener,""/images/colorchooser.gif"",474				""Colors: Edit the color settings"");475		476		helpButtonLg = Jhtml.createHelpIconUserLg(Jhtml.align2d);477		helpButtonSm=  Jcomp.createIconButton(this,bar,buttonListener,""/images/info.png"",478				""Quick Help Popup"");479		480		createMouseFunctionSelector(bar); // for drag&drop481		482		zoomPopupButton = Jcomp.createButtonGray(this,bar, null,""Zoom"",483				""Click checkmark to activate; Select button for menu; see Info (i)"");484		showPopupButton = Jcomp.createButtonGray(this,bar, null,""Show"",485				""Click checkmark to activate; Select button for menu; see Info (i)"");486		createSelectPopups(); 487		488		JPanel row = Jcomp.createRowPanelGray();489		490		GridBagLayout gbl = new GridBagLayout();491		GridBagConstraints gbc = new GridBagConstraints();492		setLayout(gbl); 		// If row.setLayout(gbl), cannot add Separators, but ipadx, etc work493		gbc.fill = GridBagConstraints.HORIZONTAL;494		gbc.gridheight = 1;495		gbc.ipadx = gbc.ipady = 0;496		497		String sp0="""", sp1="" "", sp2=""  "";498		if (hc != null) {499			addToGrid(row, gbl, gbc, homeButton, sp1);500			addToGrid(row, gbl, gbc, backButton, sp1);501			addToGrid(row, gbl, gbc, forwardButton, sp2);502		}	503		addToGrid(row, gbl, gbc, plusButton, sp1);	504		addToGrid(row, gbl, gbc, minusButton, sp2);505		addToGrid(row, gbl, gbc, shrinkButton, sp2);	506		addToGrid(row, gbl, gbc, scaleButton, sp2);507			508		addToGrid(row, gbl, gbc, zoomBox,    sp0);509		addToGrid(row, gbl, gbc, zoomPopupButton, sp1);510		addToGrid(row, gbl, gbc, new JSeparator(JSeparator.VERTICAL), sp1); // End home functions511		512		addToGrid(row, gbl, gbc, showBox,    sp0);513		addToGrid(row, gbl, gbc, showPopupButton, sp1); 514		515		addToGrid(row, gbl, gbc, editColorsButton, sp2); 516		addToGrid(row, gbl, gbc, new JSeparator(JSeparator.VERTICAL), sp2); // End edit display 517		518		addToGrid(row, gbl, gbc, showImageButton, sp1);519		addToGrid(row, gbl, gbc, helpButtonLg, sp1);520		addToGrid(row, gbl, gbc, helpButtonSm, sp1);521		522		add(row);523	}524	525	private void addToGrid(JPanel cp, GridBagLayout gbl, GridBagConstraints gbc, Component comp, String sp) {526		gbl.setConstraints(comp,gbc);527		cp.add(comp);528		if (sp.length()>0) addToGrid(cp, gbl,gbc,new JLabel(sp),"""");529    }530	531	private void createSelectPopups() {532		 PopupListener listener = new PopupListener();533		 zoomAllRadio.addActionListener(listener);534		 zoomSelRadio.addActionListener(listener);535		 showAlignRadio.addActionListener(listener);536		 showSeqRadio.addActionListener(listener);537		 538		 ///// zoom539		 JPopupMenu zoomPopupMenu = new JPopupMenu(""Zoom""); zoomPopupMenu.setBackground(Globals.white);540	     JMenuItem zpopupTitle = new JMenuItem(""Select Region of Track"");541		 zpopupTitle.setEnabled(false);542		 zoomPopupMenu.add(zpopupTitle);543		 zoomPopupMenu.addSeparator();544		 zoomPopupMenu.add(zoomAllRadio);545		 zoomPopupMenu.add(zoomSelRadio);546		 ButtonGroup grp = new ButtonGroup();547		 grp.add(zoomAllRadio);grp.add(zoomSelRadio);548		549		 zoomPopupButton.setComponentPopupMenu(zoomPopupMenu); // zoomPopupButton create in main550		 zoomBox.addActionListener(new ActionListener() {551			public void actionPerformed(ActionEvent e) {552				boolean b = zoomBox.isSelected();553				zoomPopupButton.setEnabled(b);554				showPopupButton.setEnabled(!b);555				showBox.setSelected(!b);556				557				if (zoomAllRadio.isSelected())  dp.setMouseFunction(MOUSE_FUNCTION_ZOOM_ALL);558				else  							dp.setMouseFunction(MOUSE_FUNCTION_ZOOM_SINGLE);559			}560		 }); 561		 zoomPopupButton.addMouseListener(new MouseAdapter() { // allows either left/right mouse to popup562            public void mousePressed(MouseEvent e) {563                zoomPopupMenu.show(e.getComponent(), e.getX(), e.getY());564            }565         });566		 zoomBox.setSelected(true);567		 zoomPopupButton.setEnabled(true);568		 zoomAllRadio.setSelected(true);569		570		 ////// show571		 JPopupMenu showPopupMenu = new JPopupMenu(""Show""); showPopupMenu.setBackground(Globals.white);572		 JMenuItem spopupTitle = new JMenuItem(""Select Region of Track"");573		 spopupTitle.setEnabled(false);574		 showPopupMenu.add(spopupTitle);575		 showPopupMenu.addSeparator();576		 showPopupMenu.add(showAlignRadio);577		 showPopupMenu.add(showSeqRadio);578		 ButtonGroup grp2 = new ButtonGroup();579		 grp2.add(showAlignRadio); grp2.add(showSeqRadio);580		 581		 showPopupButton.setComponentPopupMenu(showPopupMenu); // showPopupButton create in main582		 showBox.addActionListener(new ActionListener() {583			public void actionPerformed(ActionEvent e) {584				boolean b = showBox.isSelected();585				zoomPopupButton.setEnabled(!b);586				showPopupButton.setEnabled(b);587				zoomBox.setSelected(!b);588				589				if (showAlignRadio.isSelected())  	dp.setMouseFunction(MOUSE_FUNCTION_CLOSEUP);590				else  								dp.setMouseFunction(MOUSE_FUNCTION_SEQ);591			}592		 }); 593		 showPopupButton.addMouseListener(new MouseAdapter() {594            public void mousePressed(MouseEvent e) {595                showPopupMenu.show(e.getComponent(), e.getX(), e.getY());596            }597         });598		 showBox.setSelected(false);599		 showPopupButton.setEnabled(false);600		 showAlignRadio.setSelected(true);601	}602	603	private class PopupListener implements ActionListener {604		private PopupListener() { }605		public void actionPerformed(ActionEvent event) { 606			Object src = event.getSource();607			if (src == zoomAllRadio) {608				 zoomAllRadio.setSelected(true);609				 dp.setMouseFunction(MOUSE_FUNCTION_ZOOM_ALL);610				 zoomPopupButton.setText(""Zoom"");611			}612			else if (src == zoomSelRadio) {613				 zoomSelRadio.setSelected(true);614				 dp.setMouseFunction(MOUSE_FUNCTION_ZOOM_SINGLE);615				 zoomPopupButton.setText(""Zoom Select"");616			}617			else if (src == showAlignRadio) {618				 showAlignRadio.setSelected(true);619				 dp.setMouseFunction(MOUSE_FUNCTION_CLOSEUP);620				 showPopupButton.setText(""Show"");621			}622			else  if (src == showSeqRadio) {623				 showSeqRadio.setSelected(true);624				 dp.setMouseFunction(MOUSE_FUNCTION_SEQ);625				 showPopupButton.setText(""Show Seq"");626			}627		}628	}629	private ActionListener buttonListener = new ActionListener() {630		public void actionPerformed(ActionEvent e) {631			final Object source = e.getSource();632			if (source == scaleButton)    {633				dp.isToScale = !dp.isToScale;634				scaleButton.setBackground(Jcomp.getBorderColor(dp.isToScale ));635				dp.drawToScale();636			}637	638			else if (source == minusButton)      dp.changeShowRegion(0.5);639			else if (source == plusButton)       dp.changeShowRegion(2.0); 640			else if (source == shrinkButton)     dp.shrinkSpace(); 641			642			else if (source == editColorsButton) cdh.showX();643			else if (source == showImageButton)  ImageViewer.showImage(""Exp_2D"", (JPanel)dp); 644			else if (source == helpButtonSm) 	 popupHelp();645		}646	};647	648	//////////////////////////////////////////////////649	// Use to be a functional drop-down for these functions; still used for Drag&drop to work650	private JComboBox <String> createMouseFunctionSelector(HelpBar bar) {651		String [] labels = { MOUSE_FUNCTION_ZOOM_ALL,MOUSE_FUNCTION_ZOOM_SINGLE,MOUSE_FUNCTION_CLOSEUP,MOUSE_FUNCTION_SEQ};652		JComboBox <String> comboMouseFunctions = new JComboBox <String> (labels); 653		654		comboMouseFunctions.addActionListener(new ActionListener() {655			public void actionPerformed(ActionEvent e) {656		       String item = (String) comboMouseFunctions.getSelectedItem();657		       dp.setMouseFunction(item);658			}659		});660		comboMouseFunctions.setSelectedIndex(0); 661		if (bar != null) bar.addHelpListener(comboMouseFunctions,this);662		return comboMouseFunctions;663	}664	//////////////////////////////////////////////////////////665	protected void setPanelEnabled(boolean enable) {666		scaleButton.setEnabled(enable); 667		showImageButton.setEnabled(enable);668		editColorsButton.setEnabled(enable);669 670		minusButton.setEnabled(enable);671		plusButton.setEnabled(enable);672		shrinkButton.setEnabled(enable);673		if (hc != null) hc.setEnabled(enable);	 674	}675	676	protected void clear() { 677		dp.setMouseFunction(MOUSE_FUNCTION_ZOOM_ALL);678		zoomBox.setSelected(true); showBox.setSelected(false);679	680		scaleButton.setSelected(false);681		dp.isToScale = false;682		scaleButton.setBackground(Jcomp.getBorderColor(false));683	}684	685	public String getHelpText(MouseEvent event) { // symap.frame.HelpBar686		Component comp = (Component)event.getSource(); 687		Object source = event.getSource();688		String msg = comp.getName();689		if (source == scaleButton) {690			if (dp.isToScale) msg += ""; Scaled"" ;691			else msg += ""; Not scaled"";692		}693		else if (source == backButton) {694			msg += ""; Back: "" + hc.nBack(); 695		}696		else if (source == forwardButton) {697			msg += ""; Forward: "" + hc.nForward(); 698		}699		return msg;700	}701	public void setHistory(boolean toScale, String mouseFunction) { // drawingPanel.DrawingPanel702		scaleButton.setSelected(toScale);703		dp.isToScale = toScale;704		scaleButton.setBackground(Jcomp.getBorderColor(toScale));705		706		// always put back to Zoom as Show is not a history event707		showPopupButton.setSelected(false);708		showBox.setSelected(false);709		showPopupButton.setEnabled(false);710		showPopupButton.setText(""Show""); // Show is not a coordinate change, so even if set to SEQ, wasn't activated711		712		boolean bAll = !mouseFunction.equals(MOUSE_FUNCTION_ZOOM_SINGLE);713		if (bAll) dp.setMouseFunction(MOUSE_FUNCTION_ZOOM_ALL);714		else      dp.setMouseFunction(MOUSE_FUNCTION_ZOOM_SINGLE);715		716		zoomPopupButton.setSelected(true);717		zoomBox.setSelected(true);718		zoomPopupButton.setEnabled(true);719		String label = (bAll) ? ""Zoom"" : ""Zoom Select"";720		zoomPopupButton.setText(label);721		722		zoomAllRadio.setSelected(bAll);723		zoomSelRadio.setSelected(!bAll);724	}725	726	///////////////// (i) ////////////////////////////////////////727	728	static final private String SEQ_help = ""Track Information:""729			+ ""\n Hover on gene for information.""730			+ ""\n Right-click on gene for popup with the full description.""731			+ ""\n Right-click in track space for subset filter popup.""732			+ ""\n Problem: if there are more than 2 tracks and the sequence 'Annotation' is""733			+ ""\n   shown for the 2nd track, the mouse hover sometimes does not work correctly ""734			+ ""\n   in the 3rd track.""735			+ ""\n\n"";736 737	static final private String HIT_help = ""Hit-wire Information:""738			+ ""\n Hover on hit-wire for information (it will be highlighted).""739			+ ""\n Right-click on hit-wire for popup for full information ""740			+ ""\n     (it must be highlighted to be clickable).""741			+ ""\n Right-click in white space of hit area for subset filter popup.""742			+ ""\n\n"";743	744	static final private String FIL_help = ""History Events (Home, > and <):"" 745			+ ""\n Changing the coordinates of the display is a history event.""746			+ ""\n Coordinates are changed by any of the icons in the Control panel up to the first '|',""747			+ ""\n     plus the Sequence Filter coordinate changes.""748			+ ""\n Use < and > icons to go back and forward through history events.""749			+ ""\n Use the home icon to go back to starting display.""750			+ ""\n\n"";751	752	static final String DRAG_help = 753			    ""The 'Zoom' and 'Show' buttons respond to selecting a region in a track.""754			+ ""\nTo select a region, position the mouse over a track, press the left mouse button and drag, ""755			+ ""\n    release the button at the end of the region to be selected.""756			+ ""\nThe mouse function used depends on which button is checked, and which item ""757			+ ""\n    in the checked Zoom or Show popup menu is selected.""758			+ ""\n  Zoom: "" 759			+ ""\n    "" + MOUSE_FUNCTION_ZOOM_ALL + "":   zoom the region and all tracks to match (default).""760			+ ""\n    "" + MOUSE_FUNCTION_ZOOM_SINGLE + "": only zoom the selected region.""761			+ ""\n  Show: "" 762			+ ""\n    "" + MOUSE_FUNCTION_CLOSEUP + "":  the region will be aligned with the ""763			+ ""\n                       opposite track in a popup window (default).""764			+ ""\n    "" + MOUSE_FUNCTION_SEQ + "":       a popup menu will provide options to""765			+ ""\n                       view the underlying sequence in a popup window.""766			+ ""\n\n"";767			;	768	static final String Q_HELP = ""See ? for details\n"";769			770	private void popupHelp() {771		util.Popup.displayInfoMonoSpace(this, ""2d Control Quick Help"", 772				SEQ_help+HIT_help+FIL_help+DRAG_help+Q_HELP, false);773	}774}775","Java"
776"Nucleic acids","csoderlund/SyMAP","java/src/symap/drawingpanel/Frame2d.java",".java","6532","204","package symap.drawingpanel;777 778import java.awt.BorderLayout;779import java.awt.Component;780import java.awt.Container;781import java.awt.Dimension;782import java.awt.Frame;783import java.awt.Point;784import java.awt.Rectangle;785import java.awt.event.ComponentEvent;786import java.awt.event.ComponentListener;787import java.awt.event.ContainerEvent;788import java.awt.event.ContainerListener;789import java.awt.event.KeyEvent;790import java.awt.event.KeyListener;791 792import javax.swing.JFrame;793import javax.swing.JPanel;794import javax.swing.WindowConstants;795 796import props.PersistentProps;797import symap.Globals;798import symap.frame.HelpBar;799import util.ErrorReport;800 801/***********************************************************802 * The 2D frame containing the drawingpanel, controlpanel and optional helpbar if on the bottom803 * SyMAP2d creates the components of 2D display, and this puts them together804 */805public class Frame2d extends JFrame implements KeyListener, ContainerListener{	806	private static final long serialVersionUID = 1L;807	private static final String DISPLAY_SIZE_COOKIE = ""SyMAPDisplaySize"";808	private static final String DISPLAY_POSITION_COOKIE = ""SyMAPDispayPosition"";809 810	private PersistentProps sizeProp, positionProp;811	812	private ControlPanel cp;813	private DrawingPanel dp;814	private SyMAP2d symap2d;815	816	public Frame2d(SyMAP2d symap2d, ControlPanel cp, DrawingPanel dp, HelpBar hb, 817			boolean showHelpBar, PersistentProps persistentProps) {818		super(""SyMAP ""+ Globals.VERSION);819		addComponentListener(new CompListener());820		821		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);822		this.symap2d = symap2d;823		this.cp = cp;824		this.dp = dp;825		826		if (persistentProps != null) {  827			sizeProp = persistentProps.copy(DISPLAY_SIZE_COOKIE);828			positionProp = persistentProps.copy(DISPLAY_POSITION_COOKIE);829		}830		dp.setListener(this);831		dp.setCntl(cp); // so drawing panel has access for history832 833		Container container = getContentPane();834		container.setLayout(new BorderLayout());835 836		JPanel bottomPanel = new JPanel(new BorderLayout());837		bottomPanel.add(cp,BorderLayout.NORTH);838		bottomPanel.add(dp.getView(),BorderLayout.CENTER);839 840		container.add(bottomPanel,BorderLayout.CENTER);841		if (hb != null && showHelpBar) 		// Otherwise, put in Explorer on left842			container.add(hb, BorderLayout.SOUTH);843 844		setSizeAndLocationByProp(util.Jcomp.getScreenBounds(this));845 846		addKeyAndContainerListenerRecursively(this);847	}848	// Called for non-Explorer 2d: so can close connection849	public void dispose() { // override850		symap2d.clear();851		super.dispose();852	}853	public void showX() {// For non-explorer 2d; had to rename show() to something different854		try {855			if (isShowing()) dp.closeFilters();856			857			Dimension d = new Dimension();858			int nMaps = dp.getNumMaps();859			int nAnnots = dp.getNumAnnots();860			int width = Math.min(1000, 300 + 300*nMaps + 130*nAnnots); 861			d.setSize(width, 900);	 862			setSize(d);863			super.setVisible(true); // Has to be displayed first, or the build will not happen864			865			// sort of fixes DotPlot Sequence.buildGraphics timing problem; it displays a flash of window866			if (!dp.amake()) super.setVisible(false); 867		}868		catch (Exception e) {ErrorReport.print(e, ""Show non-explorer 2d"");}869	}870 871	public void hideX() {872		dp.closeFilters();873		super.setVisible(false); 874	}875 876	protected void setFrameEnabled(boolean enable) { // DrawingPanel and Frame2d877		if (enable) dp.getParent().setCursor(Globals.DEFAULT_CURSOR); 878		else 		dp.getParent().setCursor(Globals.WAIT_CURSOR); 879	880		if (cp != null) cp.setPanelEnabled(enable);881		882		dp.setVisible(enable);883	}884 885	protected Frame getFrame() 				{return (Frame)this;}886 887	/*********************************************************/888	private void setSizeAndLocationByProp(Rectangle defaultRect) {889		Dimension dimP = getDisplayProp(positionProp);890		if (dimP != null) setLocation(new Point(dimP.width,dimP.height));891		else              setLocation(new Point(defaultRect.x,defaultRect.y));892		893		Dimension dimS = getDisplayProp(sizeProp);894		if (dimS != null) setSize(dimS);895		else              setSize(new Dimension(defaultRect.width,defaultRect.height));896	}897	898	private void addKeyAndContainerListenerRecursively(Component c) {899		c.removeKeyListener(this);900		c.addKeyListener(this);901		if (c instanceof Container){902			Container cont = (Container)c;903			cont.removeContainerListener(this);904			cont.addContainerListener(this);905			Component[] children = cont.getComponents();906			for(int i = 0; i < children.length; i++){907				addKeyAndContainerListenerRecursively(children[i]);908			}909		}910	}911 912	private void removeKeyAndContainerListenerRecursively(Component c) {913		c.removeKeyListener(this);914		if(c instanceof Container){915			Container cont = (Container)c;916			cont.removeContainerListener(this);917			Component[] children = cont.getComponents();918			for(int i = 0; i < children.length; i++){919				removeKeyAndContainerListenerRecursively(children[i]);920			}921		}922	}923 924	public void componentAdded(ContainerEvent e) {925		addKeyAndContainerListenerRecursively(e.getChild());926	}927 928	public void componentRemoved(ContainerEvent e) {929		removeKeyAndContainerListenerRecursively(e.getChild());930	}931	public void keyReleased(KeyEvent e) { }932	public void keyTyped(KeyEvent e) { }933	public void keyPressed(KeyEvent e) { }934 935	private class CompListener implements ComponentListener {936		public void componentMoved(ComponentEvent e) { 937			setDisplayProp(positionProp,getLocation());938		}939		public void componentResized(ComponentEvent e) { 940			setDisplayProp(positionProp,getLocation());941			setDisplayProp(sizeProp,getSize());942		}943		public void componentHidden(ComponentEvent e) { }944		public void componentShown(ComponentEvent e) { }945		946		private void setDisplayProp(PersistentProps prop, Point p) {947			setDisplayProp(prop,new Dimension(p.x,p.y));948		}949		private void setDisplayProp(PersistentProps prop, Dimension dim) {950			if (prop != null) {951				if (dim != null) {952					String ds = dim.width + "","" + dim.height;953					prop.setProp(ds);954				}955				else System.err.println(""Dimension is null in Frame2d#setDisplayProp (PersistentProps,Dimension)!!!!"");956			}957		}958	}959		960	private Dimension getDisplayProp(PersistentProps prop) {961		if (prop == null) return null;962 963		Dimension dim = null;964		String ds = prop.getProp();965		if (ds != null && ds.length() > 0) {966			int ind = ds.indexOf(',');967			if (ind >= 0) {968				try {969					int w = Integer.parseInt(ds.substring(0,ind)); 970					int h = Integer.parseInt(ds.substring(ind+1));971					dim = new Dimension(w,h);972				}973				catch (Exception e) {ErrorReport.print(e, ""get display plops"");}974			}975		}976		return dim;977	}978}979","Java"
980"Nucleic acids","csoderlund/SyMAP","java/src/symap/drawingpanel/HistoryListener.java",".java","246","9","package symap.drawingpanel;981 982/**983 * Used by the HistoryControl as the object to update when the history needs to be changed.984 */985public interface HistoryListener {// DrawingPanel, Symap2d, HistoryControl986    public void setHistory(Object obj);987}988","Java"
989"Nucleic acids","csoderlund/SyMAP","java/src/symap/drawingpanel/HistoryControl.java",".java","3759","135","package symap.drawingpanel;990 991import java.awt.event.ActionEvent;992import java.awt.event.ActionListener;993import java.util.Vector;994 995import javax.swing.JButton;996 997/**998 * Create and control History Events. Created in SyMAP2d999 */1000public class HistoryControl implements ActionListener {1001	private HistoryListener listener;1002	private JButton home, back, forward;1003	private History history;1004	1005	public HistoryControl() { this.history = new History(); }// SyMAP2d1006	1007	public synchronized void setListener(HistoryListener listener) { // SyMAP2d1008		this.listener = listener;1009	}1010	1011	protected synchronized void setButtons(JButton home, JButton back, JButton forward) { // Control panel1012		if (this.home != home) {1013			if (this.home != null) this.home.removeActionListener(this);1014			this.home = home;1015			home.addActionListener(this);1016		}1017		if (this.back != back) {1018			if (this.back != null) this.back.removeActionListener(this);1019			this.back = back;1020			back.addActionListener(this);1021		}1022		if (this.forward != forward) {1023			if (this.forward != null) this.forward.removeActionListener(this);1024			this.forward = forward;1025			forward.addActionListener(this);1026		}1027	}1028 1029	protected void add(Object obj) {// the object is DrawingPanelData class within DrawingPanel1030		history.add(obj);1031		setButtons();1032	}1033 1034	protected void replace(Object obj) { 1035		history.replace(obj);1036	}1037	protected synchronized void setEnabled(boolean enable) { // ControlPanel1038		if (!enable) {1039			home.setEnabled(false);1040			back.setEnabled(false);1041			forward.setEnabled(false);1042		}1043		else {1044			setButtons();1045		}1046	}1047 1048	private synchronized void setButtons() {1049		home.setEnabled(history.isHome());1050		back.setEnabled(history.isBack());1051		forward.setEnabled(history.isForward());1052	}1053 1054	public void actionPerformed(ActionEvent e) {1055		Object source = e.getSource();1056		Object obj = null;1057		if (source == home) 		{obj = history.goHome();} 1058		else if (source == back) 	{obj = history.goBack();} 1059		else if (source == forward) {obj = history.goForward();}1060		if (obj != null) {1061			setButtons();1062			listener.setHistory(obj);1063		}1064	}1065	protected void clear() {history.clear();} // called from SyMAP2d did not need History object1066	protected int nBack() {return history.index;}1067	protected int nForward() {1068		return history.historyVec.size()-history.index-1;}1069	/**1070	 * Class History stores a history list with a current pointer.1071	 * If it goes Home or back, then a new one is added, all remaining are lost but not freed.1072	 */1073	private class History {1074		private Vector<Object> historyVec = new Vector <Object> (50);1075		private int index = -1;1076		private int size = 50; 1077 1078		private History() { } 1079			1080		private synchronized void add(Object obj) {1081			historyVec.setSize(++index);1082			historyVec.add(obj);1083			if (historyVec.size() > size) {1084				historyVec.remove(0);1085				index--;1086			}1087		}1088		private synchronized void replace(Object obj) {1089			historyVec.set(index, obj);1090		}1091		private synchronized Object goHome() { // HistoryControl.actionPerformed1092			if (index > 0) {1093				index = 0;1094				return historyVec.get(0);1095			}1096			return null;1097		}1098		private synchronized Object goBack() { // HistoryControl.actionPerformed1099			if (index > 0) {1100				--index;1101				return historyVec.get(index);1102			}1103			return null;1104		}1105		private synchronized Object goForward() {// HistoryControl.actionPerformed1106			if (historyVec.size() > index+1) {1107				++index;1108				return historyVec.get(index);1109			}1110			return null;1111		}1112		1113		protected synchronized boolean isHome() {return index > 0;} 1114		protected synchronized boolean isBack() {return index > 0;} 1115		protected synchronized boolean isForward() {return historyVec.size() > index+1;}1116 1117		private synchronized void clear() { // SyMAP2.HistoryControl.clear, HistoryControl.actionPerformed1118			index = -1;1119			historyVec.clear();1120		}1121	}1122}1123","Java"
1124"Nucleic acids","csoderlund/SyMAP","java/src/symap/drawingpanel/SyMAP2d.java",".java","2442","78","package symap.drawingpanel;1125 1126import colordialog.*;1127import database.DBconn2;1128import props.*;1129import symap.closeup.CloseUp;1130import symap.frame.HelpBar;1131import symapQuery.TableMainPanel;1132 1133/**1134 * SyMAP sets up the 2D display for  (see frame.ChrExpFrame for full Chromosome explorer):1135 * 	manager.SyMAPFrame.regenerate2DView1136 * 	dotplot.Data1137 * 	blockview.Block2Frame1138 * 	symapQuery.tableDataPanel.showSynteny1139 */1140public class SyMAP2d {1141	private Frame2d            frame;1142	private DrawingPanel       drawingPanel;1143	private ControlPanel       controlPanel;1144	private HelpBar            helpBar;1145	1146	private DBconn2 tdbc2;1147	private HistoryControl     historyControl;1148	private PersistentProps    persistentProps;1149	private CloseUp            closeup;1150	private ColorDialogHandler colorDialogHandler;1151 1152	/** Dotplot, Block2Frame, Query **/1153	public SyMAP2d(DBconn2 dbc2, TableMainPanel theTablePanel)  {1154		this(dbc2, null, theTablePanel);1155	}1156	/** symap.frame.ChrExpFrame.regenerate2Dview 1157	 * hb==null is from dotplot or blocks display, so not full ChrExp1158	 ***/1159	public SyMAP2d(DBconn2 dbc2, HelpBar hb, TableMainPanel theTablePanel) 1160	{	1161		String type = (hb==null) ? ""P"" : ""E"";1162		this.tdbc2 = new DBconn2(""SyMAP2d"" + type + ""-"" + DBconn2.getNumConn(), dbc2);1163		1164		persistentProps = new PersistentProps(); 1165 1166		if (hb == null) helpBar = new HelpBar(-1, 17); 1167		else			helpBar = hb; // for full explorer1168 1169		historyControl = new HistoryControl(); 1170 1171		drawingPanel = new DrawingPanel(theTablePanel, tdbc2, historyControl, helpBar);1172 1173		historyControl.setListener(drawingPanel);1174 1175		colorDialogHandler = new ColorDialogHandler(persistentProps); // This sets changed colors1176 1177		controlPanel = new ControlPanel(drawingPanel, historyControl, colorDialogHandler, helpBar, (hb!=null));1178		1179		frame = new Frame2d(this, controlPanel, drawingPanel, helpBar, hb==null, persistentProps);1180		1181		closeup = new CloseUp(drawingPanel, colorDialogHandler);1182 1183		drawingPanel.setCloseUp(closeup);1184 1185		colorDialogHandler.addListener((ColorListener)drawingPanel);1186	}1187	1188	public void clear() { // Frame2d.displose() called for non-Explorer 2d1189		tdbc2.close(); 	 1190		clearLast();1191	} 1192	public void clearLast() { // ChrExpFrame when creating a new 2d; do not close tdc21193		drawingPanel.clearData(); 	// clear caches1194		historyControl.clear(); 	// clear history1195		controlPanel.clear();1196	}1197	public Frame2d getFrame() {return frame;}1198 1199	public DrawingPanel getDrawingPanel() {return drawingPanel;}1200}

Showing the first 1,200 of 83751 lines. Download the file for the rest.