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

Public Member Functions

 SwingGraphicsApp ()

Static Public Member Functions

static void main (String[] args)

Private Member Functions

void addSampleShapes ()
void clearDrawing ()
JMenuBar createMenuBar ()
void createNewShape (Point point)
JToolBar createToolBar ()
void exportToJson ()
void exportToXml ()
String getShapeTypeName (Shape shape)
boolean isPointOnShape (Shape shape, Point point)
void newDrawing ()
void openDrawing ()
void saveDrawing ()
void saveToFile (String content, String extension)
void setupRenderPanelListeners (JPanel renderPanel)
void setupUI ()
void switchToLocalRendering ()
void switchToRemoteRendering ()

Private Attributes

String currentShapeType = "Circle"
Point dragStart
final Drawing drawing
final FileManager fileManager
boolean isDragging = false
boolean isDrawingLine = false
boolean isDrawingTriangle = false
boolean isRemoteRenderingEnabled = false
final SwingRenderer localRenderer
final RemoteRendererProxy remoteRenderer
JToggleButton remoteRenderingToggle
Shape selectedShape
final ShapeFactory shapeFactory
JLabel statusLabel
int triangleStage = 0
int x1
int x2
int y1
int y2

Detailed Description

Swing GUI application for the graphics rendering system

Definition at line 28 of file SwingGraphicsApp.java.

Constructor & Destructor Documentation

◆ SwingGraphicsApp()

com.example.graphics.SwingGraphicsApp.SwingGraphicsApp ( )
inline

Member Function Documentation

◆ addSampleShapes()

void com.example.graphics.SwingGraphicsApp.addSampleShapes ( )
inlineprivate

Definition at line 216 of file SwingGraphicsApp.java.

References drawing, shapeFactory, and statusLabel.

Referenced by setupUI().

Here is the caller graph for this function:

◆ clearDrawing()

void com.example.graphics.SwingGraphicsApp.clearDrawing ( )
inlineprivate

Definition at line 515 of file SwingGraphicsApp.java.

References drawing, and statusLabel.

Referenced by createMenuBar(), createToolBar(), newDrawing(), and openDrawing().

Here is the caller graph for this function:

◆ createMenuBar()

JMenuBar com.example.graphics.SwingGraphicsApp.createMenuBar ( )
inlineprivate

Definition at line 115 of file SwingGraphicsApp.java.

References clearDrawing(), drawing, exportToJson(), exportToXml(), newDrawing(), openDrawing(), saveDrawing(), statusLabel, switchToLocalRendering(), and switchToRemoteRendering().

Referenced by setupUI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createNewShape()

void com.example.graphics.SwingGraphicsApp.createNewShape ( Point point)
inlineprivate

Definition at line 494 of file SwingGraphicsApp.java.

References currentShapeType, drawing, shapeFactory, and statusLabel.

Referenced by setupRenderPanelListeners().

Here is the caller graph for this function:

◆ createToolBar()

JToolBar com.example.graphics.SwingGraphicsApp.createToolBar ( )
inlineprivate

Definition at line 239 of file SwingGraphicsApp.java.

References clearDrawing(), currentShapeType, isDrawingLine, isDrawingTriangle, remoteRenderingToggle, statusLabel, switchToLocalRendering(), switchToRemoteRendering(), and triangleStage.

Referenced by setupUI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToJson()

void com.example.graphics.SwingGraphicsApp.exportToJson ( )
inlineprivate

Definition at line 622 of file SwingGraphicsApp.java.

References drawing, and saveToFile().

Referenced by createMenuBar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToXml()

void com.example.graphics.SwingGraphicsApp.exportToXml ( )
inlineprivate

Definition at line 628 of file SwingGraphicsApp.java.

References drawing, and saveToFile().

Referenced by createMenuBar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getShapeTypeName()

String com.example.graphics.SwingGraphicsApp.getShapeTypeName ( Shape shape)
inlineprivate

Definition at line 428 of file SwingGraphicsApp.java.

Referenced by setupRenderPanelListeners().

Here is the caller graph for this function:

◆ isPointOnShape()

◆ main()

void com.example.graphics.SwingGraphicsApp.main ( String[] args)
inlinestatic

Definition at line 673 of file SwingGraphicsApp.java.

◆ newDrawing()

void com.example.graphics.SwingGraphicsApp.newDrawing ( )
inlineprivate

Definition at line 524 of file SwingGraphicsApp.java.

References clearDrawing(), drawing, and saveDrawing().

Referenced by createMenuBar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openDrawing()

void com.example.graphics.SwingGraphicsApp.openDrawing ( )
inlineprivate

Definition at line 541 of file SwingGraphicsApp.java.

References clearDrawing(), drawing, fileManager, and statusLabel.

Referenced by createMenuBar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveDrawing()

void com.example.graphics.SwingGraphicsApp.saveDrawing ( )
inlineprivate

Definition at line 589 of file SwingGraphicsApp.java.

References drawing, fileManager, and statusLabel.

Referenced by createMenuBar(), and newDrawing().

Here is the caller graph for this function:

◆ saveToFile()

void com.example.graphics.SwingGraphicsApp.saveToFile ( String content,
String extension )
inlineprivate

Definition at line 634 of file SwingGraphicsApp.java.

References fileManager, and statusLabel.

Referenced by exportToJson(), and exportToXml().

Here is the caller graph for this function:

◆ setupRenderPanelListeners()

void com.example.graphics.SwingGraphicsApp.setupRenderPanelListeners ( JPanel renderPanel)
inlineprivate

Definition at line 338 of file SwingGraphicsApp.java.

References createNewShape(), currentShapeType, dragStart, drawing, getShapeTypeName(), isDragging, isDrawingLine, isDrawingTriangle, isPointOnShape(), selectedShape, shapeFactory, statusLabel, triangleStage, x1, x2, y1, and y2.

Referenced by setupUI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupUI()

void com.example.graphics.SwingGraphicsApp.setupUI ( )
inlineprivate

Definition at line 82 of file SwingGraphicsApp.java.

References addSampleShapes(), createMenuBar(), createToolBar(), localRenderer, setupRenderPanelListeners(), and statusLabel.

Referenced by SwingGraphicsApp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ switchToLocalRendering()

void com.example.graphics.SwingGraphicsApp.switchToLocalRendering ( )
inlineprivate

Definition at line 291 of file SwingGraphicsApp.java.

References drawing, isRemoteRenderingEnabled, localRenderer, remoteRenderer, remoteRenderingToggle, and statusLabel.

Referenced by createMenuBar(), and createToolBar().

Here is the caller graph for this function:

◆ switchToRemoteRendering()

void com.example.graphics.SwingGraphicsApp.switchToRemoteRendering ( )
inlineprivate

Definition at line 310 of file SwingGraphicsApp.java.

References drawing, isRemoteRenderingEnabled, remoteRenderer, remoteRenderingToggle, and statusLabel.

Referenced by createMenuBar(), and createToolBar().

Here is the caller graph for this function:

Member Data Documentation

◆ currentShapeType

String com.example.graphics.SwingGraphicsApp.currentShapeType = "Circle"
private

Definition at line 36 of file SwingGraphicsApp.java.

Referenced by createNewShape(), createToolBar(), and setupRenderPanelListeners().

◆ dragStart

Point com.example.graphics.SwingGraphicsApp.dragStart
private

Definition at line 37 of file SwingGraphicsApp.java.

Referenced by setupRenderPanelListeners().

◆ drawing

◆ fileManager

final FileManager com.example.graphics.SwingGraphicsApp.fileManager
private

Definition at line 33 of file SwingGraphicsApp.java.

Referenced by SwingGraphicsApp(), openDrawing(), saveDrawing(), and saveToFile().

◆ isDragging

boolean com.example.graphics.SwingGraphicsApp.isDragging = false
private

Definition at line 38 of file SwingGraphicsApp.java.

Referenced by setupRenderPanelListeners().

◆ isDrawingLine

boolean com.example.graphics.SwingGraphicsApp.isDrawingLine = false
private

Definition at line 39 of file SwingGraphicsApp.java.

Referenced by createToolBar(), and setupRenderPanelListeners().

◆ isDrawingTriangle

boolean com.example.graphics.SwingGraphicsApp.isDrawingTriangle = false
private

Definition at line 40 of file SwingGraphicsApp.java.

Referenced by createToolBar(), and setupRenderPanelListeners().

◆ isRemoteRenderingEnabled

boolean com.example.graphics.SwingGraphicsApp.isRemoteRenderingEnabled = false
private

Definition at line 46 of file SwingGraphicsApp.java.

Referenced by switchToLocalRendering(), and switchToRemoteRendering().

◆ localRenderer

final SwingRenderer com.example.graphics.SwingGraphicsApp.localRenderer
private

Definition at line 30 of file SwingGraphicsApp.java.

Referenced by SwingGraphicsApp(), setupUI(), and switchToLocalRendering().

◆ remoteRenderer

final RemoteRendererProxy com.example.graphics.SwingGraphicsApp.remoteRenderer
private

◆ remoteRenderingToggle

JToggleButton com.example.graphics.SwingGraphicsApp.remoteRenderingToggle
private

◆ selectedShape

Shape com.example.graphics.SwingGraphicsApp.selectedShape
private

Definition at line 35 of file SwingGraphicsApp.java.

Referenced by setupRenderPanelListeners().

◆ shapeFactory

final ShapeFactory com.example.graphics.SwingGraphicsApp.shapeFactory
private

◆ statusLabel

◆ triangleStage

int com.example.graphics.SwingGraphicsApp.triangleStage = 0
private

Definition at line 41 of file SwingGraphicsApp.java.

Referenced by createToolBar(), and setupRenderPanelListeners().

◆ x1

int com.example.graphics.SwingGraphicsApp.x1
private

Definition at line 42 of file SwingGraphicsApp.java.

Referenced by isPointOnShape(), and setupRenderPanelListeners().

◆ x2

int com.example.graphics.SwingGraphicsApp.x2
private

Definition at line 42 of file SwingGraphicsApp.java.

Referenced by isPointOnShape(), and setupRenderPanelListeners().

◆ y1

int com.example.graphics.SwingGraphicsApp.y1
private

Definition at line 42 of file SwingGraphicsApp.java.

Referenced by isPointOnShape(), and setupRenderPanelListeners().

◆ y2

int com.example.graphics.SwingGraphicsApp.y2
private

Definition at line 42 of file SwingGraphicsApp.java.

Referenced by isPointOnShape(), and setupRenderPanelListeners().


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