change value to text in cell element

This commit is contained in:
Jörg Prante 2023-08-09 18:20:15 +02:00
parent ddb5db7b84
commit 8475f64388
3 changed files with 16 additions and 16 deletions

View file

@ -1,5 +1,5 @@
group = org.xbib.graphics group = org.xbib.graphics
name = graphics name = graphics
version = 4.5.0 version = 4.5.1
org.gradle.warning.mode = ALL org.gradle.warning.mode = ALL

View file

@ -27,7 +27,7 @@ public class CellCommand implements Command {
@Override @Override
public void execute(Engine engine, State state, Settings settings) throws IOException { public void execute(Engine engine, State state, Settings settings) throws IOException {
if (settings.containsSetting("value")) { if (settings.containsSetting("text")) {
TextCell.Builder cell = TextCell.builder(); TextCell.Builder cell = TextCell.builder();
if (settings.containsSetting("padding")) { if (settings.containsSetting("padding")) {
String padding = settings.get("padding", "0 0 0 0"); String padding = settings.get("padding", "0 0 0 0");
@ -38,7 +38,7 @@ public class CellCommand implements Command {
float paddingBottom = Float.parseFloat(paddings[3]); float paddingBottom = Float.parseFloat(paddings[3]);
cell.padding(paddingLeft, paddingRight, paddingTop, paddingBottom); cell.padding(paddingLeft, paddingRight, paddingTop, paddingBottom);
} }
cell.text(settings.get("value")); cell.text(settings.get("text"));
cell.fontSize(settings.getAsFloat("fontsize", 11.0f)); cell.fontSize(settings.getAsFloat("fontsize", 11.0f));
Document document = state.getDocument(); Document document = state.getDocument();
Font font = document.getFont(settings.get("font", "helvetica").toUpperCase(Locale.ROOT)); Font font = document.getFont(settings.get("font", "helvetica").toUpperCase(Locale.ROOT));

View file

@ -128,15 +128,15 @@
"elements": [ "elements": [
{ {
"type": "cell", "type": "cell",
"value": "Cell A" "text": "Cell A"
}, },
{ {
"type": "cell", "type": "cell",
"value": "Cell B" "text": "Cell B"
}, },
{ {
"type": "cell", "type": "cell",
"value": "Cell C" "text": "Cell C"
} }
] ]
}, },
@ -145,15 +145,15 @@
"elements": [ "elements": [
{ {
"type": "cell", "type": "cell",
"value": "Cell D" "text": "Cell D"
}, },
{ {
"type": "cell", "type": "cell",
"value": "Cell E" "text": "Cell E"
}, },
{ {
"type": "cell", "type": "cell",
"value": "Cell F" "text": "Cell F"
} }
] ]
} }
@ -168,15 +168,15 @@
"elements": [ "elements": [
{ {
"type": "cell", "type": "cell",
"value": "Cell 1" "text": "Cell 1"
}, },
{ {
"type": "cell", "type": "cell",
"value": "Cell 2" "text": "Cell 2"
}, },
{ {
"type": "cell", "type": "cell",
"value": "Cell 3" "text": "Cell 3"
} }
] ]
}, },
@ -185,19 +185,19 @@
"elements": [ "elements": [
{ {
"type": "cell", "type": "cell",
"value": "Cell 4", "text": "Cell 4",
"padding": "5 5 5 5", "padding": "5 5 5 5",
"borderwidth": 0.5 "borderwidth": 0.5
}, },
{ {
"type": "cell", "type": "cell",
"value": "Cell 5", "text": "Cell 5",
"padding": "5 5 5 5", "padding": "5 5 5 5",
"borderwidth": 0.5 "borderwidth": 0.5
}, },
{ {
"type": "cell", "type": "cell",
"value": "Cell 6", "text": "Cell 6",
"padding": "5 5 5 5", "padding": "5 5 5 5",
"borderwidth": 0.5 "borderwidth": 0.5
} }
@ -210,7 +210,7 @@
"elements": [ "elements": [
{ {
"type": "text", "type": "text",
"value": "Hello World 6", "text": "Hello World 6",
"fontsize": 20, "fontsize": 20,
"font": "notosans" "font": "notosans"
} }