forked from ryan-schroeder/sonic-candle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9632f61
commit 94bf163
Showing
9 changed files
with
135 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.soniccandle.model; | ||
|
||
import java.awt.Graphics2D; | ||
|
||
public abstract class BarDrawer { | ||
|
||
public Graphics2D g; | ||
public int half; | ||
|
||
public BarDrawer(Graphics2D g, int half) { | ||
this.g = g; | ||
this.half = half; | ||
} | ||
|
||
public abstract void drawBar(int height, int x); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/com/soniccandle/model/OutlinBlockBarDrawer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.soniccandle.model; | ||
|
||
import java.awt.BasicStroke; | ||
import java.awt.Graphics2D; | ||
import java.awt.Stroke; | ||
|
||
public class OutlinBlockBarDrawer extends BarDrawer { | ||
|
||
public OutlinBlockBarDrawer(Graphics2D g, int half) { super(g, half); } | ||
|
||
@Override | ||
public void drawBar(int height, int x) { | ||
Stroke str = new BasicStroke(1); | ||
g.setStroke(str); | ||
g.drawLine(x+2, half, x+2, half+height); // draws down | ||
g.drawLine(x-2, half, x-2, half+height); // draws down | ||
g.drawLine(x-2, half+height, x+2, half+height); // draws across | ||
g.drawLine(x+2, half, x+2, half-height); // draws up | ||
g.drawLine(x-2, half, x-2, half-height); // draws up | ||
g.drawLine(x-2, half-height, x+2, half-height); // draws across | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/com/soniccandle/model/ThickBlockBarDrawer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.soniccandle.model; | ||
|
||
import java.awt.BasicStroke; | ||
import java.awt.Graphics2D; | ||
import java.awt.Stroke; | ||
|
||
public class ThickBlockBarDrawer extends BarDrawer { | ||
|
||
public ThickBlockBarDrawer(Graphics2D g, int half) { super(g, half); } | ||
|
||
@Override | ||
public void drawBar(int height, int x) { | ||
Stroke str = new BasicStroke(7); | ||
g.setStroke(str); | ||
g.drawLine(x, half, x, half+height); // draws down | ||
g.drawLine(x, half, x, half-height); // draws up | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.soniccandle.model; | ||
|
||
import java.awt.BasicStroke; | ||
import java.awt.Graphics2D; | ||
import java.awt.Stroke; | ||
|
||
public class ThinBarDrawer extends BarDrawer { | ||
|
||
public ThinBarDrawer(Graphics2D g, int half) { super(g, half); } | ||
|
||
@Override | ||
public void drawBar(int height, int x) { | ||
Stroke str = new BasicStroke(2); | ||
g.setStroke(str); | ||
g.drawLine(x, half, x, half+height); // draws down | ||
g.drawLine(x, half, x, half-height); // draws up | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters