mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-13 06:49:36 -04:00
fixed some checkstyle issues
This commit is contained in:
parent
6ee0707b77
commit
bb0122eac1
@ -21,7 +21,7 @@ import java.util.ArrayList;
|
|||||||
*/
|
*/
|
||||||
public final class GraphicsFormatter {
|
public final class GraphicsFormatter {
|
||||||
|
|
||||||
private static final FormatToExpression formatToExpression = FormatToExpression.FORMATTER_UNICODE_NOAND;
|
private static final FormatToExpression DEFAULT_FORMAT = FormatToExpression.getDefaultFormat();
|
||||||
|
|
||||||
private GraphicsFormatter() {
|
private GraphicsFormatter() {
|
||||||
}
|
}
|
||||||
@ -114,6 +114,7 @@ public final class GraphicsFormatter {
|
|||||||
* @param gr the {@link Graphics2D} instance
|
* @param gr the {@link Graphics2D} instance
|
||||||
* @param expression the expression
|
* @param expression the expression
|
||||||
* @return the text fragment
|
* @return the text fragment
|
||||||
|
* @throws FormatterException FormatterException
|
||||||
*/
|
*/
|
||||||
public static Fragment createFragment(Graphics2D gr, Expression expression) throws FormatterException {
|
public static Fragment createFragment(Graphics2D gr, Expression expression) throws FormatterException {
|
||||||
return createFragment((fragment, font, str) -> {
|
return createFragment((fragment, font, str) -> {
|
||||||
@ -136,14 +137,14 @@ public final class GraphicsFormatter {
|
|||||||
String ident = ((Variable) expression).getIdentifier();
|
String ident = ((Variable) expression).getIdentifier();
|
||||||
return createFragment(sizer, font, ident);
|
return createFragment(sizer, font, ident);
|
||||||
} else if (expression instanceof Constant) {
|
} else if (expression instanceof Constant) {
|
||||||
String value = formatToExpression.constant(((Constant) expression).getValue());
|
String value = DEFAULT_FORMAT.constant(((Constant) expression).getValue());
|
||||||
return new TextFragment(sizer, font, value);
|
return new TextFragment(sizer, font, value);
|
||||||
} else if (expression instanceof Operation.And) {
|
} else if (expression instanceof Operation.And) {
|
||||||
return createOperationFragment(sizer, font, (Operation) expression, formatToExpression.getAndString());
|
return createOperationFragment(sizer, font, (Operation) expression, DEFAULT_FORMAT.getAndString());
|
||||||
} else if (expression instanceof Operation.Or) {
|
} else if (expression instanceof Operation.Or) {
|
||||||
return createOperationFragment(sizer, font, (Operation) expression, formatToExpression.getOrString());
|
return createOperationFragment(sizer, font, (Operation) expression, DEFAULT_FORMAT.getOrString());
|
||||||
} else if (expression instanceof Operation.XOr) {
|
} else if (expression instanceof Operation.XOr) {
|
||||||
return createOperationFragment(sizer, font, (Operation) expression, formatToExpression.getXorString());
|
return createOperationFragment(sizer, font, (Operation) expression, DEFAULT_FORMAT.getXorString());
|
||||||
} else if (expression instanceof Not) {
|
} else if (expression instanceof Not) {
|
||||||
return new OverlineFragment(createFragment(sizer, font, ((Not) expression).getExpression()), font);
|
return new OverlineFragment(createFragment(sizer, font, ((Not) expression).getExpression()), font);
|
||||||
} else if (expression instanceof NamedExpression) {
|
} else if (expression instanceof NamedExpression) {
|
||||||
@ -272,7 +273,7 @@ public final class GraphicsFormatter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class SentenceFragment extends Fragment {
|
private static final class SentenceFragment extends Fragment {
|
||||||
|
|
||||||
private ArrayList<Fragment> fragments;
|
private ArrayList<Fragment> fragments;
|
||||||
|
|
||||||
|
@ -15,8 +15,6 @@ import java.awt.event.WindowAdapter;
|
|||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import static de.neemann.digital.draw.graphics.text.formatter.GraphicsFormatter.createFragment;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple Dialog to show all possible functions of a truth table.
|
* Simple Dialog to show all possible functions of a truth table.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user