mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-13 06:49:36 -04:00
minor layout improvements
This commit is contained in:
parent
b6eae0d99c
commit
2e78699c41
@ -18,6 +18,7 @@ import static de.neemann.digital.draw.graphics.text.formatter.GraphicsFormatter.
|
||||
* Component to show an expression
|
||||
*/
|
||||
public class ExpressionComponent extends JComponent {
|
||||
private static final int XPAD = 5;
|
||||
private ArrayList<Expression> expressions;
|
||||
private Dimension lastRectSet;
|
||||
|
||||
@ -63,7 +64,7 @@ public class ExpressionComponent extends JComponent {
|
||||
try {
|
||||
GraphicsFormatter.Fragment fr = createFragment(gr, e);
|
||||
y += fr.getHeight();
|
||||
fr.draw(gr, 5, y);
|
||||
fr.draw(gr, XPAD, y);
|
||||
y += lineSpacing;
|
||||
|
||||
if (dx < fr.getWidth())
|
||||
@ -73,7 +74,7 @@ public class ExpressionComponent extends JComponent {
|
||||
}
|
||||
}
|
||||
|
||||
Dimension p = new Dimension(dx, y);
|
||||
Dimension p = new Dimension(dx+XPAD*2, y);
|
||||
if (!p.equals(lastRectSet)) {
|
||||
lastRectSet = p;
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
|
@ -35,6 +35,8 @@ public class ExpressionListenerJK implements ExpressionListener {
|
||||
String detName = name.substring(0, name.length() - 2);
|
||||
DetermineJKStateMachine jk = new DetermineJKStateMachine(detName, expression);
|
||||
if (detName.endsWith("^n"))
|
||||
detName = detName.substring(0, detName.length() - 2);
|
||||
else
|
||||
detName = detName.substring(0, detName.length() - 1);
|
||||
Expression j = jk.getJ();
|
||||
parent.resultFound("J_" + detName, j);
|
||||
|
Loading…
x
Reference in New Issue
Block a user