Graphic Rendering System 1.0
A Java-based graphic rendering system implementing various design patterns
|
Public Member Functions | |
RemoteRendererProxy () | |
void | clear () |
boolean | connect () |
void | disconnect () |
void | display () |
boolean | isConnected () |
void | renderCircle (Circle circle) |
void | renderLine (Line line) |
void | renderRectangle (Rectangle rectangle) |
void | renderTriangle (Triangle triangle) |
void | setLocalRenderer (SwingRenderer localRenderer) |
Public Member Functions inherited from com.example.graphics.render.Renderer | |
default int | getHeight () |
default int | getWidth () |
Private Member Functions | |
void | ensureConnected () |
Private Attributes | |
boolean | connected |
SwingRenderer | localRenderer |
RemoteRenderer | remoteRenderer |
Proxy for remote rendering operations. This implements both the RemoteRenderer interface and our local Renderer interface. Implementation of the Proxy pattern.
Definition at line 15 of file RemoteRendererProxy.java.
|
inline |
Constructor initializes the proxy
Definition at line 23 of file RemoteRendererProxy.java.
|
inline |
Clear the remote rendering surface
Implements com.example.graphics.proxy.RemoteRenderer.
Definition at line 138 of file RemoteRendererProxy.java.
References ensureConnected(), localRenderer, and remoteRenderer.
|
inline |
Connect to the remote renderer
Definition at line 39 of file RemoteRendererProxy.java.
References connected, and remoteRenderer.
Referenced by com.example.graphics.Main.main().
|
inline |
Disconnect from the remote renderer
Definition at line 60 of file RemoteRendererProxy.java.
References connected, and remoteRenderer.
Referenced by com.example.graphics.Main.main().
|
inline |
Display the rendered content remotely
Implements com.example.graphics.proxy.RemoteRenderer.
Definition at line 149 of file RemoteRendererProxy.java.
References ensureConnected(), localRenderer, and remoteRenderer.
|
inlineprivate |
Ensure connection before performing operations
IllegalStateException | if not connected |
Definition at line 87 of file RemoteRendererProxy.java.
References connected.
Referenced by clear(), display(), renderCircle(), renderLine(), renderRectangle(), and renderTriangle().
|
inline |
Check if the proxy is connected to the remote renderer
Definition at line 79 of file RemoteRendererProxy.java.
References connected.
|
inline |
Render a circle remotely
circle | the circle to render |
Implements com.example.graphics.proxy.RemoteRenderer.
Definition at line 94 of file RemoteRendererProxy.java.
References ensureConnected(), localRenderer, and remoteRenderer.
|
inline |
Render a line remotely
line | the line to render |
Implements com.example.graphics.proxy.RemoteRenderer.
Definition at line 116 of file RemoteRendererProxy.java.
References ensureConnected(), localRenderer, and remoteRenderer.
|
inline |
Render a rectangle remotely
rectangle | the rectangle to render |
Implements com.example.graphics.proxy.RemoteRenderer.
Definition at line 105 of file RemoteRendererProxy.java.
References ensureConnected(), localRenderer, and remoteRenderer.
|
inline |
Render a triangle remotely
triangle | the triangle to render |
Implements com.example.graphics.proxy.RemoteRenderer.
Definition at line 127 of file RemoteRendererProxy.java.
References ensureConnected(), localRenderer, and remoteRenderer.
|
inline |
设置本地渲染器,用于在远程渲染的同时在本地GUI显示
localRenderer | 本地渲染器 |
Definition at line 31 of file RemoteRendererProxy.java.
References localRenderer.
|
private |
Definition at line 18 of file RemoteRendererProxy.java.
Referenced by connect(), disconnect(), ensureConnected(), and isConnected().
|
private |
Definition at line 17 of file RemoteRendererProxy.java.
Referenced by clear(), display(), renderCircle(), renderLine(), renderRectangle(), renderTriangle(), and setLocalRenderer().
|
private |
Definition at line 16 of file RemoteRendererProxy.java.
Referenced by clear(), connect(), disconnect(), display(), renderCircle(), renderLine(), renderRectangle(), and renderTriangle().