Skip to content

Commit 7f08686

Browse files
committed
Updating API
1 parent 2edf910 commit 7f08686

File tree

92 files changed

+2431
-610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2431
-610
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = 'com.labelzoom.api'
8-
version = '1.0.7'
8+
version = '1.0.8'
99

1010
repositories {
1111
mavenCentral()
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package com.labelzoom.api.input;
22

3-
import com.labelzoom.api.model.components.ILabel;
3+
import com.labelzoom.api.model.components.CLabel;
4+
5+
import java.util.List;
46

57
public interface LabelReader<E>
68
{
7-
ILabel read(E in);
9+
List<CLabel> read(E in);
810
}

src/main/java/com/labelzoom/api/model/BarcodeStyle.java

-42
This file was deleted.

src/main/java/com/labelzoom/api/model/DataCloneable.java

-6
This file was deleted.

src/main/java/com/labelzoom/api/model/HorizontalAlignment.java

-6
This file was deleted.

src/main/java/com/labelzoom/api/model/Orientation.java

-6
This file was deleted.

src/main/java/com/labelzoom/api/model/PageOrientation.java

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package com.labelzoom.api.model.components;
2+
3+
/* Copyright (C) 2021, LabelZoom, a subsidiary of RJF Technology Solutions, Inc.
4+
* All rights reserved. Proprietary and confidential.
5+
*
6+
* This file is subject to the license terms found at
7+
* https://www.labelzoom.net/end-user-license-agreement/
8+
*
9+
* The methods and techniques described herein are considered
10+
* confidential and/or trade secrets.
11+
* No part of this file may be copied, modified, propagated,
12+
* or distributed except as authorized by the license.
13+
*/
14+
15+
import com.labelzoom.api.model.PositioningMode;
16+
import lombok.Getter;
17+
import lombok.Setter;
18+
19+
@Getter
20+
public abstract class AComponent implements Cloneable {
21+
22+
@Setter
23+
protected int left;
24+
25+
@Setter
26+
protected int top;
27+
28+
protected float rotation = 0;
29+
public void setRotation(float rotation) { this.rotation = rotation % 360; }
30+
31+
@Setter
32+
protected boolean reverse = false;
33+
34+
@Setter
35+
protected Justification justification = Justification.Left;
36+
37+
@Setter
38+
protected PositioningMode positioningMode = PositioningMode.Origin;
39+
40+
/**
41+
* Parameterless constructor
42+
*/
43+
public AComponent() { this(null); }
44+
45+
/**
46+
* Cloning constructor
47+
* @param original the AComponent to clone
48+
*/
49+
protected AComponent(final AComponent original)
50+
{
51+
super();
52+
if (original != null)
53+
{
54+
this.left = original.left;
55+
this.top = original.top;
56+
this.rotation = original.rotation;
57+
this.reverse = original.reverse;
58+
this.justification = original.justification;
59+
this.positioningMode = original.positioningMode;
60+
}
61+
}
62+
63+
public boolean isRotated()
64+
{
65+
return (rotation % 180) != 0;
66+
}
67+
68+
public boolean isInverted()
69+
{
70+
return (Math.abs(rotation) > 90 && Math.abs(rotation) < 270);
71+
}
72+
73+
@Override
74+
public abstract AComponent clone();
75+
76+
public abstract int getZIndex();
77+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.labelzoom.api.model.components;
2+
3+
/* Copyright (C) 2021, LabelZoom, a subsidiary of RJF Technology Solutions, Inc.
4+
* All rights reserved. Proprietary and confidential.
5+
*
6+
* This file is subject to the license terms found at
7+
* https://www.labelzoom.net/end-user-license-agreement/
8+
*
9+
* The methods and techniques described herein are considered
10+
* confidential and/or trade secrets.
11+
* No part of this file may be copied, modified, propagated,
12+
* or distributed except as authorized by the license.
13+
*/
14+
15+
import lombok.Getter;
16+
17+
import java.util.ArrayList;
18+
import java.util.Arrays;
19+
import java.util.List;
20+
21+
@Getter
22+
public abstract class AContainer extends AComponent
23+
{
24+
protected List<AComponent> children = new ArrayList<>(); // Using ArrayList because that's what Jackson uses
25+
26+
/**
27+
* Parameterless constructor
28+
*/
29+
public AContainer() { this(null); }
30+
31+
/**
32+
* Cloning constructor
33+
* @param original the AContainer to clone
34+
*/
35+
protected AContainer(final AContainer original)
36+
{
37+
super(original);
38+
39+
// Clone children
40+
if (original.children != null)
41+
{
42+
for (final AComponent component : original.children)
43+
{
44+
children.add(component.clone());
45+
}
46+
}
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package com.labelzoom.api.model.components;
2+
3+
/* Copyright (C) 2021, LabelZoom, a subsidiary of RJF Technology Solutions, Inc.
4+
* All rights reserved. Proprietary and confidential.
5+
*
6+
* This file is subject to the license terms found at
7+
* https://www.labelzoom.net/end-user-license-agreement/
8+
*
9+
* The methods and techniques described herein are considered
10+
* confidential and/or trade secrets.
11+
* No part of this file may be copied, modified, propagated,
12+
* or distributed except as authorized by the license.
13+
*/
14+
15+
import lombok.Getter;
16+
import lombok.Setter;
17+
18+
@Getter @Setter
19+
public abstract class AFontComponent extends AComponent
20+
{
21+
protected float horizontalScaling = 1.0f;
22+
23+
protected float fontSize = 10.0f;
24+
25+
protected String font = "0";
26+
27+
protected boolean blankWhenNull = false;
28+
29+
/**
30+
* Parameterless constructor
31+
*/
32+
public AFontComponent() { this(null); }
33+
34+
/**
35+
* Cloning constructor
36+
* @param original the AFontComponent to clone
37+
*/
38+
protected AFontComponent(final AFontComponent original)
39+
{
40+
super(original);
41+
if (original != null)
42+
{
43+
fontSize = original.fontSize;
44+
font = original.font;
45+
blankWhenNull = original.blankWhenNull;
46+
horizontalScaling = original.horizontalScaling;
47+
}
48+
}
49+
50+
@Override
51+
public abstract AComponent clone();
52+
53+
@Override
54+
public int getZIndex() { return 3; }
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package com.labelzoom.api.model.components;
2+
3+
/* Copyright (C) 2021, LabelZoom, a subsidiary of RJF Technology Solutions, Inc.
4+
* All rights reserved. Proprietary and confidential.
5+
*
6+
* This file is subject to the license terms found at
7+
* https://www.labelzoom.net/end-user-license-agreement/
8+
*
9+
* The methods and techniques described herein are considered
10+
* confidential and/or trade secrets.
11+
* No part of this file may be copied, modified, propagated,
12+
* or distributed except as authorized by the license.
13+
*/
14+
15+
import lombok.Getter;
16+
import lombok.Setter;
17+
18+
@Getter @Setter
19+
public class CAddressBlock extends AFontComponent
20+
{
21+
protected boolean useLocalizedAddressFormat = true;
22+
23+
protected int staticAddressFormat = 1;
24+
25+
protected boolean showContactName = false;
26+
27+
protected boolean showCountry = false;
28+
29+
protected String addressId;
30+
31+
/**
32+
* Parameterless constructor
33+
*/
34+
public CAddressBlock() { this(null); }
35+
36+
/**
37+
* Cloning constructor
38+
* @param original the CAddressBlock to clone
39+
*/
40+
protected CAddressBlock(final CAddressBlock original)
41+
{
42+
super(original);
43+
if (original != null)
44+
{
45+
useLocalizedAddressFormat = original.useLocalizedAddressFormat;
46+
staticAddressFormat = original.staticAddressFormat;
47+
showContactName = original.showContactName;
48+
showCountry = original.showCountry;
49+
addressId = original.addressId;
50+
}
51+
}
52+
53+
@Override
54+
public AComponent clone() {
55+
return new CAddressBlock(this);
56+
}
57+
58+
/**
59+
* We want to return null to signify an empty value, because Address Blocks will always be converted to a series of
60+
* Static Text objects when filling the label with data. If this conversion doesn't happen, we want to print "null"
61+
* @return
62+
*/
63+
@Override
64+
public String toString()
65+
{
66+
return null;
67+
}
68+
}

0 commit comments

Comments
 (0)