From 40f82465729c02f46261ba0f93267dff499d1868 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Mon, 17 Jun 2024 12:19:11 -0400 Subject: [PATCH 01/18] Add comment icon --- res/comment.png | Bin 0 -> 182 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 res/comment.png diff --git a/res/comment.png b/res/comment.png new file mode 100644 index 0000000000000000000000000000000000000000..f4f62aa0933c266e4fd8f72f42dbdcd83948fa59 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-MTVz~ zV@SoEw^JOs4k!pPKd%)1wfx&k*ZYCnr|%6Fym-fK!eu8mp$HCN4Mx@tuHxr^y}T)q z_wEkUo;n-x+;tWY}(0 bGuv+4%sp#2%bvdpw3ETp)z4*}Q$iB}%ymB* literal 0 HcmV?d00001 From 40cb47eeb70e0894bb6bd3b97bb93514e9f42a9c Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Mon, 17 Jun 2024 12:19:33 -0400 Subject: [PATCH 02/18] Add comments for operations --- .../java/de/usd/cstchef/operations/Operation.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/de/usd/cstchef/operations/Operation.java b/src/main/java/de/usd/cstchef/operations/Operation.java index fceb094..f85f843 100644 --- a/src/main/java/de/usd/cstchef/operations/Operation.java +++ b/src/main/java/de/usd/cstchef/operations/Operation.java @@ -19,6 +19,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.swing.Action; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; @@ -28,6 +29,7 @@ import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JSpinner; @@ -68,6 +70,7 @@ public abstract class Operation extends JPanel { private static ImageIcon disableIcon = new ImageIcon(Operation.class.getResource("/disable.png")); private static ImageIcon removeIcon = new ImageIcon(Operation.class.getResource("/remove.png")); private static ImageIcon helpIcon = new ImageIcon(Operation.class.getResource("/help.png")); + private static ImageIcon commentIcon = new ImageIcon(Operation.class.getResource("/comment.png")); private NotifyChangeListener notifyChangeListener; @@ -122,6 +125,15 @@ public Operation() { removeBtn.setToolTipText("Remove"); JButton helpBtn = createIconButton(Operation.helpIcon); helpBtn.setToolTipText(opInfos.description()); + + JButton commentButton = createIconButton(commentIcon); + commentButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String comment = JOptionPane.showInputDialog("Edit comment:", commentButton.getToolTipText()); + commentButton.setToolTipText(comment); + } + }); + disableBtn.addActionListener(new ActionListener() { @Override @@ -162,6 +174,8 @@ public void actionPerformed(ActionEvent e) { header.add(titleLbl); header.add(Box.createHorizontalStrut(6)); header.add(helpBtn); + header.add(Box.createHorizontalStrut(3)); + header.add(commentButton); header.add(Box.createHorizontalGlue()); header.add(disableBtn); header.add(Box.createHorizontalStrut(3)); From 062dc8fc06de28b1e1969e0424639f5cc183a8e1 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Mon, 24 Jun 2024 11:44:24 -0400 Subject: [PATCH 03/18] Add matching icons --- res/comment.png | Bin 182 -> 203 bytes res/no-comment.png | Bin 0 -> 316 bytes 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 res/comment.png create mode 100755 res/no-comment.png diff --git a/res/comment.png b/res/comment.png old mode 100644 new mode 100755 index f4f62aa0933c266e4fd8f72f42dbdcd83948fa59..08b18ad8ac8a3410e45dded1d5ccd8e2a9de3448 GIT binary patch delta 154 zcmV;L0A>HS0m}i9Ie&dgL_t(|ob8k`4!|G`1N}WJ{?ifO+KhcdhjgJ515)Ftp$nEg z;*)R^V2RKMKme%G0w6H}CS02j2Jk$}Mr-o|;O&dd<$F6&Yx!P4ww6B)a1ncOdH_s# z@c>HH0_q_AQ$YRegb2|~KOknMwm9q%glLZj^pH^1Xuv$(0~1rWUDw|asQ>@~07*qo IM6N<$f-%fOI{*Lx delta 132 zcmV-~0DJ$-0k#2505DxqRc}xOz@Q>iZ(spnP*G7oyR-?CfujZJ mjc&k&K+FSd#@UD9WoF(_VK@}&Wi=Bo4cE)PdMZBmT`~&UjMz#e0`5H_!T1BckF3uc`|Xu z%Vvk!TmCxkcV}Y0CS$?$IL3iF;sK9{WrOVpp(V`IjP_5ie%&Lc5!`U?r-P1A>|bxu zf~l{i4JLmT+`!n=^Y3TM0T-oj;tFgV_cKWau^0s&{?6#;=yZ_%Fh7v?Qm-(T<~5K@ zd72``d!$c%!#9O`W}O26m+R^l_WdZGdg;(ywkw=BLl{%IZE6o3H1~`u_qC7u@!I!- z*5l&lo^?iol?=j0S2!# Date: Mon, 24 Jun 2024 11:46:16 -0400 Subject: [PATCH 04/18] Refactor comment button functionality --- .../de/usd/cstchef/operations/Operation.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/usd/cstchef/operations/Operation.java b/src/main/java/de/usd/cstchef/operations/Operation.java index f85f843..b66fbf2 100644 --- a/src/main/java/de/usd/cstchef/operations/Operation.java +++ b/src/main/java/de/usd/cstchef/operations/Operation.java @@ -9,6 +9,8 @@ import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; import java.io.EOFException; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -71,6 +73,7 @@ public abstract class Operation extends JPanel { private static ImageIcon removeIcon = new ImageIcon(Operation.class.getResource("/remove.png")); private static ImageIcon helpIcon = new ImageIcon(Operation.class.getResource("/help.png")); private static ImageIcon commentIcon = new ImageIcon(Operation.class.getResource("/comment.png")); + private static ImageIcon noCommentIcon = new ImageIcon(Operation.class.getResource("/no-comment.png")); private NotifyChangeListener notifyChangeListener; @@ -83,6 +86,9 @@ public abstract class Operation extends JPanel { private Box contentBox; private Map uiElements; + private String comment; + private JButton commentButton; + private int operationSkip = 0; private int laneSkip = 0; @@ -126,11 +132,15 @@ public Operation() { JButton helpBtn = createIconButton(Operation.helpIcon); helpBtn.setToolTipText(opInfos.description()); - JButton commentButton = createIconButton(commentIcon); + commentButton = createIconButton(noCommentIcon); commentButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + commentButton.setToolTipText(getComment()); String comment = JOptionPane.showInputDialog("Edit comment:", commentButton.getToolTipText()); commentButton.setToolTipText(comment); + setComment(comment); + ImageIcon newIcon = comment.isEmpty() ? Operation.noCommentIcon : Operation.commentIcon; + commentButton.setIcon(newIcon); } }); @@ -203,6 +213,18 @@ public void actionPerformed(ActionEvent e) { this.refreshColors(); } + public String getComment() { + return this.comment; + } + + public void setComment(String comment) { + if(comment != null) { + this.comment = comment; + commentButton.setIcon(Operation.commentIcon); + commentButton.setToolTipText(comment); + } + } + public Map getState() { Map properties = new HashMap<>(); for (String key : this.uiElements.keySet()) { From 7e1b72bf15781e7b84cadd3d3dd64cb9b94a6ed3 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Mon, 24 Jun 2024 11:48:59 -0400 Subject: [PATCH 05/18] Make comments be saved/loaded in recipes --- src/main/java/de/usd/cstchef/view/RecipePanel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/de/usd/cstchef/view/RecipePanel.java b/src/main/java/de/usd/cstchef/view/RecipePanel.java index 8f4cd84..f9912a8 100644 --- a/src/main/java/de/usd/cstchef/view/RecipePanel.java +++ b/src/main/java/de/usd/cstchef/view/RecipePanel.java @@ -371,6 +371,7 @@ public void restoreState(String jsonState) throws IOException, ClassNotFoundExce Class cls = (Class) Class.forName(operation); // check if it is an operation Operation op = cls.newInstance(); + op.setComment(operationNode.get("comment").textValue()); op.load(parameters); op.setDisabled(!operationNode.get("is_enabled").asBoolean()); RecipeStepPanel panel = (RecipeStepPanel) this.operationLines.getComponent(step); @@ -392,6 +393,7 @@ private String getStateAsJSON() throws IOException { ObjectNode operationNode = mapper.createObjectNode(); operationNode.put("operation", op.getClass().getName()); operationsNode.add(operationNode); + operationNode.put("comment", op.getComment()); operationNode.putPOJO("parameters", op.getState()); operationNode.putPOJO("is_enabled", !op.isDisabled()); } From 2c3da2ffa07777d713550b5678b29a5b046d8cb0 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Tue, 25 Jun 2024 05:36:51 -0400 Subject: [PATCH 06/18] Refactor comment button --- .../de/usd/cstchef/operations/Operation.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/de/usd/cstchef/operations/Operation.java b/src/main/java/de/usd/cstchef/operations/Operation.java index b66fbf2..9a9d52b 100644 --- a/src/main/java/de/usd/cstchef/operations/Operation.java +++ b/src/main/java/de/usd/cstchef/operations/Operation.java @@ -87,7 +87,7 @@ public abstract class Operation extends JPanel { private Map uiElements; private String comment; - private JButton commentButton; + private JButton commentBtn; private int operationSkip = 0; private int laneSkip = 0; @@ -131,16 +131,16 @@ public Operation() { removeBtn.setToolTipText("Remove"); JButton helpBtn = createIconButton(Operation.helpIcon); helpBtn.setToolTipText(opInfos.description()); - - commentButton = createIconButton(noCommentIcon); - commentButton.addActionListener(new ActionListener() { + commentBtn = createIconButton(noCommentIcon); + + commentBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - commentButton.setToolTipText(getComment()); - String comment = JOptionPane.showInputDialog("Edit comment:", commentButton.getToolTipText()); - commentButton.setToolTipText(comment); + commentBtn.setToolTipText(getComment()); + String comment = JOptionPane.showInputDialog("Edit comment:", commentBtn.getToolTipText()); + commentBtn.setToolTipText(comment); setComment(comment); ImageIcon newIcon = comment.isEmpty() ? Operation.noCommentIcon : Operation.commentIcon; - commentButton.setIcon(newIcon); + commentBtn.setIcon(newIcon); } }); @@ -185,7 +185,7 @@ public void actionPerformed(ActionEvent e) { header.add(Box.createHorizontalStrut(6)); header.add(helpBtn); header.add(Box.createHorizontalStrut(3)); - header.add(commentButton); + header.add(commentBtn); header.add(Box.createHorizontalGlue()); header.add(disableBtn); header.add(Box.createHorizontalStrut(3)); @@ -220,8 +220,8 @@ public String getComment() { public void setComment(String comment) { if(comment != null) { this.comment = comment; - commentButton.setIcon(Operation.commentIcon); - commentButton.setToolTipText(comment); + commentBtn.setIcon(Operation.commentIcon); + commentBtn.setToolTipText(comment); } } From f93277bdd7ebfa4bf77c54edaa4767446b671c2f Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Tue, 25 Jun 2024 05:39:10 -0400 Subject: [PATCH 07/18] Replace icon images --- res/comment.png | Bin 203 -> 196 bytes res/no-comment.png | Bin 316 -> 277 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/res/comment.png b/res/comment.png index 08b18ad8ac8a3410e45dded1d5ccd8e2a9de3448..d3a147694c13cd6875a7ce8532312aa3ffbb72da 100755 GIT binary patch delta 147 zcmV;E0Brxu0mK22Ie&IZL_t(|ob8iA4uCKS1otcT6DIA4_`v?(lZlsAsL+c}(i_Vp z1%RIb8vp}9=Q98;B8W8SMdIcRRn_CW0(ys^C7>F9))!IrStj7iJ7AW;#4sNP-5U_x z3VI|Uko6-P$T~oqTmUz1Qc}WREx1Zb8P$Sy9MptE!lB63p$q^3002ovPDHLkV1k&G BJ~jXV delta 154 zcmV;L0A>Hg0m}i9Ie&dgL_t(|ob8k`4!|G`1N}WJ{?ifO+KhcdhjgJ515)Ftp$nEg z;*)R^V2RKMKme%G0w6H}CS02j2Jk$}Mr-o|;O&dd<$F6&Yx!P4ww6B)a1ncOdH_s# z@c>HH0_q_AQ$YRegb2|~KOknMwm9q%glLZj^pH^1Xuv$(0~1rWUDw|asQ>@~07*qo IM6N<$f;u=tNdN!< diff --git a/res/no-comment.png b/res/no-comment.png index 62992643c9680f548997cc9ac8e291a6f9f6b882..5efff095ddc64f7cc2d32149540e1a7981eb865e 100755 GIT binary patch delta 228 zcmV-)N-vP^dWH5N=`tZuvTecp7a>AO z95Yj^AA}IiJoSGKG}IY*0;gJl9`L{jxEg@l0@y;Xz-QGL+YEFTz-v=L3sEb66p9YZ z^OW%tdxs@m34@oUZ e4_s;i+Ug6h$xI*_W?#hLcs^a z4*^C&N+)8^gEj`($z(!!kv)Ct*C0b~n2eZavt zNm_SJKU( Date: Tue, 25 Jun 2024 11:12:55 -0400 Subject: [PATCH 08/18] Add Lane naming functionality --- .../de/usd/cstchef/view/RecipeStepPanel.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java b/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java index 89b79da..a0902e9 100644 --- a/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java +++ b/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java @@ -6,11 +6,18 @@ import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.List; import javax.swing.BorderFactory; import javax.swing.Box; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextField; @@ -27,6 +34,7 @@ public class RecipeStepPanel extends JPanel { private JPanel operationsLine; private GridBagConstraints addContraints; private ChangeListener changeListener; + private JTextField contentTextField; public RecipeStepPanel(String title, ChangeListener changelistener) { this.changeListener = changelistener; @@ -41,10 +49,18 @@ public RecipeStepPanel(String title, ChangeListener changelistener) { CompoundBorder border = new CompoundBorder(lineBorder, margin); headerBox.setBorder(border); - JTextField contentTextField = new JTextField(); + contentTextField = new JTextField(); contentTextField.setBorder(null); contentTextField.setBackground(new Color(0, 0, 0, 0)); contentTextField.setText(title); + contentTextField.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + String newTitle = JOptionPane.showInputDialog("Edit title:", getTitle()); + contentTextField.setText(newTitle.length() <= 50 ? newTitle : getTitle()); + setTitle(newTitle); // lane name should be leq 50 chars + } + }); headerBox.add(contentTextField); this.add(headerBox, BorderLayout.NORTH); @@ -124,4 +140,12 @@ public void clearOperations() { operationsLine.repaint(); this.changeListener.stateChanged(new ChangeEvent(this)); } + + public String getTitle() { + return contentTextField.getText(); + } + + public void setTitle(String title) { + contentTextField.setText(title); + } } From 22378bc580fcec0acd72ce80709a0dc93e32be97 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Tue, 25 Jun 2024 11:14:39 -0400 Subject: [PATCH 09/18] Add lane names to recipe saving/loading --- .../java/de/usd/cstchef/view/RecipePanel.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/usd/cstchef/view/RecipePanel.java b/src/main/java/de/usd/cstchef/view/RecipePanel.java index f9912a8..8dd2e84 100644 --- a/src/main/java/de/usd/cstchef/view/RecipePanel.java +++ b/src/main/java/de/usd/cstchef/view/RecipePanel.java @@ -364,18 +364,22 @@ public void restoreState(String jsonState) throws IOException, ClassNotFoundExce throw new IOException("wrong data format"); } - for (int i = 0; i < operationNodes.size(); i++) { + RecipeStepPanel panel = (RecipeStepPanel) this.operationLines.getComponent(step); + panel.setTitle(operationNodes.get(0).get("lane_title").asText()); + + for (int i = 1; i < operationNodes.size(); i++) { JsonNode operationNode = operationNodes.get(i); String operation = operationNode.get("operation").asText(); Map parameters = mapper.convertValue(operationNode.get("parameters"), Map.class); Class cls = (Class) Class.forName(operation); // check if it is an operation Operation op = cls.newInstance(); - op.setComment(operationNode.get("comment").textValue()); + op.setComment(operationNode.get("comment").textValue() == null ? "" : operationNode.get("comment").textValue()); op.load(parameters); op.setDisabled(!operationNode.get("is_enabled").asBoolean()); - RecipeStepPanel panel = (RecipeStepPanel) this.operationLines.getComponent(step); - panel.addComponent(op, i); + //RecipeStepPanel panel = (RecipeStepPanel) this.operationLines.getComponent(step); + panel.addComponent(op, i-1); + //panel.setTitle((String.valueOf(i))); } } } @@ -388,6 +392,11 @@ private String getStateAsJSON() throws IOException { ArrayNode operationsNode = mapper.createArrayNode(); RecipeStepPanel stepPanel = (RecipeStepPanel) this.operationLines.getComponent(step); + + ObjectNode laneTitleNode = mapper.createObjectNode(); + laneTitleNode.put("lane_title", stepPanel.getTitle()); + operationsNode.add(laneTitleNode); + List operations = stepPanel.getOperations(); for (Operation op : operations) { ObjectNode operationNode = mapper.createObjectNode(); From c4787c6bedefd7f28569e75d54ed0782574833e2 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Tue, 2 Jul 2024 11:58:05 -0400 Subject: [PATCH 10/18] Refactor icons --- res/comment.png | Bin 196 -> 342 bytes res/disable.png | Bin 533 -> 662 bytes res/help.png | Bin 510 -> 852 bytes res/no-comment.png | Bin 277 -> 583 bytes res/operation.png | Bin 367 -> 636 bytes res/remove.png | Bin 533 -> 873 bytes res/stop.png | Bin 244 -> 710 bytes res/stop_active.png | Bin 403 -> 832 bytes 8 files changed, 0 insertions(+), 0 deletions(-) diff --git a/res/comment.png b/res/comment.png index d3a147694c13cd6875a7ce8532312aa3ffbb72da..0dd861ee8e61f630a6c030831344d85d56ba3526 100755 GIT binary patch literal 342 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`k3To7igG09#C6qGD+ zjVKAuPb(=;EJ|f4FE7{2%*!rLPAo{(%P&fw{mw=TsOYh$i(`mI@7pVee$0jzI_-j=KXYS%uUM$f9XvzA3JpJK*f=l|uHO1fx+x$$oO0D*hI+b1pwVPazzN@ zwtU!gbRDCQGl&2FZD$%)Ue1Z0P{YXJ8GhJ6XX?%=wIZHfhU*y4FrG>7SuInx;h|pa lbzjBgQu&X%Q~loCII}egdP9@ literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-MVY6I zV@SoEx04pevF9KKu zFh_Dd48tv^B!|LMsdP4qqGgg+6h&*zX7kt3=qWtUn~39hnPhiwZ|_m7)!GLD^n_~L z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fFTx6u{$NuXo^iKx^$Il2^;WSXDs~ z92Akw8i1c_wORn+#ys=(_V&HKZUNvpfFHG9uYV8Vc==kSJ&3o{w#xfz21T85>Jr4+39pvW(I6o-EMcW(P$h4a0Gx$a$#Ef2f$wd(mcr!ax*$i75`=D3~+WfEoM=HwzsKMO+=abWov7mi~YiI&^3Y4lNbw)TK)Y zr{GlA_YXw4B~e^kI7=ao>7o#V#U!SiZ@PQD@B8lKJ>CKAV@pWEORZKrF$|-Z%jL8r zWI~83=e#`{jjVM}4i;1@m8YcS004xLl3^IVU``1a004BmT`3G^j2$4NyE;pV=!a`e z)AR`;hryg2^>v8oGRCAeIb%$Uf>X8?FvcK7UOqJsyw87pV)Vs`{YodTTP7Tn>lByC@hrjzFux0q49egqZF^&N*-I|M6Jy3u;4)3)v`IyZ`_I07*qoM6N<$f(N%pb@;8zV7CPIK;qDdx?*A8!U`C?cp-DqHDvI?-;o zzvDlH#bR+Qo6TOy=kxc6!{NbrJf2(>6OofdCX;E;X0zkLV1QgM_jEKGy#p}2fVW9< zI|1NF5Cl&EpjNA0wk&J6P$;~p*Xz-`qU*ZPHbmriVWZI)rBbO^{eEAQtS= zX0v%p@<1t7T^9s^GavvMW4@An<9S{=77zeBolc+Rd#&}oSU>T@S#vWm(rIlgXFqbb9)0?y3`p@^(J9!c7^{gC7#0Eoz~Ua$997K)Tod&y+- zb*t6-HowD_AtDln;XZ&J06SqA?#ogK-EQ~gA5EOs;XF#E(j@>0g5a;8?>~X-#81Fc V;WR(fKP>FSd#5^b9aa!E+40+KzZRx!mvkxO=8NR3rqVV)U#@x|qAdNWx5@ml!-<{an^LB{Ts5Dq(5? diff --git a/res/operation.png b/res/operation.png index c1103f719a8926bb0f64490d608eb72d3166e8f4..d3b9ca7d4c6b42335e291c737a831b5842147a05 100644 GIT binary patch delta 622 zcmV-!0+Idi0{jG!8Gi-<002AIl}Z2r010qNS#tmY19boZ19bt=Y@?w7000?uMObuG zZ)S9NVRB^vcXxL#X>MzCV_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N diff --git a/res/remove.png b/res/remove.png index 406976c1fb69e20429a82b514c5c8e1e9f863744..0ef8a75407029bf45697a69256179ba0dacd15c4 100644 GIT binary patch literal 873 zcmV-v1D5=WP)uZQlGakJUB4}O>T-uLr+ z^LxBE41l_AY;0^#yWKv{%&!sAVE~zkFaRNv<2YHBuUytMAQLF5CmUXYbS|F0MNsnj&90YdnPYVh=_t9I3Xf;<2e2rfcC4b zXaF=xk}E{CKMcbc^BV@3dBPZTE{FNPU#eEChjs&1tJOok@0W6@s!juVt6r~{MMTB{ z%q=Y~{hJF)rP6_RyZv1lhC|)3APAmowOUupyhnmCBLaABN!&Gk-23CzB-EDr%T{UR7V>AP8pTI3DlyX<--+sp^d9c~e=I z34pIu_0;O>>TkXBt+lhl%-L>l6-Cjn06xmH>I=rjE^LPWPJmCBRd0c-8E04{i*_i>UWe>5768_ayl7;~{# z_eVxXo(6DJi0DUEeZ4FAgou1*j5*zCG;ZYnD2je(=1+*|Vi<;x7d4*ey}``aCCjoo zW`4C+tL@8!tyb$c5xrZ46``e4>Ft4mf!nz+2!aF5e9RbgjR26f_Jnh8h8|&#^D{9q zVVrZ9oO5s9pXE4?zXx!~TKhgT_ia?sm{~SAHz!qfYh`8S2cmmTApn}D=`=GRbk0o= z4-XGM2s;6*qFVqKx3{+!Ha0ez-P->E$5OC)q?>4g00000NkvXXu0mjfJKvPO literal 533 zcmV+w0_y#VP)J?4vSR}?#$;OS z{%|uXz_r$IU0DeL z07xmPM6@S_xbr-(1pu%veC<<&hzt=o-ZnYT1`)A!_I_DZHZ;%kaWSGG2;LcQB@l+; zRvE6fj)-VpjH@tSDfMh6P^;ChJ~Fgye7#=3R7%+$(=5wQ0N^Z5)8q0e7SGXaHoIQb z*o|m38jU~uh@_NLDP{C4r|2iamjCCRb3aKEvIQDro<8kBYuz`-WIusxt^5D?__yK} XnB2j9L+;cM00000NkvXXu0mjfj{f44 diff --git a/res/stop.png b/res/stop.png index e450c91539eaf52a6639e67f57e99b33aec2e584..a9b6d816d7edb0d6b587cf01183923a94b6a9552 100644 GIT binary patch literal 710 zcmV;%0y+JOP)N!i2g){PN!cS#bR;xs6YVleScC!m;nT~ZO;z^ z0{~;p95bI_W~L~L8iN9tmX`hiuq*&O;^F)LB)SRMM;oP5>23dpstT*B*2_~1@x59=Z92Pn20{rYPC~?0v*RWsj3UyXf&poxj6`o zh?s~jrBbO`QdJNUd7d{;L@grvxxT*sV|8`)&`mtgyA9x1xm=#I0AO@<)Kb-FBJzcZ zmL12L0r2&ZurmNg;y8W@bhDPtW=)bL?}(@apqcdx@v7EBj*>P9_WEdUs`4pirZyi(`n#@wZbq@*XzeVaeS7h|N=~ zQ0VGSXXBfbcU)D9zp4C(VI>a-W6J>{rX3GTRpja!q`NHaXS`Be`o(OsY0HNfn#z?7 zCzeimd*^Ja!m%A+rge9$cy;;AwJP&^b~pb;tJW`jAiv`Pt6ssuw=63C7o8?m2Qw)2 jdw9HK*!2IScMU^{mWrg(mFzyCV;DSL{an^LB{Ts590yiy diff --git a/res/stop_active.png b/res/stop_active.png index 9ca2fee3b0236cde94a5bb9a49688499c8fd90c1..4d58d56ff4f2f5b5387eab6c9563c6b42d1c9261 100644 GIT binary patch literal 832 zcmV-G1Hb%+l zNJJE|6eM6F1Pt0J(KRZ>>gCT2L@-?}Ug5Gf8VfUPc9{FwyoAZ~P0#~VTsY@m*ml#>Q59 zz25C+fphLr0G9wf4PY_P^Hnw=N5GkxnNww1&Xd%#EZ^DL+4<{V(i<^7J$-*wRr4ed z_V)G`c6WCV000A^I_Ex2)AU6EN)rF&1E6O1igWJ$!#V{3GwXWq%RJ9NCg~4VOioTd zZf2+3RFd>XQG7(wr)fF|0GcF8M?~i0I9_PNvMf78a!FOcNYnJmlc3)Fw*g$qvTR(V zD0&va%J7ScNC@C(5xFKJ&pYSd$g*sF6tpOc62P}rRn4l1ocG?Zwkg=$-26Sy^BW|8 zsq6YvGdnjbPgQS;$axi!GeuF{X#);^i+P@Zrm8oCAh_wAd#T&)2F;v}jg4PPKBC_H zuni<4$GU!feZ61T^>vbUzu#XRk?-{+WhY(Ke86Ks5vkh>NlNoPH8u5^s(u3CR2;`I zjLHuI{9$GfpX8&6h?!kg)hhtr+S=OsX*g#vlDC!QcdB}!4Q6H!nAxI;oZH{ue{K|P z5ElXbpd`NpaCvwl%Cfu%;H;{C4q!RY^Vi$vJ4uob$%|na-qJx+E(byIs)!tUw!OXm zr}zG96h)WwJpaDAQHJc$D2iSKu+;1I?j8+!nx-F^*$w>v-Fvq*Zu?hr=PqllcHPz0000< KMNUMnLSTYAx_=-5 literal 403 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYYs>cdx@v7EBj*>P9{ssw$9&D3=E74o-U3d9> zGO|+5+z(c7s0E#2|yqqCT8~R(IczFhYksqeRyz?*`$-%&(AN=)^_h*IXStfCf!f| z1Htd#-``iSVi#m)WxsLFo}KnG^f4YUCrM9zx__OI-oBN{p9cLtu}vq qdb+;9hT)%gcXwwl{%YaLz|eF!p?;N1dKEDE7(8A5T-G@yGywn$Nvg>J From 519ec7b7803a435f78eb758f122f408c83d3b4b5 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Tue, 2 Jul 2024 11:58:51 -0400 Subject: [PATCH 11/18] Add filtering to res folder --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 398a04d..45b434a 100644 --- a/pom.xml +++ b/pom.xml @@ -85,6 +85,7 @@ res + true From b586a756377c946692ee466c53a81513221f9e27 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Tue, 2 Jul 2024 12:01:07 -0400 Subject: [PATCH 12/18] Add version property --- res/version.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 res/version.properties diff --git a/res/version.properties b/res/version.properties new file mode 100644 index 0000000..713c915 --- /dev/null +++ b/res/version.properties @@ -0,0 +1 @@ +version = ${project.version} \ No newline at end of file From f36b4f6e96caa2a2234554c5fc7e045f4bf1d545 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Tue, 2 Jul 2024 12:01:51 -0400 Subject: [PATCH 13/18] Add lane comments --- .../de/usd/cstchef/view/RecipeStepPanel.java | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java b/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java index a0902e9..5f327fd 100644 --- a/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java +++ b/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java @@ -3,6 +3,7 @@ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import java.awt.Cursor; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; @@ -17,6 +18,8 @@ import javax.swing.BorderFactory; import javax.swing.Box; +import javax.swing.ImageIcon; +import javax.swing.JButton; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -36,6 +39,12 @@ public class RecipeStepPanel extends JPanel { private ChangeListener changeListener; private JTextField contentTextField; + private String comment; + private JButton commentBtn; + + private static ImageIcon commentIcon = new ImageIcon(Operation.class.getResource("/comment.png")); + private static ImageIcon noCommentIcon = new ImageIcon(Operation.class.getResource("/no-comment.png")); + public RecipeStepPanel(String title, ChangeListener changelistener) { this.changeListener = changelistener; this.setLayout(new BorderLayout()); @@ -58,11 +67,30 @@ public RecipeStepPanel(String title, ChangeListener changelistener) { public void mouseClicked(MouseEvent e) { String newTitle = JOptionPane.showInputDialog("Edit title:", getTitle()); contentTextField.setText(newTitle.length() <= 50 ? newTitle : getTitle()); - setTitle(newTitle); // lane name should be leq 50 chars + setTitle(newTitle.length() <= 50 ? newTitle : getTitle()); // lane name should be leq 50 chars } }); headerBox.add(contentTextField); + JPanel panel = new JPanel(); + panel.setBackground(new Color(0, 0, 0, 0)); // transparent + + commentBtn = createIconButton(noCommentIcon); + + commentBtn.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + commentBtn.setToolTipText(getComment()); + String comment = JOptionPane.showInputDialog("Edit comment:", commentBtn.getToolTipText()); + commentBtn.setToolTipText(comment); + setComment(comment); + ImageIcon newIcon = comment.isEmpty() ? RecipeStepPanel.noCommentIcon : RecipeStepPanel.commentIcon; + commentBtn.setIcon(newIcon); + } + }); + + panel.add(commentBtn); + headerBox.add(panel); + this.add(headerBox, BorderLayout.NORTH); // body @@ -148,4 +176,32 @@ public String getTitle() { public void setTitle(String title) { contentTextField.setText(title); } + + private JButton createIconButton(ImageIcon icon) { + JButton btn = new JButton(); + btn.setBorder(BorderFactory.createEmptyBorder()); + btn.setIcon(icon); + btn.setContentAreaFilled(false); + btn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + btn.setAlignmentX(Component.RIGHT_ALIGNMENT); + + return btn; + } + + public String getComment() { + return this.comment; + } + + public void setComment(String comment) { + if(comment != null) { + this.comment = comment; + commentBtn.setIcon(RecipeStepPanel.commentIcon); + commentBtn.setToolTipText(comment); + } + } + + public void clearComment() { + commentBtn.setToolTipText(""); + commentBtn.setIcon(RecipeStepPanel.noCommentIcon); + } } From a459a5b006055c43fcf5783cc5c0a9d7558509c3 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Tue, 2 Jul 2024 12:03:00 -0400 Subject: [PATCH 14/18] Refactor recipe saving/loading --- .../java/de/usd/cstchef/view/RecipePanel.java | 102 +++++++++++++++--- 1 file changed, 88 insertions(+), 14 deletions(-) diff --git a/src/main/java/de/usd/cstchef/view/RecipePanel.java b/src/main/java/de/usd/cstchef/view/RecipePanel.java index 8dd2e84..ec59018 100644 --- a/src/main/java/de/usd/cstchef/view/RecipePanel.java +++ b/src/main/java/de/usd/cstchef/view/RecipePanel.java @@ -12,11 +12,13 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Paths; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.Timer; import java.util.TimerTask; @@ -350,10 +352,23 @@ public void setFormatMessage(HttpRequestResponse requestResponse, MessageType me } public void restoreState(String jsonState) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { - // TODO do we want to remove all existing operations before loading here? - this.clear(); // Yes! + this.clear(); ObjectMapper mapper = new ObjectMapper(); - JsonNode stepNodes = mapper.readTree(jsonState); + JsonNode rootNode = mapper.readTree(jsonState); + JsonNode stepNodes; + JsonNode versionNode; + + // check if "version" ObjectNode is there (since 1.3.2) + if(rootNode.get(0) != null && rootNode.get(0).get("version") == null) { + // recipes saved by CSTC <= 1.3.1 + stepNodes = rootNode; + } + else { + // currently 1.3.2 + versionNode = rootNode.get(0); + stepNodes = rootNode.get(1); + } + if (!stepNodes.isArray()) { throw new IOException("wrong data format"); } @@ -365,27 +380,52 @@ public void restoreState(String jsonState) throws IOException, ClassNotFoundExce } RecipeStepPanel panel = (RecipeStepPanel) this.operationLines.getComponent(step); - panel.setTitle(operationNodes.get(0).get("lane_title").asText()); - for (int i = 1; i < operationNodes.size(); i++) { + /* two types of ObjectNodes for every RecipeStepPanel: + Lane information (always at index 0, if set) and the Operations + + If there's a lane ObjectNode we need to tell the inner loop to begin at index 1. + The inner loop iterates over the Operations + */ + int index = 0; + if(operationNodes.get(0) != null) { + if(operationNodes.get(0).get("lane_title") != null) { + index = 1; + panel.setTitle(operationNodes.get(0).get("lane_title").asText()); + } + if(operationNodes.get(0).get("lane_comment") != null) { + index = 1; + panel.setComment(operationNodes.get(0).get("lane_comment").asText()); + } + } + + for (int i = index; i < operationNodes.size(); i++) { JsonNode operationNode = operationNodes.get(i); String operation = operationNode.get("operation").asText(); Map parameters = mapper.convertValue(operationNode.get("parameters"), Map.class); Class cls = (Class) Class.forName(operation); + // check if it is an operation Operation op = cls.newInstance(); - op.setComment(operationNode.get("comment").textValue() == null ? "" : operationNode.get("comment").textValue()); op.load(parameters); op.setDisabled(!operationNode.get("is_enabled").asBoolean()); - //RecipeStepPanel panel = (RecipeStepPanel) this.operationLines.getComponent(step); - panel.addComponent(op, i-1); - //panel.setTitle((String.valueOf(i))); + + // check if "comment" attribute is set (since 1.3.2) + if(operationNode.get("comment") != null) { + if(operationNode.get("comment").asText() != "null") { + op.setComment(operationNode.get("comment").asText()); + } + } + // depending on if lane name is set we may start the loop at index 1, but want to add the first component at index 0 + panel.addComponent(op, index == 1 ? i-1 : 0); } } } private String getStateAsJSON() throws IOException { ObjectMapper mapper = new ObjectMapper(); + ArrayNode rootNode = mapper.createArrayNode(); + ObjectNode versionNode = mapper.createObjectNode(); ArrayNode stepsNode = mapper.createArrayNode(); for (int step = 0; step < this.operationSteps; step++) { @@ -393,22 +433,53 @@ private String getStateAsJSON() throws IOException { RecipeStepPanel stepPanel = (RecipeStepPanel) this.operationLines.getComponent(step); - ObjectNode laneTitleNode = mapper.createObjectNode(); - laneTitleNode.put("lane_title", stepPanel.getTitle()); - operationsNode.add(laneTitleNode); + // save lane name in case it differs from the default + int laneNumber = step + 1; + boolean laneNodeCreated = false; + if(!stepPanel.getTitle().equals("Lane " + laneNumber)) { + laneNodeCreated = true; + ObjectNode laneNode = mapper.createObjectNode(); + laneNode.put("lane_title", stepPanel.getTitle()); + // save comment in same node in case it is set + if(stepPanel.getComment() != null) { + laneNode.put("lane_comment", stepPanel.getComment()); + } + operationsNode.add(laneNode); + } + + // save comment in case it's not already + if(!laneNodeCreated && stepPanel.getComment() != null) { + ObjectNode laneNode = mapper.createObjectNode(); + laneNode.put("lane_comment", stepPanel.getComment()); + operationsNode.add(laneNode); + } List operations = stepPanel.getOperations(); for (Operation op : operations) { ObjectNode operationNode = mapper.createObjectNode(); operationNode.put("operation", op.getClass().getName()); operationsNode.add(operationNode); - operationNode.put("comment", op.getComment()); operationNode.putPOJO("parameters", op.getState()); operationNode.putPOJO("is_enabled", !op.isDisabled()); + // "comment":null if empty + operationNode.put("comment", op.getComment()); } stepsNode.add(operationsNode); } - return mapper.writeValueAsString(stepsNode); + + /* maven performs a substitution at compile time in "/res/version.properties" + with the version from pom.xml and here it reads from this file + */ + Properties properties = new Properties(); + properties.load(RecipePanel.class.getResourceAsStream("/version.properties")); + String version = properties.getProperty("version"); + + versionNode.put("version", version); + + rootNode.add(versionNode); + rootNode.add(stepsNode); + + return mapper.writeValueAsString(rootNode); } private void save(File file) throws IOException { @@ -598,6 +669,9 @@ private void saveFilterState() { private void clear() { for (int step = 0; step < this.operationSteps; step++) { RecipeStepPanel stepPanel = (RecipeStepPanel) this.operationLines.getComponent(step); + int laneIndex = step + 1; + stepPanel.setTitle("Lane " + laneIndex); + stepPanel.clearComment(); stepPanel.clearOperations(); } } From a02acd13246b12a56ec7ba2b80df591208323f4c Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Mon, 8 Jul 2024 04:55:35 -0400 Subject: [PATCH 15/18] Fix clear lane comments --- src/main/java/de/usd/cstchef/view/RecipeStepPanel.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java b/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java index 5f327fd..79b41be 100644 --- a/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java +++ b/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java @@ -201,6 +201,7 @@ public void setComment(String comment) { } public void clearComment() { + this.comment = ""; commentBtn.setToolTipText(""); commentBtn.setIcon(RecipeStepPanel.noCommentIcon); } From 39a092d9496c062c23b75c9ca54e8445e3a86231 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Mon, 15 Jul 2024 05:03:00 -0400 Subject: [PATCH 16/18] Refactor icons --- res/comment.png | Bin 342 -> 327 bytes res/disable.png | Bin 662 -> 673 bytes res/help.png | Bin 852 -> 0 bytes res/help.png.png | Bin 0 -> 771 bytes res/no-comment.png | Bin 583 -> 0 bytes res/no_comment.png | Bin 0 -> 514 bytes res/operation.png | Bin 636 -> 474 bytes res/remove.png | Bin 873 -> 821 bytes res/stop.png | Bin 710 -> 735 bytes res/stop_active.png | Bin 832 -> 781 bytes .../de/usd/cstchef/operations/Operation.java | 2 +- .../de/usd/cstchef/view/RecipeStepPanel.java | 2 +- 12 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 res/disable.png delete mode 100644 res/help.png create mode 100755 res/help.png.png delete mode 100755 res/no-comment.png create mode 100755 res/no_comment.png mode change 100644 => 100755 res/operation.png mode change 100644 => 100755 res/remove.png mode change 100644 => 100755 res/stop.png mode change 100644 => 100755 res/stop_active.png diff --git a/res/comment.png b/res/comment.png index 0dd861ee8e61f630a6c030831344d85d56ba3526..8880c9e70e52935619c8ad1ad4a7532e70d5a9ca 100755 GIT binary patch delta 255 zcmV=W7EDAIL00cAvJ>o1Ukv1rQ)Ja4^R5*?8)G-8Z7DuOjjp5oHP}A}Jyk74VgFzMq2aV`h&Dm~)6_(%kxT0#D#S!D>co z?@Uzn0k{CRJ%tZuD`vs>V*4+Azbw7#0AxdFC0=eON?84;K6{`}jUL2&n@bt&Z? z_)aNZyZdUWKMIP7sOl3y+qQROYi<<-B&?FKP!6C$DrnJ7FMzX#s2_?g} zZ7=G&zAS-BdaatKS*MgX06tIj#w2GIfHyO{FHjKP`-hRFR00D4NoiCH+vN;M1&07*qoM6N<$g3twZX#fBK diff --git a/res/disable.png b/res/disable.png old mode 100644 new mode 100755 index c7b7a082d96ff0942b80317596a6695eee93e074..0e80c768451cf4bb6fba096d8ac7974d436b6f28 GIT binary patch delta 605 zcmV-j0;2tv1)&9yD+>h{000FR0e69~xsf&~e=bQxK~y-6tyRx!6G0Sy-z4cS_ybg0 z|A+(@W@c|i$jO72CRGC7gd$kHcoZ*EFO}*|^dJ;^E~T-=>cx}S-3=_{7RcQqN`64H ztIqS1l_6clnm(Ar{CMAd-<$W|fSGC5DwWED<2ZEyD@1e-K!J#enSTNp8Dm;WlDzG7 ze>&-`FJ=LK-@j#yxlcrU0GeSKezEtZl#2lBLWqVj=5-WB2f2WaMx)T{^_~Gp$K&y4 z-tDt0T-V(MPzb~D5i=W_${=PYrPOmN<=t%luS09SuC?CI<|32H%t;hQyMJSqXF(9` zFtgEG*NBKvE|(V^$2l4d1~S1tJ_c}6%nM{2GviDF0r1%~1Td6RF3t<)dEOF$Z$)EFe+xjJ zh~8K?eP!l5N~yvh{Hp+7*$bsoX$`0XPLM5mAkq rR{&hFzW^c{0BAAuVHk$rXMKMGKH+@-pa!;T00000NkvXXu0mjfJ_#4< delta 594 zcmV-Y0gj000D?0em!Tp^-KyeraVCmR=$JC<-D0sgrmDI~ zvQn*9|BNc@6NX_#@@FMe0|77`mKIb^j zV*umEm?!;A912*+ajuBSJ(3?)JazMkfb~RVBM1Wjp8=bu7q;^xOE|a!&h#4Y1K1_` gq0{MXABJj*zgXWr@A(KXga7~l07*qoM6N<$f&~B)egFUf diff --git a/res/help.png b/res/help.png deleted file mode 100644 index 96bc985e50658ca87e24dad60dffe522fbaf5ca2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 852 zcmV-a1FQUrP)yG2Z!{KnN+AC#X6h%&!Wv4{s49V{rjYhJvva(rj z2*Yr{wKgDm62L9b^X~WieftbB3`5si`z6WW^E|(jrs?0$9KEC{ikexLT_E`)fQw0z zJoyheJ=s?ze_35!z0Fy3m?04n-}ldp$RW@3KI`}Uwgv!MmYo%m%_K>lf=wGa$Wc9GAxQB#~5=(Ro6%!7Lh}$ zx;&Xo?igcsmjsf`^ZW~vXTvabbzx!Qq^d3r27~SLb+)#)UIp->wf2KJj^B^t_#DZ% zMdTe-4a(j$O(!IOu+|0&;3$B&Iv>Yz7DeP{y!18^+nd&*G1%|q9`6#{p0cY*B}TEDgaw8&XVu@MnrA{__p0{ug|ej{}0R< z^NOl21GwI5wLae6@(fueDSH7`^_+-2^gQp==fFTx6u{$NuXo^iKx^$Il2^;WSXDs~ z92Akw8i1c_wORn+#ys=(_V&HKZUNvpfFHG9uYV8Vc==kSJ&3o{w#xfz21T85>Jr4+39pvW(I6o-EMcW(P$h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ation.png b/res/operation.png old mode 100644 new mode 100755 index d3b9ca7d4c6b42335e291c737a831b5842147a05..84c2f025c4f043591204b720b7b39d44cfd3eb7d GIT binary patch delta 446 zcmV;v0YU!!1lj{OiBL{Q4GJ0x0000DNk~Le0000C0000C2nGNE09JKe=Kufz32;bR za{vGWE&u=mE&)j2zKM}GCw~EFNklLVjAt$j3!HqBqgb)!w z-C?zcRPIdDgf#v#{vvMExd?<5DFQ~~Bo#pf0+A~hhWJk*Vd=QL-88m24m{nm^J9ix zni=lY>2#u2tF^DH3zCmVqtO@CB-NqWZ0?%b34qTef5mb9_CbIoMSo;twOU(05SX`24IPf%5z zOeX(CB&wNX=iDnZE0QGna1S`=uDadsnyOkAAo&8o7Rf_ZHQt@I-|uhcdEO@Z*UVx7 z5RrLVmMS760MALjXMd6;Z_Mm9fSY!^{cSdz?RoD{hQr}y2;pU;(U>on%Z~sqvMl?- z5W)d~bMO6WQ55g8Ec+To(Kg9vB-PB;#^dpk-B$4;GFR1|JkN8IH`D2K0pRCte=#$y o|KSqAL`0rA=YCh0bu$3`2bS8H8DgV^HUIzs07*qoM6N<$f(U)YMgRZ+ delta 610 zcmV-o0-gQZ1N;OwiBL{Q4GJ0x0000DNk~Le0000F0000F2nGNE06W%|N&o-=32;bR za{vGXbpQYZbpg<9qoI*DCw~G7NklA!OX;ctFOb$u0OKf%z8hmME2Wlr_*`v z`~Dn&OXKm_$z(E5)4(GzfQy!8y(*W>=Pk>c(ON%C1M2nqRH0D#(P%Wrhp^)~tHa@N zE}P9Rk47VN94Z!zCx2YmT{On5Z)|K#d!82`?%Zm%c9{8OyWRfD%r*c_!mjJy2C&4; zMIu@Q5FG#QBn(3(BAc~Z?aHy4W81b8kw*aPM6`#=BdJ!a_eA7vKA+$2_xp7KGt8Wb z2$*>{ilXIGsdOrr%ehIC+`#<&e0DGxEC84$qEA}uca=(|n19dbKd!8-Bta15_V@SC z#&Nvv`~Dpwni7#OBJu{+YW3l0GaW6U-Yod%$oc{53p4uI=K^jT}& zJ&a03`nGL{MD!#Gf^#CGwAQZ=44&r|n0Y}&K4`7qAITX&#u(F7NfBmjO*8sa$K wBBHI7$cX{8nIrk8F-An>u2Sk{nlVkk0oQcVOj2O2ZvX%Q07*qoM6N<$g8Zx)r2qf` diff --git a/res/remove.png b/res/remove.png old mode 100644 new mode 100755 index 0ef8a75407029bf45697a69256179ba0dacd15c4..fc42e2589ddb469380dd41ae0537bcff838cf303 GIT binary patch delta 754 zcmVh{000FR0e69~xsf&~f5J&bK~y-6om4Sw990l~Z#J9bBxA|A zN&ykQwZ-mVTe@z0u*2ynXs}I;1O+`3O(={+0YY?<09$l%WaB8fc4z6%`@NFo&IM7@ zViSjx>|5{tp}>ny>pKf&q+iU;oA>8G{TZq%>XszQ8~uL&1Lxd4$w>eM0HUe|$v%J` ze*oKQnqJmxStm5cdMKHfs!P-f7NQW-Wo>|1i@62B)2O6?Ck7o=iFz;7+;#r zW}D>3ux5k7U^371$6*-Wt&@dec(>7LJU%%&d9#WgA0H1$K2_EC#5uQ66vftX(ca$P zsfa9z$lBc8+`CoW81s&Ztcl2{hlhuM4cB;{w?T5AVHiHK)-H^C+U)G?+s?Ulf6wz) z%Cam0tb3k!zuWEpF$y2Y@urY0$7$8;^bH(^OOL_|0aP-#{a#fpe5)-@erBC7f-2!g3mWB}I7viu~=vS+A(60RR9107*qoM6N<$g0R7TO8@`> delta 807 zcmV+?1K9kv2I&TnD+>gj000D?0em!Tp^-KyfA&d4K~y-6m6cCu9CZ}O-+RAd-6s75 z72AvA#YPVUfnuZQlGakJUB4}O>T-uLr+^LxBE41l_AY;0^#yWKv{%&!sA ze_;Tbh%f*lqQ8h}c5rZTesOW}Znu_;KxSs=+;LTXkBAnGF>}ky%YPOH&bg)1G)>O}Flm~eTVG%QXGiG;tJP}zn$6~?M6?Cq%OpwKL`2j9N)QBJ zSZgPVNC42ooQ`hFT6-ohPKbztAUGi+e|O_J{u+SxtE^}MG)a;xM6^E)!x!@#2AFxm z7;`R%`MzJOR;!10168ZlL%#2qa;U0K19+=mua`wc#sSPNEiL_<3reNZfp)w7T^NQ# z-LN1Co@=#QSIgz{{@j-&Nvf*9q-pw!5Yf>r%NB~FwY9asnR!Z8XDXG-k=!4Kf8h`_ ze=Z^?lO)+HYM6OmRbS#D2xj9r9`E&OVHggn>Wt@kQ(2Y?fUi{b)avT$Z@u!ZwX?#^ z*=}zYMbWPSKFYG}3K3mq<_~v+b*jvSnRkv#Z-c6GzXWE6^h?O!OjSQH#!QOH%;@Oo zGyOC|M7JuH%9GszYwfcDE_j~ze{qr|e>5768_ayl7;~{#_eVxXo(6DJi0DUEeZ4FA zgou1*j5*zCG;ZYnD2je(=1+*|Vi<;x7d4*ey}``aCCjooW`4C+tL@8!tyb$c5xrZ4 z6``e4>Ft4mf!nz+2!aF5e9RbgjR26f_Jnh8h8|&#^D{9qVVrZ9oO5s9f1l+zj=u+R z$6EV7Gxu#&(U@5_H#a9$b!%m1sF> zoJVK<>{zhY+83Dl9RNRz$oy^#mYJUi@NFE&KcN8mA27GhvV9pqo$mbt9_w7#B%)gY l7Pq&z7dAFFn%&y}0LN0W5qYGWXn_C#002ovPDHLkV1j`+h$a94 diff --git a/res/stop.png b/res/stop.png old mode 100644 new mode 100755 index a9b6d816d7edb0d6b587cf01183923a94b6a9552..29ea6d9333128a1a27a83efcf0a200924ba82dff GIT binary patch delta 668 zcmV;N0%QHg1>XgbD+>h{000FR0e69~xsf&~e{4xaK~y-6tyN8HQ$Z9xXCCPb_<@`F z4+=sHY2TY{6c<@*X`?o7g(3+01H?_yO+}ZAJHd4-##;Ra>MHY)K)^+zKcE$)u@K%X znd9a?d8R@9IxvenXYQGMXXf6aBurv{etsql!xqUU04GQW03c~h^3Z#~ou=vQ!C;V0 zfBJG#u+eB-_1@nC&>`7%&V4EKQ54lkwu~`t@BOnRNnTAAY`5FN?(XhGlG$i9x<76A z$tV1-dbMCGrk30=XLLA4BqbRyj*uOihwQJVeM}=*QG$o};lDzm;RMXJw^`1-e z*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(byIs)!tUw!OXmr}zG96h)WwJpaDAQHJc$ zD2iSKu+;1I?j8+!nx-F^*$w>v8CMIGt zdl$eHaU8#S*ha?|Y`5DD`u+Yjl5-;RRTzd}w=Gzb&j461iejnRlQPO0Gdmpw!3B~} v0eFz)eFMJ^0Q@E*KL$at+Uxc14%hwz`=_70E0dyJ00000NkvXXu0mjf?PGEe diff --git a/src/main/java/de/usd/cstchef/operations/Operation.java b/src/main/java/de/usd/cstchef/operations/Operation.java index 9a9d52b..efd807b 100644 --- a/src/main/java/de/usd/cstchef/operations/Operation.java +++ b/src/main/java/de/usd/cstchef/operations/Operation.java @@ -73,7 +73,7 @@ public abstract class Operation extends JPanel { private static ImageIcon removeIcon = new ImageIcon(Operation.class.getResource("/remove.png")); private static ImageIcon helpIcon = new ImageIcon(Operation.class.getResource("/help.png")); private static ImageIcon commentIcon = new ImageIcon(Operation.class.getResource("/comment.png")); - private static ImageIcon noCommentIcon = new ImageIcon(Operation.class.getResource("/no-comment.png")); + private static ImageIcon noCommentIcon = new ImageIcon(Operation.class.getResource("/no_comment.png")); private NotifyChangeListener notifyChangeListener; diff --git a/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java b/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java index 79b41be..f479220 100644 --- a/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java +++ b/src/main/java/de/usd/cstchef/view/RecipeStepPanel.java @@ -43,7 +43,7 @@ public class RecipeStepPanel extends JPanel { private JButton commentBtn; private static ImageIcon commentIcon = new ImageIcon(Operation.class.getResource("/comment.png")); - private static ImageIcon noCommentIcon = new ImageIcon(Operation.class.getResource("/no-comment.png")); + private static ImageIcon noCommentIcon = new ImageIcon(Operation.class.getResource("/no_comment.png")); public RecipeStepPanel(String title, ChangeListener changelistener) { this.changeListener = changelistener; From 7b48a8c5176570acdaf8617e405ec1374ed9fe49 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Mon, 15 Jul 2024 05:35:33 -0400 Subject: [PATCH 17/18] Fix string comparison --- src/main/java/de/usd/cstchef/view/RecipePanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/usd/cstchef/view/RecipePanel.java b/src/main/java/de/usd/cstchef/view/RecipePanel.java index ec59018..9647439 100644 --- a/src/main/java/de/usd/cstchef/view/RecipePanel.java +++ b/src/main/java/de/usd/cstchef/view/RecipePanel.java @@ -441,14 +441,14 @@ private String getStateAsJSON() throws IOException { ObjectNode laneNode = mapper.createObjectNode(); laneNode.put("lane_title", stepPanel.getTitle()); // save comment in same node in case it is set - if(stepPanel.getComment() != null) { + if(!stepPanel.getComment().equals("")) { laneNode.put("lane_comment", stepPanel.getComment()); } operationsNode.add(laneNode); } // save comment in case it's not already - if(!laneNodeCreated && stepPanel.getComment() != null) { + if(!laneNodeCreated && !stepPanel.getComment().equals("")) { ObjectNode laneNode = mapper.createObjectNode(); laneNode.put("lane_comment", stepPanel.getComment()); operationsNode.add(laneNode); From 0db33e95f3a1fc157b4a5f5c7a30915d12278c8d Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Mon, 15 Jul 2024 07:58:20 -0400 Subject: [PATCH 18/18] Fix typo --- res/{help.png.png => help.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename res/{help.png.png => help.png} (100%) diff --git a/res/help.png.png b/res/help.png similarity index 100% rename from res/help.png.png rename to res/help.png