From b17ce13cc31abd088088bf8ab26cc924a6a36585 Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Tue, 28 Jul 2020 17:57:25 +0200 Subject: Draft of the new DOSIPAS included --- .../ticketLayoutBarcode/FormatType.java | 34 ++++++++++++ .../ticketLayoutBarcode/LayoutElement.java | 50 ++++++++++++++++++ .../ticketLayoutBarcode/TicketLayout.java | 61 ++++++++++++++++++++++ 3 files changed, 145 insertions(+) create mode 100644 src/org/uic/barcode/staticHeader/ticketLayoutBarcode/FormatType.java create mode 100644 src/org/uic/barcode/staticHeader/ticketLayoutBarcode/LayoutElement.java create mode 100644 src/org/uic/barcode/staticHeader/ticketLayoutBarcode/TicketLayout.java (limited to 'src/org/uic/barcode/staticHeader/ticketLayoutBarcode') diff --git a/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/FormatType.java b/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/FormatType.java new file mode 100644 index 0000000..c5cc39e --- /dev/null +++ b/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/FormatType.java @@ -0,0 +1,34 @@ +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 new file mode 100644 index 0000000..04593f2 --- /dev/null +++ b/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/LayoutElement.java @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..e788f9a --- /dev/null +++ b/src/org/uic/barcode/staticHeader/ticketLayoutBarcode/TicketLayout.java @@ -0,0 +1,61 @@ +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; + } + + +} -- cgit v1.2.3