WarpPI/src/org/warp/picalculator/math/functions/equations/EquationsSystemPart.java

88 lines
2.4 KiB
Java
Raw Normal View History

package org.warp.picalculator.math.functions.equations;
2016-09-02 20:32:37 +02:00
2016-10-02 16:01:41 +02:00
import java.util.ArrayList;
import java.util.List;
import org.warp.picalculator.Error;
import org.warp.picalculator.gui.DisplayManager;
2017-01-17 22:32:40 +01:00
import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.MathematicalSymbols;
import org.warp.picalculator.math.functions.AnteriorFunction;
import org.warp.picalculator.math.functions.Function;
public class EquationsSystemPart extends AnteriorFunction {
2016-09-02 20:32:37 +02:00
2017-01-17 22:32:40 +01:00
public EquationsSystemPart(Calculator root, Equation equazione) {
super(root, equazione);
2016-09-02 20:32:37 +02:00
}
@Override
2017-01-17 22:32:40 +01:00
protected Function NewInstance(Calculator root, Function value) {
return new EquationsSystemPart(root, (Equation) value);
2016-10-02 16:01:41 +02:00
}
2016-09-02 20:32:37 +02:00
@Override
2017-01-17 22:32:40 +01:00
public String getSymbol() {
return MathematicalSymbols.SYSTEM;
2016-09-02 20:32:37 +02:00
}
@Override
public void generateGraphics() {
2016-09-02 20:32:37 +02:00
variable.setSmall(false);
variable.generateGraphics();
2016-09-02 20:32:37 +02:00
width = 5 + getVariable().getWidth();
height = 3 + getVariable().getHeight() + 2;
line = 3 + getVariable().getLine();
}
2016-09-02 20:32:37 +02:00
@Override
public void draw(int x, int y) {
final int h = getHeight() - 1;
2016-09-02 20:32:37 +02:00
final int paddingTop = 3;
final int spazioSotto = (h - 3 - 2) / 2 + paddingTop;
final int spazioSopra = h - spazioSotto;
variable.draw(x + 5, y + paddingTop);
DisplayManager.renderer.glDrawLine(x + 2, y + 0, x + 3, y + 0);
DisplayManager.renderer.glDrawLine(x + 1, y + 1, x + 1, y + spazioSotto / 2);
DisplayManager.renderer.glDrawLine(x + 2, y + spazioSotto / 2 + 1, x + 2, y + spazioSotto - 1);
DisplayManager.renderer.glDrawLine(x + 0, y + spazioSotto, x + 1, y + spazioSotto);
DisplayManager.renderer.glDrawLine(x + 2, y + spazioSotto + 1, x + 2, y + spazioSotto + spazioSopra / 2 - 1);
DisplayManager.renderer.glDrawLine(x + 1, y + spazioSotto + spazioSopra / 2, x + 1, y + h - 1);
DisplayManager.renderer.glDrawLine(x + 2, y + h, x + 3, y + h);
2016-09-02 20:32:37 +02:00
}
@Override
public int getWidth() {
return width;
}
@Override
public int getHeight() {
return height;
}
@Override
public int getLine() {
return line;
}
@Override
protected ArrayList<Function> solve() throws Error {
// TODO Auto-generated method stub
return null;
}
@Override
protected boolean isSolvable() {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean equals(Object o) {
// TODO Auto-generated method stub
return false;
}
2016-09-02 20:32:37 +02:00
}