Graphic Rendering System 1.0
A Java-based graphic rendering system implementing various design patterns
Loading...
Searching...
No Matches
RenderingConfig.java
Go to the documentation of this file.
1package com.example.graphics.singleton;
2
7public class RenderingConfig {
8 // The single instance of RenderingConfig
9 private static RenderingConfig instance;
10
11 // Configuration properties
12 private int defaultWidth;
13 private int defaultHeight;
14 private String defaultRendererType;
15 private boolean debugMode;
16
20 private RenderingConfig() {
21 // Default configuration values
22 defaultWidth = 800;
23 defaultHeight = 600;
24 defaultRendererType = "svg";
25 debugMode = false;
26 }
27
32 public static synchronized RenderingConfig getInstance() {
33 if (instance == null) {
35 }
36 return instance;
37 }
38
43 public int getDefaultWidth() {
44 return defaultWidth;
45 }
46
51 public void setDefaultWidth(int defaultWidth) {
52 this.defaultWidth = defaultWidth;
53 }
54
59 public int getDefaultHeight() {
60 return defaultHeight;
61 }
62
68 this.defaultHeight = defaultHeight;
69 }
70
75 public String getDefaultRendererType() {
77 }
78
84 this.defaultRendererType = defaultRendererType;
85 }
86
91 public boolean isDebugMode() {
92 return debugMode;
93 }
94
99 public void setDebugMode(boolean debugMode) {
100 this.debugMode = debugMode;
101 }
102}
void setDefaultRendererType(String defaultRendererType)
static synchronized RenderingConfig getInstance()