Skip to content

Commit

Permalink
Moved "create image" to File submenu
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaulm committed Apr 21, 2022
1 parent c913c16 commit 242b65f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
22 changes: 13 additions & 9 deletions src/main/java/com/jpaulmorrison/graphics/Block.java
Original file line number Diff line number Diff line change
Expand Up @@ -356,19 +356,24 @@ else if (fullClassName != null) {
g.setColor(Color.BLACK);
}



//blueCircs(g);


}


void calcEdges() {
leftEdge = cx - width / 2;
rightEdge = cx + width / 2;
topEdge = cy - height / 2;
botEdge = cy + height / 2;
//if (!(this instanceof Enclosure)) {
leftEdge = cx - width / 2;
rightEdge = cx + width / 2;
topEdge = cy - height / 2;
botEdge = cy + height / 2;
//} else {
// int hh = driver.gFontHeight;
// leftEdge = cx - width / 2 + width / 5;
// rightEdge = cx + width / 2 - width / 5;
// topEdge = cy - height / 2 - hh;
// botEdge = cy - height / 2 + hh;
//}

}
void calcDiagMaxAndMin(int xmin, int xmax, int ymin, int ymax) {
//if (visible) {
Expand Down Expand Up @@ -901,7 +906,6 @@ void showArrowEndAreas(Graphics g) {
Color col = g.getColor();
g.setColor(DrawFBP.grey);
Graphics2D g2 = (Graphics2D) g;

g2.fill(leftRect);
g2.fill(topRect);
g2.fill(rightRect);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/jpaulmorrison/graphics/Diagram.java
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,8 @@ void createImage() {
g.setFont(driver.fontg);
}

driver.showImage(combined, diagFile.getName(), true);
driver.showImage(combined, diagFile.getName(), true);
driver.repaint();

}

Expand Down
21 changes: 13 additions & 8 deletions src/main/java/com/jpaulmorrison/graphics/DrawFBP.java
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,12 @@ public JMenuBar createMenuBar() {
menuItem = new JMenuItem("Change Font Size");
fileMenu.add(menuItem);
menuItem.addActionListener(this);

fileMenu.addSeparator();
menuItem = new JMenuItem("Create Image");
fileMenu.add(menuItem);
menuItem.addActionListener(this);

//fileMenu.addSeparator();
menuItem = new JMenuItem("Show Image");
fileMenu.add(menuItem);
menuItem.addActionListener(this);
Expand Down Expand Up @@ -1204,10 +1208,10 @@ public JMenuBar createMenuBar() {
menuItem = new JMenuItem("New Block");
diagMenu.add(menuItem);
menuItem.addActionListener(this);
diagMenu.addSeparator();
menuItem = new JMenuItem("Create Image");
diagMenu.add(menuItem);
menuItem.addActionListener(this);
//diagMenu.addSeparator();
//menuItem = new JMenuItem("Create Image");
//diagMenu.add(menuItem);
//menuItem.addActionListener(this);
//menuItem = new JMenuItem("Show Image");
//diagMenu.add(menuItem);
//menuItem.addActionListener(this);
Expand Down Expand Up @@ -7131,6 +7135,7 @@ public void mouseDragged(MouseEvent e) {
tailMark.y = ya;
curDiag.changed = true;
currentArrow = arr;
arr.rebuildFatLines();
//buildArrowhead
repaint();
return;
Expand All @@ -7140,7 +7145,7 @@ public void mouseDragged(MouseEvent e) {
arr.toX = xa;
arr.toY = ya;
//arr.ah = arr.buildArrowhead(arr.toX, arr.toY);
//arr.rebuildFatLines();
arr.rebuildFatLines();
headMark.x = xa;
headMark.y = ya;
curDiag.changed = true;
Expand Down Expand Up @@ -7239,7 +7244,7 @@ public void mouseDragged(MouseEvent e) {
arrow.fromY += ya - oldy;
arrow.extraArrowhead = null;
adjustArrowsEndingAtLine(arrow); // must be recursive
//arrow.rebuildFatLines();
arrow.rebuildFatLines();
//arrow.ah = arrow.buildArrowhead(arrow.toX, arrow.toY);
}
if (arrow.toId == block.id && arrow.endsAtBlock) {
Expand Down Expand Up @@ -7294,7 +7299,7 @@ public void mouseDragged(MouseEvent e) {
bd.y += ya - oldy;
}
//a.ah = a.buildArrowhead(a.toX, a.toY);
//a.rebuildFatLines();
a.rebuildFatLines();
}

repaint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public final class VersionAndTimestamp {



static String date = "Apr. 20, 2022";
static String date = "Apr. 21, 2022";

static String getVersion() {
return version;
Expand Down

0 comments on commit 242b65f

Please sign in to comment.