Graphic Rendering System 1.0
A Java-based graphic rendering system implementing various design patterns
Loading...
Searching...
No Matches
com.example.graphics.proxy.RemoteRendererProxy Class Reference
Inheritance diagram for com.example.graphics.proxy.RemoteRendererProxy:
Inheritance graph
Collaboration diagram for com.example.graphics.proxy.RemoteRendererProxy:
Collaboration graph

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ RemoteRendererProxy()

com.example.graphics.proxy.RemoteRendererProxy.RemoteRendererProxy ( )
inline

Constructor initializes the proxy

Definition at line 23 of file RemoteRendererProxy.java.

Member Function Documentation

◆ clear()

void com.example.graphics.proxy.RemoteRendererProxy.clear ( )
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.

Here is the call graph for this function:

◆ connect()

boolean com.example.graphics.proxy.RemoteRendererProxy.connect ( )
inline

Connect to the remote renderer

Returns
true if connection was successful, false otherwise

Definition at line 39 of file RemoteRendererProxy.java.

References connected, and remoteRenderer.

Referenced by com.example.graphics.Main.main().

Here is the caller graph for this function:

◆ disconnect()

void com.example.graphics.proxy.RemoteRendererProxy.disconnect ( )
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().

Here is the caller graph for this function:

◆ display()

void com.example.graphics.proxy.RemoteRendererProxy.display ( )
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.

Here is the call graph for this function:

◆ ensureConnected()

void com.example.graphics.proxy.RemoteRendererProxy.ensureConnected ( )
inlineprivate

Ensure connection before performing operations

Exceptions
IllegalStateExceptionif not connected

Definition at line 87 of file RemoteRendererProxy.java.

References connected.

Referenced by clear(), display(), renderCircle(), renderLine(), renderRectangle(), and renderTriangle().

Here is the caller graph for this function:

◆ isConnected()

boolean com.example.graphics.proxy.RemoteRendererProxy.isConnected ( )
inline

Check if the proxy is connected to the remote renderer

Returns
true if connected, false otherwise

Definition at line 79 of file RemoteRendererProxy.java.

References connected.

◆ renderCircle()

void com.example.graphics.proxy.RemoteRendererProxy.renderCircle ( Circle circle)
inline

Render a circle remotely

Parameters
circlethe circle to render

Implements com.example.graphics.proxy.RemoteRenderer.

Definition at line 94 of file RemoteRendererProxy.java.

References ensureConnected(), localRenderer, and remoteRenderer.

Here is the call graph for this function:

◆ renderLine()

void com.example.graphics.proxy.RemoteRendererProxy.renderLine ( Line line)
inline

Render a line remotely

Parameters
linethe line to render

Implements com.example.graphics.proxy.RemoteRenderer.

Definition at line 116 of file RemoteRendererProxy.java.

References ensureConnected(), localRenderer, and remoteRenderer.

Here is the call graph for this function:

◆ renderRectangle()

void com.example.graphics.proxy.RemoteRendererProxy.renderRectangle ( Rectangle rectangle)
inline

Render a rectangle remotely

Parameters
rectanglethe rectangle to render

Implements com.example.graphics.proxy.RemoteRenderer.

Definition at line 105 of file RemoteRendererProxy.java.

References ensureConnected(), localRenderer, and remoteRenderer.

Here is the call graph for this function:

◆ renderTriangle()

void com.example.graphics.proxy.RemoteRendererProxy.renderTriangle ( Triangle triangle)
inline

Render a triangle remotely

Parameters
trianglethe triangle to render

Implements com.example.graphics.proxy.RemoteRenderer.

Definition at line 127 of file RemoteRendererProxy.java.

References ensureConnected(), localRenderer, and remoteRenderer.

Here is the call graph for this function:

◆ setLocalRenderer()

void com.example.graphics.proxy.RemoteRendererProxy.setLocalRenderer ( SwingRenderer localRenderer)
inline

设置本地渲染器,用于在远程渲染的同时在本地GUI显示

Parameters
localRenderer本地渲染器

Definition at line 31 of file RemoteRendererProxy.java.

References localRenderer.

Member Data Documentation

◆ connected

boolean com.example.graphics.proxy.RemoteRendererProxy.connected
private

Definition at line 18 of file RemoteRendererProxy.java.

Referenced by connect(), disconnect(), ensureConnected(), and isConnected().

◆ localRenderer

SwingRenderer com.example.graphics.proxy.RemoteRendererProxy.localRenderer
private

◆ remoteRenderer

RemoteRenderer com.example.graphics.proxy.RemoteRendererProxy.remoteRenderer
private

The documentation for this class was generated from the following file: