Skip to content

Commit

Permalink
Merge pull request #25 from jackoson/master
Browse files Browse the repository at this point in the history
changed splitmerge label text font so it scales better
  • Loading branch information
jackoson authored Feb 19, 2017
2 parents 7910457 + b3cf1f6 commit dfab894
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
13 changes: 7 additions & 6 deletions src/com/modsim/modules/SplitMerge.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.modsim.modules.parts.Port;
import com.modsim.modules.parts.SSText;
import com.modsim.res.Colors;
import com.modsim.res.Fonts;
import com.modsim.simulator.PickableEntity;
import com.modsim.util.BezierCurve;
import com.modsim.util.BinData;
Expand Down Expand Up @@ -79,12 +80,12 @@ public SplitMerge() {
new Vec2(B + b1, -15), new Vec2(d - b0, 15));
curves = Collections.unmodifiableList(Arrays.asList(cs));

parts.add(new SSText(A-10, 24, "DCBA", 7, Colors.labelText));
parts.add(new SSText(B-10, 24, "XXDC", 7, Colors.labelText));
parts.add(new SSText(a+10, -24, "ABXX", -7, Colors.labelText));
parts.add(new SSText(b+10, -24, "BXXX", -7, Colors.labelText));
parts.add(new SSText(c+10, -24, "CDXX", -7, Colors.labelText));
parts.add(new SSText(d+10, -24, "DXXX", -7, Colors.labelText));
parts.add(new SSText(A-8, 24, "DCBA", 7, Colors.splitMergeLabel, Fonts.splitMergeLabel.getFamily()));
parts.add(new SSText(B-8, 24, "XXDC", 7, Colors.splitMergeLabel, Fonts.splitMergeLabel.getFamily()));
parts.add(new SSText(a+8, -24, "XXBA", -7, Colors.splitMergeLabel, Fonts.splitMergeLabel.getFamily()));
parts.add(new SSText(b+8, -24, "XXXB", -7, Colors.splitMergeLabel, Fonts.splitMergeLabel.getFamily()));
parts.add(new SSText(c+8, -24, "XXDC", -7, Colors.splitMergeLabel, Fonts.splitMergeLabel.getFamily()));
parts.add(new SSText(d+8, -24, "XXXD", -7, Colors.splitMergeLabel, Fonts.splitMergeLabel.getFamily()));

}

Expand Down
12 changes: 11 additions & 1 deletion src/com/modsim/modules/parts/SSText.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@ public SSText(int x, int y, String txt, int fontSize, Color col) {
fontSize);
color = col;
}


public SSText(int x, int y, String txt, int fontSize, Color col, String font_name) {
this.x = x;
this.y = y;
text = txt;
font = new Font(font_name,
Fonts.moduleLabel.getStyle(),
fontSize);
color = col;
}

@Override
public void paint(Graphics2D g) {
// Draw the text
Expand Down
4 changes: 3 additions & 1 deletion src/com/modsim/res/Colors.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public enum LEDColour {
public static final Color moduleLabel = new Color(200, 200, 200);
public static final Color modulePorts = new Color(120, 120, 120);
public static final Color moduleSubLabel = new Color(120, 120, 120);


public static final Color splitMergeLabel = new Color(60, 60, 60);

public static final Color errorEdge = new Color(255, 0, 0, 120);
public static final Color errorFill = new Color(255, 255, 255, 60);
public static final Color errorText = new Color(255, 10, 10);
Expand Down
2 changes: 1 addition & 1 deletion src/com/modsim/res/Fonts.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public class Fonts {

public static final Font moduleLabel = new Font("Dialog", Font.BOLD, 20);

public static final Font splitMergeLabel = new Font("Monospaced", Font.BOLD, 20);
public static final Font label = new Font("Dialog", Font.PLAIN, 18);
public static final Font bigLabel = new Font("Dialog", Font.PLAIN, 36);

Expand Down

0 comments on commit dfab894

Please sign in to comment.