Skip to content
Snippets Groups Projects
Select Git revision
  • d746a9600fb1f021db40694e01131f0361f278ed
  • master default
  • v1.0.0
3 results

ComboBoxResolutionCell.java

Blame
  • ComboBoxResolutionCell.java 512 B
    package de.bricked.ui.cells;
    
    import de.bricked.game.settings.GameSize;
    import javafx.scene.control.cell.ComboBoxListCell;
    
    public class ComboBoxResolutionCell extends ComboBoxListCell<GameSize>
    {	
    	@Override
    	public void updateItem(GameSize item, boolean empty)
    	{
    		super.updateItem(item, empty);
    
    		if( ! empty)
    		{	
    			if(item == GameSize.FULL_SCREEN)
    			{
    				setText("Fullscreen");
    			}
    			else
    			{
    				setText(item.getWidth() + " x " + item.getHeight());
    			}			
    		}
    		else
    		{
    			setText(null);
    		}
    	}
    }