<commit_before>package com.moeyinc.formulamorph;

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.AffineTransform;
import java.awt.image.*;

import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import javax.vecmath.*;
import javax.imageio.ImageIO;

import java.io.*;
import java.net.*;

import java.util.Collections;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Properties;
import java.util.List;
import java.util.ArrayList;
import java.util.Set;
import java.util.EnumSet;
import java.text.DecimalFormat;

//import com.moeyinc.formulamorph.Parameters.ActiveParameterListener;
import de.mfo.jsurfer.algebra.*;
import de.mfo.jsurfer.rendering.*;
import de.mfo.jsurfer.util.BasicIO;

public class GUI extends JFrame implements Parameter.ValueChangeListener
{		
	class SurfaceGUIElements
	{
		final public JSurferRenderPanel panel;
		final public LaTeXLabel title;
		final public LaTeXLabel equation;
		final public JPanel levelIcon;
		final public LaTeXLabel levelLabel;
		final private Surface surface;
		private List< Gallery.GalleryItem > gallery_items;
		private List< Gallery.GalleryItem > gallery_items_unmodifyable;
		private int id_in_gallery;
		private ArrayList< JPanel > gallery_panels;
		private List< JPanel > gallery_panels_unmodifiable;
		private Map< Gallery.Level, ImageScaler > levelIcons;
		
		public SurfaceGUIElements( Surface s )
		{
			levelIcons = new EnumMap< Gallery.Level, ImageScaler >( Gallery.Level.class );
			levelIcons.put( Gallery.Level.BASIC, new ImageScaler( sierpinskiBASIC ) );
			levelIcons.put( Gallery.Level.INTERMEDIATE, new ImageScaler( sierpinskiINTERMEDIATE ) );
			levelIcons.put( Gallery.Level.ADVANCED, new ImageScaler( sierpinskiADVANCED ) );
			
			surface = s;
			id_in_gallery = 0;

			LaTeXCommands.getDynamicLaTeXMap().put( "FMImage" + s.name(), "\\includejavaimage[interpolation=bicubic]{FMImage" + s.name() + "}" );
			
			this.panel = new JSurferRenderPanel();
			
			this.title = new LaTeXLabel( "\\sf\\bf\\LARGE\\fgcolor{white}{\\jlmDynamic{FMTitle" + s.name() + "}}" );
			this.title.setHAlignment( LaTeXLabel.HAlignment.CENTER );
			this.title.setVAlignment( LaTeXLabel.VAlignment.CENTER_BASELINE );
			//this.title.setBackground( Color.GRAY ); this.title.setOpaque( true ); 
			
			this.equation = new LaTeXLabel( staticLaTeXSrc( s ) );
			//this.equation.setBackground( Color.GRAY ); this.equation.setOpaque( true );
			
			this.levelIcon = new JPanel( new BorderLayout() );
			this.levelLabel = new LaTeXLabel( "\\tiny\\fgcolor{white}{\\jlmDynamic{FMLevel" + s.name() + "}}" );
			
			gallery_panels = new ArrayList< JPanel >();
			for( int i = 0; i < 7; ++i )
			{
				JPanel p = new JPanel( new BorderLayout() );
				p.setBackground( Color.lightGray );
				p.setOpaque( true );
				gallery_panels.add( i, p );
			}
			gallery_panels.get( gallery_panels.size() / 2 ).setBorder( BorderFactory.createLineBorder( Color.WHITE, 3 ) );		
			gallery_panels_unmodifiable = Collections.unmodifiableList( gallery_panels );
			
			// load galleries
			gallery_items = new ArrayList< Gallery.GalleryItem >();
			gallery_items_unmodifyable = Collections.unmodifiableList( gallery_items );
			try
			{
				switch( surface )
				{
					case F:
					case G:
						this.gallery_items.addAll( new Gallery( Gallery.Level.BASIC, new File( "gallery" + File.separator + "basic" ) ).getItems() );
						this.gallery_items.addAll( new Gallery( Gallery.Level.INTERMEDIATE, new File( "gallery" + File.separator + "intermediate" ) ).getItems() );
						this.gallery_items.addAll( new Gallery( Gallery.Level.ADVANCED, new File( "gallery" + File.separator + "advanced" ) ).getItems() );
						break;
					default:
						break;
				}
			}<commit_msg>changed default background of empty panels in gallery<commit_after>package com.moeyinc.formulamorph;

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.AffineTransform;
import java.awt.image.*;

import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import javax.vecmath.*;
import javax.imageio.ImageIO;

import java.io.*;
import java.net.*;

import java.util.Collections;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Properties;
import java.util.List;
import java.util.ArrayList;
import java.util.Set;
import java.util.EnumSet;
import java.text.DecimalFormat;

//import com.moeyinc.formulamorph.Parameters.ActiveParameterListener;
import de.mfo.jsurfer.algebra.*;
import de.mfo.jsurfer.rendering.*;
import de.mfo.jsurfer.util.BasicIO;

public class GUI extends JFrame implements Parameter.ValueChangeListener
{		
	class SurfaceGUIElements
	{
		final public JSurferRenderPanel panel;
		final public LaTeXLabel title;
		final public LaTeXLabel equation;
		final public JPanel levelIcon;
		final public LaTeXLabel levelLabel;
		final private Surface surface;
		private List< Gallery.GalleryItem > gallery_items;
		private List< Gallery.GalleryItem > gallery_items_unmodifyable;
		private int id_in_gallery;
		private ArrayList< JPanel > gallery_panels;
		private List< JPanel > gallery_panels_unmodifiable;
		private Map< Gallery.Level, ImageScaler > levelIcons;
		
		public SurfaceGUIElements( Surface s )
		{
			levelIcons = new EnumMap< Gallery.Level, ImageScaler >( Gallery.Level.class );
			levelIcons.put( Gallery.Level.BASIC, new ImageScaler( sierpinskiBASIC ) );
			levelIcons.put( Gallery.Level.INTERMEDIATE, new ImageScaler( sierpinskiINTERMEDIATE ) );
			levelIcons.put( Gallery.Level.ADVANCED, new ImageScaler( sierpinskiADVANCED ) );
			
			surface = s;
			id_in_gallery = 0;

			LaTeXCommands.getDynamicLaTeXMap().put( "FMImage" + s.name(), "\\includejavaimage[interpolation=bicubic]{FMImage" + s.name() + "}" );
			
			this.panel = new JSurferRenderPanel();
			
			this.title = new LaTeXLabel( "\\sf\\bf\\LARGE\\fgcolor{white}{\\jlmDynamic{FMTitle" + s.name() + "}}" );
			this.title.setHAlignment( LaTeXLabel.HAlignment.CENTER );
			this.title.setVAlignment( LaTeXLabel.VAlignment.CENTER_BASELINE );
			//this.title.setBackground( Color.GRAY ); this.title.setOpaque( true ); 
			
			this.equation = new LaTeXLabel( staticLaTeXSrc( s ) );
			//this.equation.setBackground( Color.GRAY ); this.equation.setOpaque( true );
			
			this.levelIcon = new JPanel( new BorderLayout() );
			this.levelLabel = new LaTeXLabel( "\\tiny\\fgcolor{white}{\\jlmDynamic{FMLevel" + s.name() + "}}" );
			
			gallery_panels = new ArrayList< JPanel >();
			for( int i = 0; i < 7; ++i )
			{
				JPanel p = new JPanel( new BorderLayout() );
				p.setBackground( new Color( 0.1f, 0.1f, 0.1f ) );
				p.setOpaque( true );
				gallery_panels.add( i, p );
			}
			gallery_panels.get( gallery_panels.size() / 2 ).setBorder( BorderFactory.createLineBorder( Color.WHITE, 3 ) );		
			gallery_panels_unmodifiable = Collections.unmodifiableList( gallery_panels );
			
			// load galleries
			gallery_items = new ArrayList< Gallery.GalleryItem >();
			gallery_items_unmodifyable = Collections.unmodifiableList( gallery_items );
			try
			{
				switch( surface )
				{
					case F:
					case G:
						this.gallery_items.addAll( new Gallery( Gallery.Level.BASIC, new File( "gallery" + File.separator + "basic" ) ).getItems() );
						this.gallery_items.addAll( new Gallery( Gallery.Level.INTERMEDIATE, new File( "gallery" + File.separator + "intermediate" ) ).getItems() );
						this.gallery_items.addAll( new Gallery( Gallery.Level.ADVANCED, new File( "gallery" + File.separator + "advanced" ) ).getItems() );
						break;
					default:
						break;
				}
			}
{'fraction_non_alphanumeric': 0.12402900051786639, 'fraction_numerical': 0.0020714655618850335, 'mean_word_length': 4.112508272667108, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '114343', 'n_tokens_mistral': 2908, 'n_tokens_neox': 2502, 'n_words': 537}