<commit_before>package org.csstudio.sds.components.model;

import org.csstudio.sds.model.AbstractWidgetModel;
import org.csstudio.sds.model.WidgetPropertyCategory;
import org.csstudio.sds.model.properties.BooleanProperty;
import org.csstudio.sds.model.properties.DoubleProperty;
import org.csstudio.sds.components.internal.localization.Messages;

/**
 * This class defines a common widget model for any widget 
 * which has a scale. 
 * @author <NAME>
 */
public abstract class AbstractScaledWidgetModel extends AbstractWidgetModel {
	
	
	/** The ID of the <i>transparent</i> property. */
	public static final String PROP_TRANSPARENT = "transparency";	
	
	/** The ID of the value property. */
	public static final String PROP_VALUE = "value"; //$NON-NLS-1$
	
	/** The ID of the minimum property. */
	public static final String PROP_MIN = "minimum"; //$NON-NLS-1$		
	
	/** The ID of the maximum property. */
	public static final String PROP_MAX = "maximum"; //$NON-NLS-1$		
	
	/** The ID of the major tick step hint property. */
	public static final String PROP_MAJOR_TICK_STEP_HINT = "majorTickStepHint"; //$NON-NLS-1$		
	
	/** The ID of the show minor ticks property. */
	public static final String PROP_SHOW_MINOR_TICKS = "showMinorTicks"; //$NON-NLS-1$
	
	/** The ID of the show minor ticks property. */
	public static final String PROP_SHOW_SCALE = "showScale"; //$NON-NLS-1$
	
	/** The ID of the log scale property. */
	public static final String PROP_LOG_SCALE = "logScale"; //$NON-NLS-1$	
	
	/** The default value of the value property. */
	private static final double DEFAULT_VALUE = 50;	
	
	/** The default value of the minimum property. */
	private static final double DEFAULT_MIN = 0;
	
	/** The default value of the maximum property. */
	private static final double DEFAULT_MAX = 100;	
	
		/** The default value of the major tick step hint property. */
	private static final double DEFAULT_MAJOR_TICK_STEP_HINT = 50;	

	@Override
	protected void configureProperties() {
		
		addProperty(PROP_TRANSPARENT, new BooleanProperty("Transparent Background",
				WidgetPropertyCategory.Display,true));
		
		addProperty(PROP_VALUE, new DoubleProperty(Messages.FillLevelProperty,
				WidgetPropertyCategory.Behaviour, DEFAULT_VALUE));
		
		addProperty(PROP_MIN, new DoubleProperty("Minimum", 
				WidgetPropertyCategory.Behaviour,DEFAULT_MIN));
		
		addProperty(PROP_MAX, new DoubleProperty("Maximum", 
				WidgetPropertyCategory.Behaviour,DEFAULT_MAX));			
		
		addProperty(PROP_MAJOR_TICK_STEP_HINT, new DoubleProperty("Major Tick Step Hint", 
				WidgetPropertyCategory.Display,DEFAULT_MAJOR_TICK_STEP_HINT));			
		
		addProperty(PROP_SHOW_MINOR_TICKS, new BooleanProperty("Show Minor Ticks", 
				WidgetPropertyCategory.Display, true));		
		
		addProperty(PROP_SHOW_SCALE, new BooleanProperty("Show Scale", 
				WidgetPropertyCategory.Display, true));		
		
		addProperty(PROP_LOG_SCALE, new BooleanProperty("Log Scale", 
				WidgetPropertyCategory.Display, false));
		
	}
	
	/**
	 * @return the value
	 */
	public Double getValue() {
		return (Double) getProperty(PROP_VALUE).getPropertyValue();
	}


	/**
	 * @return the minimum value
	 */
	public Double getMinimum() {
		return (Double) getProperty(PROP_MIN).getPropertyValue();
	}
<commit_msg>add confinement to major tick step hint<commit_after>package org.csstudio.sds.components.model;

import org.csstudio.sds.model.AbstractWidgetModel;
import org.csstudio.sds.model.WidgetPropertyCategory;
import org.csstudio.sds.model.properties.BooleanProperty;
import org.csstudio.sds.model.properties.DoubleProperty;
import org.csstudio.sds.components.internal.localization.Messages;

/**
 * This class defines a common widget model for any widget 
 * which has a scale. 
 * @author <NAME>
 */
public abstract class AbstractScaledWidgetModel extends AbstractWidgetModel {
	
	
	/** The ID of the <i>transparent</i> property. */
	public static final String PROP_TRANSPARENT = "transparency";	
	
	/** The ID of the value property. */
	public static final String PROP_VALUE = "value"; //$NON-NLS-1$
	
	/** The ID of the minimum property. */
	public static final String PROP_MIN = "minimum"; //$NON-NLS-1$		
	
	/** The ID of the maximum property. */
	public static final String PROP_MAX = "maximum"; //$NON-NLS-1$		
	
	/** The ID of the major tick step hint property. */
	public static final String PROP_MAJOR_TICK_STEP_HINT = "majorTickStepHint"; //$NON-NLS-1$		
	
	/** The ID of the show minor ticks property. */
	public static final String PROP_SHOW_MINOR_TICKS = "showMinorTicks"; //$NON-NLS-1$
	
	/** The ID of the show minor ticks property. */
	public static final String PROP_SHOW_SCALE = "showScale"; //$NON-NLS-1$
	
	/** The ID of the log scale property. */
	public static final String PROP_LOG_SCALE = "logScale"; //$NON-NLS-1$	
	
	/** The default value of the value property. */
	private static final double DEFAULT_VALUE = 50;	
	
	/** The default value of the minimum property. */
	private static final double DEFAULT_MIN = 0;
	
	/** The default value of the maximum property. */
	private static final double DEFAULT_MAX = 100;	
	
		/** The default value of the major tick step hint property. */
	private static final double DEFAULT_MAJOR_TICK_STEP_HINT = 50;	

	@Override
	protected void configureProperties() {
		
		addProperty(PROP_TRANSPARENT, new BooleanProperty("Transparent Background",
				WidgetPropertyCategory.Display,true));
		
		addProperty(PROP_VALUE, new DoubleProperty(Messages.FillLevelProperty,
				WidgetPropertyCategory.Behaviour, DEFAULT_VALUE));
		
		addProperty(PROP_MIN, new DoubleProperty("Minimum", 
				WidgetPropertyCategory.Behaviour,DEFAULT_MIN));
		
		addProperty(PROP_MAX, new DoubleProperty("Maximum", 
				WidgetPropertyCategory.Behaviour,DEFAULT_MAX));			
		
		addProperty(PROP_MAJOR_TICK_STEP_HINT, new DoubleProperty("Major Tick Step Hint", 
				WidgetPropertyCategory.Display,DEFAULT_MAJOR_TICK_STEP_HINT, 1, 1000));			
		
		addProperty(PROP_SHOW_MINOR_TICKS, new BooleanProperty("Show Minor Ticks", 
				WidgetPropertyCategory.Display, true));		
		
		addProperty(PROP_SHOW_SCALE, new BooleanProperty("Show Scale", 
				WidgetPropertyCategory.Display, true));		
		
		addProperty(PROP_LOG_SCALE, new BooleanProperty("Log Scale", 
				WidgetPropertyCategory.Display, false));
		
	}
	
	/**
	 * @return the value
	 */
	public Double getValue() {
		return (Double) getProperty(PROP_VALUE).getPropertyValue();
	}


	/**
	 * @return the minimum value
	 */
	public Double getMinimum() {
		return (Double) getProperty(PROP_MIN).getPropertyValue();
	}

{'fraction_non_alphanumeric': 0.10399143599938829, 'fraction_numerical': 0.005352500382321456, 'mean_word_length': 4.244587008821171, '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': '6352109', 'n_tokens_mistral': 2201, 'n_tokens_neox': 1930, 'n_words': 542}