<commit_before>package etomica.graphics;
import etomica.units.Pixel;
import gl4java.awt.GLAnimCanvas;

import java.awt.Dimension;
import java.awt.Graphics;


/**
 * Parent of classes that use OpenGL to display the phase configuration.
 *
 * @author <NAME>
 */
 
public abstract class DisplayCanvasOpenGL extends GLAnimCanvas implements java.io.Serializable, DisplayCanvasInterface {
    //protected Image offScreen;
    //protected Graphics osg;
        
    /**
     * Flag to indicate if display can be resized
     */
    boolean resizable = false;
    /**
     * Flag to indicate if display can be moved
     */
    boolean movable = false;

    /** 
     * Flag to indicate if value of scale should be superimposed on image
     */
    boolean writeScale = false;
    
    /**
     * Variable that sets the quality of the rendered image.
     */
    int quality = DRAW_QUALITY_NORMAL;
          
    /**
     * Variable specifying whether a line tracing the boundary of the display should be drawn
     * Default value is <code>BOUNDARY_OUTLINE</code>
     */
    int drawBoundary = DRAW_BOUNDARY_OUTLINE;
    
    protected Pixel pixel;
        

    public DisplayCanvasOpenGL(int width, int height) {
        super(width, height);
        //!!!super(false);
        setBackground(java.awt.Color.black);
    }

    public void createOffScreen () {
        //if (offScreen == null) { 
            //createOffScreen(getSize().width, getSize().height);
        //}
    }
    public void createOffScreen (int p) {
        //createOffScreen(p,p);
    }
    public void createOffScreen(int w, int h) {
        //offScreen = createImage(w,h);
        //if(offScreen != null) osg = offScreen.getGraphics();
    }
        
    public void doPaint(Graphics g) {}
    <commit_msg>intercept setSize method and set GLCanvas' size field, which apparently doesn't get set otherwise.<commit_after>package etomica.graphics;
import etomica.units.Pixel;
import gl4java.awt.GLAnimCanvas;

import java.awt.Dimension;
import java.awt.Graphics;


/**
 * Parent of classes that use OpenGL to display the phase configuration.
 *
 * @author <NAME>
 */
 
public abstract class DisplayCanvasOpenGL extends GLAnimCanvas implements java.io.Serializable, DisplayCanvasInterface {
    //protected Image offScreen;
    //protected Graphics osg;
        
    /**
     * Flag to indicate if display can be resized
     */
    boolean resizable = false;
    /**
     * Flag to indicate if display can be moved
     */
    boolean movable = false;

    /** 
     * Flag to indicate if value of scale should be superimposed on image
     */
    boolean writeScale = false;
    
    /**
     * Variable that sets the quality of the rendered image.
     */
    int quality = DRAW_QUALITY_NORMAL;
          
    /**
     * Variable specifying whether a line tracing the boundary of the display should be drawn
     * Default value is <code>BOUNDARY_OUTLINE</code>
     */
    int drawBoundary = DRAW_BOUNDARY_OUTLINE;
    
    protected Pixel pixel;
        

    public DisplayCanvasOpenGL(int width, int height) {
        super(width, height);
        //!!!super(false);
        setBackground(java.awt.Color.black);
    }

    public void createOffScreen () {
        //if (offScreen == null) { 
            //createOffScreen(getSize().width, getSize().height);
        //}
    }
    public void createOffScreen (int p) {
        //createOffScreen(p,p);
    }
    public void createOffScreen(int w, int h) {
        //offScreen = createImage(w,h);
        //if(offScreen != null) osg = offScreen.getGraphics();
    }

    public void setSize(int w, int h) {
        super.setSize(w, h);
        size = getSize();
    }
    
    public void setSize(java.awt.Dimension d) {
        super.setSize(d);
        size = d;
    }
    
    public void doPaint(Graphics g) {}
    
{'fraction_non_alphanumeric': 0.0979676915059927, 'fraction_numerical': 0.0005211047420531526, 'mean_word_length': 2.3440766550522647, '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': '3420922', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1076, 'n_words': 330}