aboutsummaryrefslogtreecommitdiff
path: root/src/main/RoundedRectangleTest.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2023-05-06 21:58:36 -0400
committersowgro <tpoke.ferrari@gmail.com>2023-05-06 21:58:36 -0400
commite5873eef980a42e56355de1c8ffc8fe1a0aeedac (patch)
treea65b5f67f3850915de32e1cb39fc600ed98ee27c /src/main/RoundedRectangleTest.java
parent372d97fee538f86c8333fbbde43cf51484b8ac67 (diff)
downloadNPEhero-e5873eef980a42e56355de1c8ffc8fe1a0aeedac.tar.gz
NPEhero-e5873eef980a42e56355de1c8ffc8fe1a0aeedac.tar.bz2
NPEhero-e5873eef980a42e56355de1c8ffc8fe1a0aeedac.zip
Deleted old classes and added Block class
Diffstat (limited to '')
-rw-r--r--src/main/RoundedRectangleTest.java92
1 files changed, 0 insertions, 92 deletions
diff --git a/src/main/RoundedRectangleTest.java b/src/main/RoundedRectangleTest.java
deleted file mode 100644
index e5f40d2..0000000
--- a/src/main/RoundedRectangleTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package main;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.RoundRectangle2D;
-//import javafx.scene.effect.DropShadow;
-
-import javax.swing.*;
-
-public class RoundedRectangleTest extends JFrame {
- public RoundedRectangleTest() {
- setTitle("RoundedRectangle Test");
- setSize(350, 275);
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setLocationRelativeTo(null);
- setVisible(true);
- }
- public void paint(Graphics g) {
- //DropShadowBorder shadow = new DropShadowBorder();
-
- Graphics2D g2d = (Graphics2D) g;
- g2d.setPaint(Color.DARK_GRAY);
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.fillRoundRect(10, 50, 150, 150, 30, 30); // to draw a rounded rectangle.
-
- /*Graphics2D g2d = (Graphics2D) g;
- Color holdColor = g2d.getColor();
- g2d.setColor(Color.black);
- AffineTransform holdTransform = g2d.getTransform();
- // want the shadow to be one line width pixel offset
- float lineWidth;
- if (g2d.getStroke() instanceof BasicStroke)
- {
- lineWidth = ((BasicStroke) (g2d.getStroke())).getLineWidth();
- }
- else
- {
- lineWidth = 1.0f;
- }
- //System.err.println("DrawingUtilities.drawShadowedShape(): lineWidth = "+lineWidth);
- //g2d.translate(lineWidth, lineWidth);
- g2d.fillRoundRect(10, 50, 150, 150, 30, 30);
- //g2d.setColor(holdColor);
- //g2d.setTransform(holdTransform);
- //g2d.drawRoundRect(10, 50, 150, 150, 30, 30);
- */
-
-
- }
- public static void main(String []args) {
- new RoundedRectangleTest();
- }
-
- public static void drawShadowedShape(Shape shape, Graphics2D g2d)
- {
- Color holdColor = g2d.getColor();
- g2d.setColor(Color.black);
- AffineTransform holdTransform = g2d.getTransform();
- // want the shadow to be one line width pixel offset
- float lineWidth;
- if (g2d.getStroke() instanceof BasicStroke)
- {
- lineWidth = ((BasicStroke) (g2d.getStroke())).getLineWidth();
- }
- else
- {
- lineWidth = 1.0f;
- }
- //System.err.println("DrawingUtilities.drawShadowedShape(): lineWidth = "+lineWidth);
- g2d.translate(lineWidth, lineWidth);
- g2d.draw(shape);
- g2d.setColor(holdColor);
- g2d.setTransform(holdTransform);
- g2d.draw(shape);
- }
-
- public static void drawShadowedShape2(Shape shape, Graphics2D g2d) {
- Color holdColor = g2d.getColor();
- g2d.setColor(Color.black);
- AffineTransform holdTransform = g2d.getTransform();
- // want the shadow to be one line width pixel offset
- float lineWidth = g2d.getStroke() instanceof BasicStroke ? ((BasicStroke) (g2d.getStroke())).getLineWidth()
- : 1.0f;
- //System.err.println("DrawingUtilities.drawShadowedShape(): lineWidth = "+lineWidth);
- g2d.translate(lineWidth, lineWidth);
- g2d.draw(shape);
- g2d.setColor(holdColor);
- g2d.setTransform(holdTransform);
- g2d.draw(shape);
- }
-} \ No newline at end of file