Skip to content

Commit

Permalink
Lots of typing, let's hope it was worth it
Browse files Browse the repository at this point in the history
  • Loading branch information
RobFaustLZ committed Dec 2, 2023
1 parent 8225184 commit 4c3177a
Show file tree
Hide file tree
Showing 54 changed files with 670 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = 'com.labelzoom.api'
version = '1.0.2'
version = '1.0.3'

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/labelzoom/api/input/LabelReader.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.labelzoom.api.input;

import com.labelzoom.api.model.ILabel;
import com.labelzoom.api.model.components.ILabel;

public interface LabelReader<E>
{
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/com/labelzoom/api/model/BarcodeStyle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.labelzoom.api.model;

public enum BarcodeStyle
{
Unknown(-1),
Aztec(0),
Code11(1),
Interleaved2of5(2),
Code39(3),
Code49(4),
PlanetCode(5),
PDF417(7),
EAN_8(8),
UPC_E(9),
Code93(10),
CODABLOCK(11),
Code128(12),
UPSMaxiCode(13),
EAN_13(14),
Micro_PDF417(15),
Industrial2of5(18),
Standard2of5(19),
ANSICodabar(20),
LOGMARS(21),
MSI(22),
Aztec2(24),
Plessey(25),
QRCode(26),
GS1Databar(27),
UPC_EAN(28),
UPC_A(30),
DataMatrix(33),
PostNet(35);

private int value;
BarcodeStyle(final int value) {
this.value = value;
}
public int getValue() {
return value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.labelzoom.api.model;

public enum HorizontalAlignment
{
Left, Center, Right
}
5 changes: 0 additions & 5 deletions src/main/java/com/labelzoom/api/model/ILabel.java

This file was deleted.

6 changes: 6 additions & 0 deletions src/main/java/com/labelzoom/api/model/Justification.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.labelzoom.api.model;

public enum Justification
{
Left, Right, Auto
}
6 changes: 6 additions & 0 deletions src/main/java/com/labelzoom/api/model/Orientation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.labelzoom.api.model;

public enum Orientation
{
Horizontal, Vertical;
}
17 changes: 17 additions & 0 deletions src/main/java/com/labelzoom/api/model/PageOrientation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.labelzoom.api.model;

public enum PageOrientation
{
Landscape (1),
Portrait (2),
ReverseLandscape (3),
ReversePortrait (4);

private final int value;
PageOrientation(final int value) {
this.value = value;
}
public int getValue() {
return value;
}
}
6 changes: 6 additions & 0 deletions src/main/java/com/labelzoom/api/model/PositioningMode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.labelzoom.api.model;

public enum PositioningMode
{
Origin, Typeset
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.labelzoom.api.model.components;

public interface IAddressBlock extends IFontComponent
{
boolean isUseLocalizedAddressFormat();
void setUseLocalizedAddressFormat(boolean useLocalizedAddressFormat);

int getStaticAddressFormat();
void setStaticAddressFormat(int addressFormat);

boolean isShowContactName();
void setShowContactName(boolean showContactName);

boolean isShowCountry();
void setShowCountry(boolean showCountry);

String getAddressId();
void setAddressId(String addressId);
}
27 changes: 27 additions & 0 deletions src/main/java/com/labelzoom/api/model/components/IComponent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.labelzoom.api.model.components;

import com.labelzoom.api.model.Justification;
import com.labelzoom.api.model.PositioningMode;

public interface IComponent extends Cloneable
{
int getLeft();
void setLeft(int left);

int getTop();
void setTop(int top);

float getRotation();
void setRotation(float rotation);

boolean isReverse();
void setReverse();

Justification getJustification();
void setJustification(Justification justification);

PositioningMode getPositioningMode();
void setPositioningMode(PositioningMode positioningMode);

int getZIndex();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.labelzoom.api.model.components;

public interface IContainer extends IComponent
{
Iterable<IComponent> getChildren();
}
10 changes: 10 additions & 0 deletions src/main/java/com/labelzoom/api/model/components/IDataCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.labelzoom.api.model.components;

public interface IDataCommand extends Cloneable
{
String getLanguage();
void setLanguage(String language);

String getDataCommand();
void setDataCommand(String dataCommand);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.labelzoom.api.model.components;

import java.util.regex.Pattern;

public interface IDynamicField
{
Pattern SIMPLE_EXPRESSION_PATTERN = Pattern.compile("\"\\$\\{([A-Za-z0-9_]+)\\}\"");
Pattern VARIABLE_EXPRESSION_PATTERN = Pattern.compile("\\$\\{([A-Za-z0-9_]+)\\}");
Pattern VARIABLE_NAME_PATTERN = Pattern.compile("^([A-Za-z0-9_]+)$");

void setExpression(String expression);
String getExpression();

void setFieldValue(String value);
String getFieldValue();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.labelzoom.api.model.components;

public interface IFontComponent extends IComponent, ISuppressible
{
String getFont();
void setFont(String font);

float getFontSize();
void setFontSize(float fontSize);

float getHorizontalScaling();
void setHorizontalScaling(float horizontalScaling);
}
20 changes: 20 additions & 0 deletions src/main/java/com/labelzoom/api/model/components/IImage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.labelzoom.api.model.components;

import java.awt.image.RenderedImage;

public interface IImage extends IComponent
{
IImageWrapper getImage();
void setImage(IImageWrapper imageWrapper);

float getHorizontalScaling();
void setHorizontalScaling(float horizontalScaling);

float getVerticalScaling();
void setVerticalScaling(float verticalScaling);

interface IImageWrapper
{
RenderedImage getImage();
}
}
45 changes: 45 additions & 0 deletions src/main/java/com/labelzoom/api/model/components/ILabel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.labelzoom.api.model.components;

import com.labelzoom.api.model.PageOrientation;

import java.util.Comparator;
import java.util.List;
import java.util.UUID;

public interface ILabel
{
String DEFAULT_LAYER_NAME = "background";

int getWidth();
void setWidth(int width);

int getHeight();
void setHeight(int height);

boolean isHighRes();
void setHighRes(boolean highRes);

PageOrientation getOrientation();
void setOrientation(PageOrientation orientation);

List<ILayer> getLayers();
void setLayers(List<ILayer> layers);

IDataCommand getDataCommand();
void setDataCommand(IDataCommand dataCommand);

String getSchemaLocation();
void setSchemaLocation(String schemaLocation);

String getSchemaVersion();
void setSchemaVersion(String schemaVersion);

UUID getId();
void setId(UUID id);

List<IComponent> getElements();
List<IComponent> getSortedElements();
void setElements(List<IComponent> elements);

void addElement(IComponent element);
}
12 changes: 12 additions & 0 deletions src/main/java/com/labelzoom/api/model/components/ILayer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.labelzoom.api.model.components;

import java.util.List;

public interface ILayer
{
String getName();
void setName(String name);

List<IComponent> getElements();
void setElements(List<IComponent> elements);
}
15 changes: 15 additions & 0 deletions src/main/java/com/labelzoom/api/model/components/ILine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.labelzoom.api.model.components;

import com.labelzoom.api.model.Orientation;

public interface ILine extends IComponent
{
Orientation getOrientation();
void setOrientation(Orientation orientation);

int getThickness();
void setThickness(int thickness);

int getLength();
void setLength(int length);
}
13 changes: 13 additions & 0 deletions src/main/java/com/labelzoom/api/model/components/IRectangle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.labelzoom.api.model.components;

public interface IRectangle extends IComponent
{
int getWidth();
void setWidth(int width);

int getHeight();
void setHeight(int height);

int getThickness();
void setThickness(int thickness);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.labelzoom.api.model.components;

public interface IStaticText extends IFontComponent
{
String getText();
void setText(String text);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.labelzoom.api.model.components;

public interface ISuppressible
{
boolean isBlankWhenNull();
void setBlankWhenNull(boolean blankWhenNull);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.labelzoom.api.model.components;

/* Copyright (C) 2021, LabelZoom, a subsidiary of RJF Technology Solutions, Inc.
* All rights reserved. Proprietary and confidential.
*
* This file is subject to the license terms found at
* https://www.labelzoom.net/end-user-license-agreement/
*
* The methods and techniques described herein are considered
* confidential and/or trade secrets.
* No part of this file may be copied, modified, propagated,
* or distributed except as authorized by the license.
*/

@Deprecated
public interface IVariableField
{
void setDataField(String fldnam);
String getDataField();

void setFieldValue(String value);
String getFieldValue();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.labelzoom.api.model.components;

import com.labelzoom.api.model.HorizontalAlignment;

public interface IVariableText extends IFontComponent, IDynamicField
{
boolean isAutoSize();
void setAutoSize(boolean autoSize);

int getWidth();
void setWidth(int width);

int getHeight();
void setHeight(int height);

HorizontalAlignment getHorizontalAlignment();
void setHorizontalAlignment(HorizontalAlignment alignment);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.labelzoom.api.model.components.barcodes;

import com.labelzoom.api.model.BarcodeStyle;
import com.labelzoom.api.model.components.IComponent;
import com.labelzoom.api.model.components.IDynamicField;
import com.labelzoom.api.model.components.ISuppressible;

public interface IBarcode extends IComponent, IDynamicField, ISuppressible
{
BarcodeStyle getBarcodeStyle();
void setBarcodeStyle(BarcodeStyle barcodeStyle);
}
Loading

0 comments on commit 4c3177a

Please sign in to comment.