Skip to content

Commit dc1d2a2

Browse files
committed
refactoring the editor config class.
1 parent d75f6c5 commit dc1d2a2

1 file changed

Lines changed: 21 additions & 30 deletions

File tree

src/main/java/com/ss/editor/config/EditorConfig.java

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ public final class EditorConfig implements AssetEventListener {
8989
*
9090
* @return the instance
9191
*/
92-
@NotNull
93-
public static EditorConfig getInstance() {
92+
public static @NotNull EditorConfig getInstance() {
9493

9594
if (instance == null) {
9695

@@ -262,9 +261,8 @@ public EditorConfig() {
262261
*
263262
* @return The list of last opened asset folders.
264263
*/
265-
@NotNull
266264
@FromAnyThread
267-
public synchronized List<String> getLastOpenedAssets() {
265+
public synchronized @NotNull List<String> getLastOpenedAssets() {
268266
return lastOpenedAssets;
269267
}
270268

@@ -301,7 +299,7 @@ public void assetRequested(@NotNull final AssetKey key) {
301299
}
302300

303301
/**
304-
* Sets anisotropy.
302+
* Set the anisotropy level.
305303
*
306304
* @param anisotropy the new level of the anisotropy.
307305
*/
@@ -311,7 +309,7 @@ public void setAnisotropy(final int anisotropy) {
311309
}
312310

313311
/**
314-
* Gets anisotropy.
312+
* Get the anisotropy level.
315313
*
316314
* @return the current level of the anisotropy.
317315
*/
@@ -321,40 +319,39 @@ public int getAnisotropy() {
321319
}
322320

323321
/**
324-
* Sets fxaa.
322+
* Set the enabling of FXAA.
325323
*
326-
* @param fxaa flag is for enabling the FXAA.
324+
* @param fxaa true if need to enable FXAA.
327325
*/
328326
@FromAnyThread
329327
public void setFXAA(final boolean fxaa) {
330328
this.fxaa = fxaa;
331329
}
332330

333331
/**
334-
* Is fxaa boolean.
332+
* Get the flag of enabling FXAA.
335333
*
336-
* @return flag is for enabling the FXAA.
334+
* @return true if FXAA is enabled.
337335
*/
338336
@FromAnyThread
339337
public boolean isFXAA() {
340338
return fxaa;
341339
}
342340

343341
/**
344-
* Gets current asset.
342+
* Get the current asset folder.
345343
*
346344
* @return the current asset folder.
347345
*/
348-
@Nullable
349346
@FromAnyThread
350-
public Path getCurrentAsset() {
347+
public @Nullable Path getCurrentAsset() {
351348
return currentAsset;
352349
}
353350

354351
/**
355-
* Sets current asset.
352+
* Set the current asset folder.
356353
*
357-
* @param currentAsset the new current asset folder.
354+
* @param currentAsset the current asset folder.
358355
*/
359356
@FromAnyThread
360357
public void setCurrentAsset(@Nullable final Path currentAsset) {
@@ -366,9 +363,8 @@ public void setCurrentAsset(@Nullable final Path currentAsset) {
366363
*
367364
* @return the path to the folder with libraries.
368365
*/
369-
@Nullable
370366
@FromAnyThread
371-
public Path getLibrariesPath() {
367+
public @Nullable Path getLibrariesPath() {
372368
return librariesPath;
373369
}
374370

@@ -387,9 +383,8 @@ public void setLibrariesPath(@Nullable final Path librariesPath) {
387383
*
388384
* @return the path to the folder with compiled classes.
389385
*/
390-
@Nullable
391386
@FromAnyThread
392-
public Path getClassesPath() {
387+
public @Nullable Path getClassesPath() {
393388
return classesPath;
394389
}
395390

@@ -403,18 +398,17 @@ public void setClassesPath(@Nullable final Path classesPath) {
403398
}
404399

405400
/**
406-
* Gets additional envs.
401+
* Get the additional envs folder.
407402
*
408403
* @return the path to the folder with additional envs.
409404
*/
410-
@Nullable
411405
@FromAnyThread
412-
public Path getAdditionalEnvs() {
406+
public @Nullable Path getAdditionalEnvs() {
413407
return additionalEnvs;
414408
}
415409

416410
/**
417-
* Sets additional envs.
411+
* Set the additional envs folder.
418412
*
419413
* @param additionalEnvs the path to the folder with additional envs.
420414
*/
@@ -488,9 +482,8 @@ public void setToneMapFilter(final boolean toneMapFilter) {
488482
*
489483
* @return the current white point for the tone map filter.
490484
*/
491-
@NotNull
492485
@FromAnyThread
493-
public Vector3f getToneMapFilterWhitePoint() {
486+
public @NotNull Vector3f getToneMapFilterWhitePoint() {
494487
return notNull(toneMapFilterWhitePoint);
495488
}
496489

@@ -799,9 +792,8 @@ public void setAnalyticsQuestion(final boolean analyticsQuestion) {
799792
*
800793
* @return the current theme.
801794
*/
802-
@NotNull
803795
@FromAnyThread
804-
public CssColorTheme getTheme() {
796+
public @NotNull CssColorTheme getTheme() {
805797
return CssColorTheme.valueOf(theme);
806798
}
807799

@@ -820,9 +812,8 @@ public void setTheme(@NotNull final CssColorTheme theme) {
820812
*
821813
* @return the current open GL version.
822814
*/
823-
@NotNull
824815
@FromAnyThread
825-
public OpenGLVersion getOpenGLVersion() {
816+
public @NotNull OpenGLVersion getOpenGLVersion() {
826817
return notNull(openGLVersion);
827818
}
828819

@@ -886,7 +877,7 @@ private void init() {
886877
this.defaultUseFlippedTexture = prefs.getBoolean(PREF_EDITING_DEFAULT_USE_FLIPPED_TEXTURE, true);
887878
this.defaultEditorCameraEnabled = prefs.getBoolean(PREF_EDITING_CAMERA_LAMP_ENABLED, true);
888879
this.analyticsQuestion = prefs.getBoolean(PREF_OTHER_ANALYTICS_QUESTION, false);
889-
this.theme = prefs.getInt(PREF_OTHER_THEME, CssColorTheme.SHADOW.ordinal());
880+
this.theme = prefs.getInt(PREF_OTHER_THEME, CssColorTheme.DARK.ordinal());
890881
this.openGLVersion = OpenGLVersion.valueOf(prefs.getInt(PREF_GRAPHIC_OPEN_GL, GL_32.ordinal()));
891882

892883
final String currentAssetURI = prefs.get(PREF_ASSET_CURRENT_ASSET, null);

0 commit comments

Comments
 (0)