From 91118d7e2a848a903895b55adfdec0d12618b504 Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Mon, 16 Nov 2020 14:13:16 +0100 Subject: bug fix element order in openTicketData renamed package staticHeader.ticketLayout to staticFrame.ticketLayout --- src/org/uic/barcode/Decoder.java | 2 +- src/org/uic/barcode/Encoder.java | 2 +- .../uic/barcode/staticFrame/UTLAYDataRecord.java | 6 +-- .../ticketLayoutBarcode/FormatType.java | 34 ++++++++++++ .../ticketLayoutBarcode/LayoutElement.java | 50 ++++++++++++++++++ .../ticketLayoutBarcode/TicketLayout.java | 61 ++++++++++++++++++++++ .../ticketLayoutBarcode/FormatType.java | 34 ------------ .../ticketLayoutBarcode/LayoutElement.java | 50 ------------------ .../ticketLayoutBarcode/TicketLayout.java | 61 ---------------------- .../uic/barcode/test/StaticFrameBarcodeTest.java | 2 +- src/org/uic/barcode/test/TicketLayoutTest.java | 2 +- .../barcode/test/utils/SimpleTestTicketLayout.java | 4 +- .../uic/ticket/api/asn/omv1/OpenTicketData.java | 8 +-- .../uic/ticket/api/asn/omv2/OpenTicketData.java | 6 +-- 14 files changed, 161 insertions(+), 161 deletions(-) create mode 100644 src/org/uic/barcode/staticFrame/ticketLayoutBarcode/FormatType.java create mode 100644 src/org/uic/barcode/staticFrame/ticketLayoutBarcode/LayoutElement.java create mode 100644 src/org/uic/barcode/staticFrame/ticketLayoutBarcode/TicketLayout.java delete mode 100644 src/org/uic/barcode/staticHeader/ticketLayoutBarcode/FormatType.java delete mode 100644 src/org/uic/barcode/staticHeader/ticketLayoutBarcode/LayoutElement.java delete mode 100644 src/org/uic/barcode/staticHeader/ticketLayoutBarcode/TicketLayout.java (limited to 'src') diff --git a/src/org/uic/barcode/Decoder.java b/src/org/uic/barcode/Decoder.java index 2ce417c..b7fec33 100644 --- a/src/org/uic/barcode/Decoder.java +++ b/src/org/uic/barcode/Decoder.java @@ -16,7 +16,7 @@ import org.uic.barcode.dynamicFrame.SequenceOfDataType; import org.uic.barcode.staticFrame.StaticFrame; import org.uic.barcode.staticFrame.UFLEXDataRecord; import org.uic.barcode.staticFrame.UTLAYDataRecord; -import org.uic.barcode.staticHeader.ticketLayoutBarcode.TicketLayout; +import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout; import org.uic.ticket.EncodingFormatException; import org.uic.ticket.UicRailTicketCoder; import org.uic.ticket.api.spec.IUicRailTicket; diff --git a/src/org/uic/barcode/Encoder.java b/src/org/uic/barcode/Encoder.java index 301b7c5..cd6004e 100644 --- a/src/org/uic/barcode/Encoder.java +++ b/src/org/uic/barcode/Encoder.java @@ -14,7 +14,7 @@ import org.uic.barcode.staticFrame.StaticFrame; import org.uic.barcode.staticFrame.UFLEXDataRecord; import org.uic.barcode.staticFrame.UHEADDataRecord; import org.uic.barcode.staticFrame.UTLAYDataRecord; -import org.uic.barcode.staticHeader.ticketLayoutBarcode.TicketLayout; +import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout; import org.uic.ticket.EncodingFormatException; import org.uic.ticket.UicRailTicketCoder; import org.uic.ticket.api.spec.IUicRailTicket; diff --git a/src/org/uic/barcode/staticFrame/UTLAYDataRecord.java b/src/org/uic/barcode/staticFrame/UTLAYDataRecord.java index 2e9a2dc..68211ad 100644 --- a/src/org/uic/barcode/staticFrame/UTLAYDataRecord.java +++ b/src/org/uic/barcode/staticFrame/UTLAYDataRecord.java @@ -9,9 +9,9 @@ import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -import org.uic.barcode.staticHeader.ticketLayoutBarcode.FormatType; -import org.uic.barcode.staticHeader.ticketLayoutBarcode.LayoutElement; -import org.uic.barcode.staticHeader.ticketLayoutBarcode.TicketLayout; +import org.uic.barcode.staticFrame.ticketLayoutBarcode.FormatType; +import org.uic.barcode.staticFrame.ticketLayoutBarcode.LayoutElement; +import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout; import org.uic.ticket.EncodingFormatException; /** diff --git a/src/org/uic/barcode/staticFrame/ticketLayoutBarcode/FormatType.java b/src/org/uic/barcode/staticFrame/ticketLayoutBarcode/FormatType.java new file mode 100644 index 0000000..e6b9414 --- /dev/null +++ b/src/org/uic/barcode/staticFrame/ticketLayoutBarcode/FormatType.java @@ -0,0 +1,34 @@ +package org.uic.barcode.staticFrame.ticketLayoutBarcode; + + +public enum FormatType { + NORMAL("NORMAL"), + BOLD("BOLD"), + ITALIC("ITALIC"), + BOLDITALIC("BOLDITALIC"), + SMALL("SMALL"), + SMALLBOLD("SMALLBOLD"), + SMALLITALIC("SMALLITALIC"), + SMALLBOLDITALIC("SMALLBOLDITALIC"); + + + + public String text; + + FormatType(String text) { + this.text = text; + } + + public static FormatType getFormatType(int i) { + try { + return FormatType.values()[i]; + } catch (Exception e) { + return null; + } + } + + public String toString(){ + return text; + } + +} diff --git a/src/org/uic/barcode/staticFrame/ticketLayoutBarcode/LayoutElement.java b/src/org/uic/barcode/staticFrame/ticketLayoutBarcode/LayoutElement.java new file mode 100644 index 0000000..861629d --- /dev/null +++ b/src/org/uic/barcode/staticFrame/ticketLayoutBarcode/LayoutElement.java @@ -0,0 +1,50 @@ +package org.uic.barcode.staticFrame.ticketLayoutBarcode; + +public class LayoutElement { + + private int column; + private int line; + private int height; + private int width; + private String text; + private FormatType format = FormatType.NORMAL; + + public int getColumn() { + return column; + } + public void setColumn(int column) { + this.column = column; + } + public int getLine() { + return line; + } + public void setLine(int line) { + this.line = line; + } + public int getHeight() { + return height; + } + public void setHeight(int height) { + this.height = height; + } + public int getWidth() { + return width; + } + public void setWidth(int width) { + this.width = width; + } + public String getText() { + return text; + } + public void setText(String text) { + this.text = text; + } + public FormatType getFormat() { + return format; + } + public void setFormat(FormatType format) { + this.format = format; + } + + +} diff --git a/src/org/uic/barcode/staticFrame/ticketLayoutBarcode/TicketLayout.java b/src/org/uic/barcode/staticFrame/ticketLayoutBarcode/TicketLayout.java new file mode 100644 index 0000000..8ca8083 --- /dev/null +++ b/src/org/uic/barcode/staticFrame/ticketLayoutBarcode/TicketLayout.java @@ -0,0 +1,61 @@ +package org.uic.barcode.staticFrame.ticketLayoutBarcode; + +import java.util.ArrayList; +import java.util.List; + +public class TicketLayout { + + private String layoutStandard = "RCT2"; + + /** The layout elements. */ + private List elements = new ArrayList(); + + + /** + * Gets the layout standard. + * + * @return the layout standard + */ + public String getLayoutStandard() { + if (layoutStandard == null || layoutStandard.length() != 4) { + layoutStandard = "RCT2"; + } + return layoutStandard; + } + + /** + * Sets the layout standard. + * + * @param layoutStandard the new layout standard + */ + public void setLayoutStandard(String layoutStandard) { + this.layoutStandard = layoutStandard; + } + + /** + * Adds the layout element. + * + * @param element the element + */ + public void addLayoutElement(LayoutElement element){ + elements.add(element); + } + + /** + * Removes the layout elements. + */ + public void removeLayoutElements(){ + elements.clear(); + } + + /** + * Gets the elements. + * + * @return the elements + */ + public List getElements(){ + return elements; + } + + +} diff --git a/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/FormatType.java b/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/FormatType.java deleted file mode 100644 index c5cc39e..0000000 --- a/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/FormatType.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.uic.barcode.staticHeader.ticketLayoutBarcode; - - -public enum FormatType { - NORMAL("NORMAL"), - BOLD("BOLD"), - ITALIC("ITALIC"), - BOLDITALIC("BOLDITALIC"), - SMALL("SMALL"), - SMALLBOLD("SMALLBOLD"), - SMALLITALIC("SMALLITALIC"), - SMALLBOLDITALIC("SMALLBOLDITALIC"); - - - - public String text; - - FormatType(String text) { - this.text = text; - } - - public static FormatType getFormatType(int i) { - try { - return FormatType.values()[i]; - } catch (Exception e) { - return null; - } - } - - public String toString(){ - return text; - } - -} diff --git a/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/LayoutElement.java b/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/LayoutElement.java deleted file mode 100644 index 04593f2..0000000 --- a/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/LayoutElement.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.uic.barcode.staticHeader.ticketLayoutBarcode; - -public class LayoutElement { - - private int column; - private int line; - private int height; - private int width; - private String text; - private FormatType format = FormatType.NORMAL; - - public int getColumn() { - return column; - } - public void setColumn(int column) { - this.column = column; - } - public int getLine() { - return line; - } - public void setLine(int line) { - this.line = line; - } - public int getHeight() { - return height; - } - public void setHeight(int height) { - this.height = height; - } - public int getWidth() { - return width; - } - public void setWidth(int width) { - this.width = width; - } - public String getText() { - return text; - } - public void setText(String text) { - this.text = text; - } - public FormatType getFormat() { - return format; - } - public void setFormat(FormatType format) { - this.format = format; - } - - -} diff --git a/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/TicketLayout.java b/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/TicketLayout.java deleted file mode 100644 index e788f9a..0000000 --- a/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/TicketLayout.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.uic.barcode.staticHeader.ticketLayoutBarcode; - -import java.util.ArrayList; -import java.util.List; - -public class TicketLayout { - - private String layoutStandard = "RCT2"; - - /** The layout elements. */ - private List elements = new ArrayList(); - - - /** - * Gets the layout standard. - * - * @return the layout standard - */ - public String getLayoutStandard() { - if (layoutStandard == null || layoutStandard.length() != 4) { - layoutStandard = "RCT2"; - } - return layoutStandard; - } - - /** - * Sets the layout standard. - * - * @param layoutStandard the new layout standard - */ - public void setLayoutStandard(String layoutStandard) { - this.layoutStandard = layoutStandard; - } - - /** - * Adds the layout element. - * - * @param element the element - */ - public void addLayoutElement(LayoutElement element){ - elements.add(element); - } - - /** - * Removes the layout elements. - */ - public void removeLayoutElements(){ - elements.clear(); - } - - /** - * Gets the elements. - * - * @return the elements - */ - public List getElements(){ - return elements; - } - - -} diff --git a/src/org/uic/barcode/test/StaticFrameBarcodeTest.java b/src/org/uic/barcode/test/StaticFrameBarcodeTest.java index a0855de..4c176ca 100644 --- a/src/org/uic/barcode/test/StaticFrameBarcodeTest.java +++ b/src/org/uic/barcode/test/StaticFrameBarcodeTest.java @@ -18,7 +18,7 @@ import org.junit.Test; import org.uic.barcode.Decoder; import org.uic.barcode.Encoder; import org.uic.barcode.dynamicFrame.Constants; -import org.uic.barcode.staticHeader.ticketLayoutBarcode.TicketLayout; +import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout; import org.uic.barcode.test.utils.SimpleTestTicketLayout; import org.uic.barcode.test.utils.SimpleUICTestTicket; import org.uic.ticket.EncodingFormatException; diff --git a/src/org/uic/barcode/test/TicketLayoutTest.java b/src/org/uic/barcode/test/TicketLayoutTest.java index 0210896..3cf143e 100644 --- a/src/org/uic/barcode/test/TicketLayoutTest.java +++ b/src/org/uic/barcode/test/TicketLayoutTest.java @@ -6,7 +6,7 @@ import java.io.IOException; import org.junit.Test; import org.uic.barcode.staticFrame.UTLAYDataRecord; -import org.uic.barcode.staticHeader.ticketLayoutBarcode.TicketLayout; +import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout; import org.uic.barcode.test.utils.SimpleTestTicketLayout; import org.uic.barcode.test.utils.TestUtils; import org.uic.ticket.EncodingFormatException; diff --git a/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java b/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java index 24cbf50..ca888e7 100644 --- a/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java +++ b/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java @@ -1,7 +1,7 @@ package org.uic.barcode.test.utils; -import org.uic.barcode.staticHeader.ticketLayoutBarcode.LayoutElement; -import org.uic.barcode.staticHeader.ticketLayoutBarcode.TicketLayout; +import org.uic.barcode.staticFrame.ticketLayoutBarcode.LayoutElement; +import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout; public class SimpleTestTicketLayout { diff --git a/src/org/uic/ticket/api/asn/omv1/OpenTicketData.java b/src/org/uic/ticket/api/asn/omv1/OpenTicketData.java index 67bf1ac..8c759db 100644 --- a/src/org/uic/ticket/api/asn/omv1/OpenTicketData.java +++ b/src/org/uic/ticket/api/asn/omv1/OpenTicketData.java @@ -40,13 +40,13 @@ import net.gcdc.asn1.datatypesimpl.SequenceOfStringIA5; public class OpenTicketData extends Object { public OpenTicketData() { } - + @FieldOrder(order = 0) - @RestrictedString(CharacterRestriction.IA5String) - @Asn1Optional public String referenceIA5; + @Asn1Optional public Asn1BigInteger referenceNum; @FieldOrder(order = 1) - @Asn1Optional public Asn1BigInteger referenceNum; + @RestrictedString(CharacterRestriction.IA5String) + @Asn1Optional public String referenceIA5; @FieldOrder(order = 2) @IntRange(minValue=1,maxValue=32000) diff --git a/src/org/uic/ticket/api/asn/omv2/OpenTicketData.java b/src/org/uic/ticket/api/asn/omv2/OpenTicketData.java index a2e126b..ac817b4 100644 --- a/src/org/uic/ticket/api/asn/omv2/OpenTicketData.java +++ b/src/org/uic/ticket/api/asn/omv2/OpenTicketData.java @@ -42,11 +42,11 @@ public class OpenTicketData extends Object { } @FieldOrder(order = 0) - @RestrictedString(CharacterRestriction.IA5String) - @Asn1Optional public String referenceIA5; + @Asn1Optional public Asn1BigInteger referenceNum; @FieldOrder(order = 1) - @Asn1Optional public Asn1BigInteger referenceNum; + @RestrictedString(CharacterRestriction.IA5String) + @Asn1Optional public String referenceIA5; @FieldOrder(order = 2) @IntRange(minValue=1,maxValue=32000) -- cgit v1.2.3