Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Autumn-Rainfall authored May 21, 2023
1 parent 45e1845 commit b5a27b4
Show file tree
Hide file tree
Showing 100 changed files with 2,453 additions and 0 deletions.
Binary file added bin/frame/GFrame$ThemeActionHandler.class
Binary file not shown.
Binary file added bin/frame/GFrame$WindowHandler.class
Binary file not shown.
Binary file added bin/frame/GFrame.class
Binary file not shown.
Binary file added bin/frame/GMenuBar.class
Binary file not shown.
Binary file added bin/frame/GPanel$GMouseHandler$1.class
Binary file not shown.
Binary file added bin/frame/GPanel$GMouseHandler$2.class
Binary file not shown.
Binary file added bin/frame/GPanel$GMouseHandler.class
Binary file not shown.
Binary file added bin/frame/GPanel.class
Binary file not shown.
Binary file added bin/frame/GToolBar$1.class
Binary file not shown.
Binary file added bin/frame/GToolBar$ActionHandler.class
Binary file not shown.
Binary file added bin/frame/GToolBar$thicknessListener.class
Binary file not shown.
Binary file added bin/frame/GToolBar.class
Binary file not shown.
Binary file added bin/graphicsEditorA/Image/Line.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/LineSelect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/Oval.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/OvalSelect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/Pen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/PenSelect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/Polygon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/PolygonSelect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/Rect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/RectSelect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/RoundRect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/Text.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/Image/TextSelect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/graphicsEditorA/readme.pdf
Binary file not shown.
Binary file added bin/graphicsEditorA/sound_effect.mp3
Binary file not shown.
Binary file added bin/graphicsEditorA/sound_effect_1.wav
Binary file not shown.
Binary file added bin/main/GConstants$CFrame.class
Binary file not shown.
Binary file added bin/main/GConstants$EAction.class
Binary file not shown.
Binary file added bin/main/GConstants$EColorMenuItem.class
Binary file not shown.
Binary file added bin/main/GConstants$EDrawingStyle.class
Binary file not shown.
Binary file added bin/main/GConstants$EEditMenuItem.class
Binary file not shown.
Binary file added bin/main/GConstants$EFileMenuItem.class
Binary file not shown.
Binary file added bin/main/GConstants$EHelpMenuItem.class
Binary file not shown.
Binary file added bin/main/GConstants$EMenu.class
Binary file not shown.
Binary file added bin/main/GConstants$EShapeTool.class
Binary file not shown.
Binary file added bin/main/GConstants$EThemeItem.class
Binary file not shown.
Binary file added bin/main/GConstants$EThemeMenu.class
Binary file not shown.
Binary file added bin/main/GConstants.class
Binary file not shown.
Binary file added bin/main/GMain.class
Binary file not shown.
Binary file added bin/menu/GColorMenu$ActionHandler.class
Binary file not shown.
Binary file added bin/menu/GColorMenu.class
Binary file not shown.
Binary file added bin/menu/GEditMenu$ActionHandler.class
Binary file not shown.
Binary file added bin/menu/GEditMenu.class
Binary file not shown.
Binary file added bin/menu/GFileMenu$1.class
Binary file not shown.
Binary file added bin/menu/GFileMenu$ActionHandler.class
Binary file not shown.
Binary file added bin/menu/GFileMenu.class
Binary file not shown.
Binary file added bin/menu/GHelpMenu$ActionHandler.class
Binary file not shown.
Binary file added bin/menu/GHelpMenu.class
Binary file not shown.
Binary file added bin/menu/GUndoStack.class
Binary file not shown.
Binary file added bin/shapeTools/GLine.class
Binary file not shown.
Binary file added bin/shapeTools/GOval.class
Binary file not shown.
Binary file added bin/shapeTools/GPen.class
Binary file not shown.
Binary file added bin/shapeTools/GPolygon.class
Binary file not shown.
Binary file added bin/shapeTools/GRectangle.class
Binary file not shown.
Binary file added bin/shapeTools/GRoundRectangle.class
Binary file not shown.
Binary file added lib/JTattoo.jar
Binary file not shown.
Binary file added lib/idw-gpl.jar
Binary file not shown.
Binary file added lib/liquidlnf.jar
Binary file not shown.
Binary file added lib/quaqua.jar
Binary file not shown.
27 changes: 27 additions & 0 deletions src/Transformer/GMover.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package Transformer;

import java.awt.Graphics2D;

import shapeTools.GShapeTool;

public class GMover extends GTransformer {

public GMover(GShapeTool selectedShape) {
super(selectedShape);
}

@Override
public void initTransforming(Graphics2D graphics2d, int x, int y) {
this.selectedShape.initTransform(graphics2d, x, y);
this.px = x;
this.py = y;
}

@Override
public void keepTransforming(Graphics2D graphics2d, int x, int y) {
this.selectedShape.move(graphics2d, x - px, y - py);
this.px = x;
this.py = y;
}

}
28 changes: 28 additions & 0 deletions src/Transformer/GResizer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package Transformer;

import java.awt.Graphics2D;
import java.awt.Point;

import shapeTools.GShapeTool;

public class GResizer extends GTransformer {

public GResizer(GShapeTool selectedShape) {
super(selectedShape);
}

@Override
public void initTransforming(Graphics2D graphics2d, int x, int y) {
this.selectedShape.initTransform(graphics2d, x, y);
this.px = x;
this.py = y;
}

@Override
public void keepTransforming(Graphics2D graphics2d, int x, int y) {
this.selectedShape.resize(graphics2d, new Point(px, py), new Point(x, y));
this.px = x;
this.py = y;
}

}
27 changes: 27 additions & 0 deletions src/Transformer/GRotator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package Transformer;

import java.awt.Graphics2D;
import java.awt.Point;

import shapeTools.GShapeTool;

public class GRotator extends GTransformer {

public GRotator(GShapeTool selectedShape) {
super(selectedShape);
}

@Override
public void initTransforming(Graphics2D graphics2d, int x, int y) {
this.selectedShape.initTransform(graphics2d, x, y);
this.px = x;
this.py = y;
}

@Override
public void keepTransforming(Graphics2D graphics2d, int x, int y) {
this.selectedShape.rotate(graphics2d, new Point(px, py), new Point(x, y));
this.px = x;
this.py = y;
}
}
28 changes: 28 additions & 0 deletions src/Transformer/GTransformer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package Transformer;

import java.awt.Graphics2D;

import shapeTools.GShapeTool;

public abstract class GTransformer {

protected GShapeTool selectedShape;
protected int px, py;

public GTransformer(GShapeTool selectedShape) {
this.selectedShape = selectedShape;
}

public abstract void initTransforming(Graphics2D graphics2d, int x, int y);

public abstract void keepTransforming(Graphics2D graphics2d, int x, int y);

public void finishTransforming(Graphics2D graphics2d, int x, int y) {

}

public void continueTransforming(Graphics2D graphics2d, int x, int y) {

}

}
134 changes: 134 additions & 0 deletions src/frame/GFrame.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
package frame;

import java.awt.BorderLayout;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.File;

import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import main.GConstants.CFrame;

public class GFrame extends JFrame {
// attributes
private static final long serialVersionUID = 1L;

// components (Aggregation HierarchyÀÇ Àڽĵé)
private GPanel panel;
private GToolBar toolBar;
private GMenuBar menuBar;
private WindowHandler windowHandler;
private ActionListener themeActionListener;
File file = new File("src/graphicsEditorA/sound_effect_1.wav");

public GFrame() {
// initialize attributes
this.setLocation(CFrame.point);
this.setSize(CFrame.dimension);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);

setTitle("Graphics Editor");

this.windowHandler = new WindowHandler();
this.addWindowListener(windowHandler);
this.themeActionListener = new ThemeActionHandler();

// initialize components
this.menuBar = new GMenuBar(this.themeActionListener);
this.setJMenuBar(this.menuBar);
LayoutManager layoutManager = new BorderLayout();
this.getContentPane().setLayout(layoutManager);

this.toolBar = new GToolBar();
this.getContentPane().add(this.toolBar, BorderLayout.NORTH);

this.panel = new GPanel();
this.getContentPane().add(this.panel, BorderLayout.CENTER);

// set associations
this.menuBar.setAssociation(this.panel);
this.toolBar.setAssociation(this.panel);
}

public void initialize() {
this.toolBar.initialize();
this.panel.initialize();
}

public void setTheme(String theme) {
try {
UIManager.setLookAndFeel(theme);
SwingUtilities.updateComponentTreeUI(this);
} catch (Exception e) {
}
}

public class ThemeActionHandler implements ActionListener {
public void actionPerformed(ActionEvent e1) {
setTheme(e1.getActionCommand());
// System.out.println(file.exists());
try {
AudioInputStream stream = AudioSystem.getAudioInputStream(file);
Clip clip = AudioSystem.getClip();
clip.open(stream);
clip.start();
} catch (Exception e2) {
e2.printStackTrace();
}
}
}

private class WindowHandler implements WindowListener {

@Override
public void windowActivated(WindowEvent arg0) {
// TODO Auto-generated method stub

}

@Override
public void windowClosed(WindowEvent arg0) {
// TODO Auto-generated method stub

}

@Override
public void windowClosing(WindowEvent arg0) {
menuBar.windowExit();
}

@Override
public void windowDeactivated(WindowEvent arg0) {
// TODO Auto-generated method stub

}

@Override
public void windowDeiconified(WindowEvent arg0) {
// TODO Auto-generated method stub

}

@Override
public void windowIconified(WindowEvent arg0) {
// TODO Auto-generated method stub

}

@Override
public void windowOpened(WindowEvent arg0) {
// TODO Auto-generated method stub

}

}
}
53 changes: 53 additions & 0 deletions src/frame/GMenuBar.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package frame;

import java.awt.event.ActionListener;

import javax.swing.JMenuBar;

import main.GConstants.EMenu;
import menu.GColorMenu;
import menu.GEditMenu;
import menu.GFileMenu;
import menu.GHelpMenu;

public class GMenuBar extends JMenuBar {
private static final long serialVersionUID = 1L;

private GFileMenu fileMenu;
private GEditMenu editMenu;
private GHelpMenu helpMenu;
private GColorMenu colorMenu;

public GMenuBar(ActionListener themeActionListener) {
this.fileMenu = new GFileMenu(EMenu.eFile.getText());
this.add(this.fileMenu);

this.editMenu = new GEditMenu(EMenu.eEdit.getText());
this.add(this.editMenu);

this.colorMenu = new GColorMenu(EMenu.eColor.getText(), themeActionListener);
this.add(this.colorMenu);

this.helpMenu = new GHelpMenu(EMenu.eHelp.getText());
this.add(this.helpMenu);
}

// public GMenuBar() {
// for (EMenu eMenu: EMenu.values()) {
// JMenu menu = new GFileMenu(eMenu.getText());
// this.add(menu);
// }
// }

public void setAssociation(GPanel panel) {
this.fileMenu.setAssociation(panel);
this.editMenu.setAssociation(panel);
this.colorMenu.setAssociation(panel);
this.helpMenu.setAssociation(panel);
}

public void windowExit() {
this.fileMenu.exitProgram();

}
}
Loading

0 comments on commit b5a27b4

Please sign in to comment.