All Downloads are FREE. Search and download functionalities are using the official Maven repository.

editor.settings.AppearanceSettings Maven / Gradle / Ivy

There is a newer version: 1.18.1
Show newest version
package editor.settings;

import editor.LabDarkScheme;
import editor.LabFrame;
import editor.util.Experiment;
import java.util.function.Consumer;
import javax.swing.Icon;
import javax.swing.JComponent;

/**
 */
public class AppearanceSettings extends AbstractSettings
{
  public static final String PATH = "Appearance";

  public AppearanceSettings()
  {
    super( null, PATH, PATH );
  }

  @Override
  public AppearanceSettingsParameters makeDefaultParameters( Experiment experiment )
  {
    AppearanceSettingsParameters params = new AppearanceSettingsParameters();
    params.setTheme( LabDarkScheme.NAME );
    return params;
  }

  @Override
  public boolean isValid()
  {
    return true;
  }

  @Override
  public Icon getIcon()
  {
    return null;
  }

  @Override
  public JComponent makePanel( AppearanceSettingsParameters params, Consumer changeListener )
  {
    return new AppearanceSettingsPanel( params, changeListener );
  }

  @Override
  public boolean isExperimentSetting()
  {
    return true;
  }

  @Override
  public boolean isIdeSetting()
  {
    return false;
  }

  public static String getTheme()
  {
    AppearanceSettings settings = (AppearanceSettings)LabFrame.getSettings().get( AppearanceSettings.PATH );
    return settings.getParams().getTheme();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy