diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
| commit | 1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch) | |
| tree | 926cef8cb76d46862ed2c4ec7028720611e47476 | |
| download | Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2 Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip | |
added source
130 files changed, 11486 insertions, 0 deletions
diff --git a/src/AbstractGraph.java b/src/AbstractGraph.java new file mode 100644 index 0000000..cb36558 --- /dev/null +++ b/src/AbstractGraph.java @@ -0,0 +1,114 @@ +/* */ import java.awt.Color; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ +/* */ public abstract class AbstractGraph extends GraphWorld +/* */ { +/* */ private static final long serialVersionUID = -4806217320367527179L; +/* 15 */ public static final Color[] colors = { +/* 16 */ Color.red, +/* 17 */ Color.blue, +/* 18 */ Color.green, +/* 19 */ Color.yellow.darker(), +/* 20 */ Color.magenta, +/* 21 */ Color.pink, +/* 22 */ Color.orange, +/* 23 */ Color.black, +/* 24 */ new Color(100, 100, 0), +/* 25 */ Color.gray }; +/* */ private ArrayList<Point2D>[] points; +/* */ private static ExtendablePointInvoker invoker; +/* */ private double lastY; +/* */ private double lastX; +/* */ private WindowRange winRange; +/* */ private int xskip; +/* */ +/* */ public AbstractGraph(int w, int h) +/* */ { +/* 38 */ super(w, h); +/* 39 */ this.points = new ArrayList[10]; +/* 40 */ for (int i = 0; i < this.points.length; i++) this.points[i] = new ArrayList(); +/* 41 */ this.winRange = new WindowRange(); +/* */ } +/* */ public void setWindowRange(WindowRange winRange) { +/* 44 */ this.winRange = winRange; +/* 45 */ repaint(); +/* */ } +/* */ public WindowRange getWindowRange() { +/* 48 */ return this.winRange; +/* */ } +/* */ public void addPoint(Point2D point, int index) { +/* 51 */ this.points[index].add(point); +/* */ } +/* */ public void pushPoint(Point2D point, int index) { +/* 54 */ this.points[index].add(0, point); +/* */ } +/* */ public void removePoint(Point2D point, int index) { +/* 57 */ this.points[index].remove(point); +/* */ } +/* */ +/* */ public ArrayList<Point2D>[] getPoints() { +/* 61 */ return this.points; +/* */ } +/* */ public String[] getEquations() { +/* 64 */ return GraphTypeHolder.getInstance().getEquations(); +/* */ } +/* */ public void setEquations(String[] equations) { +/* 67 */ GraphTypeHolder.getInstance().setEquations(equations); +/* 68 */ clearEvents(); +/* 69 */ repaint(); +/* */ } +/* */ +/* */ protected void setLastY(double last) { +/* 73 */ this.lastY = last; +/* */ } +/* */ protected void setLastX(double last) { +/* 76 */ this.lastX = last; +/* */ } +/* */ public double getLastY() { +/* 79 */ return this.lastY; +/* */ } +/* */ public double getLastX() { +/* 82 */ return this.lastX; +/* */ } +/* */ public ExtendablePointInvoker getInvoker() { +/* 85 */ return invoker; +/* */ } +/* */ public void setInvoker(ExtendablePointInvoker invoker) { +/* 88 */ invoker = invoker; +/* 89 */ repaint(); +/* */ } +/* */ public int getXSkip() { +/* 92 */ return this.xskip; +/* */ } +/* */ public void setXSkip(int xSkip) { +/* 95 */ this.xskip = xSkip; +/* 96 */ repaint(); +/* */ } +/* */ protected void wipe() { +/* 99 */ this.points = new ArrayList[10]; +/* 100 */ for (int i = 0; i < this.points.length; i++) { +/* 101 */ this.points[i] = new ArrayList(); +/* */ } +/* 103 */ repaint(); +/* */ } +/* */ public void appendEquation(String equation) { +/* 106 */ String[] temp = GraphTypeHolder.getInstance().getEquations(); +/* 107 */ String[] nother = new String[temp.length + 1]; +/* 108 */ for (int i = 0; i < temp.length; i++) nother[i] = temp[i]; +/* 109 */ nother[(nother.length - 1)] = equation; +/* 110 */ GraphTypeHolder.getInstance().setEquations(nother); } +/* */ public abstract void makePoints(); +/* */ +/* */ public abstract void remakePoints(); +/* */ +/* 115 */ protected void clearEvents() { int max = super.getEvents().size(); +/* 116 */ for (int i = 0; i < max; i++) +/* 117 */ super.removeEvent(0); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: AbstractGraph + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ActionList.java b/src/ActionList.java new file mode 100644 index 0000000..193b8a0 --- /dev/null +++ b/src/ActionList.java @@ -0,0 +1,66 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Font; +/* */ import java.awt.GridLayout; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.util.ArrayList; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JScrollPane; +/* */ import javax.swing.JToggleButton; +/* */ +/* */ public class ActionList extends JPanel +/* */ implements ActionListener +/* */ { +/* */ private JToggleButton[] buttons; +/* */ private JScrollPane pane; +/* */ private ArrayList<ActionListener> listeners; +/* */ private JPanel mainPanel; +/* */ +/* */ public ActionList(Object[] args) +/* */ { +/* 22 */ this.listeners = new ArrayList(); +/* 23 */ this.mainPanel = new JPanel(new GridLayout(args.length, 1, 0, 0)); +/* 24 */ this.buttons = new JToggleButton[args.length]; +/* 25 */ for (int i = 0; i < args.length; i++) +/* */ { +/* 27 */ this.buttons[i] = new JToggleButton(args[i].toString()); +/* 28 */ this.buttons[i].setBackground(Color.white); +/* 29 */ this.buttons[i].setFont(new Font("Courier New", 0, 10)); +/* 30 */ this.buttons[i].setSize(70, 20); +/* 31 */ this.mainPanel.add(this.buttons[i]); +/* 32 */ this.buttons[i].addActionListener(this); +/* */ } +/* 34 */ add(this.mainPanel); +/* 35 */ this.pane = new JScrollPane(this); +/* */ } +/* */ public ActionList(Object[] args, ActionListener listen) { +/* 38 */ this(args); +/* 39 */ addActionListener(listen); +/* */ } +/* */ public JToggleButton getSelected() { +/* 42 */ for (int i = 0; i < this.buttons.length; i++) { +/* 43 */ if (this.buttons[i].isSelected()) return this.buttons[i]; +/* */ } +/* 45 */ return null; +/* */ } +/* */ public int getSelectedIndex() { +/* 48 */ for (int i = 0; i < this.buttons.length; i++) { +/* 49 */ if (this.buttons[i].isSelected()) return i; +/* */ } +/* 51 */ return -1; +/* */ } +/* 53 */ public void addActionListener(ActionListener x) { this.listeners.add(x); } +/* 54 */ public JToggleButton get(int index) { return this.buttons[index]; } +/* */ public void actionPerformed(ActionEvent e) { +/* 56 */ for (int i = 0; i < this.buttons.length; i++) { +/* 57 */ if ((this.buttons[i].isSelected()) && (e.getSource() != this.buttons[i])) this.buttons[i].setSelected(false); +/* */ } +/* 59 */ e.setSource(this); +/* 60 */ for (int i = 0; i < this.listeners.size(); i++) ((ActionListener)this.listeners.get(i)).actionPerformed(e); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ActionList + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/AlertBox.java b/src/AlertBox.java new file mode 100644 index 0000000..14f20fc --- /dev/null +++ b/src/AlertBox.java @@ -0,0 +1,41 @@ +/* */ import java.awt.BorderLayout; +/* */ import java.awt.Toolkit; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ +/* */ public class AlertBox extends JFrame +/* */ implements ActionListener +/* */ { +/* */ private JPanel bottom; +/* */ private JPanel top; +/* */ private JButton ok; +/* */ +/* */ public AlertBox(String message, String title) +/* */ { +/* 19 */ setTitle(title); +/* 20 */ setLayout(new BorderLayout()); +/* 21 */ this.bottom = new JPanel(); +/* 22 */ this.top = new JPanel(); +/* 23 */ add(this.top, "North"); +/* 24 */ add(this.bottom, "South"); +/* 25 */ this.top.add(new JLabel(message)); +/* 26 */ this.ok = new JButton("OK"); +/* 27 */ this.bottom.add(this.ok); +/* 28 */ this.ok.addActionListener(this); +/* 29 */ setVisible(true); +/* 30 */ setIconImage(Toolkit.getDefaultToolkit().getImage("modulus_symbol.png")); +/* 31 */ pack(); +/* */ } +/* 33 */ public void actionPerformed(ActionEvent e) { setVisible(false); } +/* 34 */ public static void throwError(String alert) { new AlertBox(alert, "Error"); } +/* */ +/* */ } + +/* Location: Modulus.jar + * Qualified Name: AlertBox + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/AnswerPanel.java b/src/AnswerPanel.java new file mode 100644 index 0000000..be4eb8c --- /dev/null +++ b/src/AnswerPanel.java @@ -0,0 +1,61 @@ +/* */ import java.awt.FlowLayout; +/* */ import java.awt.GridLayout; +/* */ import java.text.DecimalFormat; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JTextField; +/* */ +/* */ public class AnswerPanel extends JPanel +/* */ implements GraphTypeStateChangedListener, EquationChangeListener +/* */ { +/* */ private JTextField[] fields; +/* */ private JPanel[] panels; +/* */ private JLabel[] labels; +/* */ private String[] equations; +/* */ private DecimalFormat format; +/* */ private Graph2D graph; +/* */ +/* */ public AnswerPanel(String[] equations, Graph2D graph) +/* */ { +/* 19 */ this.equations = equations; +/* */ +/* 21 */ this.fields = new JTextField[equations.length]; +/* 22 */ this.panels = new JPanel[equations.length]; +/* 23 */ this.labels = new JLabel[equations.length]; +/* 24 */ setLayout(new GridLayout(5, 1)); +/* 25 */ for (int i = 0; i < this.fields.length; i++) { +/* 26 */ this.fields[i] = new JTextField("", 5); +/* 27 */ this.fields[i].setEditable(false); +/* 28 */ this.labels[i] = new JLabel("<html><a style='font-family:Times New Roman'>y<sub>" + i + "</sub>(" + GraphTypeHolder.getInstance().getGraphPointMaker().getIndependentVariable() + ")</a> =<html>"); +/* 29 */ this.panels[i] = new JPanel(new FlowLayout()); +/* 30 */ this.panels[i].add(this.labels[i]); +/* 31 */ this.panels[i].add(this.fields[i]); +/* 32 */ add(this.panels[i]); +/* */ } +/* */ +/* 36 */ GraphTypeHolder.getInstance().addGraphTypeStateChangedListener(this); +/* 37 */ GraphTypeHolder.getInstance().fireGraphTypeStateChanged(); +/* 38 */ this.format = new DecimalFormat(".00"); +/* 39 */ this.graph = graph; +/* */ } +/* */ public void graphTypeChanged(Point2DMaker maker) { +/* 42 */ for (int i = 0; i < this.labels.length; i++) +/* 43 */ this.labels[i].setText("<html><a style='font-family:Times New Roman'>" + maker.getDependentVariable() + "<sub>" + i + "</sub>(" + GraphTypeHolder.getInstance().getGraphPointMaker().getIndependentVariable() + ")</a> =<html>"); +/* */ } +/* */ +/* */ public void setEquations(String[] equations) { +/* 47 */ this.equations = equations; +/* */ } +/* */ public void load(double x, double y, double t) { +/* 50 */ Point2DMaker type = GraphTypeHolder.getInstance().getGraphPointMaker(); +/* 51 */ double ivar = type.getIndependentVariable() == 'y' ? y : type.getIndependentVariable() == 't' ? t : type.getIndependentVariable() == 'x' ? x : 0.0D; +/* 52 */ for (int i = 0; (i < this.equations.length) && (i < this.fields.length); i++) +/* 53 */ if ((this.equations[i] != null) && (this.equations[i].length() > 0)) +/* 54 */ this.fields[i].setText(this.format.format(this.graph.equation(ivar, this.equations[i]))); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: AnswerPanel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/AppendingThread.java b/src/AppendingThread.java new file mode 100644 index 0000000..90fd434 --- /dev/null +++ b/src/AppendingThread.java @@ -0,0 +1,38 @@ +/* */ import java.io.PrintStream; +/* */ import java.util.ArrayList; +/* */ import utilities.DecimalFormatter; +/* */ +/* */ public class AppendingThread extends Thread +/* */ { +/* 12 */ private static int count = 1; +/* */ private int index; +/* */ private String str; +/* */ private ArrayList<String> ans; +/* */ private DecimalFormatter f; +/* */ +/* */ public AppendingThread(String toSolve, int index, ArrayList<String> ans, DecimalFormatter f) +/* */ { +/* 18 */ super(Thread.currentThread().getThreadGroup(), "AppendingThread - " + count); +/* 19 */ count += 1; +/* 20 */ this.str = toSolve; +/* 21 */ this.ans = ans; +/* 22 */ this.index = index; +/* 23 */ this.f = f; +/* */ } +/* */ public void run() { +/* 26 */ String temp = ""; +/* */ try { +/* 28 */ temp = ControlPanel.figure(this.str); +/* */ } catch (Exception e) { +/* 30 */ System.out.println(e.getMessage()); +/* 31 */ }CalculatorGUI.silentPrint(this.str + "->"); +/* 32 */ System.out.println(this.f.format(temp)); +/* 33 */ CalculatorGUI.silentPrint("\n"); +/* 34 */ this.ans.add(this.index + 1, this.f.format(temp)); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: AppendingThread + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/BaseComboBox.java b/src/BaseComboBox.java new file mode 100644 index 0000000..cc8797c --- /dev/null +++ b/src/BaseComboBox.java @@ -0,0 +1,15 @@ +/* */ import javax.swing.JComboBox; +/* */ +/* */ public class BaseComboBox extends JComboBox +/* */ { +/* */ public BaseComboBox(int index) +/* */ { +/* 14 */ super(new String[] { "Unary (1)", "Binary (2)", "Ternary (3)", "Quaternal (4)", "Quintal (5)", "Sextal (6)", "Septernal (7)", "Ocatal (8)", "Nonary (9)", "Decimal (default)", "Unidecimal (11)", "Dozenal (12)", "Tredecimal (13)", "Tetradecimal (14)", "Quindecimal (15)", "Hexadecimal (16)", "Septendecimal (17)", "Octodecimal (18)", "Nonadecimal (19)", "Vigesimal (20)", "Base 21", "Base 22", "Base 23", "Base 24", "Base 25", "Base 26", "Base 27", "Base 28", "Base 29", "Base 30", "Base 31", "Base 32", "Base 33", "Base 34", "Base 35", "Base 36" }); +/* 15 */ setSelectedIndex(index); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: BaseComboBox + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/BooleanLogic.java b/src/BooleanLogic.java new file mode 100644 index 0000000..20d5e33 --- /dev/null +++ b/src/BooleanLogic.java @@ -0,0 +1,79 @@ +/* */ import java.math.BigDecimal; +/* */ import java.util.ArrayList; +/* */ +/* */ public class BooleanLogic +/* */ { +/* */ public static String solve(String eq) +/* */ throws Exception +/* */ { +/* 13 */ eq = eq.replaceAll("\\s", ""); +/* 14 */ while (eq.contains("(")) { +/* 15 */ String part = eq.substring(eq.lastIndexOf("(", eq.indexOf(")")) + 1, eq.indexOf(")")); +/* 16 */ if (TernarySolver.containsTernary(part)) +/* 17 */ eq = eq.substring(0, eq.lastIndexOf("(", eq.indexOf(")"))) + TernarySolver.solve(part) + eq.substring(eq.indexOf(")") + 1); +/* 18 */ else if (containsBoolean(part)) +/* 19 */ eq = eq.substring(0, eq.lastIndexOf("(", eq.indexOf(")"))) + solve(part) + eq.substring(eq.indexOf(")") + 1); +/* */ else +/* 21 */ eq = eq.substring(0, eq.lastIndexOf("(", eq.indexOf(")"))) + Calculator.solve(part) + eq.substring(eq.indexOf(")") + 1); +/* */ } +/* 23 */ String[] parts = eq.split("\\s*and\\s*|\\s*xor\\s*|\\s*or\\s*"); +/* 24 */ String[] logic = splitLogic(eq); +/* 25 */ boolean[] answers = new boolean[parts.length]; +/* 26 */ for (int i = 0; i < parts.length; i++) { +/* 27 */ answers[i] = parseSingleBoolean(parts[i]); +/* */ } +/* 29 */ boolean ans = answers[0]; +/* 30 */ for (int i = 0; i < logic.length; i++) { +/* 31 */ if (logic[i].equals("and")) ans &= answers[(i + 1)]; +/* 32 */ else if (logic[i].equals("xor")) ans ^= answers[(i + 1)]; +/* 33 */ else if (logic[i].equals("or")) ans |= answers[(i + 1)]; +/* */ } +/* 35 */ return ans ? 1 : 0; +/* */ } +/* */ public static boolean parseSingleBoolean(String eq) throws Exception { +/* 38 */ eq = eq.trim(); +/* 39 */ String store = ""; +/* 40 */ boolean flag = false; +/* 41 */ while (eq.startsWith("not")) { +/* 42 */ if (eq.equals("not0")) return true; +/* 43 */ if (eq.equals("not1")) return false; +/* 44 */ flag = !flag; +/* 45 */ eq = eq.substring(3); +/* */ } +/* 47 */ if ((eq.equals("1")) || (eq.equals("0")) || (eq.equals("true")) || (eq.equals("false"))) return eq.replaceAll("true", "1").contains("1") ^ flag; +/* 48 */ if ((eq.contains(">=")) || (eq.contains("=>"))) store = ">="; +/* 49 */ else if ((eq.contains("<=")) || (eq.contains("=<"))) store = "<="; +/* 50 */ else if (eq.contains(">")) store = ">"; +/* 51 */ else if (eq.contains("<")) store = "<"; else +/* 52 */ store = "="; +/* 53 */ String[] args = eq.split(">=|=>|<=|=<|<|>|="); +/* 54 */ String hold1 = Calculator.solve(args[0]); +/* 55 */ String hold2 = Calculator.solve(args[1]); +/* 56 */ switch (new BigDecimal(hold1).compareTo(new BigDecimal(hold2))) { case 0: +/* 57 */ return store.contains("=") ^ flag; +/* */ case 1: +/* 58 */ return store.contains(">") ^ flag; } +/* 59 */ return store.contains("<") ^ flag; +/* */ } +/* */ +/* */ public static String[] splitLogic(String eq) +/* */ { +/* 64 */ ArrayList ret = new ArrayList(); +/* 65 */ for (int i = 0; i < eq.length(); i++) { +/* 66 */ if ((eq.startsWith("or", i)) && (eq.charAt(i - 1) != 'x')) ret.add("or"); +/* 67 */ if (eq.startsWith("and", i)) ret.add("and"); +/* 68 */ if (eq.startsWith("xor", i)) ret.add("xor"); +/* */ } +/* 70 */ return Calculator.toStringArray(ret); +/* */ } +/* */ +/* */ public static boolean containsBoolean(String eq) { +/* 74 */ return (eq.contains("and")) || (eq.contains("or")) || (eq.contains("not")) || +/* 74 */ (eq.contains(">")) || (eq.contains("<")) || (eq.contains("=")); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: BooleanLogic + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/CalcConst.java b/src/CalcConst.java new file mode 100644 index 0000000..c04edf6 --- /dev/null +++ b/src/CalcConst.java @@ -0,0 +1,9 @@ +public class CalcConst +{ + public static final String ICON = "modulus_symbol.png"; +} + +/* Location: Modulus.jar + * Qualified Name: CalcConst + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Calculator.java b/src/Calculator.java new file mode 100644 index 0000000..9086dba --- /dev/null +++ b/src/Calculator.java @@ -0,0 +1,314 @@ +/* */ import java.math.BigDecimal; +/* */ import java.math.BigInteger; +/* */ import java.math.MathContext; +/* */ import java.util.ArrayList; +/* */ import utilities.BaseConverter; +/* */ +/* */ public class Calculator +/* */ { +/* 19 */ private static int base = 10; +/* 20 */ private static boolean radians = false; +/* */ public static final String OPS = "%/*+^e:&\\?£"; +/* 22 */ public static final String[] OPS_ARR = { "%", "/", "*", "+", "^", "e", ":", "&", "\\", "?", "£" }; +/* */ +/* */ public static String solve(String eq) throws Exception { +/* 25 */ eq = expandMult(eq); +/* 26 */ while (eq.contains("(")) { +/* 27 */ String part = eq.substring(eq.lastIndexOf("(", eq.indexOf(")")) + 1, eq.indexOf(")")); +/* 28 */ if (TernarySolver.containsTernary(part)) +/* 29 */ eq = eq.substring(0, eq.lastIndexOf("(", eq.indexOf(")"))) + TernarySolver.solve(part) + eq.substring(eq.indexOf(")") + 1); +/* 30 */ else if (BooleanLogic.containsBoolean(part)) +/* 31 */ eq = eq.substring(0, eq.lastIndexOf("(", eq.indexOf(")"))) + BooleanLogic.solve(part) + eq.substring(eq.indexOf(")") + 1); +/* */ else +/* 33 */ eq = eq.substring(0, eq.lastIndexOf("(", eq.indexOf(")"))) + solve(part) + eq.substring(eq.indexOf(")") + 1); +/* */ } +/* 35 */ while (eq.contains("|")) { +/* 36 */ String x = solve(eq.substring(eq.lastIndexOf("|", eq.lastIndexOf("|") - 1) + 1, eq.lastIndexOf("|"))); +/* 37 */ if (x.startsWith("-")) x = x.substring(1); +/* 38 */ eq = eq.substring(0, eq.lastIndexOf("|", eq.lastIndexOf("|") - 1)) + x + eq.substring(eq.lastIndexOf("|") + 1); +/* */ } +/* */ +/* 45 */ String hold = "+"; +/* */ +/* 47 */ int errIndex = 0; +/* */ +/* 49 */ eq = eq.replaceAll("\\s", ""); +/* */ +/* 51 */ eq = sudoSubtraction(eq); +/* 52 */ while (errIndex < 65535) +/* */ { +/* 54 */ String[] numbers = splitNums(eq)[0]; +/* 55 */ if (base != 10) replaceBase(numbers); +/* */ +/* 57 */ String[] operators = splitNums(eq)[1]; +/* 58 */ if ((eq.startsWith("-")) || (eq.startsWith("+"))) hold = eq.charAt(0); +/* 59 */ if ((numbers.length == 1) && (operators.length == 0)) { +/* 60 */ singleArgCheck(numbers); +/* 61 */ if (base == 10) return numbers[0]; +/* 62 */ return BaseConverter.convertFromDecimal(Double.parseDouble(numbers[0]), base); +/* */ } +/* */ +/* 77 */ singleArgCheck(numbers); +/* */ +/* 79 */ int indexOfNext = indexOf(operators, new String[] { "^", "e", "£" }); +/* 80 */ if (indexOfNext == -1) indexOfNext = indexOf(operators, new String[] { "*", "/", "%", ":" }); +/* 81 */ if (indexOfNext == -1) indexOfNext = indexOf(operators, new String[] { "+" }); +/* 82 */ if (indexOfNext == -1) indexOfNext = indexOf(operators, new String[] { "&", "\\", "?" }); +/* 83 */ if (indexOfNext == -1) { +/* 84 */ if (base == 10) return eq; +/* 85 */ return BaseConverter.convertFromDecimal(Double.parseDouble(eq), base); +/* */ } +/* */ +/* */ try +/* */ { +/* 90 */ numbers = append(new String[][] { subarray(numbers, 0, indexOfNext), { solvePart(numbers[indexOfNext], operators[indexOfNext], numbers[(indexOfNext + 1)]) }, subarray(numbers, indexOfNext + 2, numbers.length) }); +/* 91 */ operators = append(new String[][] { subarray(operators, 0, indexOfNext), subarray(operators, indexOfNext + 1, operators.length) }); +/* */ } +/* */ catch (RuntimeException e) { +/* 94 */ if (base == 10) return solvePart(numbers[indexOfNext], operators[indexOfNext], numbers[(indexOfNext + 1)]); +/* 95 */ return BaseConverter.convertFromDecimal(Double.parseDouble(solvePart(numbers[indexOfNext], operators[indexOfNext], numbers[(indexOfNext + 1)])), base); +/* */ } +/* */ +/* 98 */ eq = ""; +/* 99 */ for (int i = 0; i < numbers.length; i++) { +/* 100 */ eq = eq + numbers[i]; +/* 101 */ if (i < operators.length) eq = eq + operators[i]; +/* */ } +/* 103 */ errIndex++; +/* */ } +/* 105 */ throw new Exception(eq + " could not be parsed"); +/* */ } +/* */ +/* */ private static boolean checkOps(String[] ops, String[] nums) { +/* 109 */ boolean flag = false; +/* 110 */ if (ops.length >= nums.length) { +/* 111 */ flag = true; +/* 112 */ nums[0] = (ops[0] + nums[0]); +/* */ } +/* 114 */ for (int i = 0; i < ops.length; i++) { +/* 115 */ if ((ops[i].length() > 1) && ((ops[i].charAt(ops[i].length() - 1) == '-') || (ops[i].charAt(ops[i].length() - 1) == '+'))) { +/* 116 */ nums[(flag ? i : i + 1)] = (ops[i].charAt(1) + nums[(i + 1)]); +/* 117 */ ops[i] = ops[i].charAt(0); +/* */ } +/* */ } +/* 120 */ return flag; +/* */ } +/* */ public static int indexOf(Object[] args, Object arg) { +/* 123 */ for (int i = 0; i < args.length; i++) if (arg.equals(args[i])) return i; +/* 124 */ return -1; +/* */ } +/* */ private static String solvePart(String num1, String op, String num2) { +/* 127 */ String ret = ""; +/* */ +/* 132 */ if (num2.endsWith(".0")) num2 = num2.substring(0, num2.indexOf(".")); +/* 133 */ if (num1.endsWith(".0")) num1 = num1.substring(0, num1.indexOf(".")); +/* 134 */ if (op.equals("^")) ret = Math.pow(Double.parseDouble(num1), Double.parseDouble(num2)); +/* 135 */ if (op.equals("£")) ret = Math.pow(Double.parseDouble(num1), 1.0D / Double.parseDouble(num2)); +/* 136 */ if (op.equals("e")) +/* */ { +/* 138 */ return Double.parseDouble(num1) * Math.pow(10.0D, Integer.parseInt(num2)); +/* */ } +/* 140 */ if (op.equals("*")) ret = new BigDecimal(num1).multiply(new BigDecimal(num2)).toPlainString(); +/* 141 */ else if (op.equals(":")) ret = new BigDecimal(num1).divide(new BigDecimal(num1).add(new BigDecimal(num2)), MathContext.DECIMAL64).toPlainString(); +/* 142 */ else if (op.equals("/")) { +/* 143 */ ret = new BigDecimal(num1).divide(new BigDecimal(num2), MathContext.DECIMAL64).toPlainString(); +/* */ } +/* 145 */ else if (op.equals("%")) ret = new BigDecimal(num1).remainder(new BigDecimal(num2)).toPlainString(); +/* 146 */ else if (op.equals("+")) ret = new BigDecimal(num1).add(new BigDecimal(num2)).toPlainString(); +/* 147 */ else if (op.equals("-")) ret = new BigDecimal(num1).subtract(new BigDecimal(num2)).toPlainString(); +/* 148 */ else if (op.equals("&")) ret = new BigInteger(num1).and(new BigInteger(num2)); +/* 149 */ else if (op.equals("\\")) ret = new BigInteger(num1).or(new BigInteger(num2)); +/* 150 */ else if (op.equals("?")) ret = new BigInteger(num1).xor(new BigInteger(num2)); +/* 151 */ return base == 10 ? ret : BaseConverter.convertFromDecimal(Double.parseDouble(ret), base); +/* */ } +/* */ private static void singleArgCheck(String[] nums) { +/* 154 */ boolean neg = false; +/* 155 */ for (int i = 0; i < nums.length; i++) { +/* 156 */ if (nums[i].startsWith("sqrt")) nums[i] = Math.sqrt(Double.parseDouble(nums[i].substring(4))); +/* 157 */ if (nums[i].startsWith("~")) nums[i] = new BigInteger(nums[i].substring(1)).not(); +/* 158 */ if (nums[i].startsWith("log")) nums[i] = (Math.log(Double.parseDouble(nums[i].substring(3))) / Math.log(10.0D)); +/* 159 */ if (nums[i].startsWith("ln")) nums[i] = Math.log(Double.parseDouble(nums[i].substring(2))); +/* 160 */ if (radians) { +/* 161 */ if (nums[i].startsWith("cos")) nums[i] = Math.cos(Double.parseDouble(nums[i].substring(3))); +/* 162 */ if (nums[i].startsWith("tan")) nums[i] = Math.tan(Double.parseDouble(nums[i].substring(3))); +/* 163 */ if (nums[i].startsWith("sin")) nums[i] = Math.sin(Double.parseDouble(nums[i].substring(3))); +/* 164 */ if (nums[i].startsWith("acos")) nums[i] = Math.acos(Double.parseDouble(nums[i].substring(4))); +/* 165 */ if (nums[i].startsWith("asin")) nums[i] = Math.asin(Double.parseDouble(nums[i].substring(4))); +/* 166 */ if (nums[i].startsWith("atan")) nums[i] = Math.atan(Double.parseDouble(nums[i].substring(4))); +/* */ } +/* */ else +/* */ { +/* 170 */ if (nums[i].startsWith("cos")) nums[i] = Math.cos(Math.toRadians(Double.parseDouble(nums[i].substring(3)))); +/* 171 */ if (nums[i].startsWith("tan")) nums[i] = Math.tan(Math.toRadians(Double.parseDouble(nums[i].substring(3)))); +/* 172 */ if (nums[i].startsWith("sin")) nums[i] = Math.sin(Math.toRadians(Double.parseDouble(nums[i].substring(3)))); +/* 173 */ if (nums[i].startsWith("acos")) nums[i] = Math.toDegrees(Math.acos(Double.parseDouble(nums[i].substring(4)))); +/* 174 */ if (nums[i].startsWith("asin")) nums[i] = Math.toDegrees(Math.asin(Double.parseDouble(nums[i].substring(4)))); +/* 175 */ if (nums[i].startsWith("atan")) nums[i] = Math.toDegrees(Math.atan(Double.parseDouble(nums[i].substring(4)))); +/* */ } +/* */ +/* 178 */ if (nums[i].endsWith("!")) { +/* 179 */ if (nums[i].contains(".")) nums[i] = (nums[i].substring(0, nums[i].indexOf(".")) + "!"); +/* 180 */ nums[i] = factorial(new BigInteger(nums[i].substring(0, nums[i].length() - 1))); +/* */ } +/* 182 */ if (nums[i].endsWith("_")) +/* */ { +/* */ String tmp866_860 = (new BigDecimal(nums[i].substring(0, nums[i].length() - 1)).toString() + ".0"); String x = tmp866_860; nums[i] = tmp866_860.substring(0, x.indexOf(".")); +/* */ } +/* 186 */ if (neg) nums[i] = ("-" + nums[i]); +/* */ } +/* */ } +/* */ +/* 190 */ private static int indexOf(Object[] args, Object[] find) { int min = -1; +/* */ +/* 192 */ for (Object o : find) +/* */ { +/* */ int idx; +/* 193 */ min = ((idx = indexOf(args, o)) != -1) && ((idx < min) || (min == -1)) ? idx : min; +/* */ } +/* 195 */ return min; } +/* */ +/* */ public static String[] subarray(String[] args, int start, int end) { +/* 198 */ String[] ret = new String[end - start]; +/* 199 */ for (int i = start; i < end; i++) ret[(i - start)] = args[i]; +/* 200 */ return ret; +/* */ } +/* */ private static String[] append(String[][] args) { +/* 203 */ int max = 0; +/* 204 */ String[][] arrayOfString = args; int j = args.length; for (int i = 0; i < j; i++) { String[] x = arrayOfString[i]; max += x.length; } +/* 205 */ String[] ret = new String[max]; +/* 206 */ int i = 0; for (int k = 0; i < args.length; i++) +/* 207 */ for (int j = 0; j < args[i].length; k++) { +/* 208 */ ret[k] = args[i][j]; +/* */ +/* 207 */ j++; +/* */ } +/* 209 */ return ret; +/* */ } +/* */ private static void swapAll(Object[] args, Object swap, Object with) { +/* 212 */ for (int i = 0; i < args.length; i++) if (swap.equals(args[i])) args[i] = with; +/* */ } +/* */ +/* */ private static BigInteger factorial(BigInteger x) +/* */ { +/* 215 */ if (x.longValue() <= 1L) return x; +/* 216 */ if (x.longValue() == 20L) return new BigInteger("2432902008176640000"); +/* 217 */ if (x.longValue() == 50L) return new BigInteger("30414093201713378043612608166064768844377641568960512000000000000"); +/* 218 */ if (x.longValue() == 70L) return new BigInteger("11978571669969891796070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"); +/* 219 */ return x.multiply(factorial(x.subtract(new BigInteger("1")))); +/* */ } +/* */ +/* */ private static String[][] splitNums(String x) { +/* 223 */ ArrayList ret1 = new ArrayList(); +/* 224 */ ArrayList ret2 = new ArrayList(); +/* 225 */ boolean flag = true; +/* 226 */ String temp = ""; +/* 227 */ for (int i = 0; i < x.length(); i++) { +/* 228 */ if ("%/*+^e:&\\?£".contains(x.charAt(i))) { +/* 229 */ if (flag) { +/* 230 */ flag = !flag; +/* 231 */ ret1.add(temp); +/* 232 */ temp = ""; +/* */ } +/* */ +/* */ } +/* 236 */ else if (!flag) { +/* 237 */ flag = !flag; +/* 238 */ ret2.add(temp); +/* 239 */ temp = ""; +/* */ } +/* */ +/* 242 */ temp = temp + x.charAt(i); +/* */ } +/* 244 */ if (!flag) { +/* 245 */ flag = !flag; +/* 246 */ ret2.add(temp); +/* 247 */ temp = ""; +/* */ } +/* */ else { +/* 250 */ flag = !flag; +/* 251 */ ret1.add(temp); +/* 252 */ temp = ""; +/* */ } +/* */ +/* 255 */ return new String[][] { toStringArray(ret1), toStringArray(ret2) }; +/* */ } +/* */ public static String[] toStringArray(ArrayList<String> x) { +/* 258 */ String[] ret = new String[x.size()]; +/* 259 */ for (int i = 0; i < x.size(); i++) ret[i] = ((String)x.get(i)).toString(); +/* 260 */ return ret; +/* */ } +/* */ public static boolean toggleRadians() { +/* 263 */ return Calculator.radians = radians ? 0 : 1; +/* */ } +/* */ private static String sudoSubtraction(String eq) { +/* 266 */ while ((eq.contains("++")) || (eq.contains("--"))) { +/* 267 */ eq = eq.replaceAll("--", "+"); +/* 268 */ eq = eq.replaceAll("\\+\\+", "+"); +/* */ } +/* 270 */ String ret = ""; +/* 271 */ if (eq.charAt(0) != '+') ret = ret + eq.charAt(0); +/* */ +/* 273 */ for (int i = 1; i < eq.length() - 1; i++) { +/* 274 */ if ((eq.charAt(i) == '-') && (Character.isDigit(eq.charAt(i - 1)))) { +/* 275 */ if (eq.charAt(i + 1) == '+') { +/* 276 */ i++; +/* */ } +/* 278 */ ret = ret + "+-"; +/* */ } +/* */ else { +/* 281 */ ret = ret + eq.charAt(i); +/* */ } +/* */ } +/* 284 */ return ret + (eq.length() > 1 ? Character.valueOf(eq.charAt(eq.length() - 1)) : ""); +/* */ } +/* */ private static String expandAfterNodes(String eq) { +/* 287 */ String ret = ""; +/* 288 */ for (int i = 0; i < eq.length(); i++) { +/* 289 */ ret = ret + eq.charAt(i); +/* 290 */ if ((eq.charAt(i) == ')') && (i < eq.length() - 1) && (Character.isDigit(eq.charAt(i + 1)))) ret = ret + "*"; +/* */ } +/* 292 */ return ret; +/* */ } +/* */ private static String expandMult(String eq) { +/* 295 */ String temp = ""; +/* 296 */ eq = eq.replaceAll("\\)\\(", ")*("); +/* */ +/* 299 */ int i = eq.indexOf("("); for (int last = 0; i >= 0; i = eq.indexOf("(", i + 1)) { +/* 300 */ if (i != 0) { +/* 301 */ temp = temp + eq.substring(last, i); +/* 302 */ if (Character.isDigit(eq.charAt(i - 1))) temp = temp + "*"; +/* */ } +/* 299 */ last = i; +/* */ } +/* */ +/* 304 */ eq = temp + eq.substring(last); +/* */ +/* 306 */ return expandAfterNodes(eq); +/* */ } +/* */ private static void replaceBase(String[] nums) { +/* 309 */ for (int i = 0; i < nums.length; i++) { +/* 310 */ String y = BaseConverter.convertToDecimal(nums[i].substring(indexOfDigit(nums[i]), lastIndexOfDigit(nums[i]) + 1), base); +/* 311 */ if (y.endsWith(".0")) y = y.substring(0, y.length() - 2); +/* 312 */ nums[i] = (nums[i].substring(0, indexOfDigit(nums[i])) + y + nums[i].substring(lastIndexOfDigit(nums[i]) + 1)); +/* */ } +/* */ } +/* 315 */ public static int getBase() { return base; } +/* 316 */ public static void setBase(int newBase) { base = newBase; } +/* */ private static int indexOfDigit(String eq) { +/* 318 */ for (int i = 0; i < eq.length(); i++) if ((Character.isDigit(eq.charAt(i))) || (Character.isUpperCase(eq.charAt(i)))) return i; +/* 319 */ return 0; +/* */ } +/* */ private static int lastIndexOfDigit(String eq) { +/* 322 */ for (int i = eq.length() - 1; i >= 0; i--) if ((Character.isDigit(eq.charAt(i))) || (Character.isUpperCase(eq.charAt(i)))) return i; +/* 323 */ return eq.length(); +/* */ } +/* */ public static void test() { +/* */ } +/* 327 */ public static void setRadians(boolean istrue) { radians = istrue; } +/* */ +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Calculator + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/CalculatorGUI.java b/src/CalculatorGUI.java new file mode 100644 index 0000000..c96bfe8 --- /dev/null +++ b/src/CalculatorGUI.java @@ -0,0 +1,1024 @@ +/* */ import StandardIO.Approvable; +/* */ import StandardIO.MFileFilter; +/* */ import StandardIO.ModulusFileChooser; +/* */ import StandardIO.ModulusOutputStream; +/* */ import StandardIO.PropertiesReader; +/* */ import java.awt.BorderLayout; +/* */ import java.awt.Color; +/* */ import java.awt.Component; +/* */ import java.awt.Container; +/* */ import java.awt.Dimension; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Graphics; +/* */ import java.awt.Toolkit; +/* */ import java.awt.datatransfer.DataFlavor; +/* */ import java.awt.datatransfer.Transferable; +/* */ import java.awt.dnd.DropTarget; +/* */ import java.awt.dnd.DropTargetDragEvent; +/* */ import java.awt.dnd.DropTargetDropEvent; +/* */ import java.awt.dnd.DropTargetEvent; +/* */ import java.awt.dnd.DropTargetListener; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.awt.event.KeyEvent; +/* */ import java.awt.event.KeyListener; +/* */ import java.awt.event.MouseEvent; +/* */ import java.awt.event.MouseListener; +/* */ import java.awt.image.BufferedImage; +/* */ import java.io.File; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ import javax.imageio.ImageIO; +/* */ import javax.swing.AbstractButton; +/* */ import javax.swing.ButtonGroup; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JCheckBox; +/* */ import javax.swing.JCheckBoxMenuItem; +/* */ import javax.swing.JColorChooser; +/* */ import javax.swing.JComboBox; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JFileChooser; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JList; +/* */ import javax.swing.JMenu; +/* */ import javax.swing.JMenuBar; +/* */ import javax.swing.JMenuItem; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JRadioButton; +/* */ import javax.swing.JRadioButtonMenuItem; +/* */ import javax.swing.JScrollPane; +/* */ import javax.swing.JSeparator; +/* */ import javax.swing.JTextArea; +/* */ import javax.swing.JTextField; +/* */ import javax.swing.JToggleButton; +/* */ import javax.swing.JWindow; +/* */ import javax.swing.SwingUtilities; +/* */ import javax.swing.UIManager; +/* */ import utilities.BaseConverter; +/* */ import utilities.DecimalFormatter; +/* */ import utilities.NoFormatter; +/* */ +/* */ public class CalculatorGUI extends JFrame +/* */ implements ActionListener, DropTargetListener, KeyListener, MouseListener +/* */ { +/* */ private static final long serialVersionUID = -7536111096507880724L; +/* */ private static CalculatorGUI currentInstance; +/* 89 */ private String[] props = { "1234567890\\QWERTYUIOP\\ASDFGHJKL\\ZXCVBNM", "none", "none", "none", "full", "false" }; +/* 90 */ private static CalculatorGUI.SplashScreen splash = new CalculatorGUI.SplashScreen(); +/* 91 */ public static String CREDITS = "Modulus v2.0\nBy: Joshua Rahm\nSkyline High School\nLongmont, CO\nEmail: rahm_joshua@digitalagenation.com\nWebpage: http://www.digitalagenation/modulus.html"; +/* 92 */ private Keyboard[] keys = { +/* 93 */ new Keyboard("1234567890\\QWERTYUIOP\\ASDFGHJKL\\ZXCVBNM"), +/* 94 */ new Keyboard(new String[][] { { "7", "8", "9" }, { "4", "5", "6" }, { "1", "2", "3" }, { ".", "0", "Entr" } }, 25, 35, null), +/* 95 */ new Keyboard(new String[][] { { "acos(", "cos(" }, { "asin(", "sin(" }, { "atan(", "tan(" }, { "ln(", "log(" } }, 25, 45, null), +/* 96 */ new Keyboard(":£^%e"), +/* 97 */ new Keyboard("/\\*\\-\\+"), +/* 98 */ new Keyboard("~?|&"), +/* 99 */ new Keyboard("[(|!\\]),_"), +/* 100 */ new Keyboard(new String[][] { { ">=", "<=", ">", "<", "=", " else " }, { " and ", " or ", " xor ", "not(", " if ", " then " } }, 25, 45, null), +/* 101 */ new Keyboard(new String[][] { { "<html>x<sup>2</sup></html>", "√x", "<html>x<sup>3</sup></html>", "<html>x<sup>-1</sup></html>" } }, 25, 35, null), +/* 102 */ new Keyboard(new String[][] { { "Bkspc", "Clear" } }, 25, 45, null), +/* 103 */ new Keyboard(new String[][] { { "ClrHome" } }, 25, 55, null), +/* 104 */ new Keyboard(new String[][] { { "STO ", "STP ", "PUSH ", "POP " }, { "DISP ", "STACK ", "DEL ", "DEC " } }, 25, 55, null) }; +/* */ private DecimalFormatter formatter; +/* 108 */ private boolean controlHeld = false; +/* 109 */ private boolean shiftHeld = false; +/* 110 */ private ArrayList<String> last = new ArrayList(); +/* 111 */ private ArrayList<String> ans = new ArrayList(); +/* 112 */ private int lastIndex = 0; +/* 113 */ private String[] topOpsArr = { "^2", "sqrt(", "^3", "^-1" }; +/* */ +/* 115 */ private JPanel[] panels = { new JPanel(new FlowLayout()), new JPanel(new FlowLayout()), new JPanel(new BorderLayout()) }; +/* 116 */ private JPanel numberPanel = new JPanel(new BorderLayout()); +/* */ +/* 118 */ private JTextArea answerArea = new JTextArea(18, 17); +/* */ +/* 120 */ private JTextField answerField = new JTextField(35); +/* */ private JScrollPane scroll; +/* 123 */ private JMenuBar mainbar = new JMenuBar(); +/* */ +/* 126 */ private Object temp = null; +/* 127 */ private long sysTime = 0L; +/* */ +/* 129 */ private JButton terminate = new JButton("Terminate"); +/* 130 */ private ArrayList<Thread> exec = new ArrayList(); +/* 131 */ private File functions = new File("./functions"); +/* 132 */ private ButtonGroup layout = new ButtonGroup(); +/* */ +/* 134 */ private String[][] map = { +/* 135 */ { "Add", "Subtract", "Multiply", "Divide", "Power", "Shift", "Root", "Sine", "Cosine", "Tangent", "Arcsine", "Arccosine", "Arctangent", "Logarithm", "Greater Than", "Less Than", +/* 136 */ "Greater Than Equal To", "Less Than Equal To", "Equal To", "And", "Or", "Exclusive or", "Not", "if", "then", "else", "Bitwise And", "Bitwise or", "Bitwise Exclusive or", "Bitwise not", +/* 137 */ "x Squared", "x Cubed", "Square Root x", "Inverse of x" }, +/* 138 */ { "+", "-", "*", "/", "^", "e", "?", "sin(", "cos(", "tan(", "asin(", "acos(", "atan(", "log(", ">", "<", ">=", "<=", "=", " and ", " or ", " xor ", "not(", "if( ", " then( ", " else( ", "&", "\\", "?", "~(", +/* 139 */ "^2", "^3", "sqrt(", "^-1" } }; +/* */ +/* 145 */ private Menu[] menus = { +/* 146 */ new Menu("File", new AbstractButton[] { +/* 147 */ new JMenuItem("Close"), +/* 148 */ new JMenuItem("Save") }), +/* 150 */ new Menu("Edit", new AbstractButton[] { +/* 151 */ new JMenuItem("Change Base"), +/* 152 */ new JMenuItem("Convert Base"), +/* 153 */ new JMenuItem("Clear"), +/* 154 */ new JMenuItem("Manage Programs") }), +/* 157 */ new Menu("Calculate", new AbstractButton[] { +/* 158 */ new Menu("Basic Operators", new AbstractButton[] { +/* 159 */ new JMenuItem("Add"), +/* 160 */ new JMenuItem("Subtract"), +/* 161 */ new JMenuItem("Multiply"), +/* 162 */ new JMenuItem("Divide"), +/* 163 */ new JMenuItem("Power"), +/* 164 */ new JMenuItem("Shift"), +/* 165 */ new JMenuItem("Root") }), +/* 167 */ new Menu("Trigometic Operators", new AbstractButton[] { +/* 168 */ new JMenuItem("Sine"), +/* 169 */ new JMenuItem("Cosine"), +/* 170 */ new JMenuItem("Tangent"), +/* 171 */ new JMenuItem("Arccosine"), +/* 172 */ new JMenuItem("Arcsin"), +/* 173 */ new JMenuItem("Arctangent"), +/* 174 */ new JMenuItem("Loagrithm") }), +/* 176 */ new Menu("Boolean Operators", new AbstractButton[] { +/* 177 */ new Menu("Relational Operators", new JComponent[] { +/* 178 */ new JMenuItem("Greater Than"), +/* 179 */ new JMenuItem("Less Than"), +/* 180 */ new JMenuItem("Greater Than Equal To"), +/* 181 */ new JMenuItem("Less Than Equal To"), +/* 182 */ new JMenuItem("Equal To") }), +/* 184 */ new Menu("Logical Operators", new AbstractButton[] { +/* 185 */ new JMenuItem("And"), +/* 186 */ new JMenuItem("Or"), +/* 187 */ new JMenuItem("Exclusive or"), +/* 188 */ new JMenuItem("Not") }), +/* 190 */ new Menu("Flow Operators", new AbstractButton[] { +/* 191 */ new JMenuItem("if"), +/* 192 */ new JMenuItem("then"), +/* 193 */ new JMenuItem("else") }) }), +/* 196 */ new Menu("Bitwise Operators", new AbstractButton[] { +/* 197 */ new JMenuItem("Bitwise And"), +/* 198 */ new JMenuItem("Bitwise or"), +/* 199 */ new JMenuItem("Bitwise Exclusive or"), +/* 200 */ new JMenuItem("Bitwise not") }), +/* 202 */ new Menu("Other Operators", new AbstractButton[] { +/* 203 */ new JMenuItem("x Squared"), +/* 204 */ new JMenuItem("x Cubed"), +/* 205 */ new JMenuItem("Square Root x"), +/* 206 */ new JMenuItem("Inverse of x") }), +/* 208 */ new JCheckBoxMenuItem("Radians") }), +/* 210 */ new Menu("Programming", new JComponent[] { +/* 211 */ new JCheckBoxMenuItem("Toggle Shell Mode"), +/* 212 */ new JMenuItem("Run a Script..."), +/* 213 */ new JMenuItem("Function..."), +/* 214 */ new JMenuItem("Load Library"), +/* 215 */ new JMenuItem("Manage Startup Libraries"), +/* 216 */ new JSeparator(), +/* 217 */ new JSeparator(), +/* 218 */ new JMenuItem("View Stacks"), +/* 219 */ new JMenuItem("View Hold Variable"), +/* 220 */ new JSeparator(), +/* 221 */ new JSeparator(), +/* 222 */ new JMenuItem("Run in Terminal...") }), +/* 224 */ new Menu("Properties", new JComponent[] { +/* 225 */ new JMenuItem("Change Color"), +/* 226 */ new JMenuItem("Change Keyboard Style"), +/* 227 */ new JCheckBoxMenuItem("Always Show Commands", true), +/* 228 */ new JCheckBoxMenuItem("Auto Complete", true), +/* 229 */ new JSeparator(), +/* 230 */ new JSeparator(), +/* 231 */ new JMenuItem("Set Formatting") }), +/* 233 */ new Menu("View", new JComponent[] { +/* 234 */ new JCheckBox("Always On Top"), +/* 235 */ new JSeparator(), +/* 236 */ new JSeparator(), +/* 237 */ new JRadioButtonMenuItem("Standard"), +/* 238 */ new JRadioButtonMenuItem("Scientific"), +/* 239 */ new JRadioButtonMenuItem("Boolean"), +/* 240 */ new JRadioButtonMenuItem("Bitwise"), +/* 241 */ new JRadioButtonMenuItem("Full Calc", true), +/* 242 */ new JSeparator(), +/* 243 */ new JSeparator(), +/* 244 */ new JMenuItem("View Graph"), +/* 245 */ new JMenuItem("View 3D Graph") }) }; +/* */ +/* 248 */ private JPanel[] subPanels = { +/* 249 */ new JPanel(new FlowLayout()), new JPanel(new FlowLayout()), new JPanel(new FlowLayout()), new JPanel(new BorderLayout()) }; +/* */ +/* 251 */ private Approvable[] approvables = { +/* 252 */ new Approvable() { +/* */ public void onApprove(File file) { +/* 254 */ CalculatorGUI.silentPrint("------------------------------\n"); +/* 255 */ CalculatorGUI.silentPrint("Started Running File: " + file + " On new Thread\n"); +/* 256 */ CalculatorGUI.silentPrint("------------------------------\n"); +/* */ Thread run; +/* 258 */ CalculatorGUI.this.exec.add(run = new SilentThread(new CalculatorGUI.Run(CalculatorGUI.this, file), file.toString())); +/* 259 */ run.start(); +/* 260 */ CalculatorGUI.this.props[2] = file.getParent().toString(); +/* 261 */ CalculatorGUI.this.writeProperties(); +/* */ } +/* */ +/* */ public void onCancel() +/* */ { +/* */ } +/* */ } +/* */ , new Approvable() { +/* */ public void onApprove(File file) { +/* 267 */ CalculatorGUI.silentPrint("------------------------------\n"); +/* 268 */ CalculatorGUI.silentPrint("Loaded " + file); +/* 269 */ CalculatorGUI.silentPrint("------------------------------\n"); +/* */ try { +/* 271 */ ControlPanel.load(file.toString()); +/* */ } +/* */ catch (Exception e) { +/* 274 */ e.printStackTrace(); +/* */ } +/* 276 */ CalculatorGUI.this.props[3] = file.getParent().toString(); +/* 277 */ CalculatorGUI.this.writeProperties(); +/* */ } +/* */ +/* */ public void onCancel() +/* */ { +/* */ } +/* */ } +/* */ , new Approvable() { +/* */ public void onApprove(File file) { +/* 283 */ if ((System.out instanceof ModulusOutputStream)) +/* 284 */ ((ModulusOutputStream)System.out).flushTo(file); } +/* */ public void onCancel() { } } }; +/* */ +/* 449 */ private JButton[] hold = { new JButton("OK"), new JButton("OK"), new JButton("OK"), new JButton("OK") }; +/* 450 */ private Prompt[] prompt = { new Prompt(this, "Change Base", new JComboBox[] { new BaseComboBox(9) }, this, this.hold[0]), +/* 451 */ new Prompt(this, "Layouts", new JComponent[] { new JRadioButton("Qwerty"), +/* 452 */ new JRadioButton("Dvorak"), +/* 453 */ new JRadioButton("Alphabetical"), +/* 454 */ new JRadioButton("Other"), +/* 455 */ new JTextField("Enter other (\\ = new line)") }, this, this.hold[1]), +/* 456 */ new Prompt(this, "Functions", new JComponent[] { new ActionList(ControlPanel.getFunctions(), this), +/* 457 */ new JTextField("", 10) }, this, this.hold[2]), +/* 458 */ new Prompt(this, "Convert Bases", new JComponent[] { new BaseComboBox(9), new JTextField("", 7), new JLabel("To"), new BaseComboBox(9) }, this, this.hold[3]), +/* 459 */ new Prompt(this, "Hold Stack:", new JComponent[] { new JList() }, this, new JButton()) }; +/* */ private ButtonGroup keyboards; +/* */ +/* 294 */ public CalculatorGUI() { currentInstance = this; +/* 295 */ this.answerArea.setPreferredSize(new Dimension(100, 200)); +/* 296 */ this.formatter = new NoFormatter(5); +/* */ try { +/* 298 */ UIManager.setLookAndFeel( +/* 299 */ UIManager.getSystemLookAndFeelClassName()); +/* */ } +/* */ catch (Exception e) +/* */ { +/* 303 */ e.printStackTrace(); +/* */ } +/* 305 */ this.keys[5].get(2).setText("\\"); +/* */ +/* 307 */ this.exec.add(null); +/* 308 */ this.last.add(""); +/* 309 */ this.ans.add(""); +/* */ +/* 318 */ readProperties(); +/* */ try +/* */ { +/* 321 */ if (this.props[2].equals("none")) this.props[2] = (new File(".").getCanonicalPath().toString() + "/functions"); +/* 322 */ if (this.props[3].equals("none")) this.props[3] = (new File(".").getCanonicalPath().toString() + "/programs"); +/* */ } +/* */ catch (Exception e) +/* */ { +/* 325 */ e.printStackTrace(); +/* */ } +/* */ +/* 331 */ this.layout.add((AbstractButton)this.menus[5].get(3)); +/* 332 */ this.layout.add((AbstractButton)this.menus[5].get(4)); +/* 333 */ this.layout.add((AbstractButton)this.menus[5].get(5)); +/* 334 */ this.layout.add((AbstractButton)this.menus[5].get(6)); +/* 335 */ this.layout.add((AbstractButton)this.menus[5].get(7)); +/* */ try +/* */ { +/* 338 */ ScriptReader.runScript(this.functions.toString() + "/functionsLOD.prop"); +/* */ } catch (Exception e) { +/* 340 */ e.printStackTrace(); +/* */ } +/* 342 */ setTitle("Modulus v2.0"); +/* */ +/* 344 */ this.keyboards = new ButtonGroup(); +/* 345 */ this.keyboards.add((AbstractButton)this.prompt[1].get(0)); +/* 346 */ this.keyboards.add((AbstractButton)this.prompt[1].get(1)); +/* 347 */ this.keyboards.add((AbstractButton)this.prompt[1].get(2)); +/* 348 */ this.keyboards.add((AbstractButton)this.prompt[1].get(3)); +/* */ +/* 350 */ for (int i = 0; i < this.menus.length; i++) { +/* 351 */ this.mainbar.add(this.menus[i]); +/* 352 */ this.menus[i].addActionListener(this); +/* */ } +/* 354 */ for (int i = 0; i < this.keys.length; i++) this.keys[i].addActionListener(this); +/* */ +/* 356 */ setLayout(new BorderLayout()); +/* 357 */ add(this.panels[0], "Center"); +/* */ +/* 359 */ add(this.panels[2], "West"); +/* */ +/* 361 */ this.scroll = new JScrollPane(this.answerArea); +/* 362 */ this.scroll.setVerticalScrollBarPolicy(22); +/* 363 */ this.panels[2].add(this.scroll, "Center"); +/* 364 */ this.panels[2].add(this.terminate, "South"); +/* 365 */ this.terminate.addActionListener(this); +/* 366 */ this.panels[1].add(this.keys[10]); +/* 367 */ this.panels[1].add(this.answerField); +/* 368 */ this.panels[1].add(this.keys[9]); +/* 369 */ this.answerArea.setEditable(false); +/* */ +/* 371 */ ControlPanel.setComponent(this.answerArea); +/* */ +/* 373 */ this.numberPanel.add(this.keys[1], "Center"); +/* 374 */ this.numberPanel.add(this.keys[4], "East"); +/* */ +/* 376 */ this.panels[0].setLayout(new BorderLayout()); +/* 377 */ this.panels[0].add(this.subPanels[0], "Center"); +/* 378 */ this.panels[0].add(this.subPanels[3], "North"); +/* */ +/* 380 */ this.subPanels[3].add(this.subPanels[1], "Center"); +/* 381 */ this.subPanels[3].add(this.panels[1], "North"); +/* */ +/* 383 */ this.panels[0].add(this.subPanels[2], "South"); +/* */ +/* 385 */ this.subPanels[0].add(this.keys[2]); +/* 386 */ this.subPanels[0].add(this.numberPanel); +/* 387 */ this.subPanels[0].add(this.keys[0]); +/* */ +/* 389 */ this.subPanels[1].add(this.keys[3]); +/* 390 */ this.subPanels[1].add(this.keys[8]); +/* 391 */ this.subPanels[1].add(this.keys[5]); +/* */ +/* 394 */ this.subPanels[2].add(this.keys[6]); +/* 395 */ this.subPanels[2].add(this.keys[7]); +/* 396 */ this.subPanels[2].add(this.keys[11]); +/* */ +/* 399 */ setJMenuBar(this.mainbar); +/* 400 */ new DropTarget(this.answerArea, this); +/* 401 */ pack(); +/* 402 */ setMinimumSize(getSize()); +/* 403 */ setDefaultCloseOperation(3); +/* 404 */ this.answerField.addKeyListener(this); +/* */ +/* 407 */ SwingUtilities.updateComponentTreeUI(this); +/* */ +/* 409 */ applyProps(); +/* 410 */ Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); +/* 411 */ int x = (dim.width - getSize().width) / 2; +/* 412 */ int y = (dim.height - getSize().height) / 2; +/* 413 */ setLocation(x, y); +/* */ +/* 415 */ setVisible(true); +/* 416 */ setIconImage(Toolkit.getDefaultToolkit().getImage("modulus_symbol.png")); +/* */ +/* 418 */ System.setOut(new ModulusOutputStream(this.answerArea, System.out, true)); +/* 419 */ splash.setVisible(false); +/* 420 */ splash = null; } +/* */ +/* */ public void addListeners(Container x) +/* */ { +/* 424 */ Component[] arr = x.getComponents(); +/* 425 */ for (int i = 0; i < arr.length; i++) { +/* 426 */ if (((arr[i] instanceof Container)) || (arr[i].getClass() == JMenu.class)) addListeners((Container)arr[i]); +/* 427 */ if (AbstractButton.class.isInstance(arr[i])) +/* 428 */ ((AbstractButton)arr[i]).addActionListener(this); +/* */ } +/* */ } +/* */ +/* */ public static void main(String[] args) +/* */ { +/* 439 */ ModulusThreads.addThread("Splash Screen", new CalculatorGUI.SplashThread(null)); +/* */ try { +/* 441 */ Thread.sleep(1000L); +/* */ } +/* */ catch (InterruptedException e) { +/* 444 */ e.printStackTrace(); +/* */ } +/* 446 */ ModulusThreads.addThread("Modulus Calculator", getThread()); +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) +/* */ { +/* 463 */ if (Math.abs(System.currentTimeMillis() - this.sysTime) < 400L) return; +/* 464 */ this.sysTime = System.currentTimeMillis(); +/* 465 */ e.getSource(); +/* 466 */ this.keys[11].setVisible((((AbstractButton)this.menus[3].get(0)).isSelected()) || ( +/* 467 */ (((AbstractButton)this.menus[4].get(2)).isSelected()) && (((AbstractButton)this.menus[5].get(7)).isSelected()))); +/* 468 */ if (e.getSource() == this.menus[3].get(0)) { +/* 469 */ silentPrint("Shell Mode set to " + ((AbstractButton)this.menus[3].get(0)).isSelected() + "\n"); +/* 470 */ silentPrint("------------------------------\n"); +/* */ } +/* 472 */ if (e.getSource() == this.menus[0].get(0)) { +/* 473 */ System.exit(1); +/* */ } +/* 475 */ else if (e.getSource() == this.menus[0].get(1)) { +/* */ try { +/* 477 */ ModulusFileChooser fc = new ModulusFileChooser(this.approvables[2], "", new MFileFilter[] { +/* 478 */ new MFileFilter(new String[] { ".txt" }, "Text Files") }); +/* */ +/* 480 */ fc.promptDialog("Save"); +/* */ } +/* */ catch (Exception c) { +/* 483 */ c.printStackTrace(); +/* 484 */ this.answerArea.setText("Error while parsing file"); +/* */ } +/* */ } +/* */ +/* 488 */ if (e.getSource() == this.terminate) { +/* 489 */ for (Thread i : this.exec) if (i != null) i.interrupt(); +/* 490 */ this.exec = new ArrayList(); +/* 491 */ this.exec.add(null); +/* */ } +/* 493 */ else if (e.getSource() == this.menus[4].get(0)) { +/* 494 */ Color newColor = JColorChooser.showDialog(this, "Choose a button color: ", new Color(0, 0, 255)); +/* 495 */ changeColor(newColor); +/* */ } +/* 497 */ else if (e.getSource() == this.keys[1].get(11)) { +/* 498 */ if (this.answerField.getText().length() > 0) +/* */ { +/* 500 */ this.last.add(this.lastIndex + 1, this.answerField.getText()); +/* 501 */ if (this.last.size() >= 100) this.last.remove(100); +/* 502 */ if (((AbstractButton)this.menus[3].get(0)).isSelected()) { +/* */ try { +/* 504 */ silentPrint(">>>"); +/* 505 */ ControlPanel.parseLine(this.answerField.getText()); +/* 506 */ silentPrint(this.answerField.getText() + "\n"); +/* */ } catch (Exception localException1) { +/* */ } +/* 509 */ this.answerField.setText(""); +/* */ } +/* */ else { +/* 512 */ System.out.println(this.answerField.getText()); +/* 513 */ new AppendingThread(this.answerField.getText(), this.lastIndex, this.ans, this.formatter).start(); +/* 514 */ this.answerField.setText(""); +/* */ } +/* */ } +/* */ } +/* 518 */ else if (e.getSource() == this.menus[3].get(1)) { +/* 519 */ ModulusFileChooser fc = new ModulusFileChooser(this.approvables[0], this.props[2], new MFileFilter[] { +/* 520 */ new MFileFilter(new String[] { ".calc", ".marc" }, "All Accepted Scripts (.calc, .marc)"), +/* 521 */ new MFileFilter(new String[] { ".calc" }, "Modulus Calc Scripts (.calc)"), +/* 522 */ new MFileFilter(new String[] { ".marc" }, "Marc Bytecode (.marc)") }); +/* */ +/* 524 */ fc.promptDialog("Run"); +/* */ } +/* 526 */ else if (e.getSource() == this.menus[5].get(10)) { +/* 527 */ ModulusThreads.addThread("2DGraph", GraphFrame.getThread()); +/* */ } +/* 529 */ else if (e.getSource() == this.menus[5].get(11)) { +/* 530 */ ModulusThreads.addThread("3DGraph", M3DGraphWindow.getThread()); +/* */ } +/* 532 */ else if (e.getSource() == this.menus[3].get(3)) { +/* */ try { +/* 534 */ ModulusFileChooser fc = new ModulusFileChooser(this.approvables[1], this.props[2], new MFileFilter[] { +/* 535 */ new MFileFilter(new String[] { ".calc", ".marc", ".class" }, "All Accepted Libraries (.calc, .marc, .class)"), +/* 536 */ new MFileFilter(new String[] { ".calc" }, "Modulus Calc Scripts (.calc)"), +/* 537 */ new MFileFilter(new String[] { ".marc" }, "Marc Bytecode (.marc"), +/* 538 */ new MFileFilter(new String[] { ".class" }, "Java Class (.class)") }); +/* */ +/* 540 */ fc.promptDialog("Load"); +/* */ } +/* */ catch (Exception c) { +/* 543 */ c.printStackTrace(); +/* 544 */ this.answerArea.setText("Error while parsing file"); +/* */ } +/* */ +/* */ } +/* 548 */ else if (e.getSource() == this.keys[10].get(0)) { +/* 549 */ this.answerArea.setText(""); +/* */ } +/* 551 */ else if (e.getSource() == this.keys[10].get(0)) { +/* 552 */ this.answerArea.setText(""); +/* */ } +/* 554 */ else if (e.getSource() == this.keys[9].get(0)) { +/* 555 */ if (this.answerField.getText().length() > 0) +/* 556 */ this.answerField.setText(this.answerField.getText().substring(0, this.answerField.getText().length() - 1)); +/* */ } +/* 558 */ else if (e.getSource() == this.keys[9].get(1)) { +/* 559 */ this.answerField.setText(""); +/* */ } +/* 561 */ else if (e.getSource() == this.menus[1].get(0)) { +/* 562 */ this.hold[0] = new JButton("OK"); +/* 563 */ this.prompt[0] = new Prompt(this, "Change Base", new JComboBox[] { new BaseComboBox(9) }, this, this.hold[0]); +/* 564 */ this.prompt[0].setVisible(true); +/* */ } +/* 566 */ else if (e.getSource() == this.menus[4].get(1)) { +/* 567 */ this.prompt[1].setVisible(true); +/* */ } +/* 569 */ else if (e.getSource() == this.menus[1].get(1)) { +/* 570 */ this.hold[3] = new JButton("OK"); +/* 571 */ this.prompt[3] = new Prompt(this, "Convert Bases", new JComponent[] { new BaseComboBox(9), new JTextField("", 7), new JLabel("To"), new BaseComboBox(9) }, this, this.hold[3]); +/* 572 */ this.prompt[3].setVisible(true); +/* */ } +/* 574 */ else if (e.getSource() == this.menus[3].get(4)) { +/* 575 */ ControlPanel.reset(); +/* */ +/* 577 */ FileChanger x = new FileChanger(this.functions.toString()); +/* 578 */ x.setVisible(true); +/* */ } +/* 581 */ else if (e.getSource() == this.menus[3].get(2)) { +/* 582 */ this.temp = new ActionList(ControlPanel.getFunctions(), this); +/* 583 */ JScrollPane pane = new JScrollPane((JComponent)this.temp, 22, 30); +/* 584 */ JPanel layout = new JPanel(new BorderLayout()); +/* 585 */ pane.setPreferredSize(new Dimension(200, 100)); +/* 586 */ layout.add(pane, "Center"); +/* 587 */ this.prompt[2] = new Prompt(this, "Functions", new JComponent[] { layout, +/* 588 */ new JTextField("", 10) }, this, this.hold[2]); +/* 589 */ this.prompt[2].setVisible(true); +/* */ } +/* 591 */ else if (e.getSource() == this.menus[3].get(8)) { +/* 592 */ JScrollPane pane = new JScrollPane(new JList(ControlPanel.getCurrentHold().toArray()), 22, 30); +/* 593 */ JPanel layout = new JPanel(new BorderLayout()); +/* 594 */ pane.setPreferredSize(new Dimension(75, 100)); +/* 595 */ layout.add(pane, "Center"); +/* 596 */ JButton x = new JButton("OK"); +/* */ +/* 598 */ this.prompt[4] = new Prompt(this, "Hold Stack:", new JPanel[] { layout }, this, x); +/* 599 */ this.prompt[4].setVisible(true); +/* */ } +/* 601 */ else if (e.getSource() == this.menus[3].get(7)) { +/* 602 */ JScrollPane[] pane = new JScrollPane[26]; +/* 603 */ JPanel[] panes = new JPanel[26]; +/* 604 */ JPanel layout = new JPanel(new FlowLayout()); +/* */ +/* 606 */ for (int i = 0; i < pane.length; i++) { +/* 607 */ panes[i] = new JPanel(new BorderLayout()); +/* 608 */ pane[i] = new JScrollPane(new JList(ControlPanel.getStacks()[i].toArray())); +/* 609 */ pane[i].setPreferredSize(new Dimension(50, 75)); +/* 610 */ panes[i].add(new JLabel((char)(i + 65)), "North"); +/* 611 */ panes[i].add(pane[i], "South"); +/* 612 */ layout.add(panes[i]); +/* */ } +/* 614 */ JScrollPane finalPane = new JScrollPane(layout); +/* 615 */ finalPane.setPreferredSize(new Dimension(350, 100)); +/* 616 */ JButton x = new JButton("OK"); +/* */ +/* 618 */ Prompt prompt = new Prompt(this, "Variable Stacks:", new JScrollPane[] { finalPane }, this, x); +/* 619 */ prompt.setVisible(true); +/* */ } +/* 621 */ else if (e.getSource().equals(this.hold[0])) { +/* 622 */ Calculator.setBase(((JComboBox)this.prompt[0].get(0)).getSelectedIndex() + 1); +/* 623 */ if (Calculator.getBase() != 10) { +/* 624 */ this.menus[3].get(2).setEnabled(false); +/* 625 */ ((AbstractButton)this.menus[3].get(2)).setText("Function... ( Base needed to be 10)"); +/* */ } +/* */ else { +/* 628 */ this.menus[3].get(2).setEnabled(true); +/* 629 */ ((AbstractButton)this.menus[3].get(2)).setText("Function..."); +/* */ } +/* */ } +/* 632 */ else if (e.getSource().equals(this.hold[1])) { +/* 633 */ if (((AbstractButton)this.prompt[1].get(0)).isSelected()) +/* 634 */ this.keys[0].reset("1234567890\\QWERTYUIOP\\ASDFGHJKL\\ZXCVBNM"); +/* 635 */ else if (((AbstractButton)this.prompt[1].get(1)).isSelected()) +/* 636 */ this.keys[0].reset("1234567890\\PYFGCRL\\AOEUIDHTNS\\QJKXBMWVZ"); +/* 637 */ else if (((AbstractButton)this.prompt[1].get(2)).isSelected()) +/* 638 */ this.keys[0].reset("0123456789\\ABCDEFGHIJ\\KLMNOPQRST\\UVWXYZ"); +/* 639 */ else this.keys[0].reset(((JTextField)this.prompt[1].get(4)).getText()); +/* 640 */ this.keys[0].addActionListener(this); +/* 641 */ this.props[0] = this.keys[0].getString(); +/* 642 */ writeProperties(); +/* */ } +/* 644 */ else if (e.getSource().equals(this.menus[4].get(6))) { +/* 645 */ new FormatFrame(this, this.formatter).setVisible(true); +/* */ } +/* 647 */ else if (e.getSource() == this.temp) { +/* 648 */ String text = ((ActionList)this.temp).getSelected().getText(); +/* 649 */ if (!text.contains("(")) text = text + "("; +/* 650 */ ((JTextField)this.prompt[2].get(1)).setText(text); +/* */ } +/* 652 */ else if (e.getSource().equals(this.hold[2])) { +/* */ try { +/* 654 */ System.out.println(ScriptReader.preformFunction( +/* 655 */ ((JTextField)this.prompt[2].get(1)).getText(), +/* 656 */ ControlPanel.getFiles()[((ActionList)this.temp).getSelectedIndex()].toString(), +/* 657 */ new Object[] { ControlPanel.getClasses().get(((ActionList)this.temp).getSelectedIndex()) })); +/* */ } +/* */ catch (Exception c) +/* */ { +/* 661 */ System.err.println(c); +/* 662 */ c.printStackTrace(); +/* 663 */ if (!c.getMessage().equals("The Parameters do not match")) return; +/* 664 */ }new AlertBox("The parameters of " + ((JTextField)this.prompt[2].get(1)).getText() + " cannot be applied, the parameters must match", "Parameter Exception"); +/* */ } +/* 668 */ else if (e.getSource().equals(this.hold[3])) { +/* */ try { +/* 670 */ System.out.println(((JTextField)this.prompt[3].get(1)).getText() + " base " + (((JComboBox)this.prompt[3].get(0)).getSelectedIndex() + 1) + " to base " + (((JComboBox)this.prompt[3].get(3)).getSelectedIndex() + 1)); +/* 671 */ System.out.println(this.answerArea.getText() + BaseConverter.convertFromDecimal(BaseConverter.convertToDecimal(((JTextField)this.prompt[3].get(1)).getText(), ((JComboBox)this.prompt[3].get(0)).getSelectedIndex() + 1), ((JComboBox)this.prompt[3].get(3)).getSelectedIndex() + 1)); +/* */ } +/* */ catch (Exception c) { +/* 674 */ System.err.println(c); +/* 675 */ c.printStackTrace(); +/* */ } +/* */ } +/* 678 */ else if (this.keys[8].contains(e.getSource())) { +/* 679 */ this.answerField.setText(this.answerField.getText() + this.topOpsArr[this.keys[8].indexOf(e.getSource())]); +/* */ } +/* 681 */ else if (e.getSource() == this.menus[2].get(5)) { +/* 682 */ Calculator.setRadians(((AbstractButton)this.menus[2].get(5)).isSelected()); +/* */ } +/* 684 */ else if (e.getSource() == this.menus[5].get(3)) { +/* 685 */ changeSize("standard"); +/* */ } +/* 687 */ else if (e.getSource() == this.menus[5].get(4)) { +/* 688 */ changeSize("scientific"); +/* */ } +/* 690 */ else if (e.getSource() == this.menus[5].get(5)) { +/* 691 */ changeSize("boolean"); +/* */ } +/* 693 */ else if (e.getSource() == this.menus[5].get(6)) { +/* 694 */ changeSize("bitwise"); +/* */ } +/* 696 */ else if (e.getSource() == this.menus[5].get(7)) { +/* 697 */ changeSize("full"); +/* */ } +/* 699 */ else if (e.getSource() == this.menus[3].get(11)) { +/* 700 */ File file = null; +/* 701 */ JFileChooser fc = new JFileChooser(this.props[2]); +/* 702 */ int returnVal = fc.showOpenDialog(this); +/* */ +/* 704 */ if (returnVal == 0) { +/* 705 */ file = fc.getSelectedFile(); +/* */ +/* 707 */ this.props[2] = file.getParent().toString(); +/* 708 */ writeProperties(); +/* */ } +/* 710 */ ProcessBuilder run = new ProcessBuilder(new String[] { "calcp", file.toString() }); +/* */ try { +/* 712 */ run.start(); +/* */ } +/* */ catch (IOException c) { +/* 715 */ this.answerArea.setText("Process could not start"); +/* */ } +/* */ +/* */ } +/* 719 */ else if (e.getSource().getClass() == JMenuItem.class) { +/* 720 */ int i = indexOf(this.map[0], ((JMenuItem)e.getSource()).getText()); +/* 721 */ if (i < 0) return; +/* 722 */ String txt = this.map[1][i]; +/* 723 */ if (txt.endsWith("(")) this.answerField.setText(txt + this.answerField.getText() + ")"); +/* 724 */ else if (txt.startsWith(")")) this.answerField.setText("(" + this.answerField.getText() + txt); else +/* 725 */ this.answerField.setText("(" + this.answerField.getText() + ")" + txt); +/* */ } +/* 727 */ else if (e.getSource().getClass() == JButton.class) { +/* 728 */ this.answerField.setText(this.answerField.getText() + ((JButton)e.getSource()).getText()); +/* */ } +/* 730 */ else if (e.getSource() == this.menus[5].get(0)) { +/* 731 */ setAlwaysOnTop(((AbstractButton)this.menus[5].get(0)).isSelected()); +/* */ } +/* */ } +/* */ +/* */ public void changeSize(String size) { +/* 736 */ if (size.equals("standard")) { +/* 737 */ this.keys[0].setVisible(false); +/* 738 */ this.keys[1].setVisible(true); +/* 739 */ this.keys[2].setVisible(false); +/* 740 */ this.keys[3].setVisible(true); +/* 741 */ this.keys[4].setVisible(true); +/* 742 */ this.keys[5].setVisible(false); +/* 743 */ this.keys[6].setVisible(false); +/* 744 */ this.keys[7].setVisible(false); +/* 745 */ this.keys[8].setVisible(false); +/* 746 */ this.keys[9].setVisible(false); +/* 747 */ this.keys[10].setVisible(true); +/* 748 */ this.keys[11].setVisible(false); +/* 749 */ setMinimumSize(new Dimension(0, 0)); +/* 750 */ this.answerField.setColumns(17); +/* 751 */ this.answerArea.setRows(9); +/* 752 */ this.answerArea.setColumns(17); +/* 753 */ pack(); +/* 754 */ setMinimumSize(getSize()); +/* 755 */ ((AbstractButton)this.menus[5].get(3)).setSelected(true); +/* */ } +/* 757 */ else if (size.equals("scientific")) { +/* 758 */ this.keys[0].setVisible(false); +/* 759 */ this.keys[1].setVisible(true); +/* 760 */ this.keys[2].setVisible(true); +/* 761 */ this.keys[3].setVisible(true); +/* 762 */ this.keys[4].setVisible(true); +/* 763 */ this.keys[5].setVisible(false); +/* 764 */ this.keys[6].setVisible(false); +/* 765 */ this.keys[7].setVisible(false); +/* 766 */ this.keys[8].setVisible(true); +/* 767 */ this.keys[9].setVisible(false); +/* 768 */ this.keys[10].setVisible(true); +/* 769 */ this.keys[11].setVisible(false); +/* 770 */ setMinimumSize(new Dimension(0, 0)); +/* 771 */ this.answerField.setColumns(20); +/* 772 */ this.answerArea.setRows(9); +/* 773 */ this.answerArea.setColumns(20); +/* 774 */ pack(); +/* 775 */ setMinimumSize(getSize()); +/* 776 */ ((AbstractButton)this.menus[5].get(4)).setSelected(true); +/* */ } +/* 778 */ else if (size.equals("boolean")) { +/* 779 */ this.keys[0].setVisible(false); +/* 780 */ this.keys[1].setVisible(true); +/* 781 */ this.keys[2].setVisible(true); +/* 782 */ this.keys[3].setVisible(true); +/* 783 */ this.keys[4].setVisible(true); +/* 784 */ this.keys[5].setVisible(false); +/* 785 */ this.keys[6].setVisible(false); +/* 786 */ this.keys[7].setVisible(true); +/* 787 */ this.keys[8].setVisible(true); +/* 788 */ this.keys[9].setVisible(false); +/* 789 */ this.keys[10].setVisible(true); +/* 790 */ this.keys[11].setVisible(false); +/* 791 */ setMinimumSize(new Dimension(0, 0)); +/* 792 */ this.answerField.setColumns(20); +/* 793 */ this.answerArea.setRows(9); +/* 794 */ this.answerArea.setColumns(20); +/* 795 */ pack(); +/* 796 */ setMinimumSize(getSize()); +/* 797 */ ((AbstractButton)this.menus[5].get(5)).setSelected(true); +/* */ } +/* 799 */ else if (size.equals("bitwise")) { +/* 800 */ this.keys[0].setVisible(false); +/* 801 */ this.keys[1].setVisible(true); +/* 802 */ this.keys[2].setVisible(true); +/* 803 */ this.keys[3].setVisible(true); +/* 804 */ this.keys[4].setVisible(true); +/* 805 */ this.keys[5].setVisible(true); +/* 806 */ this.keys[6].setVisible(false); +/* 807 */ this.keys[7].setVisible(true); +/* 808 */ this.keys[8].setVisible(true); +/* 809 */ this.keys[9].setVisible(false); +/* 810 */ this.keys[10].setVisible(true); +/* 811 */ this.keys[11].setVisible(false); +/* 812 */ setMinimumSize(new Dimension(0, 0)); +/* 813 */ this.answerField.setColumns(20); +/* 814 */ this.answerArea.setRows(9); +/* 815 */ this.answerArea.setColumns(20); +/* 816 */ pack(); +/* 817 */ setMinimumSize(getSize()); +/* 818 */ ((AbstractButton)this.menus[5].get(6)).setSelected(true); +/* */ } +/* 820 */ else if (size.equals("full")) { +/* 821 */ this.keys[0].setVisible(true); +/* 822 */ this.keys[1].setVisible(true); +/* 823 */ this.keys[2].setVisible(true); +/* 824 */ this.keys[3].setVisible(true); +/* 825 */ this.keys[4].setVisible(true); +/* 826 */ this.keys[5].setVisible(true); +/* 827 */ this.keys[6].setVisible(true); +/* 828 */ this.keys[7].setVisible(true); +/* 829 */ this.keys[8].setVisible(true); +/* 830 */ this.keys[9].setVisible(true); +/* 831 */ this.keys[10].setVisible(true); +/* 832 */ this.keys[11].setVisible(true); +/* 833 */ setMinimumSize(new Dimension(0, 0)); +/* 834 */ this.answerField.setColumns(35); +/* 835 */ this.answerArea.setRows(16); +/* 836 */ this.answerArea.setColumns(25); +/* 837 */ pack(); +/* 838 */ setMinimumSize(getSize()); +/* 839 */ ((AbstractButton)this.menus[5].get(7)).setSelected(true); +/* */ } +/* */ +/* 842 */ this.props[4] = size; +/* */ } +/* */ public void changeColor(Color newColor) { +/* 845 */ this.props[1] = (BaseConverter.convertFromDecimal(newColor.getRed(), 16) + BaseConverter.convertFromDecimal(newColor.getGreen(), 16) + BaseConverter.convertFromDecimal(newColor.getBlue(), 16)); +/* 846 */ for (int i = 0; i < this.keys.length; i++) this.keys[i].setColor(newColor); +/* 847 */ writeProperties(); +/* */ } +/* */ public String fill(int x) { +/* 850 */ String ret = ""; +/* 851 */ for (int i = 0; i < x; i++) ret = ret + " "; +/* 852 */ return ret; +/* */ } +/* */ public boolean contains(Container x, Object o) { +/* 855 */ Component[] comps = x.getComponents(); +/* 856 */ for (Component i : comps) if (i == o) return true; +/* 857 */ return false; +/* */ } +/* */ public boolean keyboardsContains(Object o) { +/* 860 */ for (int i = 0; i < this.keys.length; i++) if (this.keys[i].contains(o)) return true; +/* 861 */ return false; +/* */ } +/* */ public void load() { +/* 864 */ for (File x : this.functions.listFiles()) +/* */ try { +/* 866 */ ControlPanel.load(x.toString()); +/* */ } catch (Exception localException) { +/* */ } +/* */ } +/* */ +/* */ private int indexOf(Object[] args, Object o) { +/* 872 */ for (int i = 0; i < args.length; i++) if (args[i].equals(o)) return i; +/* 873 */ return -1; +/* */ } +/* */ public void readProperties() { +/* 876 */ this.props = new PropertiesReader("./properties/properties.prop").readProperties(); +/* 877 */ applyProps(); +/* */ } +/* */ public void writeProperties() { +/* 880 */ new PropertiesReader("./properties/properties.prop").writeProperties(this.props); +/* */ } +/* */ public void applyProps() { +/* 883 */ if (!this.keys[0].getString().equals( +/* 884 */ this.props[0])) +/* */ { +/* 886 */ this.keys[0].reset(this.props[0]); +/* */ } +/* 888 */ changeSize(this.props[4]); +/* 889 */ changeColor(new Color((int)BaseConverter.convertToDecimal(this.props[1], 16))); +/* 890 */ setAlwaysOnTop(Boolean.parseBoolean(this.props[5])); +/* */ } +/* */ +/* */ public void dragEnter(DropTargetDragEvent dtde) +/* */ { +/* */ } +/* */ +/* */ public void dragExit(DropTargetEvent dte) +/* */ { +/* */ } +/* */ +/* */ public void dragOver(DropTargetDragEvent dtde) +/* */ { +/* */ } +/* */ +/* */ public void dropActionChanged(DropTargetDragEvent dtde) { +/* */ } +/* */ +/* */ public void drop(DropTargetDropEvent dtde) { +/* */ try { +/* 910 */ Transferable tr = dtde.getTransferable(); +/* 911 */ DataFlavor[] flavors = tr.getTransferDataFlavors(); +/* 912 */ for (int i = 0; i < flavors.length; i++) +/* 913 */ if (flavors[i].isFlavorJavaFileListType()) { +/* 914 */ dtde.acceptDrop(3); +/* */ +/* 916 */ List list = (List)tr.getTransferData(flavors[i]); +/* 917 */ for (int j = 0; j < list.size(); j++) { +/* 918 */ File file = new File(list.get(j).toString()); +/* */ Thread run; +/* 920 */ this.exec.set(0, run = new Thread(new CalculatorGUI.Run(file))); +/* 921 */ run.start(); +/* 922 */ this.props[2] = file.getParent().toString(); +/* 923 */ writeProperties(); +/* */ } +/* 925 */ dtde.dropComplete(true); +/* 926 */ return; +/* */ } +/* */ } catch (Exception e) { +/* 929 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void keyTyped(KeyEvent e) { +/* */ } +/* */ +/* */ public void keyPressed(KeyEvent e) { +/* 937 */ if (e.getKeyCode() == 17) this.controlHeld = true; +/* 938 */ if (e.getKeyCode() == 16) this.shiftHeld = true; +/* */ } +/* */ +/* */ public void keyReleased(KeyEvent e) +/* */ { +/* 944 */ if (e.getKeyCode() == 17) this.controlHeld = false; +/* 945 */ if (e.getKeyCode() == 16) this.shiftHeld = false; +/* 946 */ if (e.getSource() == this.answerField) { +/* 947 */ if ((((AbstractButton)this.menus[4].get(3)).isSelected()) && ( +/* 948 */ (contains((char)e.getKeyCode(), ",./\\[/*-+".toCharArray())) || ((this.shiftHeld) && (contains((char)e.getKeyCode(), "56789;,./\\=".toCharArray()))))) { +/* */ String app; +/* */ try { +/* 951 */ app = (String)this.ans.get(this.lastIndex + 1); +/* */ } +/* */ catch (IndexOutOfBoundsException c) +/* */ { +/* */ String app; +/* 954 */ app = (String)this.ans.get(this.lastIndex); +/* */ } +/* 956 */ this.answerField.setText(this.answerField.getText() + app); +/* 957 */ this.answerField.setCaretPosition(this.answerField.getText().length() - app.length()); +/* 958 */ this.answerField.moveCaretPosition(this.answerField.getText().length()); +/* */ } +/* */ +/* 961 */ if (e.getKeyCode() == 10) { +/* 962 */ actionPerformed(new ActionEvent(this.keys[1].get(11), 0, "")); +/* */ } +/* 964 */ if (e.getKeyCode() == 38) { +/* 965 */ if (this.controlHeld) { +/* 966 */ if (this.lastIndex < this.ans.size() - 1) { +/* 967 */ String temp = this.answerField.getText(); +/* 968 */ if (this.answerField.getSelectionStart() >= 0) +/* 969 */ temp = temp.substring(0, this.answerField.getSelectionStart()) + temp.substring(this.answerField.getSelectionEnd()); +/* 970 */ temp = temp.substring(0, this.answerField.getCaretPosition()) + (String)this.ans.get(++this.lastIndex) + temp.substring(this.answerField.getCaretPosition()); +/* 971 */ this.answerField.setText(temp); +/* */ } +/* 973 */ return; +/* */ } +/* */ +/* 977 */ if (this.lastIndex < this.last.size() - 1) +/* 978 */ this.answerField.setText((String)this.last.get(++this.lastIndex)); +/* */ } +/* 980 */ if (e.getKeyCode() == 40) { +/* 981 */ if (this.controlHeld) { +/* 982 */ if (this.lastIndex > 0) { +/* 983 */ String temp = this.answerField.getText(); +/* 984 */ if (this.answerField.getSelectionStart() >= 0) +/* 985 */ temp = temp.substring(0, this.answerField.getSelectionStart()) + temp.substring(this.answerField.getSelectionEnd()); +/* 986 */ temp = temp.substring(0, this.answerField.getCaretPosition()) + (String)this.ans.get(--this.lastIndex) + temp.substring(this.answerField.getCaretPosition()); +/* 987 */ this.answerField.setText(temp); +/* */ } +/* 989 */ return; +/* */ } +/* */ +/* 993 */ if (this.lastIndex > 0) +/* 994 */ this.answerField.setText((String)this.last.get(--this.lastIndex)); +/* */ } +/* */ } +/* */ } +/* */ +/* 999 */ public static void silentPrint(String prnt) { if ((System.out instanceof ModulusOutputStream)) ((ModulusOutputStream)System.out).silentPrint(prnt); } +/* */ public DecimalFormatter getFormatter() +/* */ { +/* 1002 */ return this.formatter; +/* */ } +/* */ public void setDecimalFormatter(DecimalFormatter set) { +/* 1005 */ this.formatter = set; +/* */ } +/* */ public static CalculatorGUI getCurrentInstance() { +/* 1008 */ return currentInstance; +/* */ } +/* */ private boolean contains(char x, char[] cs) { +/* 1011 */ for (char y : cs) if (y == x) return true; +/* 1012 */ return false; +/* */ } +/* */ +/* */ private void removeSelected() +/* */ { +/* 1027 */ for (Menu m : this.menus) m.setSelected(false); +/* */ } +/* 1029 */ public void mouseClicked(MouseEvent e) { removeSelected(); } +/* 1030 */ public void mousePressed(MouseEvent e) { removeSelected(); } +/* 1031 */ public void mouseReleased(MouseEvent e) { removeSelected(); } +/* */ public void mouseEntered(MouseEvent e) { +/* */ } +/* */ public void mouseExited(MouseEvent e) { } +/* 1035 */ public static Thread getThread() { return new CalculatorGUI.GuiThread(null); } +/* */ +/* */ private static class GuiThread extends Thread { +/* */ public void run() { +/* 1039 */ new CalculatorGUI().setVisible(true); +/* */ } +/* */ } +/* */ +/* */ private class Run +/* */ implements Runnable +/* */ { +/* */ File f; +/* */ +/* */ public Run(File file) +/* */ { +/* 1017 */ this.f = file; +/* */ } +/* */ public void run() { +/* */ try { +/* 1021 */ ScriptReader.runScript(this.f.toString()); +/* */ } +/* */ catch (Exception localException) +/* */ { +/* */ } +/* */ } +/* */ } +/* */ +/* */ private static class SplashScreen extends JWindow +/* */ { +/* */ private static final long serialVersionUID = 4883331298436699474L; +/* */ private BufferedImage image; +/* */ +/* */ public SplashScreen() +/* */ { +/* */ try +/* */ { +/* 1051 */ this.image = ImageIO.read(new File(new File(".").getCanonicalFile(), "splash-screen.png")); +/* */ } +/* */ catch (IOException e) { +/* 1054 */ e.printStackTrace(); +/* */ } +/* 1056 */ setSize(this.image.getWidth(), this.image.getHeight()); +/* 1057 */ Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); +/* 1058 */ int x = (dim.width - getSize().width) / 2; +/* 1059 */ int y = (dim.height - getSize().height) / 2; +/* 1060 */ setLocation(x, y); +/* */ } +/* */ public void paint(Graphics g) { +/* 1063 */ g.drawImage(this.image, 0, 0, null); +/* */ } +/* */ } +/* */ +/* */ private static class SplashThread extends Thread { +/* 1068 */ public void run() { CalculatorGUI.splash = new CalculatorGUI.SplashScreen(); +/* 1069 */ CalculatorGUI.splash.setAlwaysOnTop(true); +/* 1070 */ CalculatorGUI.splash.setVisible(true); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: CalculatorGUI + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ComplicationAlert.java b/src/ComplicationAlert.java new file mode 100644 index 0000000..18f8b7a --- /dev/null +++ b/src/ComplicationAlert.java @@ -0,0 +1,57 @@ +/* */ import java.awt.Frame; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ +/* */ public class ComplicationAlert extends JDialog +/* */ implements ActionListener +/* */ { +/* 12 */ private JButton ok = new JButton("OK"); +/* */ +/* 14 */ public ComplicationAlert(JDialog owner, String text) { super(owner, "Complication Alert", true); +/* 15 */ JPanel main = new JPanel(); +/* 16 */ main.setLayout(new BoxLayout(main, 1)); +/* 17 */ JPanel holder1 = new JPanel(); +/* 18 */ JPanel holder2 = new JPanel(); +/* 19 */ holder1.add(new JLabel(text)); +/* 20 */ holder2.add(this.ok); +/* */ +/* 22 */ main.add(holder1); +/* 23 */ main.add(holder2); +/* */ +/* 25 */ this.ok.addActionListener(this); +/* 26 */ add(main); +/* 27 */ pack(); +/* 28 */ setVisible(true); } +/* */ +/* */ public ComplicationAlert(Frame owner, String text, String title) { +/* 31 */ super(owner, title, true); +/* 32 */ JPanel main = new JPanel(); +/* 33 */ main.setLayout(new BoxLayout(main, 1)); +/* 34 */ JPanel holder1 = new JPanel(); +/* 35 */ JPanel holder2 = new JPanel(); +/* 36 */ holder1.add(new JLabel(text)); +/* 37 */ holder2.add(this.ok); +/* */ +/* 39 */ main.add(holder1); +/* 40 */ main.add(holder2); +/* */ +/* 42 */ this.ok.addActionListener(this); +/* 43 */ add(main); +/* 44 */ pack(); +/* 45 */ setVisible(true); +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent arg0) { +/* 49 */ setVisible(false); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ComplicationAlert + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ControlPanel.java b/src/ControlPanel.java new file mode 100644 index 0000000..51be3b6 --- /dev/null +++ b/src/ControlPanel.java @@ -0,0 +1,349 @@ +/* */ import java.io.BufferedReader; +/* */ import java.io.DataInputStream; +/* */ import java.io.File; +/* */ import java.io.FileInputStream; +/* */ import java.io.InputStreamReader; +/* */ import java.io.PrintStream; +/* */ import java.lang.reflect.Method; +/* */ import java.lang.reflect.Modifier; +/* */ import java.util.ArrayList; +/* */ import java.util.Scanner; +/* */ import javax.swing.JTextArea; +/* */ import utilities.PublicFileClassLoader; +/* */ +/* */ public class ControlPanel +/* */ { +/* 24 */ private static ArrayList<String> functionList = new ArrayList(); +/* 25 */ private static ArrayList<String> files = new ArrayList(); +/* 26 */ private static ArrayList<Class> classes = new ArrayList(); +/* */ +/* 28 */ private static String locs = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +/* 29 */ private static ArrayList<String>[] values = null; +/* 30 */ private static boolean init = false; +/* 31 */ private static ArrayList<ArrayList<String>> popped = new ArrayList(); +/* 32 */ private static JTextArea comp = null; +/* */ +/* 50 */ private static PublicFileClassLoader classFileLoader = new PublicFileClassLoader(); +/* */ public static Method[] objectMethods; +/* 35 */ public static String[] graphFunctions = new String[0]; +/* */ +/* */ static +/* */ { +/* */ try { +/* 40 */ objectMethods = Class.forName("java.lang.Object").getMethods(); +/* */ } catch (Exception e) { +/* 42 */ e.printStackTrace(); +/* 43 */ }init = true; +/* 44 */ popped.add(new ArrayList()); +/* 45 */ values = new ArrayList[26]; +/* 46 */ for (int i = 0; i < values.length; i++) { +/* 47 */ values[i] = new ArrayList(); +/* 48 */ values[i].add("0"); +/* */ } +/* */ } +/* */ +/* */ public static void load(String name) throws Exception +/* */ { +/* 54 */ if (name.endsWith(".class")) +/* */ { +/* 57 */ String org = name; +/* */ +/* 59 */ name = name.replaceAll("\\\\", "/"); +/* 60 */ name = name.substring(0, name.length() - 6); +/* */ +/* 62 */ File f = new File(name); +/* 63 */ classFileLoader.addDir(f.getParentFile()); +/* */ +/* 65 */ name = name.substring(name.lastIndexOf("/") + 1); +/* */ +/* 67 */ Class cls = Class.forName(name, true, classFileLoader); +/* 68 */ for (Method method : cls.getMethods()) { +/* 69 */ int mod = method.getModifiers(); +/* 70 */ if ((method.getParameterTypes().length >= 1) && (Modifier.isPublic(mod)) && (Modifier.isStatic(mod)) && (!contains(objectMethods, method)) && (method.getParameterTypes()[0].equals(new String[0].getClass())) && +/* 71 */ (method.getReturnType().equals(new String().getClass()))) +/* 72 */ addToFunctionList(method.getName(), org, cls); +/* */ } +/* 74 */ return; +/* */ } +/* 76 */ if (name.endsWith(".marc")) { +/* 77 */ name = name.replaceAll("\\\\", "/"); +/* 78 */ addToFunctionList(name.substring(name.lastIndexOf("/") + 1, name.indexOf(".")), name, null); +/* */ } +/* 80 */ File file = new File(name); +/* 81 */ if (!file.exists()) { +/* 82 */ file = new File(new File(ScriptReader.getFile()).getParent(), name); +/* 83 */ name = file.toString(); +/* */ } +/* */ +/* 86 */ FileInputStream fstream = new FileInputStream(file); +/* 87 */ DataInputStream in = new DataInputStream(fstream); +/* 88 */ InputStreamReader y = new InputStreamReader(in); +/* 89 */ BufferedReader br = new BufferedReader(y); +/* */ String str; +/* 91 */ while ((str = br.readLine()) != null) +/* */ { +/* */ String str; +/* 92 */ if (str.trim().startsWith("function")) +/* */ { +/* */ String x; +/* 94 */ addToFunctionList((x = str.trim().substring(8).trim()).substring(0, x.indexOf("(")).trim(), name, null); +/* */ } +/* */ } +/* 97 */ file = null; +/* 98 */ fstream = null; +/* 99 */ in = null; +/* 100 */ y = null; +/* 101 */ br = null; +/* */ } +/* */ +/* */ public static void launchShell() throws Exception +/* */ { +/* 106 */ Scanner scan = new Scanner(System.in); +/* 107 */ System.out.print(">>"); +/* */ String line; +/* 108 */ while (!(line = scan.nextLine()).equals("HLT")) +/* */ { +/* */ String line; +/* 109 */ parseLine(line); +/* 110 */ System.out.print(">>"); +/* */ } +/* */ } +/* */ +/* 114 */ public static void parseLine(String line) throws Exception { parseLine(line, null); } +/* */ +/* */ public static void parseLine(String line, JTextArea disp) throws Exception +/* */ { +/* 118 */ String[] split = line.split("\\s+"); +/* */ +/* 120 */ if (split[0].equalsIgnoreCase("CLRHOME")) { +/* 121 */ if (disp != null) disp.setText(""); +/* 122 */ else if (comp != null) comp.setText(""); +/* */ } +/* 124 */ else if (split[0].equalsIgnoreCase("STO")) +/* */ { +/* 126 */ String[] sec = { line.substring(3, line.lastIndexOf(",")), line.substring(line.lastIndexOf(",") + 1) }; +/* 127 */ if (sec[1].contains("[")) { +/* 128 */ String toSolve = sec[1].substring(sec[1].indexOf("[") + 1, sec[1].lastIndexOf("]")); +/* */ +/* 130 */ values[locs.indexOf(sec[1].substring(0, sec[1].indexOf("[")))].set(Integer.parseInt(figure(toSolve)), solve(sec[0]).replaceAll("E", "e")); +/* */ } +/* */ else { +/* 133 */ values[locs.indexOf(sec[1])].set(0, figure(sec[0]).replaceAll("E", "e")); +/* */ } +/* 135 */ } else if (split[0].equalsIgnoreCase("STP")) +/* */ { +/* 137 */ String[] sec = { split[1].substring(0, split[1].lastIndexOf(",")), split[1].substring(split[1].lastIndexOf(",") + 1) }; +/* 138 */ parseLine("PUSH " + sec[1]); +/* 139 */ parseLine("STO " + sec[1] + "[1]," + sec[1]); +/* 140 */ parseLine("STO " + split[1]); +/* */ } +/* 142 */ else if (split[0].equalsIgnoreCase("DISP")) { +/* 143 */ System.out.println(parseOut(line.substring(4))); +/* */ } +/* 145 */ else if (split[0].equalsIgnoreCase("PUSH")) +/* */ { +/* 147 */ values[locs.indexOf(split[1])].add(0, "0"); +/* */ } +/* 149 */ else if (split[0].equalsIgnoreCase("POP")) +/* */ { +/* 151 */ if (values[locs.indexOf(split[1])].size() > 1) { +/* 152 */ ((ArrayList)popped.get(popped.size() - 1)).add(0, (String)values[locs.indexOf(split[1])].get(0)); +/* 153 */ values[locs.indexOf(split[1])].remove(0); +/* */ } +/* */ +/* */ } +/* 157 */ else if (split[0].equalsIgnoreCase("LOD")) { +/* 158 */ load(line.substring(split[0].length())); +/* */ } +/* 160 */ else if (split[0].equalsIgnoreCase("STACK")) +/* */ { +/* 162 */ String[] sec = { split[1].substring(0, split[1].lastIndexOf(",")), split[1].substring(split[1].lastIndexOf(",") + 1) }; +/* 163 */ values[locs.indexOf(sec[1])].add(figure(sec[0])); +/* */ } +/* 165 */ else if (split[0].trim().equals("DEL")) { +/* 166 */ if (((ArrayList)popped.get(popped.size() - 1)).size() > 0) +/* 167 */ ((ArrayList)popped.get(popped.size() - 1)).remove(0); +/* */ } +/* 169 */ else if (split[0].equalsIgnoreCase("PROMPT")) +/* */ { +/* 171 */ String[] sec = { line.substring(6, line.lastIndexOf(",")), line.substring(line.lastIndexOf(",")) }; +/* 172 */ SwingPrompter prompt = new SwingPrompter(); +/* 173 */ parseLine("STO " + SwingPrompter.getPrompt(sec) + sec[1]); +/* */ } +/* 175 */ else if (split[0].equalsIgnoreCase("SLEEP")) +/* */ { +/* 177 */ long crt = System.currentTimeMillis(); +/* 178 */ long to = Long.parseLong(split[1].trim()); +/* 179 */ while (System.currentTimeMillis() - crt < to); +/* */ } +/* 183 */ else if (disp != null) { comp.append(figure(line) + "\n"); +/* 184 */ } else if (comp != null) { comp.append(figure(line) + "\n"); } else { +/* 185 */ System.out.println(figure(line)); +/* */ } +/* */ } +/* */ +/* */ public static String solve(String eq) +/* */ throws Exception +/* */ { +/* 200 */ eq = parseOutVars(eq); +/* */ +/* 202 */ return Calculator.solve(eq); +/* */ } +/* */ +/* */ public static String figure(String line) throws Exception { +/* 206 */ line = parseOutFunctions(line); +/* 207 */ if (TernarySolver.containsTernary(removeParan(line))) { +/* 208 */ line = solveTernary(line); +/* */ } +/* 210 */ if (BooleanLogic.containsBoolean(removeParan(line))) { +/* 211 */ return solveBoolean(line); +/* */ } +/* 213 */ return solve(line); +/* */ } +/* */ +/* */ public static String solveBoolean(String eq) throws Exception { +/* 217 */ eq = parseOutVars(eq); +/* 218 */ return BooleanLogic.solve(eq); +/* */ } +/* */ +/* */ public static String solveTernary(String eq) throws Exception { +/* 222 */ eq = parseOutVars(eq); +/* 223 */ return TernarySolver.solve(eq); +/* */ } +/* */ +/* */ public static String solveTernaryCP(String eq) throws Exception { +/* 227 */ eq = parseOutVars(eq); +/* 228 */ return TernarySolver.solveCP(eq); +/* */ } +/* */ public static String parseOutInnerVoids(String x) { +/* 231 */ return ""; +/* */ } +/* */ public static String parseOutVars(String eq) { +/* 234 */ if (Calculator.getBase() != 10) return eq; +/* 235 */ for (int i = 0; i < ((ArrayList)popped.get(popped.size() - 1)).size(); i++) { +/* 236 */ eq = eq.replaceAll("Hold\\[" + i + "\\]", "(" + (String)((ArrayList)popped.get(popped.size() - 1)).get(i) + ")"); +/* */ } +/* 238 */ if (((ArrayList)popped.get(popped.size() - 1)).size() > 0) eq = eq.replaceAll("Hold", "(" + (String)((ArrayList)popped.get(popped.size() - 1)).get(0) + ")"); +/* 239 */ eq = eq.replaceAll("pi", "(3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421)"); +/* 240 */ for (int i = 0; i < values.length; i++) { +/* 241 */ for (int j = 0; j < values[i].size(); j++) { +/* 242 */ eq = eq.replaceAll(locs.charAt(i) + "\\[" + j + "\\]", (String)values[i].get(j)); +/* */ } +/* 244 */ eq = eq.replaceAll(locs.charAt(i), "(" + (String)values[i].get(0) + ")"); +/* */ } +/* 246 */ eq = eq.replaceAll("time", System.currentTimeMillis()); +/* 247 */ return eq; +/* */ } +/* */ public static String parseOut(String eq) throws Exception { +/* 250 */ if (!eq.contains("{")) return eq; +/* 251 */ return parseOut(eq.substring(0, eq.lastIndexOf("{")) + +/* 252 */ figure(eq.substring(eq.lastIndexOf("{") + 1, eq.indexOf("}", eq.lastIndexOf("{")))) + +/* 253 */ eq.substring(eq.indexOf("}", eq.lastIndexOf("{")) + 1)); +/* */ } +/* */ public static String parseOutFunctions(String x) throws Exception { +/* 256 */ for (int i = 0; i < functionList.size(); i++) { +/* 257 */ while (x.contains((CharSequence)functionList.get(i))) { +/* 258 */ popped.add(new ArrayList()); +/* 259 */ x = x.substring(0, x.indexOf((String)functionList.get(i))) + +/* 260 */ ScriptReader.preformFunction(x.substring(x.indexOf((String)functionList.get(i)), +/* 261 */ match(x, x.indexOf((String)functionList.get(i))) + 1), +/* 262 */ (String)files.get(i), +/* 263 */ new Object[] { classes.get(i) }) + +/* 264 */ x.substring(match(x, x.indexOf((String)functionList.get(i))) + 1); +/* 265 */ popped.remove(popped.size() - 1); +/* */ } +/* */ } +/* 268 */ for (int j = 0; j < graphFunctions.length; j++) { +/* 269 */ int i = j + 1; +/* 270 */ while (x.contains("y" + i)) { +/* 271 */ x = x.substring(0, x.indexOf(new StringBuilder("y").append(i).toString())) + +/* 272 */ figure(graphFunctions[j].replaceAll("X", figure(x.substring(x.indexOf(new StringBuilder("y").append(i).toString()) + 3, +/* 273 */ match(x, x.indexOf(new StringBuilder("y").append(i).toString())))))) + +/* 274 */ x.substring(match(x, x.indexOf(new StringBuilder("y").append(i).toString())) + 1); +/* */ } +/* */ } +/* 277 */ return x; +/* */ } +/* */ private static int match(String eq, int index) { +/* 280 */ while (eq.charAt(index) != '(') index++; +/* 281 */ int i = index + 1; for (int x = 1; i < eq.length(); i++) { +/* 282 */ if (eq.charAt(i) == ')') x--; +/* 283 */ else if (eq.charAt(i) == '(') x++; +/* 284 */ if (x == 0) return i; +/* */ } +/* 286 */ return -1; +/* */ } +/* */ public static void addToFunctionList(String x, String fileName, Class cls) { +/* 289 */ if (functionList.contains(x)) return; +/* 290 */ functionList.add(x); +/* 291 */ files.add(fileName); +/* 292 */ classes.add(cls); +/* */ } +/* */ private static int lastIndexOf(String arg, String[] args) { +/* 295 */ int max = -1; +/* 296 */ for (String i : args) { +/* 297 */ if (arg.indexOf(i) > max) max = arg.lastIndexOf(i); +/* */ } +/* 299 */ return max; +/* */ } +/* */ private static int indexOf(String arg, String[] args) { +/* 302 */ int max = -1; +/* 303 */ for (String i : args) { +/* 304 */ if ((arg.indexOf(i) < max) || (max == -1)) max = arg.indexOf(i); +/* */ } +/* 306 */ return max; +/* */ } +/* */ public static void setComponent(JTextArea comp) { +/* 309 */ comp = comp; +/* */ } +/* 311 */ public static Object[] getFunctions() { return functionList.toArray(); } +/* 312 */ public static Object[] getFiles() { return files.toArray(); } +/* */ public static String removeParan(String eq) { +/* 314 */ int x = 0; +/* 315 */ String temp = ""; +/* 316 */ String ret = ""; +/* */ +/* 318 */ for (int i = 0; i < eq.length(); i++) { +/* 319 */ if (eq.charAt(i) == '(') x++; +/* 320 */ else if (eq.charAt(i) == ')') x--; +/* 321 */ else if (x == 0) ret = ret + eq.charAt(i); +/* */ } +/* */ +/* 324 */ if (ret.equals("")) ret = removeParan(eq.substring(1, eq.length() - 1)); +/* 325 */ return ret; +/* */ } +/* */ public static ArrayList<String>[] getStacks() { +/* 328 */ return values; +/* */ } +/* */ public static ArrayList<String> getCurrentHold() { +/* 331 */ return (ArrayList)popped.get(popped.size() - 1); +/* */ } +/* 333 */ public static boolean isInit() { return init; } +/* */ public static void reset() { +/* 335 */ functionList = new ArrayList(); +/* 336 */ files = new ArrayList(); +/* */ } +/* */ public static ArrayList<String> getFunctionList() { +/* 339 */ return functionList; +/* */ } +/* */ public static ArrayList<Class> getClasses() { +/* 342 */ return classes; +/* */ } +/* */ private static boolean contains(Object[] x, Object y) { +/* 345 */ Object[] arrayOfObject = x; int j = x.length; for (int i = 0; i < j; i++) { Object z = arrayOfObject[i]; +/* 346 */ if (z.equals(y)) return true; +/* */ } +/* 348 */ return false; +/* */ } +/* */ public static void test() { +/* */ } +/* 352 */ public static void setGraphFunctions(String[] func) { graphFunctions = func; } +/* */ public static PublicFileClassLoader getClassLoader() { +/* 354 */ return classFileLoader; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ControlPanel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/CoordinateSystem.java b/src/CoordinateSystem.java new file mode 100644 index 0000000..eee2523 --- /dev/null +++ b/src/CoordinateSystem.java @@ -0,0 +1,35 @@ +public abstract interface CoordinateSystem +{ + public abstract double getXRotation(); + + public abstract double getYRotation(); + + public abstract double getZRotation(); + + public abstract double getXMove(); + + public abstract double getYMove(); + + public abstract double getScale(); + + public abstract double getXPivot(); + + public abstract double getYPivot(); + + public abstract double getZPivot(); + + public abstract int getWidth(); + + public abstract int getHeight(); + + public abstract double getCameraZ(); + + public abstract double getCameraX(); + + public abstract double getCameraY(); +} + +/* Location: Modulus.jar + * Qualified Name: CoordinateSystem + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Dynamic3DGraph.java b/src/Dynamic3DGraph.java new file mode 100644 index 0000000..09decc0 --- /dev/null +++ b/src/Dynamic3DGraph.java @@ -0,0 +1,181 @@ +/* */ import java.awt.AWTEvent; +/* */ import java.awt.Graphics; +/* */ import java.awt.event.KeyEvent; +/* */ import java.awt.event.KeyListener; +/* */ import java.awt.event.MouseEvent; +/* */ import java.awt.event.MouseListener; +/* */ import java.awt.event.MouseMotionListener; +/* */ import java.awt.event.MouseWheelEvent; +/* */ import java.awt.event.MouseWheelListener; +/* */ import java.util.ArrayList; +/* */ +/* */ public class Dynamic3DGraph extends Graph3D +/* */ implements MouseWheelListener, MouseMotionListener, MouseListener, KeyListener +/* */ { +/* */ private static final long serialVersionUID = 5815581053362655149L; +/* 24 */ private int lastX = 0; +/* 25 */ private int lastY = 0; +/* */ private long lastClick; +/* */ private int multiplier; +/* */ private boolean shift; +/* */ private boolean ctrl; +/* */ private boolean alt; +/* */ private ArrayList<MoveListener> listeners; +/* */ +/* */ public Dynamic3DGraph() +/* */ { +/* 34 */ this.multiplier = 1; +/* 35 */ addMouseWheelListener(this); +/* 36 */ addMouseMotionListener(this); +/* 37 */ addMouseListener(this); +/* 38 */ super.setCameraZ(220.0D); +/* 39 */ this.listeners = new ArrayList(); +/* */ } +/* */ public void addMoveListener(MoveListener listen) { +/* 42 */ this.listeners.add(listen); +/* */ } +/* */ public void firePreformed(AWTEvent e) { +/* 45 */ for (int i = 0; i < this.listeners.size(); i++) +/* 46 */ ((MoveListener)this.listeners.get(i)).objectMoved(e); +/* */ } +/* */ +/* */ public void mouseWheelMoved(MouseWheelEvent e) +/* */ { +/* 51 */ super.setCameraZ(super.getCameraZ() + e.getWheelRotation() * this.multiplier); +/* */ +/* 53 */ super.repaint(); +/* 54 */ firePreformed(e); +/* */ } +/* */ public void mouseDragged(MouseEvent e) { +/* 57 */ super.setXRotation(super.getXRotation() - (e.getY() - this.lastY) * this.multiplier); +/* 58 */ if (!this.alt) super.setYRotation(super.getYRotation() + (this.lastX - e.getX()) * this.multiplier); else { +/* 59 */ super.setZRotation(super.getZRotation() + (this.lastX - e.getX()) * this.multiplier); +/* */ } +/* 61 */ this.lastX = e.getX(); +/* 62 */ this.lastY = e.getY(); +/* 63 */ super.repaint(); +/* 64 */ firePreformed(e); +/* */ } +/* */ +/* */ public void mouseMoved(MouseEvent e) +/* */ { +/* 69 */ this.lastX = e.getX(); +/* 70 */ this.lastY = e.getY(); +/* 71 */ firePreformed(e); +/* */ } +/* */ +/* */ public void mouseClicked(MouseEvent e) { +/* 75 */ this.lastX = e.getX(); +/* 76 */ this.lastY = e.getY(); +/* */ +/* 78 */ long lastClickNew = System.currentTimeMillis(); +/* 79 */ if (Math.abs(this.lastClick - lastClickNew) < 500L) { +/* 80 */ super.setXRotation(0.0D); +/* 81 */ super.setYRotation(0.0D); +/* 82 */ super.setCameraX(0.0D); +/* 83 */ super.setCameraY(0.0D); +/* 84 */ super.setCameraZ(200.0D); +/* 85 */ super.repaint(); +/* */ } +/* 87 */ this.lastClick = lastClickNew; +/* 88 */ firePreformed(e); +/* */ } +/* */ public void invoke(Graphics g) { +/* 91 */ super.invoke(g); +/* 92 */ if (this.alt) new Point3D(getXPivot(), getYPivot(), getZPivot()).drawOn(g, this); +/* 93 */ firePreformed(null); +/* */ } +/* */ public void mouseEntered(MouseEvent e) { +/* */ } +/* */ public void mouseExited(MouseEvent e) { +/* */ } +/* */ public void mousePressed(MouseEvent e) { +/* 100 */ this.lastX = e.getX(); +/* 101 */ this.lastY = e.getY(); +/* */ } +/* */ public void mouseReleased(MouseEvent e) { +/* */ } +/* 105 */ public void keyReleased(KeyEvent evt) { int keyCode = evt.getKeyCode(); +/* 106 */ if (keyCode == 17) { +/* 107 */ this.multiplier /= 5; +/* 108 */ this.ctrl = false; +/* */ } +/* 110 */ else if (keyCode == 16) { +/* 111 */ this.multiplier /= 5; +/* 112 */ this.shift = false; +/* */ } +/* 114 */ else if (keyCode == 18) { +/* 115 */ this.alt = false; +/* 116 */ repaint(); +/* */ } } +/* */ +/* */ public void keyTyped(KeyEvent evt) +/* */ { +/* */ } +/* */ +/* */ public void keyPressed(KeyEvent evt) { +/* 124 */ int keyCode = evt.getKeyCode(); +/* 125 */ if (keyCode == 37) { +/* 126 */ if (this.alt) +/* 127 */ setXPivot(getXPivot() - 5 * this.multiplier); +/* */ else { +/* 129 */ setYRotation(getYRotation() + 5 * this.multiplier); +/* */ } +/* 131 */ repaint(); +/* */ } +/* 133 */ else if (keyCode == 39) { +/* 134 */ if (this.alt) +/* 135 */ setXPivot(getXPivot() + 5 * this.multiplier); +/* */ else { +/* 137 */ setYRotation(getYRotation() - 5 * this.multiplier); +/* */ } +/* 139 */ repaint(); +/* */ } +/* 141 */ else if (keyCode == 38) { +/* 142 */ if (this.alt) { +/* 143 */ setYPivot(getYPivot() + 5 * this.multiplier); +/* */ } +/* */ else { +/* 146 */ setXRotation(getXRotation() + 5.0D); +/* */ } +/* 148 */ repaint(); +/* */ } +/* 150 */ else if (keyCode == 40) { +/* 151 */ if (this.alt) +/* 152 */ setYPivot(getYPivot() - 5 * this.multiplier); +/* */ else { +/* 154 */ setXRotation(getXRotation() - 5 * this.multiplier); +/* */ } +/* 156 */ repaint(); +/* */ } +/* 158 */ else if (keyCode == 17) { +/* 159 */ if (!this.ctrl) { +/* 160 */ this.multiplier *= 5; +/* 161 */ this.ctrl = true; +/* */ } +/* */ } +/* 164 */ else if (keyCode == 16) { +/* 165 */ if (!this.shift) { +/* 166 */ this.multiplier *= 5; +/* 167 */ this.shift = true; +/* */ } +/* */ } +/* 170 */ else if ((keyCode == 18) && (!this.alt)) { +/* 171 */ this.alt = true; +/* 172 */ repaint(); +/* */ } +/* 174 */ else if (keyCode == 61) { +/* 175 */ setCameraZ(getCameraZ() - 15 * this.multiplier); +/* 176 */ repaint(); +/* */ } +/* 178 */ else if (keyCode == 45) { +/* 179 */ setCameraZ(getCameraZ() + 15 * this.multiplier); +/* 180 */ repaint(); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Dynamic3DGraph + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/DynamicGraphBuilder.java b/src/DynamicGraphBuilder.java new file mode 100644 index 0000000..cfdd714 --- /dev/null +++ b/src/DynamicGraphBuilder.java @@ -0,0 +1,14 @@ +/* */ import java.io.Serializable; +/* */ +/* */ public abstract interface DynamicGraphBuilder extends Serializable +/* */ { +/* 12 */ public static final DynamicGraphBuilder DO_NOTHING_GRAPH_BUILDER = new DynamicGraphBuilder() { +/* 12 */ public void recreate(Graph2D graph) { } } ; +/* */ +/* */ public abstract void recreate(Graph2D paramGraph2D); +/* */ } + +/* Location: Modulus.jar + * Qualified Name: DynamicGraphBuilder + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Elucidean2DPointMaker.java b/src/Elucidean2DPointMaker.java new file mode 100644 index 0000000..6bb2f8b --- /dev/null +++ b/src/Elucidean2DPointMaker.java @@ -0,0 +1,18 @@ +/* */ public class Elucidean2DPointMaker extends Point2DMaker +/* */ { +/* */ public Elucidean2DPointMaker() +/* */ { +/* 13 */ super('x', 'y', new ElucideanDynamicGraphBuilder()); +/* */ } +/* */ public Point2D createPoint(double x, double y) { +/* 16 */ return new Point2D(x, y); +/* */ } +/* */ public GraphIterator getIteratorInstance(Graph2D graph) { +/* 19 */ return ElucideanGraphIterator.getInstance(graph); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Elucidean2DPointMaker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ElucideanDynamicGraphBuilder.java b/src/ElucideanDynamicGraphBuilder.java new file mode 100644 index 0000000..b3968a5 --- /dev/null +++ b/src/ElucideanDynamicGraphBuilder.java @@ -0,0 +1,35 @@ +/* */ import java.util.ArrayList; +/* */ +/* */ public class ElucideanDynamicGraphBuilder +/* */ implements DynamicGraphBuilder +/* */ { +/* */ public void recreate(Graph2D graph) +/* */ { +/* 11 */ Point2D minX = (Point2D)graph.getPoints()[0].get(0); +/* 12 */ Point2D maxX = (Point2D)graph.getPoints()[0].get(graph.getPoints()[0].size() - 1); +/* 13 */ Point2D minStart = graph.translate(minX); +/* 14 */ Point2D maxStart = graph.translate(maxX); +/* */ +/* 16 */ if (minX.getX() > graph.getWindowRange().getXMin()) { +/* 17 */ for (int i = minStart.getX() - graph.getXSkip(); i >= -graph.getXSkip(); i -= graph.getXSkip()) { +/* 18 */ for (int j = 0; j < graph.getEquations().length; j++) { +/* 19 */ Point2D toAdd = new Point2D(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.equation(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.getEquations()[j])); +/* 20 */ graph.pushPoint(toAdd, j); +/* 21 */ graph.trimUp(j); +/* */ } +/* */ } +/* */ } +/* 25 */ if (maxX.getX() < graph.getWindowRange().getXMax()) +/* 26 */ for (int i = maxStart.getX() + graph.getXSkip(); i <= graph.getWidth() + graph.getXSkip(); i += graph.getXSkip()) +/* 27 */ for (int j = 0; j < graph.getEquations().length; j++) { +/* 28 */ Point2D toAdd = new Point2D(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.equation(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.getEquations()[j])); +/* 29 */ graph.addPoint(toAdd, j); +/* 30 */ graph.trimDown(j); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ElucideanDynamicGraphBuilder + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ElucideanGraphIterator.java b/src/ElucideanGraphIterator.java new file mode 100644 index 0000000..764f780 --- /dev/null +++ b/src/ElucideanGraphIterator.java @@ -0,0 +1,30 @@ +/* */ public class ElucideanGraphIterator extends GraphIterator +/* */ { +/* */ private Graph2D graph; +/* */ +/* */ public ElucideanGraphIterator(Graph2D graph) +/* */ { +/* 12 */ super(-(int)(graph.getWidth() * 1.5D)); +/* 13 */ this.graph = graph; +/* */ } +/* */ public static ElucideanGraphIterator getInstance(Graph2D graph) { +/* 16 */ return new ElucideanGraphIterator(graph); +/* */ } +/* */ public boolean hasMoreTokens() { +/* 19 */ return this.index < this.graph.getWidth() * 1.5D; +/* */ } +/* */ public void onTurn() { +/* 22 */ this.index += this.graph.getXSkip(); +/* */ } +/* */ public double translateIndex(Graph2D graph) { +/* 25 */ return this.index * graph.getXRes() + graph.getWindowRange().getXMin(); +/* */ } +/* */ public double translateNumber(Graph2D graph, double i) { +/* 28 */ return i * graph.getXRes() + graph.getWindowRange().getXMin(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ElucideanGraphIterator + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/EquasiveGraph3D.java b/src/EquasiveGraph3D.java new file mode 100644 index 0000000..b4dac2d --- /dev/null +++ b/src/EquasiveGraph3D.java @@ -0,0 +1,225 @@ +/* */ import GUIComponents.ProgressFrame; +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ +/* */ public class EquasiveGraph3D extends Dynamic3DGraph +/* */ { +/* */ private double xMax; +/* */ private double yMax; +/* */ private double zMax; +/* */ private double zMin; +/* */ private double xMin; +/* */ private double yMin; +/* */ private double xStep; +/* */ private double yStep; +/* */ private double yPix; +/* */ private double xPix; +/* */ private double zPix; +/* */ protected ProgressFrame progress; +/* */ private EquasiveGraph3D.InterchangeablePointModel pointModel; +/* */ +/* */ public EquasiveGraph3D() +/* */ { +/* 27 */ this(1.0D, -1.0D, -1.0D, 1.0D, -1.0D, 1.0D, 10.0D, 10.0D); +/* */ } +/* */ public EquasiveGraph3D(double xMax, double xMin, double yMin, double yMax, double zMin, double zMax, double xStep, double yStep) { +/* 30 */ this.xMax = xMax; +/* 31 */ this.yMax = yMax; +/* 32 */ this.zMin = zMin; +/* 33 */ this.zMax = zMax; +/* 34 */ this.xMin = xMin; +/* 35 */ this.yMin = yMin; +/* 36 */ this.xStep = xStep; +/* 37 */ this.yStep = yStep; +/* */ +/* 39 */ this.yPix = ((yMax - yMin) / 300.0D); +/* 40 */ this.xPix = ((xMax - xMin) / 300.0D); +/* 41 */ this.zPix = ((zMax - zMin) / 300.0D); +/* 42 */ this.pointModel = new EquasiveGraph3D.InterchangeablePointModel(PointModel.TRUE_Euclidean, PointMaker.ORIGINAL, PointGroup.DEFAULT); +/* */ } +/* */ +/* */ private void recalc() { +/* 46 */ this.yPix = ((this.yMax - this.yMin) / 300.0D); +/* 47 */ this.xPix = ((this.xMax - this.xMin) / 300.0D); +/* 48 */ this.zPix = ((this.zMax - this.zMin) / 300.0D); +/* */ } +/* */ public void setXMax(double x) { +/* 51 */ this.xMax = x; +/* 52 */ recalc(); +/* */ } +/* */ public void setYMax(double y) { +/* 55 */ this.yMax = y; +/* 56 */ recalc(); +/* */ } +/* */ public void setXMin(double x) { +/* 59 */ this.xMin = x; +/* 60 */ recalc(); +/* */ } +/* */ public void setYMin(double y) { +/* 63 */ this.yMin = y; +/* 64 */ recalc(); +/* */ } +/* */ public void setZMax(double z) { +/* 67 */ this.zMax = z; +/* 68 */ recalc(); +/* */ } +/* */ public void setZMin(double z) { +/* 71 */ this.zMin = z; +/* 72 */ recalc(); +/* */ } +/* */ public void setXStep(double x) { +/* 75 */ this.xStep = x; +/* 76 */ recalc(); +/* */ } +/* */ public void setYStep(double y) { +/* 79 */ this.yStep = y; +/* 80 */ recalc(); +/* */ } +/* */ public void clear() { +/* 83 */ super.reset(); +/* */ } +/* 85 */ public double getXMax() { return this.xMax; } +/* 86 */ public double getYMin() { return this.yMin; } +/* 87 */ public double getXMin() { return this.xMin; } +/* 88 */ public double getYMax() { return this.yMax; } +/* 89 */ public double getZMax() { return this.zMax; } +/* 90 */ public double getZMin() { return this.zMin; } +/* 91 */ public double getXStep() { return this.xStep; } +/* 92 */ public double getYStep() { return this.yStep; } +/* 93 */ protected double convertY(double y) { return y * this.yPix; } +/* 94 */ protected double convertX(double x) { return x * this.xPix; } +/* 95 */ protected double convertZ(double z) { return z * this.zPix; } +/* */ protected double getXPix() { +/* 97 */ return this.xPix; +/* */ } +/* */ protected double getYPix() { +/* 100 */ return this.yPix; +/* */ } +/* */ protected double getZPix() { +/* 103 */ return this.zPix; +/* */ } +/* 105 */ public ProgressFrame getFrame() { return this.progress; } +/* */ public void reset() { +/* 107 */ this.points = new ArrayList(0); +/* 108 */ int i = 0; +/* 109 */ double equlen = getCount(getEquations()); +/* */ +/* 111 */ boolean go = true; +/* 112 */ if (this.progress == null) { +/* 113 */ this.progress = new ProgressFrame(0, 100, M3DGraphWindow.getCurrent()); +/* */ } +/* 115 */ this.progress.setVisible(true); +/* 116 */ this.progress.setValue(0.0D); +/* 117 */ for (Object3D obj : this.axiesChar) { +/* 118 */ obj.setModel(this.pointModel); +/* */ } +/* 120 */ for (double x = this.xMin / this.xPix; x < 150.0D; x += this.xStep) { +/* 121 */ int red = 255; +/* 122 */ int green = 0; +/* 123 */ int blue = 0; +/* 124 */ for (String equation : getEquations()) +/* */ { +/* 126 */ if (!equation.equals("")) +/* 127 */ for (double y = this.yMin / this.yPix; y < 150.0D; y += this.yStep) +/* */ { +/* 129 */ Point3D[] pnts = { +/* 130 */ this.pointModel.makePoint(x, y, equation(equation, convertX(x), convertY(y)) / this.zPix, this.pointModel), +/* 131 */ this.pointModel.makePoint(x + this.xStep, y, equation(equation, convertX(x + this.xStep), convertY(y)) / this.zPix, this.pointModel), +/* 132 */ this.pointModel.makePoint(x + this.xStep, y + this.yStep, equation(equation, convertX(x + this.xStep), convertY(y + this.yStep)) / this.zPix, this.pointModel), +/* 133 */ this.pointModel.makePoint(x, y + this.yStep, equation(equation, convertX(x), convertY(y + this.yStep)) / this.zPix, this.pointModel) }; +/* */ +/* 135 */ for (Point3D pnt : pnts) { +/* 136 */ if ((Double.isNaN(pnt.getZ())) || (Double.isInfinite(pnt.getZ()))) go = false; +/* */ } +/* 138 */ if (go) { +/* 139 */ PointGroup temp = new PointGroup(pnts, this.pointModel); +/* 140 */ temp.setColor(new Color(red, green, blue)); +/* 141 */ this.points.add(temp); +/* */ } else { +/* 143 */ go = true; +/* */ } +/* 145 */ if ((red == 255) && (blue == 0) && (green < 255)) { +/* 146 */ green += 10; +/* 147 */ if (green >= 255) green = 255; +/* */ } +/* 149 */ else if ((green == 255) && (red > 0) && (blue == 0)) { +/* 150 */ red -= 10; +/* 151 */ if (red <= 0) red = 0; +/* */ } +/* 153 */ else if ((green == 255) && (red == 0) && (blue < 255)) { +/* 154 */ blue += 10; +/* 155 */ if (blue >= 255) blue = 255; +/* */ } +/* 157 */ else if ((blue == 255) && (red == 0) && (green > 0)) { +/* 158 */ green -= 10; +/* 159 */ if (green <= 0) green = 0; +/* */ } +/* 161 */ else if ((blue == 255) && (green == 0) && (red < 255)) { +/* 162 */ red += 10; +/* 163 */ if (red >= 255) red = 255; +/* */ } +/* */ else +/* */ { +/* 166 */ blue -= 10; +/* 167 */ if (blue <= 0) blue = 0; +/* */ +/* */ } +/* */ +/* 172 */ double yChange = (150.0D - this.yMin / this.yPix) / this.yStep; +/* 173 */ double xChange = (150.0D - this.xMin / this.xPix) / this.xStep; +/* 174 */ this.progress.incrementProgress(100.0D / (yChange * xChange * equlen)); +/* 175 */ repaint(); +/* */ } +/* */ } +/* */ } +/* 179 */ this.progress.flagEnd(); +/* 180 */ clean(); +/* */ } +/* */ +/* */ public EquasiveGraph3D.InterchangeablePointModel getModel() { +/* 184 */ return this.pointModel; +/* */ } +/* */ public void setPointModel(PointModel pm) { +/* 187 */ this.pointModel.setModel(pm); +/* */ } +/* */ protected int getCount(String[] args) { +/* 190 */ int i = 0; +/* 191 */ for (String x : args) { +/* 192 */ if (!x.equals("")) i++; +/* */ } +/* 194 */ return i; } +/* */ protected class InterchangeablePointModel implements PointModel, PointMaker, WirePlotter { private PointModel model; +/* */ private PointMaker maker; +/* */ private WirePlotter plotter; +/* */ +/* 201 */ public InterchangeablePointModel(PointModel model, PointMaker maker, WirePlotter plotter) { this.model = model; +/* 202 */ this.maker = maker; +/* 203 */ this.plotter = plotter; } +/* */ +/* */ public double[] getRealCoords(double xPos, double yPos, double zPos, double xPivot, double yPivot, double zPivot, double zRotation, double xRotation, double yRotation, double scale, double xMove, double yMove, double camX, double camY, double camZ) { +/* 206 */ return this.model.getRealCoords(xPos, yPos, zPos, xPivot, yPivot, zPivot, zRotation, xRotation, yRotation, scale, xMove, yMove, camX, camY, camZ); +/* */ } +/* */ public void setModel(PointModel model) { +/* 209 */ this.model = model; +/* */ } +/* */ public void setMaker(PointMaker maker) { +/* 212 */ this.maker = maker; +/* */ } +/* */ public Point3D makePoint(double x, double y, double z, PointModel mod) { +/* 215 */ return this.maker.makePoint(x, y, z, mod); +/* */ } +/* */ public void plotWire(Graphics g, CoordinateSystem graph, Point3D[] points) { +/* 218 */ this.plotter.plotWire(g, graph, points); +/* */ } +/* */ public void setPlotter(WirePlotter plotter) { +/* 221 */ this.plotter = plotter; +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: EquasiveGraph3D + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/EquationChangeListener.java b/src/EquationChangeListener.java new file mode 100644 index 0000000..93ff661 --- /dev/null +++ b/src/EquationChangeListener.java @@ -0,0 +1,9 @@ +public abstract interface EquationChangeListener +{ + public abstract void setEquations(String[] paramArrayOfString); +} + +/* Location: Modulus.jar + * Qualified Name: EquationChangeListener + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/EquationDialog.java b/src/EquationDialog.java new file mode 100644 index 0000000..76c7bd3 --- /dev/null +++ b/src/EquationDialog.java @@ -0,0 +1,142 @@ +/* */ import java.awt.Dimension; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Frame; +/* */ import java.awt.GridBagLayout; +/* */ import java.awt.GridLayout; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.util.ArrayList; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JScrollPane; +/* */ import javax.swing.JTextField; +/* */ import javax.swing.JViewport; +/* */ +/* */ public class EquationDialog extends JDialog +/* */ implements GraphTypeStateChangedListener, ActionListener +/* */ { +/* */ private JScrollPane scroll; +/* */ private JTextField[] equations; +/* */ private JLabel[] equationNames; +/* */ private JPanel[] packages; +/* */ private JPanel holder; +/* */ private JPanel fullPanel; +/* */ private JButton ok; +/* */ private JButton cancel; +/* */ private JPanel okButtons; +/* */ private Graph2D graph; +/* */ +/* */ public EquationDialog(Frame parent, Graph2D graph) +/* */ { +/* 25 */ super(parent, true); +/* 26 */ this.graph = graph; +/* 27 */ setLayout(new GridBagLayout()); +/* 28 */ this.ok = new JButton("Apply"); +/* 29 */ this.cancel = new JButton("Cancel"); +/* 30 */ this.okButtons = new JPanel(new FlowLayout()); +/* 31 */ this.okButtons.add(this.ok); +/* 32 */ this.okButtons.add(this.cancel); +/* 33 */ this.ok.addActionListener(this); +/* 34 */ this.cancel.addActionListener(this); +/* 35 */ this.holder = new JPanel(); +/* */ +/* 37 */ this.equations = new JTextField[10]; +/* 38 */ this.equationNames = new JLabel[10]; +/* 39 */ this.scroll = new JScrollPane(); +/* 40 */ this.holder.setLayout(new GridLayout(this.equations.length, 1)); +/* 41 */ this.scroll.setPreferredSize(new Dimension(200, 200)); +/* 42 */ this.packages = new JPanel[10]; +/* 43 */ for (int i = 0; i < this.equations.length; i++) { +/* 44 */ this.equations[i] = new JTextField("", 10); +/* 45 */ this.equations[i].setFocusable(true); +/* 46 */ this.equationNames[i] = new JLabel("<html><a style='font-family:Times New Roman'>y<sub>" + i + "</sub>(x)</a>=<html>"); +/* 47 */ this.packages[i] = new JPanel(new FlowLayout()); +/* 48 */ this.packages[i].add(this.equationNames[i]); +/* 49 */ this.packages[i].add(this.equations[i]); +/* 50 */ this.packages[i].setPreferredSize(new Dimension(150, 65)); +/* 51 */ this.holder.add(this.packages[i]); +/* */ } +/* 53 */ this.scroll.getViewport().add(this.holder); +/* 54 */ this.fullPanel = new JPanel(); +/* 55 */ this.fullPanel.setLayout(new BoxLayout(this.fullPanel, 1)); +/* 56 */ this.fullPanel.add(this.scroll); +/* 57 */ this.fullPanel.add(this.okButtons); +/* 58 */ add(this.fullPanel); +/* */ +/* 60 */ pack(); +/* */ } +/* */ +/* */ public void setEquations(String[] args) { +/* 64 */ for (int i = 0; (i < args.length) && (i < this.equations.length); i++) +/* 65 */ this.equations[i].setText(args[i].replaceAll("<ivar>", GraphTypeHolder.getInstance().getGraphPointMaker().getIndependentVariable())); +/* */ } +/* */ +/* */ public void setVisible(boolean visible) { +/* 69 */ if (visible) { +/* 70 */ setEquations(this.graph.getEquations()); +/* */ } +/* 72 */ super.setVisible(visible); +/* */ } +/* */ public void applyEquations() { +/* 75 */ this.graph.setEquations(getEquations()); +/* 76 */ ModulusThreads.addThread("Remaking Points", this.graph.getThread()); +/* */ } +/* */ public String[] getEquations() { +/* 79 */ ArrayList strs = new ArrayList(); +/* 80 */ for (JTextField jtf : this.equations) { +/* 81 */ if (jtf.getText().length() != 0) +/* 82 */ strs.add(parseEquation(jtf.getText())); +/* */ } +/* 84 */ String[] ret = new String[strs.size()]; +/* 85 */ for (int i = 0; i < strs.size(); i++) ret[i] = ((String)strs.get(i)); +/* 86 */ return ret; +/* */ } +/* */ public static String parseEquation(String equation) { +/* 89 */ if (equation.equals("")) return ""; +/* 90 */ if (equation.length() == 1) return equation.charAt(0) == GraphTypeHolder.getInstance().getGraphPointMaker().getIndependentVariable() ? "<ivar>" : equation; +/* 91 */ Point2DMaker maker = GraphTypeHolder.getInstance().getGraphPointMaker(); +/* 92 */ String ret = ""; +/* 93 */ for (int i = 0; i < equation.length(); i++) { +/* 94 */ char next = equation.charAt(i); +/* 95 */ if (next == maker.getIndependentVariable()) { +/* 96 */ if (i == 0) { +/* 97 */ if (!Character.isLowerCase(equation.charAt(i + 1))) { +/* 98 */ ret = ret + "<ivar>"; +/* 99 */ continue; +/* */ } +/* */ } +/* 102 */ else if (i == equation.length() - 1) { +/* 103 */ if (!Character.isLowerCase(equation.charAt(i - 1))) { +/* 104 */ ret = ret + "<ivar>"; +/* 105 */ continue; +/* */ } +/* */ } +/* 108 */ else if ((!Character.isLowerCase(equation.charAt(i - 1))) && (!Character.isLowerCase(equation.charAt(i + 1)))) { +/* 109 */ ret = ret + "<ivar>"; +/* 110 */ continue; +/* */ } +/* */ } +/* 113 */ ret = ret + equation.charAt(i); +/* */ } +/* 115 */ return ret; +/* */ } +/* */ public void graphTypeChanged(Point2DMaker maker) { +/* 118 */ for (int i = 0; i < this.equationNames.length; i++) +/* 119 */ this.equationNames[i].setText("<html><a style='font-family:Times New Roman'>" + maker.getDependentVariable() + "<sub>" + i + "</sub>(" + GraphTypeHolder.getInstance().getGraphPointMaker().getIndependentVariable() + ")</a> =<html>"); +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) +/* */ { +/* 124 */ setVisible(false); +/* 125 */ if (e.getSource() == this.ok) +/* 126 */ applyEquations(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: EquationDialog + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Euclidean2DPointMaker.java b/src/Euclidean2DPointMaker.java new file mode 100644 index 0000000..169aee2 --- /dev/null +++ b/src/Euclidean2DPointMaker.java @@ -0,0 +1,18 @@ +/* */ public class Euclidean2DPointMaker extends Point2DMaker +/* */ { +/* */ public Euclidean2DPointMaker() +/* */ { +/* 15 */ super('x', 'y', new EuclideanDynamicGraphBuilder()); +/* */ } +/* */ public Point2D createPoint(double x, double y) { +/* 18 */ return new Point2D(x, y); +/* */ } +/* */ public GraphIterator getIteratorInstance(Graph2D graph) { +/* 21 */ return EuclideanGraphIterator.getInstance(graph); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Euclidean2DPointMaker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/EuclideanDynamicGraphBuilder.java b/src/EuclideanDynamicGraphBuilder.java new file mode 100644 index 0000000..46e3c3f --- /dev/null +++ b/src/EuclideanDynamicGraphBuilder.java @@ -0,0 +1,35 @@ +/* */ import java.util.ArrayList; +/* */ +/* */ public class EuclideanDynamicGraphBuilder +/* */ implements DynamicGraphBuilder +/* */ { +/* */ public void recreate(Graph2D graph) +/* */ { +/* 11 */ Point2D minX = (Point2D)graph.getPoints()[0].get(0); +/* 12 */ Point2D maxX = (Point2D)graph.getPoints()[0].get(graph.getPoints()[0].size() - 1); +/* 13 */ Point2D minStart = graph.translate(minX); +/* 14 */ Point2D maxStart = graph.translate(maxX); +/* */ +/* 16 */ if (minX.getX() > graph.getWindowRange().getXMin()) { +/* 17 */ for (int i = minStart.getX() - graph.getXSkip(); i >= -graph.getXSkip(); i -= graph.getXSkip()) { +/* 18 */ for (int j = 0; j < graph.getEquations().length; j++) { +/* 19 */ Point2D toAdd = new Point2D(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.equation(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.getEquations()[j])); +/* 20 */ graph.pushPoint(toAdd, j); +/* 21 */ graph.trimUp(j); +/* */ } +/* */ } +/* */ } +/* 25 */ if (maxX.getX() < graph.getWindowRange().getXMax()) +/* 26 */ for (int i = maxStart.getX() + graph.getXSkip(); i <= graph.getWidth() + graph.getXSkip(); i += graph.getXSkip()) +/* 27 */ for (int j = 0; j < graph.getEquations().length; j++) { +/* 28 */ Point2D toAdd = new Point2D(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.equation(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.getEquations()[j])); +/* 29 */ graph.addPoint(toAdd, j); +/* 30 */ graph.trimDown(j); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: EuclideanDynamicGraphBuilder + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/EuclideanGraphIterator.java b/src/EuclideanGraphIterator.java new file mode 100644 index 0000000..a09e2fe --- /dev/null +++ b/src/EuclideanGraphIterator.java @@ -0,0 +1,30 @@ +/* */ public class EuclideanGraphIterator extends GraphIterator +/* */ { +/* */ private Graph2D graph; +/* */ +/* */ public EuclideanGraphIterator(Graph2D graph) +/* */ { +/* 12 */ super(-(int)(graph.getWidth() * 1.5D)); +/* 13 */ this.graph = graph; +/* */ } +/* */ public static EuclideanGraphIterator getInstance(Graph2D graph) { +/* 16 */ return new EuclideanGraphIterator(graph); +/* */ } +/* */ public boolean hasMoreTokens() { +/* 19 */ return this.index < this.graph.getWidth() * 1.5D; +/* */ } +/* */ public void onTurn() { +/* 22 */ this.index += this.graph.getXSkip(); +/* */ } +/* */ public double translateIndex(Graph2D graph) { +/* 25 */ return this.index * graph.getXRes() + graph.getWindowRange().getXMin(); +/* */ } +/* */ public double translateNumber(Graph2D graph, double i) { +/* 28 */ return i * graph.getXRes() + graph.getWindowRange().getXMin(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: EuclideanGraphIterator + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ExtendablePointInvoker.java b/src/ExtendablePointInvoker.java new file mode 100644 index 0000000..18f3798 --- /dev/null +++ b/src/ExtendablePointInvoker.java @@ -0,0 +1,38 @@ +/* */ import java.awt.Graphics; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ +/* */ public class ExtendablePointInvoker +/* */ implements PointInvoker +/* */ { +/* */ private List<PointInvoker> invokers; +/* */ +/* */ public ExtendablePointInvoker(List<PointInvoker> invokers) +/* */ { +/* 14 */ this.invokers = invokers; +/* */ } +/* */ public ExtendablePointInvoker(PointInvoker invoker) { +/* 17 */ this.invokers = new ArrayList(); +/* 18 */ this.invokers.add(invoker); +/* */ } +/* */ public void remove(PointInvoker invoke) { +/* 21 */ this.invokers.remove(invoke); +/* */ } +/* */ public void drawPoint(Graphics g, int x, int y) { +/* 24 */ for (int i = 0; i < this.invokers.size(); i++) +/* 25 */ ((PointInvoker)this.invokers.get(i)).drawPoint(g, x, y); +/* */ } +/* */ +/* */ public void concat(PointInvoker invoke) { +/* 29 */ this.invokers.add(invoke); +/* */ } +/* */ public void setInvoker(PointInvoker invoke) { +/* 32 */ this.invokers = new ArrayList(); +/* 33 */ concat(invoke); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ExtendablePointInvoker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ExtendedPointInvoker.java b/src/ExtendedPointInvoker.java new file mode 100644 index 0000000..e1824e9 --- /dev/null +++ b/src/ExtendedPointInvoker.java @@ -0,0 +1,161 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ +/* */ public abstract interface ExtendedPointInvoker extends PointInvoker +/* */ { +/* */ public abstract Color getColor(); +/* */ +/* */ public abstract void setSize(int paramInt); +/* */ +/* */ public abstract int getSize(); +/* */ +/* */ public abstract void setColor(Color paramColor); +/* */ +/* */ public static final class CirclePointInvoker +/* */ implements ExtendedPointInvoker +/* */ { +/* */ private int radius; +/* */ private Color color; +/* */ +/* */ public CirclePointInvoker(int radius, Color color) +/* */ { +/* 78 */ this.radius = radius; +/* 79 */ this.color = color; +/* */ } +/* */ +/* */ public void drawPoint(Graphics g, int x, int y) { +/* 83 */ Color temp = g.getColor(); +/* 84 */ g.setColor(this.color); +/* 85 */ g.drawOval(x - this.radius / 2, y - this.radius / 2, this.radius, this.radius); +/* 86 */ g.setColor(temp); +/* */ } +/* */ +/* */ public Color getColor() { +/* 90 */ return this.color; +/* */ } +/* */ +/* */ public void setColor(Color color) { +/* 94 */ this.color = color; +/* */ } +/* */ +/* */ public int getSize() +/* */ { +/* 99 */ return this.radius; +/* */ } +/* */ +/* */ public void setSize(int size) { +/* 103 */ this.radius = size; +/* */ } +/* */ } +/* */ +/* */ public static final class PixelPointInvoker implements ExtendedPointInvoker { +/* */ private Color color; +/* */ +/* */ public PixelPointInvoker(Color color) { +/* 111 */ this.color = color; +/* */ } +/* */ +/* */ public void drawPoint(Graphics g, int x, int y) { +/* 115 */ Color temp = g.getColor(); +/* 116 */ g.setColor(this.color); +/* 117 */ g.drawRect(x, y, 0, 0); +/* 118 */ g.setColor(temp); +/* */ } +/* */ +/* */ public Color getColor() { +/* 122 */ return this.color; +/* */ } +/* */ +/* */ public void setColor(Color color) { +/* 126 */ this.color = color; +/* */ } +/* */ +/* */ public int getSize() +/* */ { +/* 131 */ return 1; +/* */ } +/* */ +/* */ public void setSize(int size) +/* */ { +/* */ } +/* */ } +/* */ +/* */ public static final class SquareFillPointInvoker +/* */ implements ExtendedPointInvoker +/* */ { +/* */ private int size; +/* */ private Color color; +/* */ +/* */ public SquareFillPointInvoker(int size, Color color) +/* */ { +/* 45 */ this.size = size; +/* 46 */ this.color = color; +/* */ } +/* */ +/* */ public void drawPoint(Graphics g, int x, int y) { +/* 50 */ Color temp = g.getColor(); +/* 51 */ g.setColor(this.color); +/* 52 */ g.fillRect(x - this.size / 2, y - this.size / 2, this.size, this.size); +/* 53 */ g.setColor(temp); +/* */ } +/* */ +/* */ public Color getColor() { +/* 57 */ return this.color; +/* */ } +/* */ +/* */ public void setColor(Color color) { +/* 61 */ this.color = color; +/* */ } +/* */ +/* */ public int getSize() +/* */ { +/* 66 */ return this.size; +/* */ } +/* */ +/* */ public void setSize(int size) { +/* 70 */ this.size = size; +/* */ } +/* */ } +/* */ +/* */ public static final class SquarePointInvoker +/* */ implements ExtendedPointInvoker +/* */ { +/* */ private int size; +/* */ private Color color; +/* */ +/* */ public SquarePointInvoker(int size, Color color) +/* */ { +/* 11 */ this.size = size; +/* 12 */ this.color = color; +/* */ } +/* */ +/* */ public void drawPoint(Graphics g, int x, int y) { +/* 16 */ Color temp = g.getColor(); +/* 17 */ g.setColor(this.color); +/* 18 */ g.drawRect(x - this.size / 2, y - this.size / 2, this.size, this.size); +/* 19 */ g.setColor(temp); +/* */ } +/* */ +/* */ public Color getColor() { +/* 23 */ return this.color; +/* */ } +/* */ +/* */ public void setColor(Color color) { +/* 27 */ this.color = color; +/* */ } +/* */ +/* */ public int getSize() +/* */ { +/* 32 */ return this.size; +/* */ } +/* */ +/* */ public void setSize(int size) { +/* 36 */ this.size = size; +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ExtendedPointInvoker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/FileChanger.java b/src/FileChanger.java new file mode 100644 index 0000000..aac7c92 --- /dev/null +++ b/src/FileChanger.java @@ -0,0 +1,261 @@ +/* */ import java.awt.BorderLayout; +/* */ import java.awt.Dimension; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Toolkit; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.io.BufferedReader; +/* */ import java.io.BufferedWriter; +/* */ import java.io.DataInputStream; +/* */ import java.io.File; +/* */ import java.io.FileFilter; +/* */ import java.io.FileInputStream; +/* */ import java.io.FileWriter; +/* */ import java.io.FilenameFilter; +/* */ import java.io.IOException; +/* */ import java.io.InputStreamReader; +/* */ import java.util.ArrayList; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JList; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JScrollPane; +/* */ +/* */ public class FileChanger extends JFrame +/* */ implements ActionListener, FileFilter, FilenameFilter +/* */ { +/* */ private File parent2; +/* */ private String file1; +/* */ private String file2; +/* */ private Object[] list1; +/* */ private Object[] list2; +/* */ private JList jList1; +/* */ private JList jList2; +/* 26 */ private JButton move = new JButton("Move"); +/* 27 */ private JButton ok = new JButton("OK"); +/* */ private JScrollPane pane1; +/* */ private JScrollPane pane2; +/* 30 */ private JButton clr1 = new JButton("Clear"); +/* 31 */ private JButton clr2 = new JButton("Clear"); +/* */ +/* 33 */ public FileChanger(String filename, String[] lst1, String[] lst2) { this.file2 = filename; +/* 34 */ this.parent2 = new File(filename); +/* */ +/* 36 */ if (!this.parent2.exists()) this.parent2.mkdirs(); +/* */ +/* 38 */ this.list1 = lst1; +/* 39 */ this.list2 = lst2; +/* */ +/* 41 */ this.jList1 = new JList(this.list1); +/* 42 */ this.jList2 = new JList(this.list2); +/* */ +/* 44 */ this.pane1 = new JScrollPane(this.jList1, 22, 30); +/* 45 */ this.pane2 = new JScrollPane(this.jList2, 22, 30); +/* */ +/* 50 */ this.pane1.setPreferredSize(new Dimension(130, 260)); +/* 51 */ this.pane2.setPreferredSize(new Dimension(130, 260)); +/* 52 */ JPanel sto1 = new JPanel(new BorderLayout()); +/* 53 */ JPanel sto2 = new JPanel(new BorderLayout()); +/* 54 */ this.ok.addActionListener(this); +/* 55 */ this.move.addActionListener(this); +/* 56 */ this.clr1.addActionListener(this); +/* 57 */ this.clr2.addActionListener(this); +/* */ +/* 59 */ setLayout(new BorderLayout()); +/* 60 */ JPanel sto = new JPanel(new FlowLayout()); +/* 61 */ add(new JLabel("Add/Remove Functions"), "North"); +/* 62 */ add(sto, "Center"); +/* */ +/* 64 */ sto1.add(new JLabel("Unused Libraries"), "North"); +/* 65 */ sto2.add(new JLabel("Current Libraries"), "North"); +/* 66 */ sto1.add(this.pane1, "Center"); +/* 67 */ sto2.add(this.pane2, "Center"); +/* 68 */ sto1.add(this.clr1, "South"); +/* 69 */ sto2.add(this.clr2, "South"); +/* */ +/* 71 */ sto.add(sto1); +/* 72 */ sto.add(this.move); +/* 73 */ sto.add(sto2); +/* 74 */ JPanel tmp = new JPanel(); +/* 75 */ tmp.add(this.ok); +/* 76 */ add(tmp, "South"); +/* 77 */ pack(); +/* 78 */ setIconImage(Toolkit.getDefaultToolkit().getImage("modulus_symbol.png")); +/* 79 */ setVisible(true); +/* */ } +/* */ +/* */ public FileChanger(String parent) +/* */ { +/* 85 */ String filename = parent; +/* 86 */ this.file2 = filename; +/* 87 */ String[] lst1 = subtract( +/* 88 */ new File(parent).list(this), +/* 89 */ pickup(parent)); +/* */ +/* 91 */ String[] lst2 = pickup(parent); +/* 92 */ this.parent2 = new File(filename); +/* */ +/* 94 */ if (!this.parent2.exists()) this.parent2.mkdirs(); +/* */ +/* 96 */ this.list1 = lst1; +/* 97 */ this.list2 = lst2; +/* */ +/* 99 */ this.jList1 = new JList(this.list1); +/* 100 */ this.jList2 = new JList(this.list2); +/* */ +/* 102 */ this.pane1 = new JScrollPane(this.jList1, 22, 30); +/* 103 */ this.pane2 = new JScrollPane(this.jList2, 22, 30); +/* */ +/* 108 */ this.pane1.setPreferredSize(new Dimension(130, 260)); +/* 109 */ this.pane2.setPreferredSize(new Dimension(130, 260)); +/* 110 */ JPanel sto1 = new JPanel(new BorderLayout()); +/* 111 */ JPanel sto2 = new JPanel(new BorderLayout()); +/* 112 */ this.ok.addActionListener(this); +/* 113 */ this.move.addActionListener(this); +/* 114 */ this.clr1.addActionListener(this); +/* 115 */ this.clr2.addActionListener(this); +/* */ +/* 117 */ setLayout(new BorderLayout()); +/* 118 */ JPanel sto = new JPanel(new FlowLayout()); +/* 119 */ add(new JLabel("Add/Remove Functions"), "North"); +/* 120 */ add(sto, "Center"); +/* */ +/* 122 */ sto1.add(new JLabel("Unused Libraries"), "North"); +/* 123 */ sto2.add(new JLabel("Current Libraries"), "North"); +/* 124 */ sto1.add(this.pane1, "Center"); +/* 125 */ sto2.add(this.pane2, "Center"); +/* 126 */ sto1.add(this.clr1, "South"); +/* 127 */ sto2.add(this.clr2, "South"); +/* */ +/* 129 */ sto.add(sto1); +/* 130 */ sto.add(this.move); +/* 131 */ sto.add(sto2); +/* 132 */ JPanel tmp = new JPanel(); +/* 133 */ tmp.add(this.ok); +/* 134 */ add(tmp, "South"); +/* 135 */ pack(); +/* */ } +/* */ public void setList1(String[] arg) { +/* 138 */ this.list1 = arg; +/* 139 */ update(); +/* */ } +/* */ public void setList2(String[] arg) { +/* 142 */ this.list1 = arg; +/* 143 */ update(); +/* */ } +/* */ +/* */ public void update() { +/* 147 */ ArrayList lst1 = asList(this.list1); +/* 148 */ ArrayList lst2 = asList(this.list2); +/* */ +/* 150 */ for (int i : this.jList1.getSelectedIndices()) { +/* 151 */ lst2.add((String)lst1.get(i)); +/* */ } +/* 153 */ for (int i : this.jList2.getSelectedIndices()) { +/* 154 */ lst1.add((String)lst2.get(i)); +/* */ } +/* 156 */ for (int i : this.jList1.getSelectedIndices()) { +/* 157 */ lst1.set(i, "<removed>"); +/* */ } +/* 159 */ for (int i : this.jList2.getSelectedIndices()) { +/* 160 */ lst2.set(i, "<removed>"); +/* */ } +/* 162 */ for (int i = 0; (i < lst2.size()) || (i < lst1.size()); i++) { +/* 163 */ if ((i < lst2.size()) && (((String)lst2.get(i)).equals("<removed>"))) lst2.remove(i); +/* 164 */ if ((i < lst1.size()) && (((String)lst1.get(i)).equals("<removed>"))) lst1.remove(i); +/* */ } +/* 166 */ this.list1 = toStringArray(lst1); +/* 167 */ this.list2 = toStringArray(lst2); +/* 168 */ this.jList1.setListData(this.list1); +/* 169 */ this.jList2.setListData(this.list2); +/* */ } +/* */ public void load() { +/* 172 */ write(); +/* 173 */ for (Object str : this.list2) +/* */ try { +/* 175 */ ControlPanel.load(new File(".").getCanonicalPath().toString() + "/functions/" + str.toString()); +/* */ } catch (Exception e) { +/* 177 */ e.printStackTrace(); +/* */ } +/* 179 */ setVisible(false); +/* */ } +/* */ public void actionPerformed(ActionEvent o) { +/* 182 */ if (o.getSource() == this.ok) { +/* 183 */ load(); +/* */ } +/* 185 */ if (o.getSource() == this.move) +/* */ { +/* 194 */ update(); +/* */ } +/* 196 */ if (o.getSource() == this.clr1) this.jList1.clearSelection(); +/* 197 */ if (o.getSource() == this.clr2) this.jList2.clearSelection(); +/* */ } +/* */ +/* 200 */ public boolean accept(File dir, String name) { return accept(new File(dir, name)); } +/* */ +/* */ +/* */ public boolean accept(File pathname) +/* */ { +/* 205 */ return ((pathname.getName().endsWith(".calc")) || (pathname.getName().endsWith(".marc")) || (pathname.getName().endsWith(".class"))) && +/* 205 */ (!pathname.isDirectory()); +/* */ } +/* */ public void write() { +/* */ try { +/* 209 */ BufferedWriter out = new BufferedWriter(new FileWriter(new File(this.parent2, "functionsLOD.prop"))); +/* 210 */ for (Object i : this.list2) { +/* 211 */ out.write("lod " + i + "\n"); +/* */ } +/* 213 */ out.close(); +/* */ } catch (IOException localIOException) { +/* */ } +/* */ } +/* */ +/* */ private ArrayList<String> asList(Object[] x) { +/* 219 */ ArrayList ret = new ArrayList(); +/* 220 */ for (Object i : x) ret.add(i.toString()); +/* 221 */ return ret; +/* */ } +/* */ public static String[] toStringArray(ArrayList<String> x) { +/* 224 */ String[] ret = new String[x.size()]; +/* 225 */ for (int i = 0; i < x.size(); i++) { +/* 226 */ ret[i] = ((String)x.get(i)); +/* */ } +/* 228 */ return ret; +/* */ } +/* */ private static String[] pickup(String parent) { +/* */ try { +/* 232 */ File par = new File(parent); +/* 233 */ File sub = new File(par, "functionsLOD.prop"); +/* 234 */ FileInputStream fstream = new FileInputStream(sub); +/* 235 */ DataInputStream in = new DataInputStream(fstream); +/* 236 */ BufferedReader br = new BufferedReader(new InputStreamReader(in)); +/* 237 */ ArrayList x = new ArrayList(); +/* */ String str; +/* 239 */ while ((str = br.readLine()) != null) +/* */ { +/* 240 */ String str; +/* 240 */ if (str.startsWith("lod")) x.add(str.substring(3).trim()); +/* */ } +/* 242 */ return toStringArray(x); +/* */ } +/* */ catch (Exception e) { +/* 245 */ AlertBox.throwError(e.getMessage()); +/* 246 */ e.printStackTrace(); +/* 247 */ }return null; +/* */ } +/* */ public static String[] subtract(String[] arg1, String[] arg2) { +/* 250 */ ArrayList ret = new ArrayList(); +/* 251 */ String[] arrayOfString1 = arg1; int j = arg1.length; for (int i = 0; i < j; i++) { String i = arrayOfString1[i]; +/* 252 */ boolean b = false; +/* 253 */ for (String j : arg2) if ((j != null) && (j.equals(i))) b = true; +/* 254 */ if (!b) ret.add(i); +/* */ } +/* 256 */ return toStringArray(ret); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: FileChanger + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Flagger.java b/src/Flagger.java new file mode 100644 index 0000000..490c1f7 --- /dev/null +++ b/src/Flagger.java @@ -0,0 +1,31 @@ +import java.awt.Component; + +public abstract interface Flagger +{ + public abstract void flag(double paramDouble1, double paramDouble2, String paramString); + + public abstract void flag0(int paramInt); + + public abstract void flag1(Component paramComponent); + + public abstract void flag2(Object paramObject); + + public abstract void flag3(); + + public abstract void flag4(); + + public abstract void flag5(); + + public abstract void flag6(); + + public abstract void flag7(); + + public abstract void flag8(); + + public abstract void flag9(); +} + +/* Location: Modulus.jar + * Qualified Name: Flagger + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/FormatFrame.java b/src/FormatFrame.java new file mode 100644 index 0000000..b20b670 --- /dev/null +++ b/src/FormatFrame.java @@ -0,0 +1,92 @@ +/* */ import java.awt.BorderLayout; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JCheckBox; +/* */ import javax.swing.JComboBox; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JRadioButton; +/* */ import utilities.DecimalFormatter; +/* */ import utilities.EFormatter; +/* */ import utilities.NoFormatter; +/* */ import utilities.ScientificFormatter; +/* */ +/* */ public class FormatFrame extends JDialog +/* */ implements ActionListener +/* */ { +/* 16 */ private JRadioButton[] buttons = { +/* 17 */ new JRadioButton("No Format"), +/* 18 */ new JRadioButton("Scientific Notation"), +/* 19 */ new JRadioButton("E Notation") }; +/* */ private MButtonGroup group; +/* */ private JCheckBox flt; +/* */ private JButton ok; +/* */ private JButton cancel; +/* 25 */ private JComboBox num = new JComboBox(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }); +/* */ private JPanel mainPanel; +/* */ private JPanel secondPanel; +/* */ private JPanel buttonPanel; +/* */ private JPanel bottomPanel; +/* */ +/* */ public FormatFrame(JFrame parent, DecimalFormatter f) +/* */ { +/* 31 */ super(parent, true); +/* 32 */ this.flt = new JCheckBox("Float"); +/* 33 */ this.group = new MButtonGroup(this.buttons); +/* 34 */ if ((f instanceof NoFormatter)) this.buttons[0].setSelected(true); +/* 35 */ else if ((f instanceof EFormatter)) this.buttons[2].setSelected(true); else { +/* 36 */ this.buttons[1].setSelected(true); +/* */ } +/* */ +/* 39 */ this.ok = new JButton("Set"); +/* 40 */ this.cancel = new JButton("Cancel"); +/* */ +/* 42 */ this.ok.addActionListener(this); +/* 43 */ this.cancel.addActionListener(this); +/* */ +/* 45 */ this.mainPanel = new JPanel(new BorderLayout()); +/* 46 */ this.secondPanel = new JPanel(new FlowLayout()); +/* 47 */ this.buttonPanel = new JPanel(new BorderLayout()); +/* 48 */ this.bottomPanel = new JPanel(new FlowLayout()); +/* */ +/* 50 */ this.secondPanel.add(new JLabel("Float To:")); +/* 51 */ this.secondPanel.add(this.num); +/* 52 */ this.secondPanel.add(this.flt); +/* */ +/* 55 */ this.buttonPanel.add(this.buttons[0], "North"); +/* 56 */ this.buttonPanel.add(this.buttons[1], "Center"); +/* 57 */ this.buttonPanel.add(this.buttons[2], "South"); +/* */ +/* 59 */ this.bottomPanel.add(this.ok); +/* 60 */ this.bottomPanel.add(this.cancel); +/* */ +/* 62 */ this.mainPanel.add(this.buttonPanel, "West"); +/* 63 */ this.mainPanel.add(this.secondPanel, "East"); +/* 64 */ this.mainPanel.add(this.bottomPanel, "South"); +/* */ +/* 66 */ add(this.mainPanel); +/* 67 */ pack(); +/* */ } +/* */ public DecimalFormatter createInstance() { +/* 70 */ if (this.buttons[0].isSelected()) return new NoFormatter(0); +/* 71 */ if (this.buttons[1].isSelected()) return new ScientificFormatter(this.num.getSelectedIndex() + 1, Calculator.getBase(), getFloat()); +/* 72 */ return new EFormatter(this.num.getSelectedIndex() + 1, Calculator.getBase(), getFloat()); +/* */ } +/* */ public void actionPerformed(ActionEvent e) { +/* 75 */ if (e.getSource() == this.ok) +/* 76 */ CalculatorGUI.getCurrentInstance().setDecimalFormatter(createInstance()); +/* 77 */ setVisible(false); +/* */ } +/* */ public boolean getFloat() { +/* 80 */ return this.flt.isSelected(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: FormatFrame + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/GridPanel.java b/src/GUIComponents/GridPanel.java new file mode 100644 index 0000000..dc8d904 --- /dev/null +++ b/src/GUIComponents/GridPanel.java @@ -0,0 +1,36 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.Component; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.GridLayout; +/* */ import javax.swing.JPanel; +/* */ +/* */ public class GridPanel extends JPanel +/* */ { +/* */ private JPanel[][] panels; +/* */ +/* */ public GridPanel(int width, int height, int spacingx, int spacingy) +/* */ { +/* 18 */ this.panels = new JPanel[width][height]; +/* 19 */ setLayout(new GridLayout(height, width)); +/* 20 */ int i = 0; for (int a = 0; i < this.panels.length; a++) { +/* 21 */ for (int j = 0; j < this.panels[0].length; a++) +/* */ { +/* 23 */ add(this.panels[i][j] = = new JPanel(new FlowLayout())); +/* */ +/* 21 */ j++; +/* */ } +/* 20 */ i++; +/* */ } +/* */ } +/* */ +/* */ public void add(Component component, int col, int row) +/* */ { +/* 30 */ this.panels[col][row].add(component); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.GridPanel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/JOptionPanel.java b/src/GUIComponents/JOptionPanel.java new file mode 100644 index 0000000..08ec6a3 --- /dev/null +++ b/src/GUIComponents/JOptionPanel.java @@ -0,0 +1,60 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.BorderLayout; +/* */ import java.awt.Dimension; +/* */ import java.awt.GridLayout; +/* */ import javax.swing.BorderFactory; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.border.TitledBorder; +/* */ +/* */ public class JOptionPanel extends JPanel +/* */ { +/* */ private JPanel[] panels; +/* */ +/* */ public JOptionPanel(String[] titles, JPanel[] p) +/* */ { +/* 19 */ setLayout(new GridLayout(getCount(titles), 1)); +/* 20 */ if (p != null) { +/* 21 */ this.panels = p; +/* */ } +/* */ else { +/* 24 */ this.panels = new JPanel[titles.length]; +/* 25 */ for (int i = 0; i < this.panels.length; i++) { +/* 26 */ this.panels[i] = new JPanel(new BorderLayout()); +/* 27 */ this.panels[i].setPreferredSize(new Dimension(getWidth(), getHeight() / titles.length)); +/* */ } +/* */ } +/* 30 */ for (int i = 0; i < titles.length; i++) +/* 31 */ if (titles[i] != null) { +/* 32 */ if (!titles[i].equals("")) { +/* 33 */ TitledBorder titledBorder = BorderFactory.createTitledBorder(titles[i]); +/* 34 */ this.panels[i].setBorder(titledBorder); +/* */ +/* 36 */ if (i == 0) String str1 = "Center"; +/* 37 */ String layout; +/* 37 */ if (i == 1) layout = "North"; else +/* 38 */ layout = "South"; +/* */ } +/* 40 */ add(this.panels[i], i); +/* */ } +/* */ } +/* */ +/* */ public JOptionPanel(String[] titles) { +/* 45 */ this(titles, null); +/* */ } +/* */ public int getCount(Object[] obj) { +/* 48 */ int i = 0; +/* 49 */ for (Object x : obj) { +/* 50 */ if (x != null) i++; +/* */ } +/* 52 */ return i; +/* */ } +/* */ public JPanel getPanel(int index) { +/* 55 */ return this.panels[index]; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.JOptionPanel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/MouseClickListener.java b/src/GUIComponents/MouseClickListener.java new file mode 100644 index 0000000..12b578f --- /dev/null +++ b/src/GUIComponents/MouseClickListener.java @@ -0,0 +1,44 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.Container; +/* */ import java.awt.event.MouseEvent; +/* */ import java.awt.event.MouseListener; +/* */ +/* */ public abstract class MouseClickListener +/* */ implements MouseListener +/* */ { +/* */ private static Container listener; +/* */ +/* */ public MouseClickListener(Container listener) +/* */ { +/* 10 */ listener = listener; +/* */ } +/* */ +/* */ public MouseClickListener() +/* */ { +/* */ } +/* */ +/* */ public abstract void mouseClicked(MouseEvent paramMouseEvent); +/* */ +/* */ public void mouseEntered(MouseEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void mouseExited(MouseEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public abstract void mousePressed(MouseEvent paramMouseEvent); +/* */ +/* */ public abstract void mouseReleased(MouseEvent paramMouseEvent); +/* */ +/* */ public Container getContainer() +/* */ { +/* 36 */ return listener; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.MouseClickListener + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/MouseOneClickListener.java b/src/GUIComponents/MouseOneClickListener.java new file mode 100644 index 0000000..1758cea --- /dev/null +++ b/src/GUIComponents/MouseOneClickListener.java @@ -0,0 +1,34 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.Container; +/* */ import java.awt.event.MouseEvent; +/* */ +/* */ public class MouseOneClickListener extends MouseClickListener +/* */ { +/* */ public MouseOneClickListener(Container listener) +/* */ { +/* 16 */ super(listener); +/* */ } +/* */ +/* */ public MouseOneClickListener() +/* */ { +/* */ } +/* */ +/* */ public void mouseClicked(MouseEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void mousePressed(MouseEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void mouseReleased(MouseEvent arg0) +/* */ { +/* 47 */ getContainer().removeMouseListener(this); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.MouseOneClickListener + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/OptionPanel.java b/src/GUIComponents/OptionPanel.java new file mode 100644 index 0000000..7f03487 --- /dev/null +++ b/src/GUIComponents/OptionPanel.java @@ -0,0 +1,58 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.Dimension; +/* */ import java.awt.GridLayout; +/* */ import javax.swing.JPanel; +/* */ +/* */ public class OptionPanel extends JPanel +/* */ { +/* */ private JOptionPanel[] outerPanels; +/* */ +/* */ public OptionPanel(String[] titles, JPanel[] panels) +/* */ { +/* 21 */ this.outerPanels = new JOptionPanel[(int)Math.ceil(titles.length / 3.0D)]; +/* 22 */ setLayout(new GridLayout(1, this.outerPanels.length)); +/* 23 */ int i = 0; for (int count = 0; i < this.outerPanels.length; i++) { +/* 24 */ count += 3; +/* 25 */ int max = titles.length < count ? titles.length : count; +/* 26 */ if (panels == null) +/* 27 */ this.outerPanels[i] = new JOptionPanel(split(titles, count - 3, max)); +/* */ else +/* 29 */ this.outerPanels[i] = new JOptionPanel(split(titles, count - 3, max), split(panels, count - 3, max)); +/* 30 */ this.outerPanels[i].setPreferredSize(new Dimension(getWidth() / this.outerPanels.length, getHeight())); +/* */ String layout; +/* */ String layout; +/* 32 */ if (i == 0) { layout = "Center"; } +/* */ else +/* */ { +/* 33 */ String layout; +/* 33 */ if (i == 1) layout = "West"; else +/* 34 */ layout = "East"; +/* */ } +/* 36 */ add(this.outerPanels[i], i); +/* */ } +/* */ } +/* */ +/* */ public JPanel getPanel(int index) { +/* 41 */ return this.outerPanels[index]; +/* */ } +/* */ private String[] split(String[] other, int min, int max) { +/* 44 */ String[] ret = new String[max - min]; +/* 45 */ for (int i = min; i < max; i++) { +/* 46 */ ret[(i - min)] = other[i]; +/* */ } +/* 48 */ return ret; +/* */ } +/* */ private JPanel[] split(JPanel[] other, int min, int max) { +/* 51 */ JPanel[] ret = new JPanel[max - min]; +/* 52 */ for (int i = min; i < max; i++) { +/* 53 */ ret[(i - min)] = other[i]; +/* */ } +/* 55 */ return ret; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.OptionPanel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/ProgressFrame.java b/src/GUIComponents/ProgressFrame.java new file mode 100644 index 0000000..b95c8e7 --- /dev/null +++ b/src/GUIComponents/ProgressFrame.java @@ -0,0 +1,44 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.BorderLayout; +/* */ import java.awt.FlowLayout; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JProgressBar; +/* */ +/* */ public class ProgressFrame extends JDialog +/* */ { +/* */ private JProgressBar progress; +/* */ private JPanel panelHolder; +/* */ private double prog; +/* */ +/* */ public ProgressFrame(int min, int max, JFrame parent) +/* */ { +/* 17 */ super(parent); +/* 18 */ this.prog = 0.0D; +/* 19 */ setLayout(new BorderLayout()); +/* 20 */ this.panelHolder = new JPanel(new FlowLayout()); +/* 21 */ add(this.panelHolder, "North"); +/* 22 */ this.progress = new JProgressBar(min, max); +/* 23 */ this.progress.setSize(200, 50); +/* 24 */ this.panelHolder.add(this.progress); +/* 25 */ pack(); +/* */ } +/* */ public void incrementProgress(double amt) { +/* 28 */ this.prog += amt; +/* 29 */ this.progress.setValue((int)this.prog); +/* */ } +/* */ public void setValue(double amt) { +/* 32 */ this.prog = amt; +/* 33 */ this.progress.setValue((int)this.prog); +/* */ } +/* */ public void flagEnd() { +/* 36 */ setVisible(false); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.ProgressFrame + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/PushablePanel.java b/src/GUIComponents/PushablePanel.java new file mode 100644 index 0000000..3d67de1 --- /dev/null +++ b/src/GUIComponents/PushablePanel.java @@ -0,0 +1,62 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.Dimension; +/* */ import java.awt.GridLayout; +/* */ import java.util.ArrayList; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JScrollPane; +/* */ import javax.swing.JViewport; +/* */ +/* */ public class PushablePanel extends JPanel +/* */ { +/* */ private JScrollPane scroll; +/* */ private ArrayList<JComponent> panels; +/* */ private JPanel holdingPanel; +/* */ +/* */ public PushablePanel(int height, int width, ArrayList<JComponent> start) +/* */ { +/* 24 */ setLayout(new GridLayout(1, 1)); +/* 25 */ this.panels = start; +/* 26 */ this.scroll = new JScrollPane(22, 32); +/* 27 */ this.holdingPanel = new JPanel(); +/* 28 */ this.holdingPanel.setLayout(new BoxLayout(this.holdingPanel, 1)); +/* */ +/* 31 */ for (JComponent p : this.panels) { +/* 32 */ this.holdingPanel.add(p); +/* */ } +/* 34 */ this.scroll.getViewport().add(this.holdingPanel); +/* 35 */ add(this.scroll); +/* */ } +/* */ public PushablePanel() { +/* 38 */ this(150, 50, new ArrayList()); +/* */ } +/* */ +/* */ public void pushComponent(JComponent panel) { +/* 42 */ this.panels.add(panel); +/* 43 */ this.holdingPanel.add(panel); +/* 44 */ updateUI(); +/* */ } +/* */ public void removeComponent(JComponent panel) { +/* 47 */ this.panels.remove(panel); +/* 48 */ this.holdingPanel.remove(panel); +/* 49 */ updateUI(); +/* */ } +/* */ public ArrayList<JComponent> getPushedComponents() { +/* 52 */ return this.panels; +/* */ } +/* */ public void setPreferredSize(Dimension x) { +/* 55 */ super.setPreferredSize(x); +/* 56 */ this.scroll.setPreferredSize(x); +/* */ } +/* */ public void removeAllComponents() { +/* 59 */ while (this.panels.size() > 0) +/* 60 */ removeComponent((JComponent)this.panels.get(0)); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.PushablePanel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/ThreadRunner.java b/src/GUIComponents/ThreadRunner.java new file mode 100644 index 0000000..d3043ca --- /dev/null +++ b/src/GUIComponents/ThreadRunner.java @@ -0,0 +1,29 @@ +/* */ package GUIComponents; +/* */ +/* */ import javax.swing.JFrame; +/* */ +/* */ public class ThreadRunner extends Thread +/* */ { +/* */ private ProgressFrame progress; +/* */ +/* */ public ThreadRunner(JFrame parent) +/* */ { +/* 15 */ super(new ThreadGroup(Thread.currentThread().getThreadGroup().getParent(), "Loading"), "Bar"); +/* 16 */ this.progress = new ProgressFrame(0, 100, parent); +/* 17 */ setPriority(1); +/* */ } +/* */ public void increment(double amt) { +/* 20 */ this.progress.incrementProgress(amt); +/* */ } +/* */ public void flagEnd() { +/* 23 */ this.progress.setVisible(false); +/* */ } +/* */ public void run() { +/* 26 */ this.progress.setVisible(true); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.ThreadRunner + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/ToggleButtonGroup.java b/src/GUIComponents/ToggleButtonGroup.java new file mode 100644 index 0000000..a2c8ad6 --- /dev/null +++ b/src/GUIComponents/ToggleButtonGroup.java @@ -0,0 +1,51 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.util.ArrayList; +/* */ import javax.swing.JToggleButton; +/* */ +/* */ public class ToggleButtonGroup +/* */ implements ActionListener +/* */ { +/* */ private ArrayList<JToggleButton> toggleButtons; +/* */ +/* */ public ToggleButtonGroup() +/* */ { +/* 12 */ this.toggleButtons = new ArrayList(); +/* */ } +/* */ public void addToggleButton(JToggleButton button) { +/* 15 */ this.toggleButtons.add(button); +/* 16 */ button.addActionListener(this); +/* */ } +/* */ public void removeToggleButton(JToggleButton button) { +/* 19 */ this.toggleButtons.remove(button); +/* 20 */ button.removeActionListener(this); +/* */ } +/* */ public JToggleButton getSelectedButton() { +/* 23 */ for (int i = 0; i < this.toggleButtons.size(); i++) if (((JToggleButton)this.toggleButtons.get(i)).isSelected()) return (JToggleButton)this.toggleButtons.get(i); +/* 24 */ return null; +/* */ } +/* */ public int getSelectedIndex() { +/* 27 */ for (int i = 0; i < this.toggleButtons.size(); i++) if (((JToggleButton)this.toggleButtons.get(i)).isSelected()) return i; +/* 28 */ return -1; +/* */ } +/* */ public void setSelectedIndex(int index) { +/* 31 */ clear(); +/* 32 */ ((JToggleButton)this.toggleButtons.get(index)).setSelected(true); +/* */ } +/* */ private void clear() { +/* 35 */ for (int i = 0; i < this.toggleButtons.size(); i++) ((JToggleButton)this.toggleButtons.get(i)).setSelected(false); +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) +/* */ { +/* 39 */ clear(); +/* 40 */ ((JToggleButton)e.getSource()).setSelected(true); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.ToggleButtonGroup + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GUIComponents/WrapperPanel.java b/src/GUIComponents/WrapperPanel.java new file mode 100644 index 0000000..c41c628 --- /dev/null +++ b/src/GUIComponents/WrapperPanel.java @@ -0,0 +1,22 @@ +/* */ package GUIComponents; +/* */ +/* */ import java.awt.Component; +/* */ import java.awt.FlowLayout; +/* */ import javax.swing.JPanel; +/* */ +/* */ public class WrapperPanel extends JPanel +/* */ { +/* */ public WrapperPanel(Component t) +/* */ { +/* 10 */ add(t); +/* */ } +/* */ public WrapperPanel(Component[] cArr) { +/* 13 */ super(new FlowLayout()); +/* 14 */ for (Component x : cArr) add(x); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GUIComponents.WrapperPanel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Graph2D.java b/src/Graph2D.java new file mode 100644 index 0000000..49653b3 --- /dev/null +++ b/src/Graph2D.java @@ -0,0 +1,356 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ import java.awt.Point; +/* */ import java.awt.event.MouseListener; +/* */ import java.awt.event.MouseMotionListener; +/* */ import java.io.PrintStream; +/* */ import java.math.BigDecimal; +/* */ import java.text.DecimalFormat; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ +/* */ public class Graph2D extends AbstractGraph +/* */ implements PointInvoker, GraphTranslator, EquationChangeListener, GraphTypeStateChangedListener +/* */ { +/* */ private static final long serialVersionUID = 7997481241457409003L; +/* 31 */ private static Graph2D instance = null; +/* */ private double thetaStep; +/* */ private double thetaStart; +/* */ private double thetaEnd; +/* */ private boolean rectangleMode; +/* */ private RectangleDrawer drawer; +/* 37 */ private ArrayList<EquationChangeListener> equationChangeListeners = new ArrayList(); +/* */ private ArrayList<StatPlot> statPlots; +/* */ private MouseMotionListener[] mouseMotionHold; +/* */ private MouseListener[] mouseHold; +/* */ private Point startRect; +/* */ private Point endRect; +/* 45 */ public static final Color[] colors = { +/* 46 */ Color.red, +/* 47 */ Color.blue, +/* 48 */ Color.green, +/* 49 */ Color.yellow.darker(), +/* 50 */ Color.magenta, +/* 51 */ Color.pink, +/* 52 */ Color.orange, +/* 53 */ Color.black, +/* 54 */ new Color(100, 100, 0), +/* 55 */ Color.gray }; +/* */ private double yres; +/* */ private double xres; +/* */ +/* */ public Graph2D(double xMin, double xMax, double yMin, double yMax) +/* */ { +/* 60 */ super(500, 500); +/* */ +/* 62 */ super.setEquations(new String[] { "<ivar>" }); +/* 63 */ super.setLastY((0.0D / 0.0D)); +/* 64 */ super.setLastX((0.0D / 0.0D)); +/* 65 */ super.setXSkip(1); +/* 66 */ super.setInvoker(new ExtendablePointInvoker(this)); +/* */ +/* 68 */ super.setWindowRange(new WindowRange(xMin, yMin, xMax, yMax)); +/* */ +/* 70 */ this.xres = ((getWindowRange().getXMax() - getWindowRange().getXMin()) / getWidth()); +/* 71 */ this.yres = ((getWindowRange().getYMax() - getWindowRange().getYMin()) / getHeight()); +/* 72 */ this.thetaStart = 0.0D; +/* 73 */ this.thetaEnd = 360.0D; +/* 74 */ this.thetaStep = 1.0D; +/* 75 */ this.statPlots = new ArrayList(); +/* 76 */ this.drawer = new RectangleDrawer(this); +/* */ } +/* */ public void drawPoint(Graphics g, int x, int y) { +/* 79 */ if ((!Double.isNaN(getLastY())) && (!Double.isNaN(getLastX()))) +/* 80 */ g.drawLine((int)getLastX(), (int)getLastY(), x, y); +/* 81 */ super.setLastX(x); +/* 82 */ super.setLastY(y); +/* */ } +/* */ +/* */ public void zoom(double amt) { +/* 86 */ super.setWindowRange(super.getWindowRange().getScaledInstance(amt)); +/* 87 */ repaint(); +/* 88 */ recreate(); +/* */ } +/* */ public void invoke(Graphics g) { +/* 91 */ g.setColor(Color.white); +/* 92 */ g.fillRect(0, 0, getWidth(), getHeight()); +/* 93 */ g.setColor(Color.black); +/* 94 */ this.xres = ((getWindowRange().getXMax() - getWindowRange().getXMin()) / getWidth()); +/* 95 */ this.yres = ((getWindowRange().getYMax() - getWindowRange().getYMin()) / getHeight()); +/* 96 */ drawAxis(g); +/* 97 */ int colorindex = 0; +/* 98 */ for (int i = 0; i < this.statPlots.size(); i++) ((StatPlot)this.statPlots.get(i)).drawPoints(g); +/* 99 */ for (ArrayList pointarr : super.getPoints()) { +/* 100 */ super.setLastY((0.0D / 0.0D)); +/* 101 */ super.setLastX((0.0D / 0.0D)); +/* 102 */ g.setColor(colors[colorindex]); +/* 103 */ for (int i = 0; i < pointarr.size(); i++) { +/* 104 */ Point2D trans = translate((Point2D)pointarr.get(i)); +/* 105 */ if (trans != null) { +/* 106 */ super.getInvoker().drawPoint(g, trans.getX(), trans.getY()); +/* */ } else { +/* 108 */ super.setLastY((0.0D / 0.0D)); +/* 109 */ super.setLastX((0.0D / 0.0D)); +/* */ } +/* */ } +/* 112 */ colorindex = (colorindex + 1) % colors.length; +/* */ } +/* 114 */ if ((this.startRect != null) && (this.endRect != null) && (this.rectangleMode)) +/* */ { +/* 117 */ g.drawLine(this.startRect.x, this.startRect.y, this.endRect.x, this.startRect.y); +/* 118 */ g.drawLine(this.startRect.x, this.startRect.y, this.startRect.x, this.endRect.y); +/* */ +/* 120 */ g.drawLine(this.startRect.x, this.endRect.y, this.endRect.x, this.endRect.y); +/* 121 */ g.drawLine(this.endRect.x, this.startRect.y, this.endRect.x, this.endRect.y); +/* */ } +/* 123 */ for (int i = 0; i < super.getEvents().size(); i++) +/* 124 */ ((GraphicsEvent)super.getEvents().get(i)).invoke(g); +/* */ } +/* */ +/* */ public RectangleDrawer getRectangleDrawer() { +/* 128 */ return this.drawer; +/* */ } +/* */ public void makePoints() { +/* 131 */ for (int j = 0; j < super.getEquations().length; j++) { +/* 132 */ GraphIterator iterator = GraphTypeHolder.getInstance().getGraphPointMaker().getIteratorInstance(this); +/* 133 */ for (; iterator.hasMoreTokens(); iterator.onTurn()) +/* */ { +/* 136 */ Point2D toAdd = GraphTypeHolder.getInstance().getGraphPointMaker().createPoint(iterator.translateIndex(this), equation(iterator.translateIndex(this), super.getEquations()[j])); +/* 137 */ addPoint(toAdd, j); +/* 138 */ repaint(); +/* */ try { +/* 140 */ Thread.sleep(1L); +/* */ } catch (Exception localException) { +/* */ } +/* */ } +/* */ } +/* */ } +/* */ +/* */ public void remakePoints() { +/* 148 */ super.wipe(); +/* 149 */ makePoints(); +/* */ } +/* */ public void drawAxis(Graphics g) { +/* 152 */ DecimalFormat format = new DecimalFormat(".00"); +/* 153 */ if ((getWindowRange().getYMin() < 0.0D) && (getWindowRange().getYMax() > 0.0D)) { +/* 154 */ g.drawLine( +/* 155 */ 0, getHeight() - (int)(getHeight() * (-super.getWindowRange().getYMin() / (super.getWindowRange().getYMax() - super.getWindowRange().getYMin()))), +/* 156 */ getWidth(), getHeight() - (int)(getHeight() * (-super.getWindowRange().getYMin() / (super.getWindowRange().getYMax() - super.getWindowRange().getYMin())))); +/* */ +/* 158 */ String xMinS = format.format(getWindowRange().getXMin()); +/* 159 */ String xMaxS = format.format(getWindowRange().getXMax()); +/* 160 */ g.drawString(xMinS, 0, getHeight() - (int)(getHeight() * (-super.getWindowRange().getYMin() / (super.getWindowRange().getYMax() - super.getWindowRange().getYMin()))) - 10); +/* 161 */ g.drawString(xMaxS, getWidth() - 8 * xMaxS.length(), getHeight() - (int)(getHeight() * (-super.getWindowRange().getYMin() / (super.getWindowRange().getYMax() - super.getWindowRange().getYMin()))) - 10); +/* */ } else { +/* 163 */ String xMinS = format.format(getWindowRange().getXMin()); +/* 164 */ String xMaxS = format.format(getWindowRange().getXMax()); +/* 165 */ g.drawString(xMinS, 0, getHeight() / 2); +/* 166 */ g.drawString(xMaxS, getWidth() - 8 * xMaxS.length(), getHeight() / 2); +/* */ } +/* 168 */ if ((super.getWindowRange().getXMin() < 0.0D) && (super.getWindowRange().getXMax() > 0.0D)) { +/* 169 */ String yMinS = format.format(getWindowRange().getYMin()); +/* 170 */ String yMaxS = format.format(getWindowRange().getYMax()); +/* 171 */ g.drawString(yMinS, (int)(getWidth() * (-super.getWindowRange().getXMin() / (super.getWindowRange().getXMax() - super.getWindowRange().getXMin()))), getHeight() - 8); +/* 172 */ g.drawString(yMaxS, (int)(getWidth() * (-super.getWindowRange().getXMin() / (super.getWindowRange().getXMax() - super.getWindowRange().getXMin()))), 15); +/* 173 */ g.drawLine((int)(getWidth() * (-super.getWindowRange().getXMin() / (super.getWindowRange().getXMax() - super.getWindowRange().getXMin()))), 0, (int)(getWidth() * (-super.getWindowRange().getXMin() / (super.getWindowRange().getXMax() - super.getWindowRange().getXMin()))), getHeight()); +/* */ } else { +/* 175 */ String yMinS = format.format(getWindowRange().getYMin()); +/* 176 */ String yMaxS = format.format(getWindowRange().getYMax()); +/* 177 */ g.drawString(yMinS, getWidth() / 2, getHeight() - 8); +/* 178 */ g.drawString(yMaxS, getWidth() / 2, 15); +/* */ } +/* */ } +/* */ +/* */ public Point2D translate(Point2D point) { +/* 183 */ if ((point == null) || (Double.isNaN(point.getRealY())) || (Double.isNaN(point.getRealX()))) { +/* 184 */ return new Point2D((point.getRealX() - super.getWindowRange().getXMin()) / this.xres, (0.0D / 0.0D)); +/* */ } +/* 186 */ double x = (point.getRealX() - super.getWindowRange().getXMin()) / this.xres; +/* 187 */ double y = (point.getRealY() - super.getWindowRange().getYMin()) / this.yres; +/* 188 */ return new Point2D(x, getHeight() - y); +/* */ } +/* */ public Point2D translateInv(Point2D point) { +/* 191 */ if ((point == null) || (Double.isNaN(point.getRealY())) || (Double.isNaN(point.getRealX()))) { +/* 192 */ return new Point2D((point.getRealX() - super.getWindowRange().getXMin()) / this.xres, (0.0D / 0.0D)); +/* */ } +/* 194 */ double x = point.getRealX() * this.xres + super.getWindowRange().getXMin(); +/* 195 */ double y = getHeight() * this.yres - point.getRealY() * this.yres + super.getWindowRange().getYMin(); +/* 196 */ return new Point2D(x, y); +/* */ } +/* */ public double translateY(int pixels) { +/* 199 */ return getHeight() * this.yres - pixels * this.yres + super.getWindowRange().getYMin(); +/* */ } +/* */ public double translateX(int pixels) { +/* 202 */ return pixels * this.xres + super.getWindowRange().getXMin(); +/* */ } +/* */ public static Graph2D getGraphInstance() { +/* 205 */ if (instance != null) return instance; +/* 206 */ instance = new Graph2D(-10.0D, 10.0D, -10.0D, 10.0D); +/* 207 */ instance.setSize(500, 500); +/* 208 */ return instance; +/* */ } +/* */ public double equation(double x, String equation) { +/* */ try { +/* 212 */ return Double.parseDouble(ControlPanel.figure(equation.replaceAll("<ivar>", "(" + new BigDecimal(x).toPlainString() + ")"))); +/* */ } +/* */ catch (ArithmeticException e) { +/* 215 */ return (0.0D / 0.0D); +/* */ } +/* */ catch (NumberFormatException e) { +/* */ try { +/* 219 */ return Double.parseDouble(ControlPanel.figure(equation.replaceAll("<ivar>", "(" + (int)x + ")"))); +/* */ } catch (Exception c) { +/* 221 */ c.printStackTrace(); +/* 222 */ return (0.0D / 0.0D); +/* */ } +/* */ } catch (Exception e) { +/* */ } +/* 226 */ return (0.0D / 0.0D); +/* */ } +/* */ +/* */ public void recreate() +/* */ { +/* 231 */ if (getEquations().length > 0) +/* 232 */ GraphTypeHolder.getInstance().getGraphPointMaker().getGraphBuilder().recreate(this); +/* */ } +/* */ +/* 235 */ public void trimUp(int index) { if (getPoints()[index].size() > getWidth() * 5) +/* 236 */ for (int i = getPoints()[index].size() - 1; getPoints()[index].size() >= getWidth() * 4; i--) +/* 237 */ getPoints()[index].remove(i); +/* */ } +/* */ +/* */ public void trimDown(int index) +/* */ { +/* 242 */ if (getPoints()[index].size() > getWidth() * 5) +/* 243 */ for (int i = 0; getPoints()[index].size() >= getWidth() * 4; i++) +/* 244 */ getPoints()[index].remove(i); +/* */ } +/* */ +/* */ public double getXRes() +/* */ { +/* 254 */ return this.xres; +/* */ } +/* */ public double getYRes() { +/* 257 */ return this.yres; +/* */ } +/* */ public double getTStart() { +/* 260 */ return this.thetaStart; +/* */ } +/* */ public double getTEnd() { +/* 263 */ return this.thetaEnd; +/* */ } +/* */ public double getTStep() { +/* 266 */ return this.thetaStep; +/* */ } +/* */ public void setTStart(double t) { +/* 269 */ boolean temp = t != this.thetaStart; +/* 270 */ this.thetaStart = t; +/* 271 */ if (temp) +/* 272 */ ModulusThreads.addRunnable("Point Remaker", new Runnable() { +/* */ public void run() { +/* 274 */ Graph2D.this.remakePoints(); +/* */ } +/* */ }); +/* */ } +/* */ +/* */ public void setTEnd(double t) { +/* 280 */ boolean temp = t != this.thetaEnd; +/* 281 */ this.thetaEnd = t; +/* 282 */ if (temp) +/* 283 */ ModulusThreads.addRunnable("Point Remaker", new Runnable() { +/* */ public void run() { +/* 285 */ Graph2D.this.remakePoints(); +/* */ } +/* */ }); +/* */ } +/* */ +/* */ public void setTStep(double t) { +/* 291 */ boolean temp = t != this.thetaStep; +/* 292 */ this.thetaStep = t; +/* 293 */ if (temp) +/* 294 */ ModulusThreads.addRunnable("Point Remaker", new Runnable() { +/* */ public void run() { +/* 296 */ Graph2D.this.remakePoints(); +/* */ } +/* */ }); +/* */ } +/* */ +/* */ public void printPoints() { +/* 302 */ for (int i = 0; i < getPoints()[0].size(); i++) System.out.println(getPoints()[0].get(i)); +/* */ } +/* */ +/* 305 */ public void setEquations(String[] equations) { super.setEquations(equations); +/* 306 */ for (int i = 0; i < this.equationChangeListeners.size(); i++) +/* 307 */ ((EquationChangeListener)this.equationChangeListeners.get(i)).setEquations(equations); } +/* */ +/* */ public void addEquationChangeListener(EquationChangeListener listener) +/* */ { +/* 311 */ this.equationChangeListeners.add(listener); +/* */ } +/* */ +/* */ public void graphTypeChanged(Point2DMaker maker) { +/* 315 */ remakePoints(); +/* */ } +/* */ +/* */ public void addStatPlot(StatPlot plot) { +/* 319 */ this.statPlots.add(plot); +/* 320 */ repaint(); +/* */ } +/* */ public void removeStatPlot(StatPlot plot) { +/* 323 */ this.statPlots.remove(plot); +/* 324 */ repaint(); +/* */ } +/* */ public void resetPlots() { +/* 327 */ this.statPlots = new ArrayList(); +/* 328 */ repaint(); +/* */ } +/* */ public void setRectangleMode(boolean mode) { +/* 331 */ if ((mode) && (!this.rectangleMode)) { +/* 332 */ this.mouseHold = getMouseListeners(); +/* 333 */ this.mouseMotionHold = getMouseMotionListeners(); +/* 334 */ for (MouseListener x : this.mouseHold) +/* 335 */ removeMouseListener(x); +/* 336 */ for (MouseMotionListener x : this.mouseMotionHold) +/* 337 */ removeMouseMotionListener(x); +/* 338 */ addMouseMotionListener(this.drawer); +/* 339 */ addMouseListener(this.drawer); +/* */ } else { +/* 341 */ removeMouseMotionListener(this.drawer); +/* 342 */ removeMouseListener(this.drawer); +/* 343 */ for (MouseListener x : this.mouseHold) +/* 344 */ addMouseListener(x); +/* 345 */ for (MouseMotionListener x : this.mouseMotionHold) +/* 346 */ addMouseMotionListener(x); +/* */ } +/* 348 */ this.rectangleMode = mode; +/* */ } +/* */ public Thread getThread() { +/* 351 */ return new Graph2D.remakeLaunch(); +/* */ } +/* */ public void setRectangleShow(Point p1, Point p2) { +/* 354 */ this.startRect = p1; +/* 355 */ this.endRect = p2; +/* */ } +/* */ +/* */ public void removeEquationChangeListener(EquationChangeListener listen) +/* */ { +/* 363 */ this.equationChangeListeners.remove(listen); +/* */ } +/* */ +/* */ public class remakeLaunch extends Thread +/* */ { +/* */ public remakeLaunch() +/* */ { +/* */ } +/* */ +/* */ public void run() +/* */ { +/* 359 */ Graph2D.this.remakePoints(); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Graph2D + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Graph2DOptionFrame.java b/src/Graph2DOptionFrame.java new file mode 100644 index 0000000..6421ed9 --- /dev/null +++ b/src/Graph2DOptionFrame.java @@ -0,0 +1,68 @@ +/* */ import java.awt.Dimension; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JComboBox; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JPanel; +/* */ +/* */ public class Graph2DOptionFrame extends JDialog +/* */ implements ActionListener +/* */ { +/* */ private static final long serialVersionUID = 1255261492376898359L; +/* */ private JPanel panel; +/* */ private JPanel buttonHolder; +/* */ private JComboBox comboBox; +/* */ private Point2DMaker[] link; +/* */ private String[] keys; +/* */ private JButton ok; +/* */ private JButton cancel; +/* */ +/* */ public Graph2DOptionFrame(JFrame owner) +/* */ { +/* 28 */ super(owner, true); +/* 29 */ this.panel = new JPanel(); +/* 30 */ this.panel.setLayout(new BoxLayout(this.panel, 1)); +/* 31 */ this.buttonHolder = new JPanel(new FlowLayout()); +/* 32 */ this.keys = new String[] { +/* 33 */ "Euclidean", +/* 34 */ "Polar", +/* 35 */ "X Equals" }; +/* */ +/* 37 */ this.link = new Point2DMaker[] { +/* 38 */ new Euclidean2DPointMaker(), +/* 39 */ new Polar2DPointMaker(), +/* 40 */ new ReverseEuclidean2DPointMaker() }; +/* */ +/* 43 */ this.comboBox = new JComboBox(this.keys); +/* 44 */ this.ok = new JButton("Apply"); +/* 45 */ this.cancel = new JButton("Cancel"); +/* */ +/* 47 */ this.ok.addActionListener(this); +/* 48 */ this.cancel.addActionListener(this); +/* */ +/* 50 */ this.buttonHolder.add(this.ok); +/* 51 */ this.buttonHolder.add(this.cancel); +/* */ +/* 53 */ this.panel.add(this.comboBox); +/* 54 */ this.panel.add(this.buttonHolder); +/* 55 */ this.panel.setPreferredSize(new Dimension(200, 50)); +/* 56 */ add(this.panel); +/* 57 */ pack(); +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent arg0) +/* */ { +/* 62 */ setVisible(false); +/* 63 */ if (arg0.getSource() == this.ok) +/* 64 */ GraphTypeHolder.getInstance().setGraphPointMaker(this.link[this.comboBox.getSelectedIndex()]); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Graph2DOptionFrame + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Graph3D.java b/src/Graph3D.java new file mode 100644 index 0000000..80789ec --- /dev/null +++ b/src/Graph3D.java @@ -0,0 +1,165 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ import java.awt.Graphics2D; +/* */ import java.awt.geom.AffineTransform; +/* */ import java.awt.image.BufferedImage; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ +/* */ public class Graph3D extends GraphWorld +/* */ implements CoordinateSystem +/* */ { +/* 20 */ protected List<PointGroup> points = new ArrayList(); +/* 21 */ private boolean slow = false; +/* 22 */ private String[] equations = { "x%y" }; +/* 23 */ private boolean loaded = false; +/* */ private BufferedImage background; +/* */ public static final double GLOBAL_SIZE = 300.0D; +/* 26 */ private Point3D[][] axies = { +/* 27 */ { new Point3D(0.0D, 200.0D, 0.0D, 0.0D, 0.0D, 0.0D), new Point3D(0.0D, -200.0D, 0.0D, 0.0D, 0.0D, 0.0D) }, +/* 28 */ { new Point3D(200.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D), new Point3D(-200.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D) }, +/* 29 */ { new Point3D(0.0D, 0.0D, 200.0D, 0.0D, 0.0D, 0.0D), new Point3D(0.0D, 0.0D, -200.0D, 0.0D, 0.0D, 0.0D) } }; +/* */ +/* 31 */ private static Color[] colors = { +/* 32 */ Color.GREEN, +/* 33 */ Color.BLUE, +/* 34 */ Color.RED }; +/* */ +/* 36 */ protected Object3D[] axiesChar = { +/* 37 */ new YAxisChar(0.0D, 210.0D, 0.0D, 0.0D, 0.0D, 180.0D, this, Color.GREEN), +/* 38 */ new XAxisChar(210.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, this, Color.BLUE), +/* 39 */ new ZAxisChar(0.0D, 0.0D, 210.0D, 0.0D, 0.0D, 180.0D, this, Color.RED), +/* 40 */ new YAxisChar(0.0D, -210.0D, 0.0D, 0.0D, 0.0D, 180.0D, this, Color.GREEN), +/* 41 */ new XAxisChar(-210.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, this, Color.BLUE), +/* 42 */ new ZAxisChar(0.0D, 0.0D, -210.0D, 0.0D, 0.0D, 180.0D, this, Color.RED), +/* 43 */ new ZAxis(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, this, Color.RED), +/* 44 */ new XAxis(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, this, Color.BLUE), +/* 45 */ new YAxis(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, this, Color.GREEN) }; +/* */ +/* 47 */ private double moveX = 0.0D; +/* 48 */ private double moveY = 0.0D; +/* 49 */ private double rotoZ = 0.0D; +/* 50 */ private double rotoY = 0.0D; +/* 51 */ private double rotoX = 0.0D; +/* */ +/* 53 */ private double scale = 1.0D; +/* 54 */ private double pivX = 0.0D; +/* 55 */ private double pivY = 0.0D; +/* 56 */ private double pivZ = 0.0D; +/* 57 */ private double zCam = 300.0D; +/* 58 */ private double xCam = 0.0D; +/* 59 */ private double yCam = 0.0D; +/* 60 */ private boolean drawAxies = true; +/* */ +/* 62 */ public Graph3D() { super(1280, 1024); +/* 63 */ this.background = new BufferedImage(1, 1, 1); +/* 64 */ Graphics g = this.background.getGraphics(); +/* 65 */ g.setColor(new Color(0)); +/* 66 */ g.fillRect(0, 0, this.background.getWidth(), this.background.getHeight()); +/* 67 */ this.scale /= this.zCam; +/* */ +/* 69 */ for (Object3D add : this.axiesChar) +/* 70 */ addEvent(add); +/* */ } +/* */ +/* */ public void setSlow(boolean slow) +/* */ { +/* 76 */ this.slow = slow; +/* */ } +/* 78 */ public void reset() { this.points = new ArrayList(); } +/* */ public boolean isLoaded() { +/* 80 */ return this.loaded; } +/* 81 */ public double getXRotation() { return this.rotoX; } +/* 82 */ public double getYRotation() { return this.rotoY; } +/* 83 */ public double getZRotation() { return this.rotoZ; } +/* 84 */ public double getXMove() { return this.moveX; } +/* 85 */ public double getYMove() { return this.moveY; } +/* 86 */ public double getScale() { return this.scale; } +/* 87 */ public double getXPivot() { return this.pivX; } +/* 88 */ public double getYPivot() { return this.pivY; } +/* 89 */ public double getZPivot() { return this.pivZ; } +/* 90 */ public double getCameraZ() { return this.zCam; } +/* 91 */ public double getCameraX() { return this.xCam; } +/* 92 */ public double getCameraY() { return this.yCam; } +/* */ public void setBackground(BufferedImage image) { +/* 94 */ this.background = image; +/* 95 */ repaint(); +/* */ } +/* */ public BufferedImage getBackgroundImage() { +/* 98 */ return this.background; +/* */ } +/* 100 */ public void setEquations(String[] equations) { this.equations = equations; } +/* 101 */ public String[] getEquations() { return this.equations; } +/* */ public void setXRotation(double x) { +/* 103 */ if (x < 0.0D) x += 360.0D; +/* 104 */ this.rotoX = (x % 360.0D); +/* */ } +/* */ public void setYRotation(double y) { +/* 107 */ if (y < 0.0D) y += 360.0D; +/* 108 */ this.rotoY = (y % 360.0D); +/* */ } +/* */ public void setZRotation(double z) { +/* 111 */ if (z < 0.0D) z += 360.0D; +/* 112 */ this.rotoZ = (z % 360.0D); } +/* 113 */ public void setXMove(double x) { this.moveX = x; } +/* 114 */ public void setYMove(double y) { this.moveY = y; } +/* 115 */ public void setScale(double s) { this.scale = s; } +/* 116 */ public void setXPivot(double x) { this.pivX = x; } +/* 117 */ public void setYPivot(double y) { this.pivY = y; } +/* 118 */ public void setZPivot(double z) { this.pivZ = z; } +/* 119 */ public void setCameraZ(double z) { this.zCam = z; } +/* 120 */ public void setCameraX(double x) { this.xCam = x; } +/* 121 */ public void setCameraY(double y) { this.yCam = y; } +/* */ public void setDrawAxies(boolean draw) { +/* 123 */ this.drawAxies = draw; +/* */ } +/* */ public void invoke(Graphics g) { +/* 126 */ if (this.slow) g = getGraphics(); +/* 127 */ Graphics2D g2 = (Graphics2D)g; +/* 128 */ if (this.background != null) { +/* 129 */ g2.drawImage(this.background, AffineTransform.getScaleInstance(getWidth() / this.background.getWidth(), getHeight() / this.background.getHeight()), null); +/* */ } +/* */ +/* 141 */ g.setColor(new Color(11141120)); +/* */ +/* 143 */ for (int i = 0; i < this.points.size(); i++) { +/* 144 */ PointGroup p = (PointGroup)this.points.get(i); +/* 145 */ if (p != null) +/* 146 */ p.invoke(g, this); +/* */ } +/* 148 */ if (this.drawAxies) { +/* 149 */ for (int i = 0; i < super.getEvents().size(); i++) { +/* 150 */ ((GraphicsEvent)super.getEvents().get(i)).invoke(g); +/* */ } +/* */ } +/* 153 */ int y = 0; +/* */ } +/* */ public List<PointGroup> getPoints() { +/* 156 */ return this.points; +/* */ } +/* */ public boolean isFocusable() { +/* 159 */ return true; +/* */ } +/* */ public void rotateLeft(double amt) { +/* 162 */ this.rotoZ += amt; +/* */ } +/* */ +/* */ public static double equation(String equation, double x, double y) { +/* */ try { +/* 167 */ return Double.parseDouble(ControlPanel.figure(equation.replaceAll("x", x).replaceAll("y", y))); +/* */ } +/* */ catch (Exception e) { +/* */ } +/* 171 */ return (0.0D / 0.0D); +/* */ } +/* */ +/* */ protected void clean() { +/* 175 */ for (int i = 0; i < this.points.size(); i++) +/* 176 */ if (this.points.get(i) == null) this.points.remove(i); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Graph3D + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GraphBoxListener.java b/src/GraphBoxListener.java new file mode 100644 index 0000000..6ddf691 --- /dev/null +++ b/src/GraphBoxListener.java @@ -0,0 +1,9 @@ +public abstract interface GraphBoxListener +{ + public abstract void graphBoxMade(int paramInt1, int paramInt2, int paramInt3, int paramInt4); +} + +/* Location: Modulus.jar + * Qualified Name: GraphBoxListener + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GraphEventHandler.java b/src/GraphEventHandler.java new file mode 100644 index 0000000..ff56fb9 --- /dev/null +++ b/src/GraphEventHandler.java @@ -0,0 +1,66 @@ +/* */ import java.awt.Point; +/* */ import java.awt.event.MouseEvent; +/* */ import java.awt.event.MouseListener; +/* */ import java.awt.event.MouseMotionListener; +/* */ import java.awt.event.MouseWheelEvent; +/* */ import java.awt.event.MouseWheelListener; +/* */ +/* */ public class GraphEventHandler +/* */ implements MouseListener, MouseMotionListener, MouseWheelListener +/* */ { +/* */ private Point lastClick; +/* */ private Graph2D graph; +/* */ +/* */ public GraphEventHandler(Graph2D target) +/* */ { +/* 19 */ this.graph = target; +/* */ } +/* */ +/* */ public void mouseClicked(MouseEvent e) { +/* 23 */ this.lastClick = e.getPoint(); +/* */ } +/* */ +/* */ public void mouseEntered(MouseEvent e) +/* */ { +/* */ } +/* */ +/* */ public void mouseExited(MouseEvent e) +/* */ { +/* */ } +/* */ +/* */ public void mousePressed(MouseEvent e) +/* */ { +/* 38 */ this.lastClick = e.getPoint(); +/* */ } +/* */ +/* */ public void mouseReleased(MouseEvent e) +/* */ { +/* 44 */ this.lastClick = e.getPoint(); +/* */ } +/* */ +/* */ public void mouseDragged(MouseEvent e) +/* */ { +/* 50 */ Point move = e.getPoint(); +/* */ +/* 52 */ double difx = (move.x - this.lastClick.x) * this.graph.getXRes(); +/* 53 */ double dify = (move.y - this.lastClick.y) * this.graph.getYRes(); +/* 54 */ this.graph.setWindowRange(this.graph.getWindowRange().getTranslatedInstance(difx, dify)); +/* 55 */ this.graph.recreate(); +/* 56 */ this.graph.repaint(); +/* 57 */ this.lastClick = e.getPoint(); +/* */ } +/* */ +/* */ public void mouseMoved(MouseEvent e) +/* */ { +/* */ } +/* */ +/* */ public void mouseWheelMoved(MouseWheelEvent e) +/* */ { +/* 67 */ this.graph.zoom(Math.min(Math.pow(1.2D, e.getWheelRotation()), 1.728D)); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GraphEventHandler + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GraphFrame.java b/src/GraphFrame.java new file mode 100644 index 0000000..4bcfe47 --- /dev/null +++ b/src/GraphFrame.java @@ -0,0 +1,1020 @@ +/* */ import GUIComponents.MouseClickListener; +/* */ import GUIComponents.MouseOneClickListener; +/* */ import StandardIO.Approvable; +/* */ import StandardIO.ModulusFileChooser; +/* */ import equations.FiveVariableEquation; +/* */ import equations.FourVariableEquation; +/* */ import equations.LinearEquation; +/* */ import equations.ThreeVariableEquation; +/* */ import java.awt.Container; +/* */ import java.awt.Frame; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.awt.event.MouseEvent; +/* */ import java.awt.event.WindowEvent; +/* */ import java.awt.event.WindowListener; +/* */ import java.io.File; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import javax.imageio.ImageIO; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JMenuBar; +/* */ import javax.swing.JPanel; +/* */ +/* */ public class GraphFrame extends JFrame +/* */ implements ActionListener, GraphBoxListener, WindowListener +/* */ { +/* */ private static final long serialVersionUID = 1L; +/* 34 */ private static GraphFrame instance = null; +/* */ private Graph2D graph; +/* */ private GraphEventHandler eventHandler; +/* */ private JPanel panel; +/* */ private JPanel graphContainer; +/* */ private TrackingPanel trackingPanel; +/* */ private AnswerPanel answerPanel; +/* */ private JMenuBar menubar; +/* */ private EquationDialog equationDialog; +/* */ private Graph2DOptionFrame graphOptions; +/* */ private StatPlotDialog statplot; +/* */ private WindowRangeDialog windowRangeDialog; +/* */ private Menu zoomMenu; +/* */ private int graphBoxListenerIndex; +/* */ private int graphClickListenerIndex; +/* */ private GraphFrame ths; +/* */ public static final double DERIV_DIFFERENCE = 2.E-05D; +/* */ private MouseClickListener currentThreading; +/* */ private Menu[] menus; +/* */ private Approvable saveBitmap; +/* */ private ModulusFileChooser saveBitmapChooser; +/* */ private GraphBoxListener[] gboxlisteners; +/* */ private MouseClickListener[] clickListeners; +/* */ private RegressionDialog[] regressionDialogs; +/* */ +/* */ // ERROR // +/* */ public GraphFrame() +/* */ { +/* */ // Byte code: +/* */ // 0: aload_0 +/* */ // 1: invokespecial 71 javax/swing/JFrame:<init> ()V +/* */ // 4: aload_0 +/* */ // 5: invokestatic 73 Graph2D:getGraphInstance ()LGraph2D; +/* */ // 8: putfield 79 GraphFrame:graph LGraph2D; +/* */ // 11: aload_0 +/* */ // 12: new 81 StatPlotDialog +/* */ // 15: dup +/* */ // 16: aload_0 +/* */ // 17: aload_0 +/* */ // 18: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 21: invokespecial 83 StatPlotDialog:<init> (Ljava/awt/Frame;LGraph2D;)V +/* */ // 24: putfield 86 GraphFrame:statplot LStatPlotDialog; +/* */ // 27: aload_0 +/* */ // 28: iconst_0 +/* */ // 29: putfield 88 GraphFrame:graphBoxListenerIndex I +/* */ // 32: aload_0 +/* */ // 33: iconst_0 +/* */ // 34: putfield 90 GraphFrame:graphClickListenerIndex I +/* */ // 37: aload_0 +/* */ // 38: iconst_5 +/* */ // 39: anewarray 92 Menu +/* */ // 42: dup +/* */ // 43: iconst_0 +/* */ // 44: new 92 Menu +/* */ // 47: dup +/* */ // 48: ldc 94 +/* */ // 50: iconst_2 +/* */ // 51: anewarray 96 javax/swing/JComponent +/* */ // 54: dup +/* */ // 55: iconst_0 +/* */ // 56: new 98 javax/swing/JMenuItem +/* */ // 59: dup +/* */ // 60: ldc 100 +/* */ // 62: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 65: aastore +/* */ // 66: dup +/* */ // 67: iconst_1 +/* */ // 68: new 98 javax/swing/JMenuItem +/* */ // 71: dup +/* */ // 72: ldc 105 +/* */ // 74: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 77: aastore +/* */ // 78: invokespecial 107 Menu:<init> (Ljava/lang/String;[Ljavax/swing/JComponent;)V +/* */ // 81: aastore +/* */ // 82: dup +/* */ // 83: iconst_1 +/* */ // 84: new 92 Menu +/* */ // 87: dup +/* */ // 88: ldc 110 +/* */ // 90: bipush 6 +/* */ // 92: anewarray 96 javax/swing/JComponent +/* */ // 95: dup +/* */ // 96: iconst_0 +/* */ // 97: new 98 javax/swing/JMenuItem +/* */ // 100: dup +/* */ // 101: ldc 112 +/* */ // 103: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 106: aastore +/* */ // 107: dup +/* */ // 108: iconst_1 +/* */ // 109: new 98 javax/swing/JMenuItem +/* */ // 112: dup +/* */ // 113: ldc 114 +/* */ // 115: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 118: aastore +/* */ // 119: dup +/* */ // 120: iconst_2 +/* */ // 121: new 98 javax/swing/JMenuItem +/* */ // 124: dup +/* */ // 125: ldc 116 +/* */ // 127: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 130: aastore +/* */ // 131: dup +/* */ // 132: iconst_3 +/* */ // 133: new 118 javax/swing/JSeparator +/* */ // 136: dup +/* */ // 137: invokespecial 120 javax/swing/JSeparator:<init> ()V +/* */ // 140: aastore +/* */ // 141: dup +/* */ // 142: iconst_4 +/* */ // 143: new 118 javax/swing/JSeparator +/* */ // 146: dup +/* */ // 147: invokespecial 120 javax/swing/JSeparator:<init> ()V +/* */ // 150: aastore +/* */ // 151: dup +/* */ // 152: iconst_5 +/* */ // 153: new 98 javax/swing/JMenuItem +/* */ // 156: dup +/* */ // 157: ldc 121 +/* */ // 159: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 162: aastore +/* */ // 163: invokespecial 107 Menu:<init> (Ljava/lang/String;[Ljavax/swing/JComponent;)V +/* */ // 166: aastore +/* */ // 167: dup +/* */ // 168: iconst_2 +/* */ // 169: new 92 Menu +/* */ // 172: dup +/* */ // 173: ldc 123 +/* */ // 175: bipush 15 +/* */ // 177: anewarray 96 javax/swing/JComponent +/* */ // 180: dup +/* */ // 181: iconst_0 +/* */ // 182: new 98 javax/swing/JMenuItem +/* */ // 185: dup +/* */ // 186: ldc 125 +/* */ // 188: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 191: aastore +/* */ // 192: dup +/* */ // 193: iconst_1 +/* */ // 194: new 98 javax/swing/JMenuItem +/* */ // 197: dup +/* */ // 198: ldc 127 +/* */ // 200: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 203: aastore +/* */ // 204: dup +/* */ // 205: iconst_2 +/* */ // 206: new 98 javax/swing/JMenuItem +/* */ // 209: dup +/* */ // 210: ldc 129 +/* */ // 212: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 215: aastore +/* */ // 216: dup +/* */ // 217: iconst_3 +/* */ // 218: new 118 javax/swing/JSeparator +/* */ // 221: dup +/* */ // 222: invokespecial 120 javax/swing/JSeparator:<init> ()V +/* */ // 225: aastore +/* */ // 226: dup +/* */ // 227: iconst_4 +/* */ // 228: new 118 javax/swing/JSeparator +/* */ // 231: dup +/* */ // 232: invokespecial 120 javax/swing/JSeparator:<init> ()V +/* */ // 235: aastore +/* */ // 236: dup +/* */ // 237: iconst_5 +/* */ // 238: new 98 javax/swing/JMenuItem +/* */ // 241: dup +/* */ // 242: ldc 131 +/* */ // 244: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 247: aastore +/* */ // 248: dup +/* */ // 249: bipush 6 +/* */ // 251: new 98 javax/swing/JMenuItem +/* */ // 254: dup +/* */ // 255: ldc 133 +/* */ // 257: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 260: aastore +/* */ // 261: dup +/* */ // 262: bipush 7 +/* */ // 264: new 98 javax/swing/JMenuItem +/* */ // 267: dup +/* */ // 268: ldc 135 +/* */ // 270: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 273: aastore +/* */ // 274: dup +/* */ // 275: bipush 8 +/* */ // 277: new 118 javax/swing/JSeparator +/* */ // 280: dup +/* */ // 281: invokespecial 120 javax/swing/JSeparator:<init> ()V +/* */ // 284: aastore +/* */ // 285: dup +/* */ // 286: bipush 9 +/* */ // 288: new 118 javax/swing/JSeparator +/* */ // 291: dup +/* */ // 292: invokespecial 120 javax/swing/JSeparator:<init> ()V +/* */ // 295: aastore +/* */ // 296: dup +/* */ // 297: bipush 10 +/* */ // 299: new 98 javax/swing/JMenuItem +/* */ // 302: dup +/* */ // 303: ldc 137 +/* */ // 305: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 308: aastore +/* */ // 309: dup +/* */ // 310: bipush 11 +/* */ // 312: new 98 javax/swing/JMenuItem +/* */ // 315: dup +/* */ // 316: ldc 139 +/* */ // 318: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 321: aastore +/* */ // 322: dup +/* */ // 323: bipush 12 +/* */ // 325: new 98 javax/swing/JMenuItem +/* */ // 328: dup +/* */ // 329: ldc 141 +/* */ // 331: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 334: aastore +/* */ // 335: dup +/* */ // 336: bipush 13 +/* */ // 338: new 98 javax/swing/JMenuItem +/* */ // 341: dup +/* */ // 342: ldc 143 +/* */ // 344: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 347: aastore +/* */ // 348: dup +/* */ // 349: bipush 14 +/* */ // 351: new 98 javax/swing/JMenuItem +/* */ // 354: dup +/* */ // 355: ldc 145 +/* */ // 357: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 360: aastore +/* */ // 361: invokespecial 107 Menu:<init> (Ljava/lang/String;[Ljavax/swing/JComponent;)V +/* */ // 364: aastore +/* */ // 365: dup +/* */ // 366: iconst_3 +/* */ // 367: new 92 Menu +/* */ // 370: dup +/* */ // 371: ldc 147 +/* */ // 373: iconst_3 +/* */ // 374: anewarray 96 javax/swing/JComponent +/* */ // 377: dup +/* */ // 378: iconst_0 +/* */ // 379: new 98 javax/swing/JMenuItem +/* */ // 382: dup +/* */ // 383: ldc 149 +/* */ // 385: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 388: aastore +/* */ // 389: dup +/* */ // 390: iconst_1 +/* */ // 391: new 151 javax/swing/JRadioButton +/* */ // 394: dup +/* */ // 395: ldc 153 +/* */ // 397: invokespecial 155 javax/swing/JRadioButton:<init> (Ljava/lang/String;)V +/* */ // 400: aastore +/* */ // 401: dup +/* */ // 402: iconst_2 +/* */ // 403: aload_0 +/* */ // 404: new 92 Menu +/* */ // 407: dup +/* */ // 408: ldc 156 +/* */ // 410: bipush 7 +/* */ // 412: anewarray 96 javax/swing/JComponent +/* */ // 415: dup +/* */ // 416: iconst_0 +/* */ // 417: new 98 javax/swing/JMenuItem +/* */ // 420: dup +/* */ // 421: ldc 158 +/* */ // 423: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 426: aastore +/* */ // 427: dup +/* */ // 428: iconst_1 +/* */ // 429: new 98 javax/swing/JMenuItem +/* */ // 432: dup +/* */ // 433: ldc 160 +/* */ // 435: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 438: aastore +/* */ // 439: dup +/* */ // 440: iconst_2 +/* */ // 441: new 98 javax/swing/JMenuItem +/* */ // 444: dup +/* */ // 445: ldc 162 +/* */ // 447: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 450: aastore +/* */ // 451: dup +/* */ // 452: iconst_3 +/* */ // 453: new 98 javax/swing/JMenuItem +/* */ // 456: dup +/* */ // 457: ldc 164 +/* */ // 459: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 462: aastore +/* */ // 463: dup +/* */ // 464: iconst_4 +/* */ // 465: new 118 javax/swing/JSeparator +/* */ // 468: dup +/* */ // 469: invokespecial 120 javax/swing/JSeparator:<init> ()V +/* */ // 472: aastore +/* */ // 473: dup +/* */ // 474: iconst_5 +/* */ // 475: new 118 javax/swing/JSeparator +/* */ // 478: dup +/* */ // 479: invokespecial 120 javax/swing/JSeparator:<init> ()V +/* */ // 482: aastore +/* */ // 483: dup +/* */ // 484: bipush 6 +/* */ // 486: new 98 javax/swing/JMenuItem +/* */ // 489: dup +/* */ // 490: ldc 166 +/* */ // 492: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 495: aastore +/* */ // 496: invokespecial 107 Menu:<init> (Ljava/lang/String;[Ljavax/swing/JComponent;)V +/* */ // 499: dup_x1 +/* */ // 500: putfield 168 GraphFrame:zoomMenu LMenu; +/* */ // 503: aastore +/* */ // 504: invokespecial 107 Menu:<init> (Ljava/lang/String;[Ljavax/swing/JComponent;)V +/* */ // 507: aastore +/* */ // 508: dup +/* */ // 509: iconst_4 +/* */ // 510: new 92 Menu +/* */ // 513: dup +/* */ // 514: ldc 170 +/* */ // 516: iconst_3 +/* */ // 517: anewarray 96 javax/swing/JComponent +/* */ // 520: dup +/* */ // 521: iconst_0 +/* */ // 522: new 98 javax/swing/JMenuItem +/* */ // 525: dup +/* */ // 526: ldc 172 +/* */ // 528: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 531: aastore +/* */ // 532: dup +/* */ // 533: iconst_1 +/* */ // 534: new 98 javax/swing/JMenuItem +/* */ // 537: dup +/* */ // 538: ldc 174 +/* */ // 540: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 543: aastore +/* */ // 544: dup +/* */ // 545: iconst_2 +/* */ // 546: new 98 javax/swing/JMenuItem +/* */ // 549: dup +/* */ // 550: ldc 176 +/* */ // 552: invokespecial 102 javax/swing/JMenuItem:<init> (Ljava/lang/String;)V +/* */ // 555: aastore +/* */ // 556: invokespecial 107 Menu:<init> (Ljava/lang/String;[Ljavax/swing/JComponent;)V +/* */ // 559: aastore +/* */ // 560: putfield 178 GraphFrame:menus [LMenu; +/* */ // 563: aload_0 +/* */ // 564: new 180 GraphFrame$1 +/* */ // 567: dup +/* */ // 568: aload_0 +/* */ // 569: invokespecial 182 GraphFrame$1:<init> (LGraphFrame;)V +/* */ // 572: putfield 185 GraphFrame:saveBitmap LStandardIO/Approvable; +/* */ // 575: aload_0 +/* */ // 576: new 187 StandardIO/ModulusFileChooser +/* */ // 579: dup +/* */ // 580: aload_0 +/* */ // 581: getfield 185 GraphFrame:saveBitmap LStandardIO/Approvable; +/* */ // 584: ldc 189 +/* */ // 586: iconst_3 +/* */ // 587: anewarray 191 StandardIO/MFileFilter +/* */ // 590: dup +/* */ // 591: iconst_0 +/* */ // 592: new 191 StandardIO/MFileFilter +/* */ // 595: dup +/* */ // 596: iconst_2 +/* */ // 597: anewarray 193 java/lang/String +/* */ // 600: dup +/* */ // 601: iconst_0 +/* */ // 602: ldc 195 +/* */ // 604: aastore +/* */ // 605: dup +/* */ // 606: iconst_1 +/* */ // 607: ldc 197 +/* */ // 609: aastore +/* */ // 610: ldc 199 +/* */ // 612: invokespecial 201 StandardIO/MFileFilter:<init> ([Ljava/lang/String;Ljava/lang/String;)V +/* */ // 615: aastore +/* */ // 616: dup +/* */ // 617: iconst_1 +/* */ // 618: new 191 StandardIO/MFileFilter +/* */ // 621: dup +/* */ // 622: iconst_1 +/* */ // 623: anewarray 193 java/lang/String +/* */ // 626: dup +/* */ // 627: iconst_0 +/* */ // 628: ldc 204 +/* */ // 630: aastore +/* */ // 631: ldc 206 +/* */ // 633: invokespecial 201 StandardIO/MFileFilter:<init> ([Ljava/lang/String;Ljava/lang/String;)V +/* */ // 636: aastore +/* */ // 637: dup +/* */ // 638: iconst_2 +/* */ // 639: new 191 StandardIO/MFileFilter +/* */ // 642: dup +/* */ // 643: iconst_1 +/* */ // 644: anewarray 193 java/lang/String +/* */ // 647: dup +/* */ // 648: iconst_0 +/* */ // 649: ldc 208 +/* */ // 651: aastore +/* */ // 652: ldc 210 +/* */ // 654: invokespecial 201 StandardIO/MFileFilter:<init> ([Ljava/lang/String;Ljava/lang/String;)V +/* */ // 657: aastore +/* */ // 658: invokespecial 212 StandardIO/ModulusFileChooser:<init> (LStandardIO/Approvable;Ljava/lang/String;[LStandardIO/MFileFilter;)V +/* */ // 661: putfield 215 GraphFrame:saveBitmapChooser LStandardIO/ModulusFileChooser; +/* */ // 664: aload_0 +/* */ // 665: iconst_2 +/* */ // 666: anewarray 7 GraphBoxListener +/* */ // 669: dup +/* */ // 670: iconst_0 +/* */ // 671: new 217 GraphFrame$2 +/* */ // 674: dup +/* */ // 675: aload_0 +/* */ // 676: invokespecial 219 GraphFrame$2:<init> (LGraphFrame;)V +/* */ // 679: aastore +/* */ // 680: dup +/* */ // 681: iconst_1 +/* */ // 682: new 220 GraphFrame$3 +/* */ // 685: dup +/* */ // 686: aload_0 +/* */ // 687: invokespecial 222 GraphFrame$3:<init> (LGraphFrame;)V +/* */ // 690: aastore +/* */ // 691: putfield 223 GraphFrame:gboxlisteners [LGraphBoxListener; +/* */ // 694: aload_0 +/* */ // 695: iconst_3 +/* */ // 696: anewarray 225 GUIComponents/MouseClickListener +/* */ // 699: dup +/* */ // 700: iconst_0 +/* */ // 701: new 227 GraphFrame$4 +/* */ // 704: dup +/* */ // 705: aload_0 +/* */ // 706: aload_0 +/* */ // 707: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 710: invokespecial 229 GraphFrame$4:<init> (LGraphFrame;Ljava/awt/Container;)V +/* */ // 713: aastore +/* */ // 714: dup +/* */ // 715: iconst_1 +/* */ // 716: new 232 GraphFrame$5 +/* */ // 719: dup +/* */ // 720: aload_0 +/* */ // 721: invokespecial 234 GraphFrame$5:<init> (LGraphFrame;)V +/* */ // 724: aastore +/* */ // 725: dup +/* */ // 726: iconst_2 +/* */ // 727: new 235 GraphFrame$6 +/* */ // 730: dup +/* */ // 731: aload_0 +/* */ // 732: aload_0 +/* */ // 733: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 736: invokespecial 237 GraphFrame$6:<init> (LGraphFrame;Ljava/awt/Container;)V +/* */ // 739: aastore +/* */ // 740: putfield 238 GraphFrame:clickListeners [LGUIComponents/MouseClickListener; +/* */ // 743: aload_0 +/* */ // 744: iconst_4 +/* */ // 745: anewarray 240 RegressionDialog +/* */ // 748: dup +/* */ // 749: iconst_0 +/* */ // 750: new 242 GraphFrame$7 +/* */ // 753: dup +/* */ // 754: aload_0 +/* */ // 755: aload_0 +/* */ // 756: getfield 244 GraphFrame:ths LGraphFrame; +/* */ // 759: ldc 137 +/* */ // 761: aload_0 +/* */ // 762: getfield 86 GraphFrame:statplot LStatPlotDialog; +/* */ // 765: invokespecial 246 GraphFrame$7:<init> (LGraphFrame;Ljava/awt/Frame;Ljava/lang/String;LStatPlotDialog;)V +/* */ // 768: aastore +/* */ // 769: dup +/* */ // 770: iconst_1 +/* */ // 771: new 249 GraphFrame$8 +/* */ // 774: dup +/* */ // 775: aload_0 +/* */ // 776: aload_0 +/* */ // 777: getfield 244 GraphFrame:ths LGraphFrame; +/* */ // 780: ldc 139 +/* */ // 782: aload_0 +/* */ // 783: getfield 86 GraphFrame:statplot LStatPlotDialog; +/* */ // 786: invokespecial 251 GraphFrame$8:<init> (LGraphFrame;Ljava/awt/Frame;Ljava/lang/String;LStatPlotDialog;)V +/* */ // 789: aastore +/* */ // 790: dup +/* */ // 791: iconst_2 +/* */ // 792: new 252 GraphFrame$9 +/* */ // 795: dup +/* */ // 796: aload_0 +/* */ // 797: aload_0 +/* */ // 798: getfield 244 GraphFrame:ths LGraphFrame; +/* */ // 801: ldc 141 +/* */ // 803: aload_0 +/* */ // 804: getfield 86 GraphFrame:statplot LStatPlotDialog; +/* */ // 807: invokespecial 254 GraphFrame$9:<init> (LGraphFrame;Ljava/awt/Frame;Ljava/lang/String;LStatPlotDialog;)V +/* */ // 810: aastore +/* */ // 811: dup +/* */ // 812: iconst_3 +/* */ // 813: new 255 GraphFrame$10 +/* */ // 816: dup +/* */ // 817: aload_0 +/* */ // 818: aload_0 +/* */ // 819: getfield 244 GraphFrame:ths LGraphFrame; +/* */ // 822: ldc 143 +/* */ // 824: aload_0 +/* */ // 825: getfield 86 GraphFrame:statplot LStatPlotDialog; +/* */ // 828: invokespecial 257 GraphFrame$10:<init> (LGraphFrame;Ljava/awt/Frame;Ljava/lang/String;LStatPlotDialog;)V +/* */ // 831: aastore +/* */ // 832: putfield 258 GraphFrame:regressionDialogs [LRegressionDialog; +/* */ // 835: aload_0 +/* */ // 836: ldc_w 260 +/* */ // 839: invokevirtual 262 GraphFrame:setTitle (Ljava/lang/String;)V +/* */ // 842: aload_0 +/* */ // 843: new 265 java/awt/GridBagLayout +/* */ // 846: dup +/* */ // 847: invokespecial 267 java/awt/GridBagLayout:<init> ()V +/* */ // 850: invokevirtual 268 GraphFrame:setLayout (Ljava/awt/LayoutManager;)V +/* */ // 853: new 272 java/awt/GridBagConstraints +/* */ // 856: dup +/* */ // 857: invokespecial 274 java/awt/GridBagConstraints:<init> ()V +/* */ // 860: astore_1 +/* */ // 861: aload_0 +/* */ // 862: new 275 javax/swing/JPanel +/* */ // 865: dup +/* */ // 866: invokespecial 277 javax/swing/JPanel:<init> ()V +/* */ // 869: putfield 278 GraphFrame:panel Ljavax/swing/JPanel; +/* */ // 872: aload_0 +/* */ // 873: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 876: aload_0 +/* */ // 877: getfield 280 GraphFrame:trackingPanel LTrackingPanel; +/* */ // 880: invokevirtual 282 Graph2D:addMouseMotionListener (Ljava/awt/event/MouseMotionListener;)V +/* */ // 883: aload_0 +/* */ // 884: new 286 AnswerPanel +/* */ // 887: dup +/* */ // 888: iconst_5 +/* */ // 889: anewarray 193 java/lang/String +/* */ // 892: dup +/* */ // 893: iconst_0 +/* */ // 894: ldc_w 288 +/* */ // 897: aastore +/* */ // 898: dup +/* */ // 899: iconst_1 +/* */ // 900: ldc_w 288 +/* */ // 903: aastore +/* */ // 904: dup +/* */ // 905: iconst_2 +/* */ // 906: ldc_w 288 +/* */ // 909: aastore +/* */ // 910: dup +/* */ // 911: iconst_3 +/* */ // 912: ldc_w 288 +/* */ // 915: aastore +/* */ // 916: dup +/* */ // 917: iconst_4 +/* */ // 918: ldc_w 288 +/* */ // 921: aastore +/* */ // 922: aload_0 +/* */ // 923: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 926: invokespecial 290 AnswerPanel:<init> ([Ljava/lang/String;LGraph2D;)V +/* */ // 929: putfield 293 GraphFrame:answerPanel LAnswerPanel; +/* */ // 932: aload_0 +/* */ // 933: new 295 TrackingPanel +/* */ // 936: dup +/* */ // 937: aload_0 +/* */ // 938: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 941: aload_0 +/* */ // 942: getfield 293 GraphFrame:answerPanel LAnswerPanel; +/* */ // 945: invokespecial 297 TrackingPanel:<init> (LGraphTranslator;LAnswerPanel;)V +/* */ // 948: putfield 280 GraphFrame:trackingPanel LTrackingPanel; +/* */ // 951: aload_0 +/* */ // 952: new 275 javax/swing/JPanel +/* */ // 955: dup +/* */ // 956: new 300 java/awt/FlowLayout +/* */ // 959: dup +/* */ // 960: invokespecial 302 java/awt/FlowLayout:<init> ()V +/* */ // 963: invokespecial 303 javax/swing/JPanel:<init> (Ljava/awt/LayoutManager;)V +/* */ // 966: putfield 305 GraphFrame:graphContainer Ljavax/swing/JPanel; +/* */ // 969: aload_0 +/* */ // 970: getfield 278 GraphFrame:panel Ljavax/swing/JPanel; +/* */ // 973: new 300 java/awt/FlowLayout +/* */ // 976: dup +/* */ // 977: invokespecial 302 java/awt/FlowLayout:<init> ()V +/* */ // 980: invokevirtual 307 javax/swing/JPanel:setLayout (Ljava/awt/LayoutManager;)V +/* */ // 983: aload_0 +/* */ // 984: getfield 305 GraphFrame:graphContainer Ljavax/swing/JPanel; +/* */ // 987: aload_0 +/* */ // 988: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 991: invokevirtual 308 javax/swing/JPanel:add (Ljava/awt/Component;)Ljava/awt/Component; +/* */ // 994: pop +/* */ // 995: aload_0 +/* */ // 996: getfield 293 GraphFrame:answerPanel LAnswerPanel; +/* */ // 999: new 312 java/awt/Dimension +/* */ // 1002: dup +/* */ // 1003: bipush 120 +/* */ // 1005: sipush 500 +/* */ // 1008: invokespecial 314 java/awt/Dimension:<init> (II)V +/* */ // 1011: invokevirtual 317 AnswerPanel:setPreferredSize (Ljava/awt/Dimension;)V +/* */ // 1014: aload_0 +/* */ // 1015: getfield 280 GraphFrame:trackingPanel LTrackingPanel; +/* */ // 1018: new 312 java/awt/Dimension +/* */ // 1021: dup +/* */ // 1022: sipush 500 +/* */ // 1025: bipush 70 +/* */ // 1027: invokespecial 314 java/awt/Dimension:<init> (II)V +/* */ // 1030: invokevirtual 321 TrackingPanel:setPreferredSize (Ljava/awt/Dimension;)V +/* */ // 1033: aload_1 +/* */ // 1034: bipush 23 +/* */ // 1036: putfield 322 java/awt/GridBagConstraints:anchor I +/* */ // 1039: aload_1 +/* */ // 1040: dconst_0 +/* */ // 1041: putfield 325 java/awt/GridBagConstraints:weightx D +/* */ // 1044: aload_1 +/* */ // 1045: iconst_2 +/* */ // 1046: putfield 328 java/awt/GridBagConstraints:gridwidth I +/* */ // 1049: aload_1 +/* */ // 1050: iconst_2 +/* */ // 1051: putfield 331 java/awt/GridBagConstraints:gridheight I +/* */ // 1054: aload_1 +/* */ // 1055: iconst_2 +/* */ // 1056: putfield 334 java/awt/GridBagConstraints:fill I +/* */ // 1059: aload_1 +/* */ // 1060: iconst_0 +/* */ // 1061: putfield 337 java/awt/GridBagConstraints:gridx I +/* */ // 1064: aload_1 +/* */ // 1065: iconst_0 +/* */ // 1066: putfield 340 java/awt/GridBagConstraints:gridy I +/* */ // 1069: aload_0 +/* */ // 1070: aload_0 +/* */ // 1071: getfield 305 GraphFrame:graphContainer Ljavax/swing/JPanel; +/* */ // 1074: aload_1 +/* */ // 1075: invokevirtual 343 GraphFrame:add (Ljava/awt/Component;Ljava/lang/Object;)V +/* */ // 1078: aload_1 +/* */ // 1079: bipush 22 +/* */ // 1081: putfield 322 java/awt/GridBagConstraints:anchor I +/* */ // 1084: aload_1 +/* */ // 1085: dconst_0 +/* */ // 1086: putfield 325 java/awt/GridBagConstraints:weightx D +/* */ // 1089: aload_1 +/* */ // 1090: iconst_3 +/* */ // 1091: putfield 334 java/awt/GridBagConstraints:fill I +/* */ // 1094: aload_1 +/* */ // 1095: iconst_2 +/* */ // 1096: putfield 337 java/awt/GridBagConstraints:gridx I +/* */ // 1099: aload_1 +/* */ // 1100: iconst_1 +/* */ // 1101: putfield 340 java/awt/GridBagConstraints:gridy I +/* */ // 1104: aload_0 +/* */ // 1105: aload_0 +/* */ // 1106: getfield 293 GraphFrame:answerPanel LAnswerPanel; +/* */ // 1109: aload_1 +/* */ // 1110: invokevirtual 343 GraphFrame:add (Ljava/awt/Component;Ljava/lang/Object;)V +/* */ // 1113: aload_1 +/* */ // 1114: bipush 25 +/* */ // 1116: putfield 322 java/awt/GridBagConstraints:anchor I +/* */ // 1119: aload_1 +/* */ // 1120: dconst_0 +/* */ // 1121: putfield 325 java/awt/GridBagConstraints:weightx D +/* */ // 1124: aload_1 +/* */ // 1125: iconst_2 +/* */ // 1126: putfield 334 java/awt/GridBagConstraints:fill I +/* */ // 1129: aload_1 +/* */ // 1130: iconst_0 +/* */ // 1131: putfield 337 java/awt/GridBagConstraints:gridx I +/* */ // 1134: aload_1 +/* */ // 1135: iconst_2 +/* */ // 1136: putfield 340 java/awt/GridBagConstraints:gridy I +/* */ // 1139: aload_0 +/* */ // 1140: aload_0 +/* */ // 1141: getfield 280 GraphFrame:trackingPanel LTrackingPanel; +/* */ // 1144: aload_1 +/* */ // 1145: invokevirtual 343 GraphFrame:add (Ljava/awt/Component;Ljava/lang/Object;)V +/* */ // 1148: aload_0 +/* */ // 1149: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1152: new 312 java/awt/Dimension +/* */ // 1155: dup +/* */ // 1156: sipush 500 +/* */ // 1159: sipush 500 +/* */ // 1162: invokespecial 314 java/awt/Dimension:<init> (II)V +/* */ // 1165: invokevirtual 346 Graph2D:setPreferredSize (Ljava/awt/Dimension;)V +/* */ // 1168: aload_0 +/* */ // 1169: getfield 305 GraphFrame:graphContainer Ljavax/swing/JPanel; +/* */ // 1172: invokestatic 347 javax/swing/BorderFactory:createLoweredBevelBorder ()Ljavax/swing/border/Border; +/* */ // 1175: ldc_w 353 +/* */ // 1178: invokestatic 355 javax/swing/BorderFactory:createTitledBorder (Ljavax/swing/border/Border;Ljava/lang/String;)Ljavax/swing/border/TitledBorder; +/* */ // 1181: invokevirtual 359 javax/swing/JPanel:setBorder (Ljavax/swing/border/Border;)V +/* */ // 1184: aload_0 +/* */ // 1185: getfield 293 GraphFrame:answerPanel LAnswerPanel; +/* */ // 1188: invokestatic 347 javax/swing/BorderFactory:createLoweredBevelBorder ()Ljavax/swing/border/Border; +/* */ // 1191: ldc_w 363 +/* */ // 1194: invokestatic 355 javax/swing/BorderFactory:createTitledBorder (Ljavax/swing/border/Border;Ljava/lang/String;)Ljavax/swing/border/TitledBorder; +/* */ // 1197: invokevirtual 365 AnswerPanel:setBorder (Ljavax/swing/border/Border;)V +/* */ // 1200: aload_0 +/* */ // 1201: getfield 280 GraphFrame:trackingPanel LTrackingPanel; +/* */ // 1204: invokestatic 347 javax/swing/BorderFactory:createLoweredBevelBorder ()Ljavax/swing/border/Border; +/* */ // 1207: ldc_w 366 +/* */ // 1210: invokestatic 355 javax/swing/BorderFactory:createTitledBorder (Ljavax/swing/border/Border;Ljava/lang/String;)Ljavax/swing/border/TitledBorder; +/* */ // 1213: invokevirtual 368 TrackingPanel:setBorder (Ljavax/swing/border/Border;)V +/* */ // 1216: aload_0 +/* */ // 1217: new 369 javax/swing/JMenuBar +/* */ // 1220: dup +/* */ // 1221: invokespecial 371 javax/swing/JMenuBar:<init> ()V +/* */ // 1224: putfield 372 GraphFrame:menubar Ljavax/swing/JMenuBar; +/* */ // 1227: aload_0 +/* */ // 1228: getfield 178 GraphFrame:menus [LMenu; +/* */ // 1231: dup +/* */ // 1232: astore 5 +/* */ // 1234: arraylength +/* */ // 1235: istore 4 +/* */ // 1237: iconst_0 +/* */ // 1238: istore_3 +/* */ // 1239: goto +25 -> 1264 +/* */ // 1242: aload 5 +/* */ // 1244: iload_3 +/* */ // 1245: aaload +/* */ // 1246: astore_2 +/* */ // 1247: aload_0 +/* */ // 1248: getfield 372 GraphFrame:menubar Ljavax/swing/JMenuBar; +/* */ // 1251: aload_2 +/* */ // 1252: invokevirtual 374 javax/swing/JMenuBar:add (Ljavax/swing/JMenu;)Ljavax/swing/JMenu; +/* */ // 1255: pop +/* */ // 1256: aload_2 +/* */ // 1257: aload_0 +/* */ // 1258: invokevirtual 377 Menu:addActionListener (Ljava/awt/event/ActionListener;)V +/* */ // 1261: iinc 3 1 +/* */ // 1264: iload_3 +/* */ // 1265: iload 4 +/* */ // 1267: if_icmplt -25 -> 1242 +/* */ // 1270: aload_0 +/* */ // 1271: aload_0 +/* */ // 1272: getfield 372 GraphFrame:menubar Ljavax/swing/JMenuBar; +/* */ // 1275: invokevirtual 381 GraphFrame:setJMenuBar (Ljavax/swing/JMenuBar;)V +/* */ // 1278: aload_0 +/* */ // 1279: new 385 GraphEventHandler +/* */ // 1282: dup +/* */ // 1283: aload_0 +/* */ // 1284: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1287: invokespecial 387 GraphEventHandler:<init> (LGraph2D;)V +/* */ // 1290: putfield 390 GraphFrame:eventHandler LGraphEventHandler; +/* */ // 1293: aload_0 +/* */ // 1294: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1297: aload_0 +/* */ // 1298: getfield 390 GraphFrame:eventHandler LGraphEventHandler; +/* */ // 1301: invokevirtual 282 Graph2D:addMouseMotionListener (Ljava/awt/event/MouseMotionListener;)V +/* */ // 1304: aload_0 +/* */ // 1305: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1308: aload_0 +/* */ // 1309: getfield 390 GraphFrame:eventHandler LGraphEventHandler; +/* */ // 1312: invokevirtual 392 Graph2D:addMouseListener (Ljava/awt/event/MouseListener;)V +/* */ // 1315: aload_0 +/* */ // 1316: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1319: aload_0 +/* */ // 1320: getfield 280 GraphFrame:trackingPanel LTrackingPanel; +/* */ // 1323: invokevirtual 282 Graph2D:addMouseMotionListener (Ljava/awt/event/MouseMotionListener;)V +/* */ // 1326: aload_0 +/* */ // 1327: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1330: aload_0 +/* */ // 1331: getfield 293 GraphFrame:answerPanel LAnswerPanel; +/* */ // 1334: invokevirtual 396 Graph2D:addEquationChangeListener (LEquationChangeListener;)V +/* */ // 1337: invokestatic 400 GraphTypeHolder:getInstance ()LGraphTypeHolder; +/* */ // 1340: aload_0 +/* */ // 1341: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1344: invokevirtual 406 GraphTypeHolder:addGraphTypeStateChangedListener (LGraphTypeStateChangedListener;)V +/* */ // 1347: aload_0 +/* */ // 1348: getfield 293 GraphFrame:answerPanel LAnswerPanel; +/* */ // 1351: aload_0 +/* */ // 1352: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1355: invokevirtual 410 Graph2D:getEquations ()[Ljava/lang/String; +/* */ // 1358: invokevirtual 414 AnswerPanel:setEquations ([Ljava/lang/String;)V +/* */ // 1361: aload_0 +/* */ // 1362: aload_0 +/* */ // 1363: getfield 390 GraphFrame:eventHandler LGraphEventHandler; +/* */ // 1366: invokevirtual 418 GraphFrame:addMouseWheelListener (Ljava/awt/event/MouseWheelListener;)V +/* */ // 1369: aload_0 +/* */ // 1370: invokevirtual 422 GraphFrame:pack ()V +/* */ // 1373: aload_0 +/* */ // 1374: iconst_1 +/* */ // 1375: invokevirtual 425 GraphFrame:setVisible (Z)V +/* */ // 1378: aload_0 +/* */ // 1379: invokevirtual 422 GraphFrame:pack ()V +/* */ // 1382: ldc2_w 429 +/* */ // 1385: invokestatic 431 java/lang/Thread:sleep (J)V +/* */ // 1388: goto +4 -> 1392 +/* */ // 1391: astore_2 +/* */ // 1392: aload_0 +/* */ // 1393: new 437 EquationDialog +/* */ // 1396: dup +/* */ // 1397: aload_0 +/* */ // 1398: aload_0 +/* */ // 1399: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1402: invokespecial 439 EquationDialog:<init> (Ljava/awt/Frame;LGraph2D;)V +/* */ // 1405: putfield 440 GraphFrame:equationDialog LEquationDialog; +/* */ // 1408: aload_0 +/* */ // 1409: new 442 Graph2DOptionFrame +/* */ // 1412: dup +/* */ // 1413: aload_0 +/* */ // 1414: invokespecial 444 Graph2DOptionFrame:<init> (Ljavax/swing/JFrame;)V +/* */ // 1417: putfield 447 GraphFrame:graphOptions LGraph2DOptionFrame; +/* */ // 1420: aload_0 +/* */ // 1421: new 449 WindowRangeDialog +/* */ // 1424: dup +/* */ // 1425: aload_0 +/* */ // 1426: aload_0 +/* */ // 1427: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1430: invokespecial 451 WindowRangeDialog:<init> (Ljava/awt/Frame;LGraph2D;)V +/* */ // 1433: putfield 452 GraphFrame:windowRangeDialog LWindowRangeDialog; +/* */ // 1436: invokestatic 400 GraphTypeHolder:getInstance ()LGraphTypeHolder; +/* */ // 1439: aload_0 +/* */ // 1440: getfield 440 GraphFrame:equationDialog LEquationDialog; +/* */ // 1443: invokevirtual 406 GraphTypeHolder:addGraphTypeStateChangedListener (LGraphTypeStateChangedListener;)V +/* */ // 1446: aload_0 +/* */ // 1447: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1450: invokevirtual 454 Graph2D:makePoints ()V +/* */ // 1453: aload_0 +/* */ // 1454: getfield 79 GraphFrame:graph LGraph2D; +/* */ // 1457: invokevirtual 457 Graph2D:getRectangleDrawer ()LRectangleDrawer; +/* */ // 1460: aload_0 +/* */ // 1461: invokevirtual 461 RectangleDrawer:addGraphBoxListener (LGraphBoxListener;)V +/* */ // 1464: aload_0 +/* */ // 1465: aload_0 +/* */ // 1466: putfield 244 GraphFrame:ths LGraphFrame; +/* */ // 1469: aload_0 +/* */ // 1470: getfield 178 GraphFrame:menus [LMenu; +/* */ // 1473: iconst_2 +/* */ // 1474: aaload +/* */ // 1475: bipush 12 +/* */ // 1477: invokevirtual 467 Menu:get (I)Ljavax/swing/JComponent; +/* */ // 1480: iconst_0 +/* */ // 1481: invokevirtual 471 javax/swing/JComponent:setEnabled (Z)V +/* */ // 1484: aload_0 +/* */ // 1485: getfield 178 GraphFrame:menus [LMenu; +/* */ // 1488: iconst_2 +/* */ // 1489: aaload +/* */ // 1490: bipush 13 +/* */ // 1492: invokevirtual 467 Menu:get (I)Ljavax/swing/JComponent; +/* */ // 1495: iconst_0 +/* */ // 1496: invokevirtual 471 javax/swing/JComponent:setEnabled (Z)V +/* */ // 1499: aload_0 +/* */ // 1500: getfield 178 GraphFrame:menus [LMenu; +/* */ // 1503: iconst_2 +/* */ // 1504: aaload +/* */ // 1505: bipush 14 +/* */ // 1507: invokevirtual 467 Menu:get (I)Ljavax/swing/JComponent; +/* */ // 1510: iconst_0 +/* */ // 1511: invokevirtual 471 javax/swing/JComponent:setEnabled (Z)V +/* */ // 1514: aload_0 +/* */ // 1515: aload_0 +/* */ // 1516: invokevirtual 474 GraphFrame:addWindowListener (Ljava/awt/event/WindowListener;)V +/* */ // 1519: return +/* */ // +/* */ // Exception table: +/* */ // from to target type +/* */ // 1382 1388 1391 java/lang/Exception +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) +/* */ { +/* 206 */ if (this.currentThreading != null) { +/* 207 */ this.graph.removeMouseListener(this.currentThreading); +/* */ } +/* 209 */ if (e.getSource() == this.menus[0].get(0)) { +/* 210 */ this.saveBitmapChooser.promptSave(); +/* */ } +/* 212 */ if (e.getSource() == this.menus[1].get(0)) +/* 213 */ this.equationDialog.setVisible(true); +/* 214 */ if (e.getSource() == this.menus[4].get(1)) +/* 215 */ this.graphOptions.setVisible(true); +/* 216 */ if (e.getSource() == this.menus[1].get(1)) +/* 217 */ this.statplot.setVisible(true); +/* 218 */ if (e.getSource() == this.menus[3].get(0)) +/* 219 */ this.windowRangeDialog.setVisible(true); +/* 220 */ if (e.getSource() == this.menus[4].get(0)) +/* 221 */ ModulusThreads.addThread("Remaking Points", this.graph.getThread()); +/* 222 */ if (e.getSource() == this.zoomMenu.get(1)) +/* 223 */ scaleToInt(); +/* 224 */ if (e.getSource() == this.zoomMenu.get(6)) +/* 225 */ recenter(); +/* 226 */ if (e.getSource() == this.zoomMenu.get(2)) { +/* 227 */ this.graphBoxListenerIndex = 0; +/* 228 */ this.graph.setRectangleMode(true); +/* 229 */ }if (e.getSource() == this.menus[2].get(2)) { +/* 230 */ this.graphBoxListenerIndex = 1; +/* 231 */ this.graph.setRectangleMode(true); +/* 232 */ }if (e.getSource() == this.menus[2].get(5)) { +/* 233 */ this.graphClickListenerIndex = 0; +/* 234 */ this.graph.addMouseListener(this.clickListeners[this.graphClickListenerIndex]); +/* 235 */ }if (e.getSource() == this.menus[2].get(6)) { +/* 236 */ this.graphClickListenerIndex = 2; +/* 237 */ this.graph.addMouseListener(this.clickListeners[this.graphClickListenerIndex]); +/* 238 */ }if (e.getSource() == this.menus[2].get(7)) { +/* 239 */ this.graphClickListenerIndex = 1; +/* 240 */ this.graph.addMouseListener(this.clickListeners[this.graphClickListenerIndex]); +/* 241 */ this.currentThreading = this.clickListeners[this.graphClickListenerIndex]; +/* 242 */ }if (e.getSource() == this.menus[2].get(10)) +/* 243 */ this.regressionDialogs[0].setVisible(true); +/* 244 */ if (e.getSource() == this.menus[2].get(11)) +/* 245 */ this.regressionDialogs[1].setVisible(true); +/* 246 */ if (e.getSource() == this.menus[2].get(12)) +/* 247 */ this.regressionDialogs[2].setVisible(true); +/* 248 */ if (e.getSource() == this.menus[2].get(13)) +/* 249 */ this.regressionDialogs[3].setVisible(true); +/* 250 */ if (e.getSource() == this.menus[1].get(5)) +/* */ try { +/* 252 */ new TableFrame(this.graph.getEquations(), 0.0D, 10.0D).setVisible(true); +/* */ } catch (Exception ex) { +/* 254 */ ex.printStackTrace(); +/* */ } +/* */ } +/* */ +/* 258 */ public static void main(String[] args) { run(); } +/* */ +/* */ public static void run() +/* */ { +/* 262 */ if (instance == null) +/* 263 */ instance = new GraphFrame(); +/* */ else +/* 265 */ instance.setVisible(true); +/* */ } +/* */ +/* 268 */ private void scaleToInt() { WindowRange graphWindowRange = this.graph.getWindowRange(); +/* 269 */ int differenceX = (int)Math.round((graphWindowRange.getXMax() - graphWindowRange.getXMin()) / this.graph.getWidth()) * getWidth(); +/* 270 */ int differenceY = (int)Math.round((graphWindowRange.getYMax() - graphWindowRange.getYMin()) / this.graph.getHeight()) * getHeight(); +/* */ +/* 272 */ if (differenceX == 0) differenceX = this.graph.getWidth(); +/* 273 */ if (differenceY == 0) differenceY = this.graph.getHeight(); +/* */ +/* 275 */ double pivX = (graphWindowRange.getXMax() + graphWindowRange.getXMin()) / 2.0D; +/* 276 */ double pivY = (graphWindowRange.getYMax() + graphWindowRange.getYMin()) / 2.0D; +/* */ +/* 278 */ WindowRange newRange = new WindowRange(pivX - differenceX / 2, pivY - differenceY / 2, pivX + differenceX / 2, pivY + differenceY / 2); +/* 279 */ this.graph.setWindowRange(newRange); +/* 280 */ this.graph.recreate(); } +/* */ +/* */ private void recenter() { +/* 283 */ WindowRange graphWindowRange = this.graph.getWindowRange(); +/* 284 */ double halfX = (graphWindowRange.getXMax() - graphWindowRange.getXMin()) / 2.0D; +/* 285 */ double halfY = (graphWindowRange.getYMax() - graphWindowRange.getYMin()) / 2.0D; +/* 286 */ WindowRange newRange = new WindowRange(-halfX, -halfY, halfX, halfY); +/* 287 */ this.graph.setWindowRange(newRange); +/* 288 */ this.graph.recreate(); +/* */ } +/* */ private static double round(double x, int radix) { +/* 291 */ return Math.round(x * Math.pow(10.0D, radix)) / Math.pow(10.0D, radix); +/* */ } +/* */ +/* */ public void graphBoxMade(int x1, int y1, int x2, int y2) { +/* 295 */ this.gboxlisteners[this.graphBoxListenerIndex].graphBoxMade(x1, y1, x2, y2); +/* */ } +/* */ +/* */ public static Thread getThread() +/* */ { +/* 530 */ return new GraphFrame.GuiThread(null); +/* */ } +/* */ +/* */ public void windowActivated(WindowEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void windowClosed(WindowEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void windowClosing(WindowEvent arg0) +/* */ { +/* 546 */ this.graph.removeMouseMotionListener(this.eventHandler); +/* 547 */ this.graph.removeMouseListener(this.eventHandler); +/* 548 */ this.graph.removeMouseMotionListener(this.trackingPanel); +/* 549 */ this.graph.removeEquationChangeListener(this.answerPanel); +/* */ } +/* */ +/* */ public void windowDeactivated(WindowEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void windowDeiconified(WindowEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void windowIconified(WindowEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void windowOpened(WindowEvent arg0) +/* */ { +/* */ } +/* */ +/* */ private static class GuiThread extends Thread +/* */ { +/* */ public void run() +/* */ { +/* 534 */ new GraphFrame().setVisible(true); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GraphFrame + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GraphIterator.java b/src/GraphIterator.java new file mode 100644 index 0000000..022048d --- /dev/null +++ b/src/GraphIterator.java @@ -0,0 +1,27 @@ +/* */ public abstract class GraphIterator +/* */ { +/* */ protected double index; +/* */ +/* */ public GraphIterator(double start) +/* */ { +/* 12 */ this.index = start; +/* */ } +/* */ public double getIndex() { +/* 15 */ return this.index; +/* */ } +/* */ public abstract boolean hasMoreTokens(); +/* */ +/* */ public abstract void onTurn(); +/* */ +/* */ public double translateIndex(Graph2D graph) { +/* 22 */ return this.index; +/* */ } +/* */ public double translateNumber(Graph2D graph, double i) { +/* 25 */ return i; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GraphIterator + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GraphLineDrawEvent.java b/src/GraphLineDrawEvent.java new file mode 100644 index 0000000..53e8623 --- /dev/null +++ b/src/GraphLineDrawEvent.java @@ -0,0 +1,28 @@ +/* */ import java.awt.Graphics; +/* */ +/* */ public class GraphLineDrawEvent +/* */ implements GraphicsEvent +/* */ { +/* */ private Graph2D graph; +/* */ private Point2D from; +/* */ private Point2D to; +/* */ +/* */ public GraphLineDrawEvent(Graph2D graph, Point2D from, Point2D to) +/* */ { +/* 15 */ this.graph = graph; +/* 16 */ this.from = from; +/* 17 */ this.to = to; +/* */ } +/* */ +/* */ public void invoke(Graphics graphics) +/* */ { +/* 24 */ Point2D transFrom = this.graph.translate(this.from); +/* 25 */ Point2D transTo = this.graph.translate(this.to); +/* 26 */ graphics.drawLine(transFrom.getX(), transFrom.getY(), transTo.getX(), transTo.getY()); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GraphLineDrawEvent + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GraphThread.java b/src/GraphThread.java new file mode 100644 index 0000000..9ef3bee --- /dev/null +++ b/src/GraphThread.java @@ -0,0 +1,24 @@ +/* */ import java.awt.EventQueue; +/* */ +/* */ public class GraphThread extends EventQueue +/* */ implements Runnable +/* */ { +/* */ public GraphThread() +/* */ { +/* */ try +/* */ { +/* 12 */ invokeLater(this); +/* */ } +/* */ catch (Exception e) { +/* 15 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* 19 */ public void run() { GraphFrame.run(); } +/* */ +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GraphThread + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GraphTranslator.java b/src/GraphTranslator.java new file mode 100644 index 0000000..f387aa9 --- /dev/null +++ b/src/GraphTranslator.java @@ -0,0 +1,11 @@ +public abstract interface GraphTranslator +{ + public abstract Point2D translate(Point2D paramPoint2D); + + public abstract Point2D translateInv(Point2D paramPoint2D); +} + +/* Location: Modulus.jar + * Qualified Name: GraphTranslator + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GraphTypeHolder.java b/src/GraphTypeHolder.java new file mode 100644 index 0000000..1fcac09 --- /dev/null +++ b/src/GraphTypeHolder.java @@ -0,0 +1,109 @@ +/* */ import java.io.File; +/* */ import java.io.FileInputStream; +/* */ import java.io.FileOutputStream; +/* */ import java.io.IOException; +/* */ import java.io.ObjectInputStream; +/* */ import java.io.ObjectOutputStream; +/* */ import java.io.Serializable; +/* */ import java.util.ArrayList; +/* */ +/* */ public class GraphTypeHolder +/* */ implements Serializable +/* */ { +/* */ private static final long serialVersionUID = -5227701003145329653L; +/* 21 */ private ArrayList<GraphTypeStateChangedListener> listeners = new ArrayList(); +/* 22 */ private Point2DMaker graphType = new Euclidean2DPointMaker(); +/* */ private static GraphTypeHolder instance; +/* */ private String[] equations; +/* */ +/* */ public GraphTypeHolder() +/* */ { +/* 27 */ for (int i = 0; i < this.listeners.size(); i++) +/* 28 */ ((GraphTypeStateChangedListener)this.listeners.get(i)).graphTypeChanged(this.graphType); +/* */ } +/* */ +/* */ public void setGraphPointMaker(Point2DMaker maker) { +/* 32 */ this.graphType = maker; +/* 33 */ fireGraphTypeStateChanged(); +/* */ } +/* */ public void fireGraphTypeStateChanged() { +/* 36 */ for (int i = 0; i < this.listeners.size(); i++) +/* 37 */ ((GraphTypeStateChangedListener)this.listeners.get(i)).graphTypeChanged(this.graphType); +/* */ } +/* */ +/* */ public Point2DMaker getGraphPointMaker() { +/* 41 */ return this.graphType; +/* */ } +/* */ public void addGraphTypeStateChangedListener(GraphTypeStateChangedListener g) { +/* 44 */ if (g == null) return; +/* 45 */ this.listeners.add(g); +/* */ } +/* */ public String[] getEquations() { +/* 48 */ return this.equations; +/* */ } +/* */ public void setEquations(String[] equations) { +/* 51 */ this.equations = equations; +/* */ } +/* */ public static GraphTypeHolder getInstance() { +/* 54 */ if (instance == null) instance = new GraphTypeHolder(); +/* 55 */ return instance; +/* */ } +/* */ public void serialize() { +/* 58 */ File file = null; +/* */ try { +/* 60 */ file = new File(new File(".").getCanonicalFile(), "LastGraph.ser"); +/* */ } +/* */ catch (IOException e) { +/* 63 */ e.printStackTrace(); +/* 64 */ return; +/* */ } +/* 66 */ FileOutputStream fos = null; +/* 67 */ ObjectOutputStream out = null; +/* */ try +/* */ { +/* 70 */ fos = new FileOutputStream(file); +/* 71 */ out = new ObjectOutputStream(fos); +/* 72 */ out.writeObject(this); +/* 73 */ out.close(); +/* */ } +/* */ catch (IOException ex) +/* */ { +/* 77 */ ex.printStackTrace(); +/* */ } +/* */ } +/* */ +/* 81 */ private static GraphTypeHolder read() { File file = null; +/* */ try { +/* 83 */ file = new File(new File(".").getCanonicalFile(), "LastGraph.ser"); +/* */ } +/* */ catch (IOException e) { +/* 86 */ e.printStackTrace(); +/* */ } +/* */ +/* 89 */ FileInputStream fis = null; +/* 90 */ ObjectInputStream in = null; +/* 91 */ GraphTypeHolder ret = null; +/* */ try +/* */ { +/* 94 */ fis = new FileInputStream(file); +/* 95 */ in = new ObjectInputStream(fis); +/* 96 */ ret = (GraphTypeHolder)in.readObject(); +/* 97 */ in.close(); +/* 98 */ return ret; +/* */ } +/* */ catch (IOException ex) +/* */ { +/* 102 */ ex.printStackTrace(); +/* */ } +/* */ catch (ClassNotFoundException ex) +/* */ { +/* 106 */ ex.printStackTrace(); +/* */ } +/* 108 */ return null; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: GraphTypeHolder + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/GraphTypeStateChangedListener.java b/src/GraphTypeStateChangedListener.java new file mode 100644 index 0000000..ef3f5f4 --- /dev/null +++ b/src/GraphTypeStateChangedListener.java @@ -0,0 +1,9 @@ +public abstract interface GraphTypeStateChangedListener +{ + public abstract void graphTypeChanged(Point2DMaker paramPoint2DMaker); +} + +/* Location: Modulus.jar + * Qualified Name: GraphTypeStateChangedListener + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/HeightMapGraph.java b/src/HeightMapGraph.java new file mode 100644 index 0000000..dc01134 --- /dev/null +++ b/src/HeightMapGraph.java @@ -0,0 +1,66 @@ +/* */ import GUIComponents.ProgressFrame; +/* */ import java.awt.Color; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ +/* */ public class HeightMapGraph extends EquasiveGraph3D +/* */ { +/* */ private HeightMapReader map; +/* */ +/* */ public HeightMapGraph(String image) +/* */ { +/* 15 */ super(300.0D, -300.0D, -300.0D, 300.0D, -300.0D, 300.0D, 10.0D, 10.0D); +/* */ try { +/* 17 */ this.map = new HeightMapReader(image, 0.5D); +/* */ } +/* */ catch (Exception localException) { +/* */ } +/* */ } +/* */ +/* */ public void reset() { +/* 24 */ this.points = new ArrayList(); +/* 25 */ Point3D[][] points = this.map.readAll((int)getXStep(), (int)getYStep()); +/* 26 */ if (this.progress == null) { +/* 27 */ this.progress = new ProgressFrame(0, 100, M3DGraphWindow.getCurrent()); +/* 28 */ this.progress.setVisible(true); +/* */ } +/* 30 */ this.progress.setVisible(true); +/* 31 */ this.progress.setValue(0.0D); +/* 32 */ for (int x = 0; x < points.length - 1; x++) +/* 33 */ for (int y = 0; y < points[x].length - 1; y++) { +/* 34 */ Point3D[] group = { +/* 35 */ points[x][y], +/* 36 */ points[(x + 1)][y], +/* 37 */ points[(x + 1)][(y + 1)], +/* 38 */ points[x][(y + 1)] }; +/* */ +/* 41 */ if (checkGroup(group)) { +/* 42 */ for (Point3D p : group) { +/* 43 */ p.setModel(getModel()); +/* */ } +/* 45 */ PointGroup temp = new PointGroup(group); +/* 46 */ int adv = (int)Math.min(averageHeight(group) / this.map.getMultiplier(), 255.0D); +/* 47 */ temp.setColor(new Color(adv, adv, adv)); +/* 48 */ this.points.add(temp); +/* 49 */ repaint(); +/* */ } +/* */ } +/* 52 */ this.progress.flagEnd(); +/* */ } +/* */ private boolean checkGroup(Point3D[] points) { +/* 55 */ for (Point3D x : points) if (x == null) return false; +/* 56 */ return true; +/* */ } +/* */ private double averageHeight(Point3D[] pnts) { +/* 59 */ double total = 0.0D; +/* 60 */ for (Point3D p : pnts) { +/* 61 */ total += p.getY(); +/* */ } +/* 63 */ return total / pnts.length; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: HeightMapGraph + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/HeightMapReader.java b/src/HeightMapReader.java new file mode 100644 index 0000000..83376fc --- /dev/null +++ b/src/HeightMapReader.java @@ -0,0 +1,51 @@ +/* */ import java.awt.Color; +/* */ import java.awt.image.BufferedImage; +/* */ import java.io.File; +/* */ import javax.imageio.ImageIO; +/* */ +/* */ public class HeightMapReader +/* */ { +/* */ private BufferedImage heightMap; +/* */ private double multiplier; +/* */ +/* */ public HeightMapReader(String file, double multiplier) +/* */ throws Exception +/* */ { +/* 18 */ this(new File(file), multiplier); +/* */ } +/* */ public HeightMapReader(File file, double multiplier) throws Exception { +/* 21 */ this(ImageIO.read(file), multiplier); +/* */ } +/* */ public HeightMapReader(BufferedImage image, double multiplier) { +/* 24 */ this.heightMap = image; +/* 25 */ this.multiplier = multiplier; +/* */ } +/* */ public Point3D readPoint(int x, int y) { +/* 28 */ Color pixelColor = new Color(this.heightMap.getRGB(x, y)); +/* */ +/* 30 */ return new Point3D(x - this.heightMap.getWidth() / 2.0D, pixelColor.getRed() * this.multiplier, y - this.heightMap.getHeight() / 2.0D); +/* */ } +/* */ +/* */ public Point3D[][] readAll(int xstep, int ystep) { +/* 34 */ Point3D[][] ret = new Point3D[this.heightMap.getWidth() / xstep][this.heightMap.getHeight() / ystep]; +/* */ +/* 36 */ for (int x = 0; (x < ret.length * xstep) && (x < this.heightMap.getWidth()); x += xstep) { +/* 37 */ Point3D[] toAdd = new Point3D[this.heightMap.getWidth() / xstep]; +/* 38 */ for (int y = 0; (y < toAdd.length * ystep) && (y < this.heightMap.getHeight()); y += ystep) { +/* 39 */ toAdd[(y / ystep)] = readPoint(x, y); +/* */ } +/* 41 */ ret[(x / xstep)] = toAdd; +/* */ } +/* */ +/* 44 */ return ret; +/* */ } +/* 46 */ public double getMultiplier() { return this.multiplier; } +/* */ public Color getColorAt(int x, int y) { +/* 48 */ return new Color(this.heightMap.getRGB(x, y)); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: HeightMapReader + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ImageFrame.java b/src/ImageFrame.java new file mode 100644 index 0000000..3fb7321 --- /dev/null +++ b/src/ImageFrame.java @@ -0,0 +1,89 @@ +/* */ import StandardIO.Approvable; +/* */ import StandardIO.MFileFilter; +/* */ import StandardIO.ModulusFileChooser; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Graphics; +/* */ import java.awt.Graphics2D; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.awt.event.MouseEvent; +/* */ import java.awt.event.MouseListener; +/* */ import java.awt.geom.AffineTransform; +/* */ import java.awt.image.BufferedImage; +/* */ import java.io.File; +/* */ import java.io.IOException; +/* */ import javax.imageio.ImageIO; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JDialog; +/* */ +/* */ public class ImageFrame extends JDialog +/* */ implements MouseListener, ActionListener +/* */ { +/* */ private BufferedImage image; +/* */ private JButton saveButton; +/* 25 */ private Approvable imageSaveApprove = new Approvable() +/* */ { +/* */ public void onApprove(File file) { +/* */ try { +/* 29 */ file.createNewFile(); +/* 30 */ ImageIO.write(ImageFrame.this.image, file.toString().substring(file.toString().lastIndexOf(".") + 1), file); +/* */ } +/* */ catch (IOException localIOException) +/* */ { +/* */ } +/* */ } +/* */ +/* */ public void onCancel() +/* */ { +/* */ } +/* 25 */ }; +/* */ +/* */ public ImageFrame(BufferedImage img) +/* */ { +/* 37 */ setAlwaysOnTop(true); +/* 38 */ setLayout(new FlowLayout()); +/* 39 */ setTitle("Snapshot"); +/* 40 */ this.image = img; +/* 41 */ this.saveButton = new JButton("Save"); +/* 42 */ add(this.saveButton); +/* 43 */ this.saveButton.setVisible(true); +/* 44 */ this.saveButton.addActionListener(this); +/* 45 */ addMouseListener(this); +/* 46 */ reset(); +/* */ } +/* */ public void setImage(BufferedImage image) { +/* 49 */ this.image = image; +/* 50 */ reset(); +/* */ } +/* */ private void reset() { +/* 53 */ setSize(350, 300); +/* 54 */ repaint(); +/* */ } +/* */ public void paint(Graphics g2) { +/* 57 */ Graphics2D g = (Graphics2D)g2; +/* 58 */ if (this.image != null) +/* 59 */ g.drawImage(this.image, AffineTransform.getScaleInstance(getWidth() / this.image.getWidth(), getHeight() / this.image.getHeight()), null); +/* */ } +/* */ public void mouseClicked(MouseEvent e) { +/* */ } +/* */ public void mouseEntered(MouseEvent e) { +/* */ } +/* */ +/* */ public void mouseExited(MouseEvent e) { +/* */ } +/* */ +/* */ public void mousePressed(MouseEvent e) { +/* */ } +/* */ +/* */ public void mouseReleased(MouseEvent e) { +/* */ } +/* */ +/* 75 */ public void actionPerformed(ActionEvent e) { ModulusFileChooser mfc = new ModulusFileChooser(this.imageSaveApprove, "", new MFileFilter[] { new MFileFilter(new String[] { ".png" }, "png Image"), new MFileFilter(new String[] { ".gif" }, "Comput"), new MFileFilter(new String[] { ".bmp" }, "Bitmap") }); +/* 76 */ mfc.promptSave(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ImageFrame + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/JTurtle.jar b/src/JTurtle.jar Binary files differnew file mode 100644 index 0000000..184c3cb --- /dev/null +++ b/src/JTurtle.jar diff --git a/src/Keyboard.java b/src/Keyboard.java new file mode 100644 index 0000000..5f7cd6d --- /dev/null +++ b/src/Keyboard.java @@ -0,0 +1,187 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Dimension; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Font; +/* */ import java.awt.GridLayout; +/* */ import java.awt.Insets; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.util.ArrayList; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JPanel; +/* */ +/* */ public class Keyboard extends JPanel +/* */ implements ActionListener +/* */ { +/* */ public static final String QWERTY = "1234567890\\QWERTYUIOP\\ASDFGHJKL\\ZXCVBNM"; +/* */ public static final String ALPHABETICAL = "0123456789\\ABCDEFGHIJ\\KLMNOPQRST\\UVWXYZ"; +/* */ public static final String DVORAK = "1234567890\\PYFGCRL\\AOEUIDHTNS\\QJKXBMWVZ"; +/* */ public static final String NUMBER_PAD = "789\\456\\123\\0"; +/* 21 */ private char lastTyped = ' '; +/* */ private String[][] characters; +/* */ private ArrayList<JButton> keys; +/* */ private ArrayList<ActionListener> listenersList; +/* */ GridLayout grid; +/* */ JPanel[] centerPanels; +/* */ JPanel[] gridPanels; +/* 28 */ private String str = ""; +/* */ +/* */ public Keyboard(String layout) { +/* 31 */ this(toTwoDimenstions(layout), 25, 30, null); +/* 32 */ this.str = layout; +/* */ } +/* */ public Keyboard(String layout, ActionListener listener) { +/* 35 */ this(layout); +/* 36 */ this.str = layout; +/* 37 */ this.listenersList.add(listener); +/* */ } +/* */ public Keyboard() { +/* 40 */ this("1234567890\\QWERTYUIOP\\ASDFGHJKL\\ZXCVBNM"); +/* */ } +/* */ public Keyboard(String[][] layout, int height, int width, Color color) { +/* 43 */ this.characters = layout; +/* 44 */ this.listenersList = new ArrayList(); +/* 45 */ int max = 0; +/* 46 */ for (String[] i : this.characters) if (i.length > max) max = i.length; +/* 47 */ int added = 0; +/* 48 */ for (int i = 0; i < this.characters.length; i++) { +/* 49 */ added += this.characters[i].length; +/* */ } +/* 51 */ this.keys = new ArrayList(); +/* 52 */ this.grid = new GridLayout(this.characters.length, 1); +/* 53 */ setLayout(this.grid); +/* 54 */ setSize(max * 30 + 5, this.characters.length * 30 + 5); +/* 55 */ this.gridPanels = new JPanel[this.characters.length]; +/* 56 */ this.centerPanels = new JPanel[this.characters.length]; +/* 57 */ int i = 0; for (int k = 0; i < this.gridPanels.length; k++) { +/* 58 */ this.gridPanels[i] = new JPanel(new FlowLayout()); +/* 59 */ add(this.gridPanels[i]); +/* 60 */ this.centerPanels[i] = new JPanel(new GridLayout(1, this.characters[i].length)); +/* 61 */ this.gridPanels[i].add(this.centerPanels[i]); +/* 62 */ for (int j = 0; j < this.characters[i].length; k++) { +/* 63 */ JButton temp = new JButton(this.characters[i][j]); +/* 64 */ temp.setFont(new Font("Times New Roman", 0, 12)); +/* 65 */ temp.addActionListener(this); +/* 66 */ this.centerPanels[i].setPreferredSize(new Dimension(this.characters[i].length * 50, 50)); +/* 67 */ temp.setMargin(new Insets(0, 0, 0, 0)); +/* 68 */ this.keys.add(temp); +/* 69 */ this.centerPanels[i].add(temp); +/* 70 */ temp.setPreferredSize(new Dimension(width, height)); +/* 71 */ temp.setBackground(color); +/* */ +/* 62 */ j++; +/* */ } +/* */ +/* 73 */ this.centerPanels[i].setPreferredSize(new Dimension(this.characters[i].length * width, height)); +/* */ +/* 57 */ i++; +/* */ } +/* */ } +/* */ +/* */ private void fireActionPerformed(ActionEvent e) +/* */ { +/* 79 */ for (int i = 0; i < this.listenersList.size(); i++) { +/* 80 */ ((ActionListener)this.listenersList.get(i)).actionPerformed(e); +/* 81 */ e.setSource(this); +/* 82 */ ((ActionListener)this.listenersList.get(i)).actionPerformed(e); +/* */ } +/* */ } +/* */ +/* 86 */ public JButton get(int index) { return (JButton)this.keys.get(index); } +/* */ +/* */ public JButton getByName(String name) { +/* 89 */ for (int i = 0; i < this.keys.size(); i++) if (((JButton)this.keys.get(i)).getText().equals(name)) return (JButton)this.keys.get(i); +/* 90 */ return null; +/* */ } +/* */ public JButton getByObject(Object o) { +/* 93 */ for (int i = 0; i < this.keys.size(); i++) if (this.keys.get(i) == o) return (JButton)this.keys.get(i); +/* 94 */ return null; +/* */ } +/* */ public boolean contains(Object o) { +/* 97 */ return getByObject(o) != null; +/* */ } +/* */ public void actionPerformed(ActionEvent e) { +/* 100 */ fireActionPerformed(e); +/* */ } +/* 102 */ public void addActionListener(ActionListener listen) { this.listenersList.add(listen); } +/* 103 */ public char lastTyped() { return this.lastTyped; } +/* */ public void setColor(Color color) { +/* 105 */ for (int i = 0; i < this.keys.size(); i++) +/* 106 */ ((JButton)this.keys.get(i)).setBackground(color); +/* */ } +/* */ +/* */ public void setText(int index, String text) { +/* 110 */ ((JButton)this.keys.get(index)).setText(text); +/* */ } +/* */ private static String[][] toTwoDimenstions(String layout) { +/* 113 */ String[] x = layout.split("\\\\"); +/* 114 */ int max = 0; +/* 115 */ for (String i : x) if (i.length() > max) max = i.length(); +/* 116 */ String[][] lay = new String[x.length][max]; +/* 117 */ for (int i = 0; i < x.length; i++) { +/* 118 */ lay[i] = new String[x[i].length()]; +/* 119 */ for (int j = 0; j < lay[i].length; j++) +/* */ { +/* 121 */ lay[i][j] = x[i].charAt(j); +/* */ } +/* */ } +/* 124 */ return lay; +/* */ } +/* */ +/* */ public void reset(String layout) { +/* 128 */ reset(toTwoDimenstions(layout), 25, 30, null); +/* 129 */ this.str = layout; +/* */ } +/* */ public void reset(String[][] layout, int height, int width, Color color) { +/* 132 */ removeAll(); +/* 133 */ this.characters = layout; +/* 134 */ this.listenersList = new ArrayList(); +/* 135 */ int max = 0; +/* 136 */ for (String[] i : this.characters) if (i.length > max) max = i.length; +/* 137 */ int added = 0; +/* 138 */ for (int i = 0; i < this.characters.length; i++) { +/* 139 */ added += this.characters[i].length; +/* */ } +/* 141 */ this.keys = new ArrayList(); +/* 142 */ this.grid = new GridLayout(this.characters.length, 1); +/* 143 */ setLayout(this.grid); +/* 144 */ setSize(max * 30 + 5, this.characters.length * 30 + 5); +/* 145 */ this.gridPanels = new JPanel[this.characters.length]; +/* 146 */ this.centerPanels = new JPanel[this.characters.length]; +/* 147 */ int i = 0; for (int k = 0; i < this.gridPanels.length; k++) { +/* 148 */ this.gridPanels[i] = new JPanel(new FlowLayout()); +/* 149 */ add(this.gridPanels[i]); +/* 150 */ this.centerPanels[i] = new JPanel(new GridLayout(1, this.characters[i].length)); +/* 151 */ this.gridPanels[i].add(this.centerPanels[i]); +/* 152 */ for (int j = 0; j < this.characters[i].length; k++) { +/* 153 */ JButton temp = new JButton(this.characters[i][j]); +/* 154 */ temp.addActionListener(this); +/* 155 */ this.centerPanels[i].setPreferredSize(new Dimension(this.characters[i].length * 50, 50)); +/* 156 */ temp.setMargin(new Insets(0, 0, 0, 0)); +/* 157 */ this.keys.add(temp); +/* 158 */ this.centerPanels[i].add(temp); +/* 159 */ temp.setPreferredSize(new Dimension(width, height)); +/* 160 */ temp.setBackground(color); +/* */ +/* 152 */ j++; +/* */ } +/* */ +/* 162 */ this.centerPanels[i].setPreferredSize(new Dimension(this.characters[i].length * width, height)); +/* */ +/* 147 */ i++; +/* */ } +/* */ +/* 164 */ updateUI(); +/* */ } +/* */ public int indexOf(Object o) { +/* 167 */ for (int i = 0; i < this.keys.size(); i++) if (this.keys.get(i) == o) return i; +/* 168 */ return -1; +/* */ } +/* 170 */ public String getString() { return this.str; } +/* */ +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Keyboard + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/M3DGraphWindow.java b/src/M3DGraphWindow.java new file mode 100644 index 0000000..92d7927 --- /dev/null +++ b/src/M3DGraphWindow.java @@ -0,0 +1,264 @@ +/* */ import StandardIO.Approvable; +/* */ import StandardIO.MFileFilter; +/* */ import StandardIO.ModulusFileChooser; +/* */ import java.awt.AWTEvent; +/* */ import java.awt.BorderLayout; +/* */ import java.awt.Component; +/* */ import java.awt.Dimension; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.awt.event.MouseEvent; +/* */ import java.awt.event.MouseListener; +/* */ import java.awt.image.BufferedImage; +/* */ import java.io.File; +/* */ import java.util.ArrayList; +/* */ import javax.imageio.ImageIO; +/* */ import javax.swing.AbstractButton; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JMenuBar; +/* */ import javax.swing.JMenuItem; +/* */ import javax.swing.JPopupMenu; +/* */ import javax.swing.JRadioButton; +/* */ import javax.swing.JSeparator; +/* */ +/* */ public class M3DGraphWindow extends JFrame +/* */ implements ActionListener, Flagger, MouseListener, MoveListener +/* */ { +/* */ private static M3DGraphWindow current; +/* */ private ArrayList<Thread> threads; +/* */ private ImageFrame imageholder; +/* */ private boolean realTime; +/* 23 */ private JComponent[] comp = { +/* 25 */ new JMenuItem("Set Equations"), +/* 26 */ new JMenuItem("Options..."), +/* 27 */ new JMenuItem("Re-Draw all Equations"), +/* 28 */ new Menu("Rotate", new JComponent[] { +/* 29 */ new JMenuItem("X - Axis"), +/* 30 */ new JMenuItem("Y - Axis"), +/* 31 */ new JMenuItem("Z - Axis"), +/* 32 */ new JSeparator(), +/* 33 */ new JSeparator(), +/* 34 */ new JMenuItem("Stop") }), +/* 36 */ new JMenuItem("Re-Center") }; +/* */ +/* 39 */ private Menu[] menus = { +/* 40 */ new Menu("File", new JComponent[] { +/* 41 */ new JMenuItem("Capture Bitmap"), +/* 42 */ new JRadioButton("Real-Time Capture"), +/* 43 */ new JMenuItem("Load Graph"), +/* 44 */ new JMenuItem("Load Heightmap") }), +/* 46 */ new Menu("Options", new JComponent[] { +/* 47 */ new JMenuItem("Set Equations"), +/* 48 */ new JMenuItem("Options..."), +/* 49 */ new JMenuItem("Re-Draw all Equations"), +/* 50 */ new Menu("Rotate", new JComponent[] { +/* 51 */ new JMenuItem("X - Axis"), +/* 52 */ new JMenuItem("Y - Axis"), +/* 53 */ new JMenuItem("Z - Axis"), +/* 54 */ new JSeparator(), +/* 55 */ new JSeparator(), +/* 56 */ new JMenuItem("Stop") }), +/* 58 */ new JMenuItem("Re-Center") }), +/* 60 */ new Menu("Graph", new JComponent[] { +/* 61 */ new JRadioButton("Show Axies", true), +/* 62 */ new JMenuItem("Set Background") }) }; +/* */ +/* 66 */ private JMenuBar bar = new JMenuBar(); +/* 67 */ private EquasiveGraph3D graph = new EquasiveGraph3D(15.0D, -15.0D, -15.0D, 15.0D, -15.0D, 15.0D, 10.0D, 10.0D); +/* */ private JPopupMenu popup; +/* 69 */ private Approvable hmapapprove = new Approvable() { +/* */ public void onApprove(File f) { +/* 71 */ M3DGraphWindow.this.setGraph(new HeightMapGraph(f.toString())); +/* */ } +/* */ +/* */ public void onCancel() +/* */ { +/* */ } +/* 69 */ }; +/* */ +/* 76 */ private Approvable bgimgapprove = new Approvable() { +/* */ public void onApprove(File f) { +/* */ try { +/* 79 */ M3DGraphWindow.this.getGraph().setBackground(ImageIO.read(f)); +/* */ } catch (Exception e) { +/* 81 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void onCancel() +/* */ { +/* */ } +/* 76 */ }; +/* */ +/* */ public M3DGraphWindow() +/* */ { +/* 89 */ setTitle("Modulus 3D Graphing Canvas"); +/* 90 */ addMouseListener(this); +/* 91 */ current = this; +/* 92 */ setLayout(new BorderLayout()); +/* */ +/* 94 */ for (Menu m : this.menus) { +/* 95 */ this.bar.add(m); +/* 96 */ m.addActionListener(this); +/* */ } +/* 98 */ for (JComponent c : this.comp) { +/* 99 */ if ((c instanceof AbstractButton)) ((AbstractButton)c).addActionListener(this); +/* */ } +/* */ +/* 102 */ add(this.graph, "Center"); +/* 103 */ add(this.bar, "North"); +/* 104 */ setVisible(true); +/* 105 */ setSize(new Dimension(500, 500)); +/* 106 */ setMinimumSize(getSize()); +/* 107 */ this.graph.addMouseListener(this); +/* 108 */ this.graph.reset(); +/* 109 */ this.imageholder = new ImageFrame(this.graph.getImage()); +/* 110 */ addKeyListener(this.graph); +/* 111 */ this.popup = new Menu("Options", this.comp).getPopupMenu(); +/* 112 */ RangeOptionFrame.reset(this); +/* 113 */ this.threads = new ArrayList(); +/* */ +/* 115 */ this.graph.addMoveListener(this); +/* 116 */ this.realTime = false; +/* */ } +/* */ public boolean isFocusable() { +/* 119 */ return true; +/* */ } +/* */ public void flag2(Object obj) { +/* 122 */ if ((obj instanceof String[])) { +/* 123 */ this.graph.setEquations((String[])obj); +/* 124 */ reset(); +/* */ } +/* */ } +/* */ +/* 128 */ public EquasiveGraph3D getGraph() { return this.graph; } +/* */ +/* */ public void setGraph(EquasiveGraph3D grph) { +/* 131 */ Dimension dim = this.graph.getSize(); +/* 132 */ BufferedImage graphbg = this.graph.getBackgroundImage(); +/* 133 */ String[] equations = this.graph.getEquations(); +/* 134 */ remove(this.graph); +/* 135 */ grph.setSize(dim); +/* 136 */ this.graph = grph; +/* 137 */ this.graph.setBackground(graphbg); +/* 138 */ this.graph.setEquations(equations); +/* 139 */ add(this.graph, "Center"); +/* 140 */ this.graph.addMouseListener(this); +/* 141 */ this.graph.addMoveListener(this); +/* 142 */ addKeyListener(this.graph); +/* 143 */ for (Component x : getComponents()) { +/* 144 */ if ((x instanceof JComponent)) { +/* 145 */ ((JComponent)x).updateUI(); +/* */ } +/* */ } +/* 148 */ reset(); +/* */ } +/* */ public void reset() { +/* 151 */ repaint(); +/* 152 */ Thread x = new Thread(new Runnable() +/* */ { +/* */ public void run() +/* */ { +/* */ } +/* */ }); +/* 159 */ Thread y = new Thread(new Runnable() { +/* */ public void run() { +/* 161 */ M3DGraphWindow.this.graph.reset(); +/* */ } +/* */ }); +/* 164 */ x.start(); +/* 165 */ y.start(); +/* 166 */ repaint(); +/* */ } +/* */ public void flag(double x, double y, String key) { +/* */ } +/* */ public void flag0(int i) { } +/* */ public void flag1(Component x) { } +/* */ public void flag3() { } +/* */ public void flag4() { } +/* */ public void flag5() { } +/* */ public void flag6() { } +/* */ public void flag7() { } +/* */ public void flag8() { } +/* */ public void flag9() { } +/* 179 */ public static M3DGraphWindow getCurrent() { return current; } +/* */ public static void test() { +/* */ } +/* */ public void actionPerformed(ActionEvent e) { +/* 183 */ if ((e.getSource() == this.menus[1].get(0)) || (e.getSource() == this.comp[0])) { new ZGraphEquationChooser(this, this.graph.getEquations()).setVisible(true); +/* 184 */ } else if ((e.getSource() == this.menus[1].get(2)) || (e.getSource() == this.comp[2])) { reset(); +/* 185 */ } else if ((e.getSource() == this.menus[1].get(1)) || (e.getSource() == this.comp[1])) { RangeOptionFrame.showDialog(); +/* 186 */ } else if (e.getSource() == this.menus[0].get(3)) { +/* 187 */ ModulusFileChooser mfc = new ModulusFileChooser(this.hmapapprove, "", new MFileFilter[] { new MFileFilter(new String[] { ".jpg", ".gif", ".bmp", ".png" }, "All accepted images") }); +/* 188 */ mfc.promptOpen(); +/* */ } +/* 190 */ else if (e.getSource() == this.menus[2].get(1)) { +/* 191 */ ModulusFileChooser mfc = new ModulusFileChooser(this.bgimgapprove, "", new MFileFilter[] { new MFileFilter(new String[] { ".jpg", ".gif", ".bmp", ".png" }, "All accepted images") }); +/* 192 */ mfc.promptOpen(); +/* */ } +/* 194 */ else if ((e.getSource() == ((Menu)this.menus[1].get(3)).get(0)) || (e.getSource() == ((Menu)this.comp[3]).get(0))) { +/* 195 */ this.threads.add(new RotatingThread(getGraph(), "x")); +/* 196 */ ((Thread)this.threads.get(this.threads.size() - 1)).start(); +/* */ } +/* 198 */ else if ((e.getSource() == ((Menu)this.menus[1].get(3)).get(1)) || (e.getSource() == ((Menu)this.comp[3]).get(1))) { +/* 199 */ this.threads.add(new RotatingThread(getGraph(), "y")); +/* 200 */ ((Thread)this.threads.get(this.threads.size() - 1)).start(); +/* */ } +/* 202 */ else if ((e.getSource() == ((Menu)this.menus[1].get(3)).get(2)) || (e.getSource() == ((Menu)this.comp[3]).get(2))) { +/* 203 */ this.threads.add(new RotatingThread(getGraph(), "z")); +/* 204 */ ((Thread)this.threads.get(this.threads.size() - 1)).start(); +/* */ } +/* 206 */ else if ((e.getSource() == ((Menu)this.menus[1].get(3)).get(5)) || (e.getSource() == ((Menu)this.comp[3]).get(5))) +/* */ { +/* 208 */ for (int i = 0; i < this.threads.size(); i++) { +/* 209 */ ((Thread)this.threads.get(i)).interrupt(); +/* */ } +/* 211 */ this.threads.clear(); +/* */ } +/* 213 */ else if (e.getSource() == this.menus[2].get(0)) { +/* 214 */ getGraph().setDrawAxies(((JRadioButton)this.menus[2].get(0)).isSelected()); +/* */ } +/* 216 */ else if (e.getSource() == this.menus[0].get(0)) { +/* 217 */ createImageFrame(); +/* */ } +/* 219 */ else if (e.getSource() == this.menus[0].get(1)) { +/* 220 */ this.realTime = ((JRadioButton)this.menus[0].get(1)).isSelected(); +/* 221 */ createImageFrame(); +/* */ } +/* 223 */ getGraph().repaint(); +/* */ } +/* */ public void mouseClicked(MouseEvent e) { +/* */ } +/* */ public void mousePressed(MouseEvent e) { +/* 228 */ if (e.getButton() == 3) +/* 229 */ this.popup.show(this, e.getX(), e.getY()); +/* */ } +/* */ public void mouseReleased(MouseEvent e) { +/* */ } +/* */ public void mouseEntered(MouseEvent e) { +/* */ } +/* */ public void mouseExited(MouseEvent e) { } +/* */ +/* 236 */ public void createImageFrame() { this.imageholder.setImage(this.graph.getImage()); +/* 237 */ if (!this.imageholder.isVisible()) +/* 238 */ this.imageholder.setVisible(true); } +/* */ +/* */ public void objectMoved(AWTEvent e) +/* */ { +/* 242 */ if (this.realTime) createImageFrame(); +/* */ } +/* */ +/* 245 */ public static Thread getThread() { return new M3DGraphWindow.GuiThread(null); } +/* */ +/* */ private static class GuiThread extends Thread { +/* */ public void run() { +/* 249 */ new M3DGraphWindow().setVisible(true); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: M3DGraphWindow + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/MButtonGroup.java b/src/MButtonGroup.java new file mode 100644 index 0000000..c8c07f0 --- /dev/null +++ b/src/MButtonGroup.java @@ -0,0 +1,15 @@ +/* */ import javax.swing.ButtonGroup; +/* */ import javax.swing.JRadioButton; +/* */ +/* */ public class MButtonGroup extends ButtonGroup +/* */ { +/* */ public MButtonGroup(JRadioButton[] arr) +/* */ { +/* 14 */ for (JRadioButton b : arr) add(b); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: MButtonGroup + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..490f0d4 --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,6 @@ +Manifest-Version: 1.0
+Rsrc-Class-Path: ./ JTurtle.jar equations.jar ops.jar
+Class-Path: .
+Rsrc-Main-Class: CalculatorGUI
+Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader
+
diff --git a/src/Main.java b/src/Main.java new file mode 100644 index 0000000..b2a8cf0 --- /dev/null +++ b/src/Main.java @@ -0,0 +1,28 @@ +/* */ import java.io.PrintStream; +/* */ +/* */ public class Main +/* */ { +/* */ public static void main(String[] args) +/* */ { +/* 12 */ String[] arrayOfString = args; int j = args.length; for (int i = 0; i < j; i++) { String i = arrayOfString[i]; +/* */ try { +/* 14 */ ScriptReader.runScript(i); +/* */ } +/* */ catch (Exception e) { +/* 17 */ e.printStackTrace(); +/* 18 */ System.err.println("in file: " + i); +/* */ } +/* */ try { +/* 21 */ new PressAnyKey("Press enter to continue..."); +/* */ } +/* */ catch (Exception localException1) +/* */ { +/* */ } +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Main + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Menu.java b/src/Menu.java new file mode 100644 index 0000000..b741aaf --- /dev/null +++ b/src/Menu.java @@ -0,0 +1,32 @@ +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.AbstractButton; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JMenu; +/* */ +/* */ public class Menu extends JMenu +/* */ implements ActionListener +/* */ { +/* */ private JComponent[] comps; +/* */ +/* */ public Menu(String name, JComponent[] args) +/* */ { +/* 14 */ super(name); +/* 15 */ this.comps = args; +/* 16 */ for (int i = 0; i < args.length; i++) { +/* 17 */ add(args[i]); +/* 18 */ if ((args[i] instanceof AbstractButton)) +/* 19 */ ((AbstractButton)args[i]).addActionListener(this); +/* */ } +/* */ } +/* */ +/* 23 */ public JComponent get(int x) { return this.comps[x]; } +/* */ public void actionPerformed(ActionEvent e) { +/* 25 */ for (int i = 0; i < getActionListeners().length; i++) getActionListeners()[i].actionPerformed(e); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Menu + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/MethodClass.java b/src/MethodClass.java new file mode 100644 index 0000000..61c5aff --- /dev/null +++ b/src/MethodClass.java @@ -0,0 +1,27 @@ +/* */ import java.lang.reflect.Method; +/* */ +/* */ public class MethodClass +/* */ { +/* */ Class cls; +/* */ +/* */ public MethodClass(Class cls) +/* */ { +/* 12 */ this.cls = cls; +/* */ } +/* */ public Method getMethod(String name) { +/* 15 */ for (Method m : this.cls.getMethods()) { +/* 16 */ if (m.getName().equals(name)) { +/* 17 */ return m; +/* */ } +/* */ } +/* 20 */ return null; +/* */ } +/* */ public Class getCls() { +/* 23 */ return this.cls; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: MethodClass + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ModulusThreads.java b/src/ModulusThreads.java new file mode 100644 index 0000000..a664249 --- /dev/null +++ b/src/ModulusThreads.java @@ -0,0 +1,33 @@ +/* */ import java.util.LinkedHashMap; +/* */ import java.util.Map; +/* */ +/* */ public class ModulusThreads +/* */ { +/* 8 */ private static Map<String, Thread> executing = new LinkedHashMap(); +/* */ +/* 10 */ public static void addThread(String key, Thread thread) { if (executing.containsKey(key)) { +/* 11 */ executing.remove(key); +/* 12 */ executing.put(key, thread); +/* */ } +/* */ +/* 15 */ executing.put(key, thread); +/* 16 */ if (!thread.isAlive()) +/* 17 */ thread.start(); } +/* */ +/* */ public static void addRunnable(String key, Runnable x) +/* */ { +/* 21 */ addThread(key, new Thread(x)); +/* */ } +/* */ public static Thread getThread(String key) { +/* 24 */ return (Thread)executing.get(key); +/* */ } +/* */ public static void removeThread(String key) { +/* 27 */ Thread temp = (Thread)executing.get(key); +/* 28 */ executing.remove(key); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ModulusThreads + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/MoveListener.java b/src/MoveListener.java new file mode 100644 index 0000000..3e7c967 --- /dev/null +++ b/src/MoveListener.java @@ -0,0 +1,11 @@ +import java.awt.AWTEvent; + +public abstract interface MoveListener +{ + public abstract void objectMoved(AWTEvent paramAWTEvent); +} + +/* Location: Modulus.jar + * Qualified Name: MoveListener + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/NonZeroSpinnerModel.java b/src/NonZeroSpinnerModel.java new file mode 100644 index 0000000..34c8bc3 --- /dev/null +++ b/src/NonZeroSpinnerModel.java @@ -0,0 +1,43 @@ +/* */ import javax.swing.SpinnerModel; +/* */ import javax.swing.event.ChangeListener; +/* */ +/* */ public class NonZeroSpinnerModel +/* */ implements SpinnerModel +/* */ { +/* 7 */ int current = 1; +/* */ +/* */ public void addChangeListener(ChangeListener arg0) +/* */ { +/* */ } +/* */ +/* */ public Object getNextValue() +/* */ { +/* 16 */ return new Integer(this.current + 1); +/* */ } +/* */ +/* */ public Object getPreviousValue() +/* */ { +/* 21 */ if (this.current == 1) return new Integer(this.current); +/* 22 */ return new Integer(this.current - 1); +/* */ } +/* */ +/* */ public Object getValue() +/* */ { +/* 27 */ return new Integer(this.current); +/* */ } +/* */ +/* */ public void removeChangeListener(ChangeListener arg0) +/* */ { +/* */ } +/* */ +/* */ public void setValue(Object arg0) +/* */ { +/* 38 */ if ((arg0 instanceof Integer)) +/* 39 */ this.current = ((Integer)arg0).intValue(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: NonZeroSpinnerModel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Object3D.java b/src/Object3D.java new file mode 100644 index 0000000..a97fe55 --- /dev/null +++ b/src/Object3D.java @@ -0,0 +1,83 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ +/* */ public class Object3D +/* */ implements CoordinateSystem, GraphicsEvent +/* */ { +/* */ private Point3D[][] points; +/* */ private PointGroup[] pointGroups; +/* */ private double xoff; +/* */ private double yoff; +/* */ private double zoff; +/* */ private double pivY; +/* */ private double pivX; +/* */ private double pivZ; +/* */ private double rotoX; +/* */ private double rotoY; +/* */ private double rotoZ; +/* */ private CoordinateSystem graph; +/* */ +/* */ public Object3D(Point3D[][] points, double xoff, double yoff, double zoff, double rotX, double rotY, double rotZ, CoordinateSystem graph) +/* */ { +/* 28 */ this.points = points; +/* 29 */ this.pointGroups = new PointGroup[points.length]; +/* 30 */ this.xoff = xoff; +/* 31 */ this.yoff = yoff; +/* 32 */ this.zoff = zoff; +/* 33 */ this.rotoX = rotX; +/* 34 */ this.rotoY = rotY; +/* 35 */ this.rotoZ = rotZ; +/* */ +/* 37 */ for (int i = 0; i < points.length; i++) { +/* 38 */ this.pointGroups[i] = new PointGroup(points[i]); +/* */ } +/* 40 */ this.graph = graph; +/* */ } +/* */ +/* */ public Object3D(Point3D[][] points, Color[] colors, double xoff, double yoff, double zoff, double rotX, double rotY, double rotZ, CoordinateSystem graph) { +/* 44 */ this(points, xoff, yoff, zoff, rotX, rotY, rotZ, graph); +/* 45 */ for (int i = 0; (i < this.pointGroups.length) && (i < colors.length); i++) +/* 46 */ this.pointGroups[i].setColor(colors[i]); +/* */ } +/* */ +/* 49 */ public double getCameraY() { return this.graph.getCameraY(); } +/* 50 */ public double getCameraZ() { return this.graph.getCameraZ(); } +/* 51 */ public double getCameraX() { return this.graph.getCameraX(); } +/* */ public double getXRotation() { +/* 53 */ return this.rotoX; } +/* 54 */ public double getYRotation() { return this.rotoY; } +/* 55 */ public double getZRotation() { return this.rotoZ; } +/* 56 */ public double getXMove() { return this.graph.getXMove(); } +/* 57 */ public double getYMove() { return this.graph.getYMove(); } +/* 58 */ public double getScale() { return this.graph.getScale(); } +/* 59 */ public double getXPivot() { return this.xoff; } +/* 60 */ public double getYPivot() { return this.yoff; } +/* 61 */ public double getZPivot() { return this.zoff; } +/* 62 */ public int getWidth() { return this.graph.getWidth(); } +/* 63 */ public int getHeight() { return this.graph.getHeight(); } +/* 64 */ public void setXRotation(double x) { this.rotoX = (x % 360.0D); } +/* 65 */ public void setYRotation(double y) { this.rotoY = (y % 360.0D); } +/* 66 */ public void setZRotation(double z) { this.rotoZ = (z % 360.0D); } +/* 67 */ public void setXPivot(double x) { this.pivX = x; } +/* 68 */ public void setYPivot(double y) { this.pivY = y; } +/* 69 */ public void setZPivot(double z) { this.pivZ = z; } +/* */ +/* */ +/* */ public void invoke(Graphics g) +/* */ { +/* 74 */ for (PointGroup pg : this.pointGroups) { +/* 75 */ PointGroup temp = pg.translateAll(this.xoff, this.yoff, this.zoff, this.rotoZ, this.rotoX, this.rotoY, 0.0D, 0.0D, 0.0D); +/* */ +/* 77 */ temp.invoke(g, this.graph); +/* */ } +/* */ } +/* */ +/* */ public void setModel(PointModel pm) { +/* 82 */ for (Point3D[] p3darr : this.points) for (Point3D p3d : p3darr) p3d.setModel(pm); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Object3D + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Point2D.java b/src/Point2D.java new file mode 100644 index 0000000..cde1caf --- /dev/null +++ b/src/Point2D.java @@ -0,0 +1,63 @@ +/* */ import java.awt.Graphics; +/* */ import java.awt.Point; +/* */ +/* */ public class Point2D +/* */ { +/* */ private double x; +/* */ private double y; +/* */ private PointInvoker invoker; +/* 16 */ public static final PointInvoker DONOTHING_POINT_INVOKER = new PointInvoker() { +/* 16 */ public void drawPoint(Graphics g, int x, int y) { } } ; +/* */ +/* */ public Point2D(double x, double y) +/* */ { +/* 24 */ this.x = x; +/* 25 */ this.y = y; +/* 26 */ this.invoker = DONOTHING_POINT_INVOKER; +/* */ } +/* */ +/* */ public Point2D(Point x) +/* */ { +/* 32 */ this(x.x, x.y); +/* */ } +/* */ +/* */ public double getRealX() +/* */ { +/* 38 */ return this.x; +/* */ } +/* */ +/* */ public int getX() +/* */ { +/* 44 */ return (int)this.x; +/* */ } +/* */ +/* */ public double getRealY() +/* */ { +/* 50 */ return this.y; +/* */ } +/* */ +/* */ public int getY() +/* */ { +/* 56 */ return (int)this.y; +/* */ } +/* */ +/* */ public void setInvoker(PointInvoker invoker) +/* */ { +/* 62 */ this.invoker = invoker; +/* */ } +/* */ +/* */ public PointInvoker getInvoker() +/* */ { +/* 68 */ return this.invoker; +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 75 */ return "(" + this.x + "," + this.y + ")"; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Point2D + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Point2DMaker.java b/src/Point2DMaker.java new file mode 100644 index 0000000..9c3c843 --- /dev/null +++ b/src/Point2DMaker.java @@ -0,0 +1,34 @@ +/* */ import java.io.Serializable; +/* */ +/* */ public abstract class Point2DMaker +/* */ implements Serializable +/* */ { +/* */ private static final long serialVersionUID = 2479846522556400217L; +/* */ private char iVaraible; +/* */ private char dVaraible; +/* */ private DynamicGraphBuilder graphBuilder; +/* */ +/* */ public Point2DMaker(char independentVariable, char dependentVariable, DynamicGraphBuilder graphBuilder) +/* */ { +/* 20 */ this.iVaraible = independentVariable; +/* 21 */ this.dVaraible = dependentVariable; +/* 22 */ this.graphBuilder = graphBuilder; +/* */ } +/* */ public char getIndependentVariable() { +/* 25 */ return this.iVaraible; +/* */ } +/* */ public char getDependentVariable() { +/* 28 */ return this.dVaraible; +/* */ } +/* */ public abstract GraphIterator getIteratorInstance(Graph2D paramGraph2D); +/* */ +/* */ public abstract Point2D createPoint(double paramDouble1, double paramDouble2); +/* */ +/* 34 */ public DynamicGraphBuilder getGraphBuilder() { return this.graphBuilder; } +/* */ +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Point2DMaker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Point3D.java b/src/Point3D.java new file mode 100644 index 0000000..843a394 --- /dev/null +++ b/src/Point3D.java @@ -0,0 +1,116 @@ +/* */ import java.awt.Graphics; +/* */ +/* */ public class Point3D +/* */ { +/* */ private double xPos; +/* */ private double yPos; +/* */ private double zPos; +/* */ private double xPivot; +/* */ private double yPivot; +/* */ private double zPivot; +/* */ private PointModel model; +/* */ +/* */ public Point3D(double x, double y, double z, double pivotx, double pivoty, double pivotz, PointModel model) +/* */ { +/* 21 */ this.xPos = x; +/* 22 */ this.yPos = y; +/* 23 */ this.zPos = z; +/* 24 */ this.xPivot = pivotx; +/* 25 */ this.yPivot = pivoty; +/* 26 */ this.zPivot = pivotz; +/* 27 */ this.model = model; +/* */ } +/* */ public Point3D(double x, double y, double z, double pivotx, double pivoty, double pivotz) { +/* 30 */ this(x, y, z, pivotx, pivoty, pivotz, PointModel.TRUE_Euclidean); +/* */ } +/* */ public Point3D(double x, double y, double z, PointModel model) { +/* 33 */ this(x, y, z, 0.0D, 0.0D, 0.0D, model); +/* */ } +/* */ public Point3D(double x, double y, double z) { +/* 36 */ this(x, y, z, 0.0D, 0.0D, 0.0D, PointModel.TRUE_Euclidean); +/* */ } +/* */ public double getX() { +/* 39 */ return this.xPos; +/* */ } +/* */ public double getY() { +/* 42 */ return this.yPos; +/* */ } +/* */ public double getZ() { +/* 45 */ return this.zPos; +/* */ } +/* */ public void setX(double x) { +/* 48 */ this.xPos = x; +/* */ } +/* */ public void setY(double y) { +/* 51 */ this.yPos = y; +/* */ } +/* */ public void setZ(double z) { +/* 54 */ this.zPos = z; +/* */ } +/* */ public void setPointModel(PointModel model) { +/* 57 */ this.model = model; +/* */ } +/* */ public double getTrueZ(CoordinateSystem graph) { +/* 60 */ return getRealCoords(graph)[2]; +/* */ } +/* */ +/* */ public double[] getRealCoords(double xPivot, double yPivot, double zPivot, double zRotation, double xRotation, double yRotation, double scale, double xMove, double yMove, double camX, double camY, double camZ) { +/* 64 */ return this.model.getRealCoords(this.xPos, this.yPos, this.zPos, xPivot, yPivot, zPivot, zRotation, xRotation, yRotation, scale, xMove, yMove, camX, camY, camZ); +/* */ } +/* */ public double[] getRealCoords(double xPivot, double yPivot, double zPivot, double zRotation, double xRotation, double yRotation) { +/* 67 */ return getRealCoords(xPivot, yPivot, zPivot, zRotation, xRotation, yRotation, 1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D); +/* */ } +/* */ public double[] getRealCoords(double zRotation, double xRotation, double yRotation) { +/* 70 */ return getRealCoords(this.xPivot, this.yPivot, this.zPivot, zRotation, xRotation, yRotation, 1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D); +/* */ } +/* */ public String toString() { +/* 73 */ return "[" + this.xPos + ", " + this.yPos + ", " + this.zPos + "]"; +/* */ } +/* */ public double[] getRealCoords(CoordinateSystem graph) { +/* 76 */ double[] realPoints = getRealCoords(graph.getXPivot(), graph.getYPivot(), graph.getZPivot(), graph.getZRotation(), graph.getXRotation(), graph.getYRotation(), graph.getScale(), graph.getXMove(), graph.getYMove(), graph.getCameraX(), graph.getCameraY(), graph.getCameraZ()); +/* 77 */ realPoints[0] += graph.getWidth() / 2; +/* 78 */ realPoints[1] += graph.getHeight() / 2; +/* 79 */ return realPoints; +/* */ } +/* */ public void drawOn(Graphics g, CoordinateSystem graph) { +/* 82 */ double[] realPoints = getRealCoords(graph.getXPivot(), graph.getYPivot(), graph.getZPivot(), graph.getZRotation(), graph.getXRotation(), graph.getYRotation(), graph.getScale(), graph.getXMove(), graph.getYMove(), graph.getCameraX(), graph.getCameraY(), graph.getCameraZ()); +/* */ +/* 85 */ g.drawRect((int)(realPoints[0] + graph.getWidth() / 2), (int)(realPoints[1] + graph.getHeight() / 2), (int)(2.0D / graph.getCameraZ() / graph.getScale()), (int)(2.0D / graph.getCameraZ() / graph.getScale())); +/* */ } +/* */ public Point3D transpose(double x, double y, double z, double zRotation, double xRotation, double yRotation, double pivotx, double pivoty, double pivotz) { +/* 88 */ double newx = this.xPos; +/* 89 */ double newy = this.yPos; +/* 90 */ double newz = this.zPos; +/* */ +/* 92 */ double xd = newx - pivotx; +/* 93 */ double yd = newy - pivoty; +/* 94 */ double zd = newz - pivotz; +/* */ +/* 96 */ double zx = xd * Math.cos(Math.toRadians(zRotation)) - yd * Math.sin(Math.toRadians(zRotation)) - xd; +/* 97 */ double zy = xd * Math.sin(Math.toRadians(zRotation)) + yd * Math.cos(Math.toRadians(zRotation)) - yd; +/* */ +/* 99 */ double yx = (xd + zx) * Math.cos(Math.toRadians(yRotation)) - zd * Math.sin(Math.toRadians(yRotation)) - (xd + zx); +/* 100 */ double yz = (xd + zx) * Math.sin(Math.toRadians(yRotation)) + zd * Math.cos(Math.toRadians(yRotation)) - zd; +/* */ +/* 102 */ double xy = (yd + zy) * Math.cos(Math.toRadians(xRotation)) - (yz + zd) * Math.sin(Math.toRadians(xRotation)) - (yd + zy); +/* 103 */ double xz = (yd + zy) * Math.sin(Math.toRadians(xRotation)) + (yz + zd) * Math.cos(Math.toRadians(xRotation)) - (zd + yz); +/* */ +/* 105 */ double xrotooff = yx + zx; +/* 106 */ double yrotooff = zy + xy; +/* 107 */ double zrotooff = xz + yz; +/* */ +/* 111 */ return new Point3D(newx + xrotooff + x, newy + yrotooff + y, newz + zrotooff + z, 0.0D, 0.0D, 0.0D); +/* */ } +/* */ public void setModel(PointModel model) { +/* 114 */ this.model = model; +/* */ } +/* */ +/* */ public void invoke(Graphics g) +/* */ { +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Point3D + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/PointGroup.java b/src/PointGroup.java new file mode 100644 index 0000000..e2261d0 --- /dev/null +++ b/src/PointGroup.java @@ -0,0 +1,152 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ import java.awt.Polygon; +/* */ +/* */ public class PointGroup +/* */ { +/* */ private Point3D[] points; +/* */ private Color color; +/* */ private double averageZ; +/* */ private double averageY; +/* */ private double averageX; +/* */ private WirePlotter plotter; +/* 19 */ public static final WirePlotter DEFAULT = new WirePlotter() { +/* */ public void plotWire(Graphics g, CoordinateSystem graph, Point3D[] points) { +/* 21 */ int[] xPoints = new int[points.length]; +/* 22 */ int[] yPoints = new int[points.length]; +/* 23 */ for (int i = 0; i < points.length; i++) { +/* 24 */ double[] xyPoints = points[i].getRealCoords(graph); +/* 25 */ xPoints[i] = ((int)xyPoints[0]); +/* 26 */ yPoints[i] = ((int)xyPoints[1]); +/* */ } +/* */ +/* 32 */ g.drawPolyline(xPoints, yPoints, points.length); +/* */ } +/* 19 */ }; +/* */ +/* 36 */ public static final WirePlotter PLOT_X_LINES = new WirePlotter() { +/* */ public void plotWire(Graphics g, CoordinateSystem graph, Point3D[] points) { +/* 38 */ if (points.length < 4) { +/* 39 */ PointGroup.DEFAULT.plotWire(g, graph, points); +/* 40 */ return; +/* */ } +/* 42 */ double[] xyPoints1 = points[0].getRealCoords(graph); +/* 43 */ double[] xyPoints2 = points[1].getRealCoords(graph); +/* 44 */ g.drawLine((int)xyPoints1[0], (int)xyPoints1[1], (int)xyPoints2[0], (int)xyPoints2[1]); +/* */ +/* 46 */ xyPoints1 = points[2].getRealCoords(graph); +/* 47 */ xyPoints2 = points[3].getRealCoords(graph); +/* 48 */ g.drawLine((int)xyPoints1[0], (int)xyPoints1[1], (int)xyPoints2[0], (int)xyPoints2[1]); +/* */ } +/* 36 */ }; +/* */ +/* 51 */ public static final WirePlotter PLOT_Y_LINES = new WirePlotter() { +/* */ public void plotWire(Graphics g, CoordinateSystem graph, Point3D[] points) { +/* 53 */ if (points.length < 4) { +/* 54 */ PointGroup.DEFAULT.plotWire(g, graph, points); +/* 55 */ return; +/* */ } +/* 57 */ double[] xyPoints1 = points[1].getRealCoords(graph); +/* 58 */ double[] xyPoints2 = points[2].getRealCoords(graph); +/* 59 */ g.drawLine((int)xyPoints1[0], (int)xyPoints1[1], (int)xyPoints2[0], (int)xyPoints2[1]); +/* */ +/* 61 */ xyPoints1 = points[0].getRealCoords(graph); +/* 62 */ xyPoints2 = points[3].getRealCoords(graph); +/* 63 */ g.drawLine((int)xyPoints1[0], (int)xyPoints1[1], (int)xyPoints2[0], (int)xyPoints2[1]); +/* */ } +/* 51 */ }; +/* */ +/* */ public PointGroup(Point3D[] points) +/* */ { +/* 67 */ this.points = points; +/* 68 */ double clumpX = 0.0D; +/* 69 */ double clumpY = 0.0D; +/* 70 */ double clumpZ = 0.0D; +/* 71 */ for (int i = 0; i < points.length; i++) +/* */ { +/* 73 */ clumpZ += points[i].getZ(); +/* 74 */ clumpX += points[i].getX(); +/* 75 */ clumpY += points[i].getY(); +/* */ } +/* 77 */ this.averageZ = (clumpZ / points.length); +/* 78 */ this.averageX = (clumpX / points.length); +/* 79 */ this.averageY = (clumpY / points.length); +/* 80 */ this.plotter = DEFAULT; +/* */ } +/* */ public PointGroup(Point3D[] points, WirePlotter plotter) { +/* 83 */ this(points); +/* 84 */ this.plotter = plotter; +/* */ } +/* */ public void setColor(Color color) { +/* 87 */ this.color = color; +/* */ } +/* */ public PointGroup translateAll(double x, double y, double z, double zRotation, double xRotation, double yRotation, double pivotx, double pivoty, double pivotz) { +/* 90 */ Point3D[] newPoints = new Point3D[this.points.length]; +/* 91 */ double clumpX = 0.0D; +/* 92 */ double clumpY = 0.0D; +/* 93 */ double clumpZ = 0.0D; +/* 94 */ for (int i = 0; i < this.points.length; i++) { +/* 95 */ newPoints[i] = this.points[i].transpose(x, y, z, zRotation, xRotation, yRotation, pivotx, pivoty, pivotz); +/* 96 */ clumpZ += newPoints[i].getZ(); +/* 97 */ clumpX += newPoints[i].getX(); +/* 98 */ clumpY += newPoints[i].getY(); +/* */ } +/* */ +/* 101 */ this.averageZ = (clumpZ / this.points.length); +/* 102 */ this.averageX = (clumpX / this.points.length); +/* 103 */ this.averageY = (clumpY / this.points.length); +/* */ +/* 105 */ PointGroup newp = new PointGroup(newPoints); +/* 106 */ newp.setColor(this.color); +/* 107 */ return newp; +/* */ } +/* */ public double getAverageTrueZ(CoordinateSystem syst) { +/* 110 */ double clump = 0.0D; +/* 111 */ for (Point3D pnt : this.points) { +/* 112 */ clump += pnt.getTrueZ(syst); +/* */ } +/* 114 */ return clump / this.points.length; +/* */ } +/* */ public double getAverageZ() { +/* 117 */ return this.averageZ; +/* */ } +/* */ public double getAverageX() { +/* 120 */ return this.averageX; +/* */ } +/* */ public double getAverageY() { +/* 123 */ return this.averageY; +/* */ } +/* */ public void invoke(Graphics g, CoordinateSystem graph) { +/* 126 */ if (this.color != null) { +/* 127 */ g.setColor(this.color); +/* */ } +/* 129 */ this.plotter.plotWire(g, graph, this.points); +/* */ } +/* */ +/* */ public void invoke(Graphics g, CoordinateSystem graph, boolean fill) { +/* 133 */ if (!fill) { invoke(g, graph); +/* */ } else { +/* 135 */ if (this.color != null) { +/* 136 */ g.setColor(this.color); +/* */ } +/* 138 */ int[] xPoints = new int[this.points.length]; +/* 139 */ int[] yPoints = new int[this.points.length]; +/* 140 */ for (int i = 0; i < this.points.length; i++) { +/* 141 */ double[] xyPoints = this.points[i].getRealCoords(graph); +/* */ +/* 143 */ xPoints[i] = ((int)xyPoints[0]); +/* 144 */ yPoints[i] = ((int)xyPoints[1]); +/* */ } +/* */ +/* 147 */ g.fillPolygon(new Polygon(xPoints, yPoints, this.points.length)); +/* */ } +/* */ } +/* */ +/* 151 */ public String toString() { return this.averageX + ", " + this.averageY + ", " + this.averageZ; } +/* */ +/* */ } + +/* Location: Modulus.jar + * Qualified Name: PointGroup + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/PointHashMap.java b/src/PointHashMap.java new file mode 100644 index 0000000..0a75e5b --- /dev/null +++ b/src/PointHashMap.java @@ -0,0 +1,89 @@ +/* */ import java.io.PrintStream; +/* */ import java.util.ArrayList; +/* */ +/* */ public class PointHashMap +/* */ { +/* */ private ArrayList<ArrayList<ArrayList<PointGroup>>> pointsXYZ; +/* */ +/* */ public PointHashMap() +/* */ { +/* 13 */ this.pointsXYZ = new ArrayList(); +/* */ } +/* */ public void add(PointGroup point) { +/* 16 */ if (this.pointsXYZ.size() == 0) { +/* 17 */ ArrayList p = new ArrayList(); +/* 18 */ p.add(point); +/* 19 */ ArrayList np = new ArrayList(); +/* 20 */ np.add(p); +/* 21 */ this.pointsXYZ.add(np); +/* 22 */ return; +/* */ } +/* 24 */ double lastx = ((PointGroup)((ArrayList)((ArrayList)this.pointsXYZ.get(0)).get(0)).get(0)).getAverageX(); +/* 25 */ double lasty = ((PointGroup)((ArrayList)((ArrayList)this.pointsXYZ.get(0)).get(0)).get(0)).getAverageY(); +/* 26 */ double lastz = ((PointGroup)((ArrayList)((ArrayList)this.pointsXYZ.get(0)).get(0)).get(0)).getAverageZ(); +/* 27 */ for (int i = 0; i < this.pointsXYZ.size(); i++) { +/* 28 */ double xPos = ((PointGroup)((ArrayList)((ArrayList)this.pointsXYZ.get(i)).get(0)).get(0)).getAverageX(); +/* 29 */ if (xPos == point.getAverageX()) +/* */ { +/* 31 */ for (int j = 0; j < ((ArrayList)this.pointsXYZ.get(i)).size(); j++) { +/* 32 */ double yPos = ((PointGroup)((ArrayList)((ArrayList)this.pointsXYZ.get(i)).get(j)).get(0)).getAverageY(); +/* 33 */ if (yPos == point.getAverageY()) +/* */ { +/* 35 */ for (int k = 0; k < ((ArrayList)((ArrayList)this.pointsXYZ.get(i)).get(j)).size(); k++) { +/* 36 */ double zPos = ((PointGroup)((ArrayList)((ArrayList)this.pointsXYZ.get(i)).get(j)).get(k)).getAverageY(); +/* 37 */ if (zPos == point.getAverageZ()) { +/* 38 */ ((ArrayList)((ArrayList)this.pointsXYZ.get(i)).get(j)).add(k, point); +/* 39 */ return; +/* */ } +/* 41 */ if (zPos < point.getAverageZ()) { +/* 42 */ ((ArrayList)((ArrayList)this.pointsXYZ.get(i)).get(j)).add(k, point); +/* 43 */ return; +/* */ } +/* 45 */ lastz = zPos; +/* */ } +/* */ +/* */ } +/* 49 */ else if (yPos < point.getAverageY()) { +/* 50 */ ArrayList p = new ArrayList(); +/* 51 */ p.add(point); +/* 52 */ ((ArrayList)this.pointsXYZ.get(i)).add(j, p); +/* 53 */ return; +/* */ } +/* 55 */ lasty = yPos; +/* */ } +/* */ +/* */ } +/* 59 */ else if (xPos < point.getAverageX()) { +/* 60 */ ArrayList p = new ArrayList(); +/* 61 */ p.add(point); +/* 62 */ ArrayList np = new ArrayList(); +/* 63 */ np.add(p); +/* 64 */ this.pointsXYZ.add(i, np); +/* 65 */ return; +/* */ } +/* 67 */ lastx = xPos; +/* */ } +/* 69 */ ArrayList p = new ArrayList(); +/* 70 */ p.add(point); +/* 71 */ ArrayList np = new ArrayList(); +/* 72 */ np.add(p); +/* 73 */ this.pointsXYZ.add(np); +/* */ } +/* */ +/* */ public void printAll() { +/* 77 */ for (int i = 0; i < this.pointsXYZ.size(); i++) +/* 78 */ for (int j = 0; j < ((ArrayList)this.pointsXYZ.get(i)).size(); j++) +/* 79 */ for (int k = 0; k < ((ArrayList)((ArrayList)this.pointsXYZ.get(i)).get(j)).size(); k++) +/* 80 */ System.out.println(((ArrayList)((ArrayList)this.pointsXYZ.get(i)).get(j)).get(k)); +/* */ } +/* */ +/* */ public ArrayList<ArrayList<ArrayList<PointGroup>>> getList() +/* */ { +/* 86 */ return this.pointsXYZ; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: PointHashMap + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/PointInvoker.java b/src/PointInvoker.java new file mode 100644 index 0000000..2b60d67 --- /dev/null +++ b/src/PointInvoker.java @@ -0,0 +1,11 @@ +import java.awt.Graphics; + +public abstract interface PointInvoker +{ + public abstract void drawPoint(Graphics paramGraphics, int paramInt1, int paramInt2); +} + +/* Location: Modulus.jar + * Qualified Name: PointInvoker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/PointMaker.java b/src/PointMaker.java new file mode 100644 index 0000000..61c8691 --- /dev/null +++ b/src/PointMaker.java @@ -0,0 +1,28 @@ +/* */ public abstract interface PointMaker +/* */ { +/* 11 */ public static final PointMaker ORIGINAL = new PointMaker() { +/* */ public Point3D makePoint(double x, double y, double z, PointModel mod) { +/* 13 */ return new Point3D(x, y, z, mod); +/* */ } +/* 11 */ }; +/* */ +/* 17 */ public static final PointMaker POLAR = new PointMaker() { +/* */ public Point3D makePoint(double x, double y, double z, PointModel mod) { +/* 19 */ return new Point3D(y * Math.cos(Math.toRadians(x)), y * Math.sin(Math.toRadians(x)), z, mod); +/* */ } +/* 17 */ }; +/* */ +/* 22 */ public static final PointMaker POLAR3D = new PointMaker() +/* */ { +/* */ public Point3D makePoint(double x, double y, double z, PointModel mod) { +/* 25 */ return new Point3D(z * Math.cos(Math.toRadians(x)) * Math.cos(Math.toRadians(y)), z * Math.sin(Math.toRadians(x)), z * Math.cos(Math.toRadians(x)) * Math.cos(Math.toRadians(90.0D - y)), mod); +/* */ } +/* 22 */ }; +/* */ +/* */ public abstract Point3D makePoint(double paramDouble1, double paramDouble2, double paramDouble3, PointModel paramPointModel); +/* */ } + +/* Location: Modulus.jar + * Qualified Name: PointMaker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/PointModel.java b/src/PointModel.java new file mode 100644 index 0000000..a645c96 --- /dev/null +++ b/src/PointModel.java @@ -0,0 +1,91 @@ +/* */ public abstract interface PointModel +/* */ { +/* 10 */ public static final PointModel TRUE_Euclidean = new PointModel() { +/* */ public double[] getRealCoords(double xPos, double yPos, double zPos, double xPivot, double yPivot, double zPivot, double zRotation, double xRotation, double yRotation, double scale, double xMove, double yMove, double camX, double camY, double camZ) { +/* 12 */ double xd = xPos - xPivot; +/* 13 */ double yd = yPos - yPivot; +/* 14 */ double zd = zPos - zPivot; +/* */ +/* 16 */ double zx = xd * Math.cos(Math.toRadians(zRotation)) - yd * Math.sin(Math.toRadians(zRotation)) - xd; +/* 17 */ double zy = xd * Math.sin(Math.toRadians(zRotation)) + yd * Math.cos(Math.toRadians(zRotation)) - yd; +/* */ +/* 19 */ double yx = (xd + zx) * Math.cos(Math.toRadians(yRotation)) - zd * Math.sin(Math.toRadians(yRotation)) - (xd + zx); +/* 20 */ double yz = (xd + zx) * Math.sin(Math.toRadians(yRotation)) + zd * Math.cos(Math.toRadians(yRotation)) - zd; +/* */ +/* 22 */ double xy = (yd + zy) * Math.cos(Math.toRadians(xRotation)) - (zd + yz) * Math.sin(Math.toRadians(xRotation)) - (yd + zy); +/* 23 */ double xz = (yd + zy) * Math.sin(Math.toRadians(xRotation)) + (zd + yz) * Math.cos(Math.toRadians(xRotation)) - (zd + yz); +/* */ +/* 25 */ double xrotoff = yx + zx; +/* 26 */ double yrotoff = zy + xy; +/* 27 */ double zrotoff = xz + yz; +/* */ +/* 31 */ double realZ = zPos + zrotoff + camZ; +/* 32 */ if (realZ <= 0.0D) realZ = 0.1D; +/* */ +/* 34 */ double realX = (xPos + xrotoff + camX) / realZ / scale + xMove; +/* 35 */ double realY = (yPos + yrotoff + camY) / realZ / scale + yMove; +/* 36 */ return new double[] { realX, realY, realZ }; +/* */ } +/* 10 */ }; +/* */ +/* 39 */ public static final PointModel FISHEYE = new PointModel() { +/* */ public double[] getRealCoords(double xPos, double yPos, double zPos, double xPivot, double yPivot, double zPivot, double zRotation, double xRotation, double yRotation, double scale, double xMove, double yMove, double camX, double camY, double camZ) { +/* 41 */ double xd = xPos - xPivot; +/* 42 */ double yd = yPos - yPivot; +/* 43 */ double zd = zPos - zPivot; +/* */ +/* 45 */ double zx = xd * Math.cos(Math.toRadians(zRotation)) - yd * Math.sin(Math.toRadians(zRotation)) - xd; +/* 46 */ double zy = xd * Math.sin(Math.toRadians(zRotation)) + yd * Math.cos(Math.toRadians(zRotation)) - yd; +/* */ +/* 48 */ double yx = (xd + zx) * Math.cos(Math.toRadians(yRotation)) - zd * Math.sin(Math.toRadians(yRotation)) - (xd + zx); +/* 49 */ double yz = (xd + zx) * Math.sin(Math.toRadians(yRotation)) + zd * Math.cos(Math.toRadians(yRotation)) - zd; +/* */ +/* 51 */ double xy = (yd + zy) * Math.cos(Math.toRadians(xRotation)) - (zd + yz) * Math.sin(Math.toRadians(xRotation)) - (yd + zy); +/* 52 */ double xz = (yd + zy) * Math.sin(Math.toRadians(xRotation)) + (zd + yz) * Math.cos(Math.toRadians(xRotation)) - (zd + yz); +/* */ +/* 54 */ double xrotoff = yx + zx; +/* 55 */ double yrotoff = zy + xy; +/* 56 */ double zrotoff = xz + yz; +/* */ +/* 60 */ double realZ = zPos + zrotoff + camZ; +/* 61 */ if (realZ <= 0.0D) realZ = 0.1D; +/* */ +/* 63 */ double realX = (xPos + xrotoff + camX * 2.0D) / realZ / scale + xMove; +/* 64 */ double realY = (yPos + yrotoff + camY * 2.0D) / realZ / scale + yMove; +/* 65 */ return new double[] { realX, realY, realZ }; +/* */ } +/* 39 */ }; +/* */ +/* 68 */ public static final PointModel ISOMETRIC_Euclidean = new PointModel() { +/* */ public double[] getRealCoords(double xPos, double yPos, double zPos, double xPivot, double yPivot, double zPivot, double zRotation, double xRotation, double yRotation, double scale, double xMove, double yMove, double camX, double camY, double camZ) { +/* 70 */ double xd = xPos - xPivot; +/* 71 */ double yd = yPos - yPivot; +/* 72 */ double zd = zPos - zPivot; +/* */ +/* 74 */ double zx = xd * Math.cos(Math.toRadians(zRotation)) - yd * Math.sin(Math.toRadians(zRotation)) - xd; +/* 75 */ double zy = xd * Math.sin(Math.toRadians(zRotation)) + yd * Math.cos(Math.toRadians(zRotation)) - yd; +/* */ +/* 77 */ double yx = (xd + zx) * Math.cos(Math.toRadians(yRotation)) - zd * Math.sin(Math.toRadians(yRotation)) - (xd + zx); +/* 78 */ double yz = (xd + zx) * Math.sin(Math.toRadians(yRotation)) + zd * Math.cos(Math.toRadians(yRotation)) - zd; +/* */ +/* 80 */ double xy = (yd + zy) * Math.cos(Math.toRadians(xRotation)) - (zd + yz) * Math.sin(Math.toRadians(xRotation)) - (yd + zy); +/* 81 */ double xz = (yd + zy) * Math.sin(Math.toRadians(xRotation)) + (zd + yz) * Math.cos(Math.toRadians(xRotation)) - (zd + yz); +/* */ +/* 83 */ double xrotoff = yx + zx; +/* 84 */ double yrotoff = zy + xy; +/* 85 */ double zrotoff = xz + yz; +/* */ +/* 87 */ double realZ = zPos + zrotoff; +/* 88 */ double realX = (xPos + xrotoff) / (camZ / 300.0D) + xMove; +/* 89 */ double realY = (yPos + yrotoff) / (camZ / 300.0D) + yMove; +/* 90 */ return new double[] { realX, realY, realZ }; +/* */ } +/* 68 */ }; +/* */ +/* */ public abstract double[] getRealCoords(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6, double paramDouble7, double paramDouble8, double paramDouble9, double paramDouble10, double paramDouble11, double paramDouble12, double paramDouble13, double paramDouble14, double paramDouble15); +/* */ } + +/* Location: Modulus.jar + * Qualified Name: PointModel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Polar2DPointMaker.java b/src/Polar2DPointMaker.java new file mode 100644 index 0000000..8991287 --- /dev/null +++ b/src/Polar2DPointMaker.java @@ -0,0 +1,18 @@ +/* */ public class Polar2DPointMaker extends Point2DMaker +/* */ { +/* */ public Polar2DPointMaker() +/* */ { +/* 11 */ super('t', 'r', DynamicGraphBuilder.DO_NOTHING_GRAPH_BUILDER); +/* */ } +/* */ public Point2D createPoint(double t, double r) { +/* 14 */ return new Point2D(r * Math.cos(Math.toRadians(t)), r * Math.sin(Math.toRadians(t))); +/* */ } +/* */ public GraphIterator getIteratorInstance(Graph2D graph) { +/* 17 */ return PolarGraphIterator.getInstance(graph); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Polar2DPointMaker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Polar3DGraph.java b/src/Polar3DGraph.java new file mode 100644 index 0000000..7aa1c2e --- /dev/null +++ b/src/Polar3DGraph.java @@ -0,0 +1,111 @@ +/* */ import GUIComponents.ProgressFrame; +/* */ import java.awt.Color; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ +/* */ public class Polar3DGraph extends EquasiveGraph3D +/* */ { +/* */ private double t1Min; +/* */ private double t1Max; +/* */ private double t2Min; +/* */ private double t2Max; +/* */ private double t1Step; +/* */ private double t2Step; +/* */ +/* */ public Polar3DGraph(double t1Min, double t1Max, double t2Min, double t2Max, double xMin, double xMax, double yMin, double yMax, double zMin, double zMax, double t1Step, double t2Step) +/* */ { +/* 14 */ super(xMax, xMin, yMin, yMax, zMin, zMax, 0.0D, 0.0D); +/* 15 */ this.t1Min = t1Min; +/* 16 */ this.t2Min = t2Min; +/* 17 */ this.t1Max = t1Max; +/* 18 */ this.t2Max = t2Max; +/* 19 */ this.t1Step = t1Step; +/* 20 */ this.t2Step = t2Step; +/* */ } +/* */ +/* */ public void setT1Min(double t1) { +/* 24 */ this.t1Min = t1; +/* */ } +/* 26 */ public void setT2Min(double t2) { this.t2Min = t2; } +/* */ public void setT1Max(double t1) { +/* 28 */ this.t1Max = t1; +/* */ } +/* 30 */ public void setT2Max(double t2) { this.t2Max = t2; } +/* */ +/* */ +/* */ public void reset() +/* */ { +/* 35 */ this.points = new ArrayList(); +/* 36 */ boolean go = true; +/* 37 */ double equlen = getCount(getEquations()); +/* 38 */ int red = 255; +/* 39 */ int green = 0; +/* 40 */ int blue = 0; +/* 41 */ if (this.progress == null) { +/* 42 */ this.progress = new ProgressFrame(0, 100, M3DGraphWindow.getCurrent()); +/* */ } +/* 44 */ this.progress.setVisible(true); +/* 45 */ this.progress.setValue(0.0D); +/* 46 */ this.progress.setTitle("Progress Frame"); +/* 47 */ for (String equation : getEquations()) { +/* 48 */ if (!equation.equals("")) +/* 49 */ for (double t1 = this.t1Min; t1 <= this.t1Max; t1 += this.t1Step) { +/* 50 */ for (double t2 = this.t2Min; t2 <= this.t2Max; t2 += this.t2Step) { +/* 51 */ Point3D[] pnts = { +/* 52 */ getModel().makePoint(t1, t2, equation(equation, t1, t2) / getZPix(), getModel()), +/* 53 */ getModel().makePoint(t1 + this.t1Step, t2, equation(equation, t1 + this.t1Step, t2) / getZPix(), getModel()), +/* 54 */ getModel().makePoint(t1 + this.t1Step, t2 + this.t2Step, equation(equation, t1 + this.t1Step, t2 + this.t2Step) / getZPix(), getModel()), +/* 55 */ getModel().makePoint(t1, t2 + this.t2Step, equation(equation, t1, t2 + this.t2Step) / getZPix(), getModel()) }; +/* */ +/* 57 */ for (Point3D pnt : pnts) { +/* 58 */ if ((Double.isNaN(pnt.getZ())) || (Double.isInfinite(pnt.getZ()))) go = false; +/* */ } +/* 60 */ if (go) { +/* 61 */ PointGroup temp = new PointGroup(pnts, getModel()); +/* 62 */ temp.setColor(new Color(red, green, blue)); +/* 63 */ this.points.add(temp); +/* */ } else { +/* 65 */ go = true; +/* 66 */ }double yChange = (this.t1Max - this.t1Min) / this.t1Step; +/* 67 */ double xChange = (this.t2Max - this.t2Min) / this.t2Step; +/* 68 */ this.progress.incrementProgress(100.0D / (yChange * xChange * equlen)); +/* 69 */ repaint(); +/* */ } +/* */ +/* 72 */ if ((red == 255) && (blue == 0) && (green < 255)) { +/* 73 */ green += 10; +/* 74 */ if (green >= 255) green = 255; +/* */ } +/* 76 */ else if ((green == 255) && (red > 0) && (blue == 0)) { +/* 77 */ red -= 10; +/* 78 */ if (red <= 0) red = 0; +/* */ } +/* 80 */ else if ((green == 255) && (red == 0) && (blue < 255)) { +/* 81 */ blue += 10; +/* 82 */ if (blue >= 255) blue = 255; +/* */ } +/* 84 */ else if ((blue == 255) && (red == 0) && (green > 0)) { +/* 85 */ green -= 10; +/* 86 */ if (green <= 0) green = 0; +/* */ } +/* 88 */ else if ((blue == 255) && (green == 0) && (red < 255)) { +/* 89 */ red += 10; +/* 90 */ if (red >= 255) red = 255; +/* */ } +/* */ else +/* */ { +/* 93 */ blue -= 10; +/* 94 */ if (blue <= 0) blue = 0; +/* */ } +/* */ } +/* */ } +/* 98 */ this.progress.flagEnd(); +/* 99 */ clean(); +/* 100 */ this.progress.setVisible(false); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Polar3DGraph + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/PolarGraphIterator.java b/src/PolarGraphIterator.java new file mode 100644 index 0000000..eaaf2cf --- /dev/null +++ b/src/PolarGraphIterator.java @@ -0,0 +1,26 @@ +/* */ public class PolarGraphIterator extends GraphIterator +/* */ { +/* */ private double tEnd; +/* */ private double tStep; +/* */ +/* */ private PolarGraphIterator(double tStart, double tEnd, double tStep) +/* */ { +/* 13 */ super(tStart); +/* 14 */ this.tEnd = tEnd; +/* 15 */ this.tStep = tStep; +/* */ } +/* */ public static PolarGraphIterator getInstance(Graph2D graph) { +/* 18 */ return new PolarGraphIterator(graph.getTStart(), graph.getTEnd(), graph.getTStep()); +/* */ } +/* */ public boolean hasMoreTokens() { +/* 21 */ return getIndex() <= this.tEnd; +/* */ } +/* */ public void onTurn() { +/* 24 */ this.index += this.tStep; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: PolarGraphIterator + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/PressAnyKey.java b/src/PressAnyKey.java new file mode 100644 index 0000000..1a72bfe --- /dev/null +++ b/src/PressAnyKey.java @@ -0,0 +1,19 @@ +/* */ import java.io.BufferedReader; +/* */ import java.io.InputStreamReader; +/* */ import java.io.PrintStream; +/* */ +/* */ public class PressAnyKey +/* */ { +/* */ public PressAnyKey(String disp) +/* */ throws Exception +/* */ { +/* 13 */ System.out.println(disp); +/* 14 */ BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); +/* 15 */ int ch = stdin.read(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: PressAnyKey + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Prompt.java b/src/Prompt.java new file mode 100644 index 0000000..6f7ec59 --- /dev/null +++ b/src/Prompt.java @@ -0,0 +1,72 @@ +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Toolkit; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.SwingUtilities; +/* */ import javax.swing.UIManager; +/* */ +/* */ public class Prompt<E extends JComponent> extends JDialog +/* */ implements ActionListener +/* */ { +/* 7 */ private JPanel mainPanel = new JPanel(new FlowLayout()); +/* */ private Object[] args; +/* */ private JButton done; +/* */ private JButton cancel; +/* */ private JPanel bottom; +/* */ +/* */ public Prompt(JFrame owner, String text, E[] args, ActionListener listener, JButton ok) +/* */ { +/* 13 */ super(owner, true); +/* 14 */ this.done = ok; +/* 15 */ this.bottom = new JPanel(new FlowLayout()); +/* 16 */ this.cancel = new JButton("Cancel"); +/* */ try { +/* 18 */ UIManager.setLookAndFeel( +/* 19 */ UIManager.getSystemLookAndFeelClassName()); +/* */ } +/* */ catch (Exception e) +/* */ { +/* 23 */ e.printStackTrace(); +/* */ } +/* */ +/* 26 */ SwingUtilities.updateComponentTreeUI(this); +/* */ +/* 28 */ this.args = args; +/* 29 */ setTitle(text); +/* 30 */ add(new JLabel(text), "North"); +/* 31 */ for (int i = 0; i < this.args.length; i++) { +/* 32 */ this.mainPanel.add((JComponent)this.args[i]); +/* */ } +/* 34 */ ok.addActionListener(listener); +/* 35 */ ok.addActionListener(this); +/* 36 */ this.cancel.addActionListener(this); +/* 37 */ this.bottom.add(this.done); +/* 38 */ this.bottom.add(this.cancel); +/* 39 */ add(this.mainPanel, "Center"); +/* 40 */ add(this.bottom, "South"); +/* 41 */ setIconImage(Toolkit.getDefaultToolkit().getImage("modulus_symbol.png")); +/* 42 */ pack(); +/* */ } +/* 44 */ public E get(int i) { return (JComponent)this.args[i]; } +/* */ public String[] getFields() { +/* 46 */ String[] ret = new String[this.args.length]; +/* 47 */ for (int i = 0; i < this.args.length; i++) ret[i] = this.args[i].toString(); +/* 48 */ return ret; +/* */ } +/* */ public void actionPerformed(ActionEvent e) { +/* 51 */ setVisible(false); +/* */ } +/* 53 */ public JButton getButton() { return this.done; } +/* */ +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Prompt + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/RangeOptionFrame.java b/src/RangeOptionFrame.java new file mode 100644 index 0000000..03106e9 --- /dev/null +++ b/src/RangeOptionFrame.java @@ -0,0 +1,272 @@ +/* */ import GUIComponents.GridPanel; +/* */ import GUIComponents.OptionPanel; +/* */ import java.awt.BorderLayout; +/* */ import java.awt.Dimension; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JComboBox; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JRadioButton; +/* */ import javax.swing.JSpinner; +/* */ import javax.swing.JTextField; +/* */ +/* */ public class RangeOptionFrame extends JDialog +/* */ implements ActionListener +/* */ { +/* 15 */ public static final PointMaker[] makers = { +/* 16 */ PointMaker.ORIGINAL, +/* 17 */ PointMaker.POLAR, +/* 18 */ PointMaker.POLAR3D }; +/* */ +/* 20 */ public static final PointModel[] models = { +/* 22 */ PointModel.TRUE_Euclidean, +/* 23 */ PointModel.ISOMETRIC_Euclidean, +/* 24 */ PointModel.FISHEYE }; +/* */ +/* 26 */ public static final WirePlotter[] plotters = { +/* 27 */ PointGroup.DEFAULT, +/* 28 */ PointGroup.PLOT_X_LINES, +/* 29 */ PointGroup.PLOT_Y_LINES }; +/* */ +/* 31 */ private static RangeOptionFrame current = null; +/* 32 */ private static int zequalsNumbers = 5; +/* */ private EquasiveGraph3D graph; +/* */ private M3DGraphWindow window; +/* */ private GridPanel xyzMinMax; +/* */ private GridPanel xySteps; +/* */ private GridPanel equations; +/* */ private GridPanel wires; +/* */ private GridPanel mode; +/* */ private JButton ok; +/* */ private JButton cancel; +/* */ private JComboBox coordinateSystem; +/* */ private MButtonGroup bg; +/* */ private JRadioButton radians; +/* */ private JRadioButton degrees; +/* */ private MButtonGroup rd; +/* */ private JComboBox model; +/* */ private MButtonGroup ip; +/* */ private JTextField xMin; +/* */ private JTextField yMin; +/* */ private JTextField zMin; +/* */ private JTextField xMax; +/* */ private JTextField yMax; +/* */ private JTextField zMax; +/* */ private JLabel xMinT; +/* */ private JLabel yMinT; +/* */ private JLabel zMinT; +/* */ private JLabel xMaxT; +/* */ private JLabel yMaxT; +/* */ private JLabel zMaxT; +/* */ private JSpinner xStep; +/* */ private JSpinner yStep; +/* */ private JTextField[] zEquals; +/* */ private JRadioButton solid; +/* */ private JRadioButton gradient; +/* */ private JRadioButton multiColor; +/* */ private MButtonGroup colorTypes; +/* */ private JComboBox plotType; +/* */ private OptionPanel options; +/* */ +/* */ private RangeOptionFrame(M3DGraphWindow parent) +/* */ { +/* 83 */ super(parent, true); +/* 84 */ this.window = parent; +/* 85 */ this.graph = parent.getGraph(); +/* 86 */ setTitle("Options"); +/* 87 */ setLayout(new BorderLayout()); +/* 88 */ this.xyzMinMax = new GridPanel(2, 3, 0, 0); +/* 89 */ this.xySteps = new GridPanel(1, 2, 0, 0); +/* 90 */ this.equations = new GridPanel(1, zequalsNumbers, 0, 0); +/* 91 */ this.wires = new GridPanel(3, 1, 0, 0); +/* 92 */ this.mode = new GridPanel(3, 2, 0, 0); +/* */ +/* 94 */ this.coordinateSystem = new JComboBox(new String[] { "Euclidean", "Polar", "Spheric" }); +/* 95 */ this.coordinateSystem.addActionListener(this); +/* 96 */ this.radians = new JRadioButton("Radians"); +/* 97 */ this.degrees = new JRadioButton("Degrees"); +/* */ +/* 99 */ this.model = new JComboBox(new String[] { "Perspective", "Isometric", "Fisheye" }); +/* 100 */ this.plotType = new JComboBox(new String[] { "Wire Mesh", "X-Wires Only", "Y-Wires Only" }); +/* 101 */ this.rd = new MButtonGroup(new JRadioButton[] { this.radians, this.degrees }); +/* */ +/* 103 */ this.xMin = new JTextField(this.graph.getXMin(), 5); +/* 104 */ this.yMin = new JTextField(this.graph.getYMin(), 5); +/* 105 */ this.zMin = new JTextField(this.graph.getZMin(), 5); +/* 106 */ this.xMax = new JTextField(this.graph.getXMax(), 5); +/* 107 */ this.yMax = new JTextField(this.graph.getYMax(), 5); +/* 108 */ this.zMax = new JTextField(this.graph.getZMax(), 5); +/* */ +/* 110 */ this.xStep = new JSpinner(); +/* 111 */ this.xStep.setValue(Integer.valueOf(10)); +/* 112 */ this.xStep.setSize(30, 10); +/* 113 */ this.yStep = new JSpinner(); +/* 114 */ this.yStep.setValue(Integer.valueOf(10)); +/* 115 */ this.yStep.setSize(30, 10); +/* */ +/* 117 */ this.zEquals = new JTextField[zequalsNumbers]; +/* 118 */ for (int i = 0; i < this.zEquals.length; i++) { +/* 119 */ this.zEquals[i] = new JTextField(5); +/* */ } +/* */ +/* 122 */ this.solid = new JRadioButton("Solid Color"); +/* 123 */ this.gradient = new JRadioButton("Gradient"); +/* 124 */ this.multiColor = new JRadioButton("Multi Color"); +/* 125 */ this.colorTypes = new MButtonGroup(new JRadioButton[] { this.solid, this.gradient, this.multiColor }); +/* */ +/* 127 */ this.xyzMinMax.add(this.xMinT = new JLabel("x Min: "), 0, 0); +/* 128 */ this.xyzMinMax.add(this.yMinT = new JLabel("y Min: "), 0, 2); +/* 129 */ this.xyzMinMax.add(this.zMinT = new JLabel("z Min: "), 1, 1); +/* 130 */ this.xyzMinMax.add(this.xMaxT = new JLabel("x Max: "), 0, 1); +/* 131 */ this.xyzMinMax.add(this.yMaxT = new JLabel("y Max: "), 1, 0); +/* 132 */ this.xyzMinMax.add(this.zMaxT = new JLabel("z Max: "), 1, 2); +/* 133 */ this.xyzMinMax.add(this.xMin, 0, 0); +/* 134 */ this.xyzMinMax.add(this.yMin, 0, 2); +/* 135 */ this.xyzMinMax.add(this.zMin, 1, 1); +/* 136 */ this.xyzMinMax.add(this.xMax, 0, 1); +/* 137 */ this.xyzMinMax.add(this.yMax, 1, 0); +/* 138 */ this.xyzMinMax.add(this.zMax, 1, 2); +/* */ +/* 140 */ this.xySteps.add(new JLabel("X Interval: "), 0, 0); +/* 141 */ this.xySteps.add(this.xStep, 0, 0); +/* 142 */ this.xySteps.add(new JLabel("Y Interval: "), 0, 0); +/* 143 */ this.xySteps.add(this.yStep, 0, 0); +/* */ +/* 145 */ for (int i = 0; i < this.zEquals.length; i++) { +/* 146 */ this.equations.add(new JLabel("z" + i), 0, i); +/* 147 */ this.equations.add(this.zEquals[i], 0, i); +/* */ } +/* */ +/* 150 */ this.wires.add(this.plotType, 0, 0); +/* 151 */ this.wires.add(this.gradient, 1, 0); +/* 152 */ this.wires.add(this.multiColor, 2, 0); +/* */ +/* 154 */ this.mode.add(this.model, 0, 0); +/* */ +/* 156 */ this.mode.add(this.degrees, 1, 0); +/* */ +/* 158 */ this.mode.add(this.coordinateSystem, 0, 1); +/* 159 */ this.mode.add(this.radians, 2, 1); +/* 160 */ JPanel[] args = { +/* 161 */ this.xyzMinMax, +/* 162 */ this.xySteps, +/* 164 */ 0, this.wires, +/* 165 */ this.mode, +/* 166 */ new JPanel() }; +/* */ +/* 170 */ this.options = new OptionPanel(new String[] { "Range", "Intervals", 0, "Wires", "Mode" }, args); +/* 171 */ this.ok = new JButton("Set"); +/* 172 */ this.cancel = new JButton("Cancel"); +/* 173 */ JPanel buttonHolder = new JPanel(new FlowLayout()); +/* 174 */ add(this.options, "Center"); +/* */ +/* 176 */ buttonHolder.add(this.ok); +/* 177 */ buttonHolder.add(this.cancel); +/* 178 */ this.ok.addActionListener(this); +/* 179 */ this.cancel.addActionListener(this); +/* 180 */ add(buttonHolder, "South"); +/* 181 */ setSize(new Dimension(805, 269)); +/* 182 */ setResizable(false); +/* */ } +/* */ +/* */ public void attribute() +/* */ { +/* */ try { +/* 188 */ if (((this.coordinateSystem.getSelectedIndex() == 1) || (this.coordinateSystem.getSelectedIndex() == 2)) && (this.window.getGraph().getClass() != Polar3DGraph.class)) { +/* 189 */ this.window.setGraph(new Polar3DGraph(0.0D, 180.0D, 0.0D, 180.0D, -15.0D, 15.0D, -15.0D, 15.0D, -15.0D, 15.0D, 5.0D, 5.0D)); +/* */ } +/* 191 */ else if ((this.coordinateSystem.getSelectedIndex() != 1) && (this.coordinateSystem.getSelectedIndex() != 2) && +/* 192 */ (this.window.getGraph().getClass() != EquasiveGraph3D.class)) { +/* 193 */ this.window.setGraph(new EquasiveGraph3D(15.0D, -15.0D, -15.0D, 15.0D, -15.0D, 15.0D, 10.0D, 10.0D)); +/* */ } +/* */ +/* 196 */ this.graph = this.window.getGraph(); +/* 197 */ this.window.getGraph().getModel().setMaker(makers[this.coordinateSystem.getSelectedIndex()]); +/* 198 */ this.window.getGraph().getModel().setModel(models[this.model.getSelectedIndex()]); +/* 199 */ this.window.getGraph().getModel().setPlotter(plotters[this.plotType.getSelectedIndex()]); +/* 200 */ if (this.window.getGraph().getClass() == Polar3DGraph.class) { +/* 201 */ Polar3DGraph grph = (Polar3DGraph)this.graph; +/* 202 */ grph.setT1Min(Double.parseDouble(ControlPanel.figure(this.xMin.getText()))); +/* 203 */ grph.setT2Min(Double.parseDouble(ControlPanel.figure(this.yMin.getText()))); +/* */ +/* 205 */ grph.setT1Max(Double.parseDouble(ControlPanel.figure(this.xMax.getText()))); +/* 206 */ grph.setT2Max(Double.parseDouble(ControlPanel.figure(this.yMax.getText()))); +/* */ } else { +/* 208 */ this.graph.setXMin(Double.parseDouble(ControlPanel.figure(this.xMin.getText()))); +/* 209 */ this.graph.setYMin(Double.parseDouble(ControlPanel.figure(this.yMin.getText()))); +/* */ +/* 211 */ this.graph.setXMax(Double.parseDouble(ControlPanel.figure(this.xMax.getText()))); +/* 212 */ this.graph.setYMax(Double.parseDouble(ControlPanel.figure(this.yMax.getText()))); +/* */ } +/* 214 */ this.graph.setZMin(Double.parseDouble(ControlPanel.figure(this.zMin.getText()))); +/* 215 */ this.graph.setZMax(Double.parseDouble(ControlPanel.figure(this.zMax.getText()))); +/* 216 */ this.graph.setXStep(((Integer)this.xStep.getValue()).intValue()); +/* 217 */ this.graph.setYStep(((Integer)this.yStep.getValue()).intValue()); +/* */ +/* 219 */ Calculator.setRadians(!this.radians.isSelected()); +/* 220 */ this.window.reset(); +/* */ } +/* */ catch (Exception e) { +/* 223 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* 227 */ public void setToEuclidean() { this.xMinT.setText("x Min"); +/* 228 */ this.xMaxT.setText("x Max"); +/* 229 */ this.yMinT.setText("y Min"); +/* 230 */ this.yMaxT.setText("y Max"); +/* 231 */ this.zMinT.setText("z Min"); +/* 232 */ this.zMaxT.setText("z Max"); } +/* */ +/* */ public void setToPolar() { +/* 235 */ this.xMinT.setText("Ï´ Min"); +/* 236 */ this.xMaxT.setText("Ï´ Max"); +/* 237 */ this.yMinT.setText("r Min"); +/* 238 */ this.yMaxT.setText("r Max"); +/* 239 */ this.zMinT.setText("z Min"); +/* 240 */ this.zMaxT.setText("z Max"); +/* */ } +/* */ public void setTo3DPolar() { +/* 243 */ this.xMinT.setText("Ï´1 Min"); +/* 244 */ this.xMaxT.setText("Ï´1 Max"); +/* 245 */ this.yMinT.setText("Ï´2 Min"); +/* 246 */ this.yMaxT.setText("Ï´2 Max"); +/* 247 */ this.zMinT.setText(" r Min"); +/* 248 */ this.zMaxT.setText(" r Max"); +/* */ } +/* */ public void actionPerformed(ActionEvent e) { +/* 251 */ if (e.getSource() == this.coordinateSystem) { +/* 252 */ if (this.coordinateSystem.getSelectedIndex() == 0) { +/* 253 */ setToEuclidean(); +/* */ } +/* 255 */ else if (this.coordinateSystem.getSelectedIndex() == 1) { +/* 256 */ setToPolar(); +/* */ } +/* 258 */ else if (this.coordinateSystem.getSelectedIndex() == 2) { +/* 259 */ setTo3DPolar(); +/* */ } +/* */ } +/* */ +/* 263 */ if ((e.getSource() == this.ok) || (e.getSource() == this.cancel)) { +/* 264 */ if (e.getSource() == this.ok) attribute(); +/* 265 */ setVisible(false); +/* */ } +/* */ } +/* */ +/* */ public static void reset(M3DGraphWindow parent) +/* */ { +/* 271 */ current = new RangeOptionFrame(parent); +/* */ } +/* */ public static void showDialog() { +/* 274 */ current.setVisible(true); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: RangeOptionFrame + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/RectangleDrawer.java b/src/RectangleDrawer.java new file mode 100644 index 0000000..7ada78f --- /dev/null +++ b/src/RectangleDrawer.java @@ -0,0 +1,71 @@ +/* */ import java.awt.Point; +/* */ import java.awt.Rectangle; +/* */ import java.awt.event.MouseEvent; +/* */ import java.awt.event.MouseListener; +/* */ import java.awt.event.MouseMotionListener; +/* */ import java.util.ArrayList; +/* */ +/* */ public class RectangleDrawer +/* */ implements MouseMotionListener, MouseListener +/* */ { +/* */ private Graph2D graph; +/* */ private Point lastClick; +/* */ private Rectangle lastRect; +/* */ private boolean toggle; +/* */ private ArrayList<GraphBoxListener> listener; +/* */ +/* */ public RectangleDrawer(Graph2D graph) +/* */ { +/* 17 */ this.graph = graph; +/* 18 */ this.lastClick = new Point(0, 0); +/* 19 */ this.listener = new ArrayList(); +/* */ } +/* */ +/* */ public void mouseDragged(MouseEvent arg0) +/* */ { +/* 24 */ this.graph.setRectangleShow(new Point(arg0.getPoint().x, arg0.getPoint().y), new Point(this.lastClick.x, this.lastClick.y)); +/* 25 */ this.graph.repaint(); +/* 26 */ this.lastRect = new Rectangle(this.lastClick.x, this.lastClick.y, arg0.getPoint().x - this.lastClick.x, arg0.getPoint().y - this.lastClick.y); +/* */ } +/* */ +/* */ public void mouseMoved(MouseEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void mouseClicked(MouseEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void mouseEntered(MouseEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void mouseExited(MouseEvent arg0) +/* */ { +/* */ } +/* */ +/* */ public void mousePressed(MouseEvent arg0) +/* */ { +/* 57 */ this.lastClick = arg0.getPoint(); +/* 58 */ this.toggle = true; +/* */ } +/* */ +/* */ public void mouseReleased(MouseEvent arg0) +/* */ { +/* 63 */ this.toggle = false; +/* 64 */ this.graph.setRectangleShow(null, null); +/* 65 */ this.graph.setRectangleMode(false); +/* 66 */ this.graph.repaint(); +/* 67 */ for (int i = 0; i < this.listener.size(); i++) +/* 68 */ ((GraphBoxListener)this.listener.get(i)).graphBoxMade(arg0.getPoint().x, arg0.getPoint().y, this.lastClick.x, this.lastClick.y); +/* */ } +/* */ +/* */ public void addGraphBoxListener(GraphBoxListener l) { +/* 72 */ this.listener.add(l); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: RectangleDrawer + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/RegressionDialog.java b/src/RegressionDialog.java new file mode 100644 index 0000000..a7217e1 --- /dev/null +++ b/src/RegressionDialog.java @@ -0,0 +1,96 @@ +/* */ import GUIComponents.PushablePanel; +/* */ import GUIComponents.ToggleButtonGroup; +/* */ import GUIComponents.WrapperPanel; +/* */ import java.awt.Color; +/* */ import java.awt.Dimension; +/* */ import java.awt.Frame; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.util.ArrayList; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JToggleButton; +/* */ +/* */ public abstract class RegressionDialog extends JDialog +/* */ implements ActionListener +/* */ { +/* */ private StatPlotDialog dialog; +/* */ private PushablePanel panel; +/* 23 */ private ToggleButtonGroup buttonGroup = new ToggleButtonGroup(); +/* 24 */ private ArrayList<ActionListener> listeners = new ArrayList(); +/* */ private JButton ok; +/* */ private JButton cancel; +/* */ +/* */ public RegressionDialog(Frame owner, String title, StatPlotDialog dialog) +/* */ { +/* 27 */ super(owner, title, true); +/* 28 */ JPanel main = new JPanel(); +/* 29 */ main.setLayout(new BoxLayout(main, 1)); +/* 30 */ this.dialog = dialog; +/* 31 */ this.panel = new PushablePanel(); +/* 32 */ for (int i = 0; i < dialog.getPlots().size(); i++) { +/* 33 */ JToggleButton button = new JToggleButton("Statplot #" + (i + 1)); +/* 34 */ button.setBackground(Color.white); +/* 35 */ this.buttonGroup.addToggleButton(button); +/* 36 */ this.panel.pushComponent(button); +/* */ } +/* 38 */ this.panel.setPreferredSize(new Dimension(150, 250)); +/* 39 */ this.ok = new JButton("Calculate"); +/* 40 */ this.cancel = new JButton("Cancel"); +/* 41 */ this.ok.addActionListener(this); +/* 42 */ this.cancel.addActionListener(this); +/* 43 */ main.add(this.panel); +/* 44 */ main.add(new WrapperPanel(new JComponent[] { this.ok, this.cancel })); +/* 45 */ add(main); +/* 46 */ pack(); +/* */ } +/* */ public void addActionListener(ActionListener listen) { +/* 49 */ this.listeners.add(listen); +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) { +/* 53 */ if (e.getSource() == this.ok) { +/* 54 */ e.setSource(this); +/* 55 */ for (int i = 0; i < this.listeners.size(); i++) { +/* 56 */ ((ActionListener)this.listeners.get(i)).actionPerformed(e); +/* */ } +/* 58 */ calculateRegression(); +/* */ } +/* 60 */ setVisible(false); +/* */ } +/* */ public ToggleButtonGroup getToggleButtonGroup() { +/* 63 */ return this.buttonGroup; +/* */ } +/* */ public void setVisible(boolean b) { +/* 66 */ if (b) { +/* 67 */ this.panel.removeAllComponents(); +/* 68 */ this.buttonGroup = new ToggleButtonGroup(); +/* 69 */ for (int i = 0; i < this.dialog.getPlots().size(); i++) { +/* 70 */ JToggleButton button = new JToggleButton("Statplot #" + (i + 1)); +/* 71 */ button.setBackground(Color.white); +/* 72 */ this.buttonGroup.addToggleButton(button); +/* 73 */ this.panel.pushComponent(button); +/* */ } +/* 75 */ super.setVisible(b); +/* */ } +/* */ else { +/* 78 */ super.setVisible(b); +/* */ } +/* */ } +/* */ +/* 82 */ public StatPlotDialog getStatPlotDialog() { return this.dialog; } +/* */ +/* */ public StatPlot getSelectedStatPlot() { +/* 85 */ return (StatPlot)this.dialog.getPlots().get(this.buttonGroup.getSelectedIndex()); +/* */ } +/* */ +/* */ public abstract double[] calculateRegression(); +/* */ } + +/* Location: Modulus.jar + * Qualified Name: RegressionDialog + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ReverseElucidean2DPointMaker.java b/src/ReverseElucidean2DPointMaker.java new file mode 100644 index 0000000..96a5529 --- /dev/null +++ b/src/ReverseElucidean2DPointMaker.java @@ -0,0 +1,18 @@ +/* */ public class ReverseElucidean2DPointMaker extends Point2DMaker +/* */ { +/* */ public ReverseElucidean2DPointMaker() +/* */ { +/* 13 */ super('y', 'x', new XEqualsDynamicGraphBuilder()); +/* */ } +/* */ public Point2D createPoint(double x, double y) { +/* 16 */ return new Point2D(y, x); +/* */ } +/* */ public GraphIterator getIteratorInstance(Graph2D graph) { +/* 19 */ return XEqualsGraphIterator.getInstance(graph); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ReverseElucidean2DPointMaker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ReverseEuclidean2DPointMaker.java b/src/ReverseEuclidean2DPointMaker.java new file mode 100644 index 0000000..fce48a0 --- /dev/null +++ b/src/ReverseEuclidean2DPointMaker.java @@ -0,0 +1,18 @@ +/* */ public class ReverseEuclidean2DPointMaker extends Point2DMaker +/* */ { +/* */ public ReverseEuclidean2DPointMaker() +/* */ { +/* 13 */ super('y', 'x', new XEqualsDynamicGraphBuilder()); +/* */ } +/* */ public Point2D createPoint(double x, double y) { +/* 16 */ return new Point2D(y, x); +/* */ } +/* */ public GraphIterator getIteratorInstance(Graph2D graph) { +/* 19 */ return XEqualsGraphIterator.getInstance(graph); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ReverseEuclidean2DPointMaker + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/RotatingThread.java b/src/RotatingThread.java new file mode 100644 index 0000000..afe4a6e --- /dev/null +++ b/src/RotatingThread.java @@ -0,0 +1,46 @@ +/* */ public class RotatingThread extends Thread +/* */ { +/* */ private boolean stop; +/* */ private Graph3D graph; +/* */ private String axies; +/* */ +/* */ public RotatingThread(Graph3D graph, String axies) +/* */ { +/* 14 */ this.graph = graph; +/* 15 */ this.axies = axies; +/* 16 */ this.stop = false; +/* */ } +/* */ public void interrupt() { +/* 19 */ super.interrupt(); +/* 20 */ this.stop = true; +/* */ } +/* */ public void run() { +/* 23 */ boolean x = this.axies.contains("x"); +/* 24 */ boolean y = this.axies.contains("y"); +/* 25 */ boolean z = this.axies.contains("z"); +/* 26 */ while (!this.stop) +/* */ { +/* 28 */ if (x) { +/* 29 */ this.graph.setXRotation(this.graph.getXRotation() + 1.0D); +/* */ } +/* 31 */ if (y) { +/* 32 */ this.graph.setYRotation(this.graph.getYRotation() + 1.0D); +/* */ } +/* 34 */ if (z) { +/* 35 */ this.graph.setZRotation(this.graph.getZRotation() + 1.0D); +/* */ } +/* 37 */ this.graph.repaint(); +/* */ try { +/* 39 */ Thread.sleep(33L); +/* */ } +/* */ catch (Exception localException) +/* */ { +/* */ } +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: RotatingThread + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/RunnablePrompt.java b/src/RunnablePrompt.java new file mode 100644 index 0000000..6052353 --- /dev/null +++ b/src/RunnablePrompt.java @@ -0,0 +1,34 @@ +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JTextField; +/* */ +/* */ public class RunnablePrompt +/* */ implements Runnable, ActionListener +/* */ { +/* */ Prompt<JTextField> tempPrompt; +/* */ String[] args; +/* */ +/* */ public RunnablePrompt(String[] args) +/* */ { +/* 16 */ this.args = args; +/* */ } +/* */ public void run() { +/* */ try { +/* 20 */ this.tempPrompt = new Prompt(null, ControlPanel.parseOut(this.args[0]), new JTextField[] { new JTextField("", 5) }, this, new JButton("OK")); +/* 21 */ this.tempPrompt.setVisible(true); +/* */ } +/* */ catch (Exception e) { +/* 24 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* 28 */ public void actionPerformed(ActionEvent e) { SwingPrompter.hold = ((JTextField)this.tempPrompt.get(0)).getText(); +/* 29 */ SwingPrompter.toggle = true; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: RunnablePrompt + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ScriptReader.java b/src/ScriptReader.java new file mode 100644 index 0000000..dd37bd6 --- /dev/null +++ b/src/ScriptReader.java @@ -0,0 +1,308 @@ +/* */ import java.io.BufferedReader; +/* */ import java.io.DataInputStream; +/* */ import java.io.File; +/* */ import java.io.FileInputStream; +/* */ import java.io.InputStreamReader; +/* */ import java.io.PrintStream; +/* */ import java.lang.reflect.Method; +/* */ import java.util.ArrayList; +/* */ +/* */ public class ScriptReader +/* */ { +/* */ private static int idx; +/* 15 */ private static int tst = 0; +/* 16 */ private static boolean lastBoolean = false; +/* 17 */ private static String currentFile = ""; +/* */ public static final String MARC_DIR = "I:/Computer Stuff/Marc Virtual Machine/"; +/* */ +/* */ static +/* */ { +/* */ try +/* */ { +/* 21 */ System.loadLibrary("javamarc"); +/* */ } +/* */ catch (UnsatisfiedLinkError e) { +/* 24 */ e.printStackTrace(); +/* 25 */ System.out.println("Marc Virtual Machine Could Not Be Loaded"); } } +/* */ public static native void setIndex(int paramInt); +/* */ +/* */ public static native void interpretFrom(int paramInt1, int[] paramArrayOfInt, int paramInt2); +/* */ +/* */ public static native int getFromStack(int paramInt); +/* */ +/* */ public static native int stackLength(); +/* */ +/* */ public static native void printData(); +/* */ +/* */ public static native void run(String paramString); +/* */ +/* */ public static native void interpret(String paramString); +/* */ +/* */ public static native void push(int paramInt); +/* */ +/* */ public static native void clrstk(); +/* */ +/* 38 */ public static int tempRun(String file) { run(file); +/* 39 */ return getFromStack(0); } +/* */ +/* */ public static void go(String file) { +/* */ } +/* */ +/* */ public static ArrayList<String> loadUp(String name) throws Exception { +/* 45 */ FileInputStream fstream = new FileInputStream(new File(name)); +/* 46 */ DataInputStream in = new DataInputStream(fstream); +/* 47 */ BufferedReader br = new BufferedReader(new InputStreamReader(in)); +/* 48 */ ArrayList args = new ArrayList(); +/* */ String str; +/* 50 */ while ((str = br.readLine()) != null) +/* */ { +/* */ String str; +/* 51 */ if ((!str.trim().equals("")) && (!str.trim().startsWith(";"))) +/* 52 */ args.add(str.trim()); +/* 53 */ if (str.trim().startsWith("function")) +/* */ { +/* */ String x; +/* 55 */ ControlPanel.addToFunctionList((x = str.trim().substring(8).trim()).substring(0, x.indexOf("(")).trim(), name, null); +/* */ } +/* */ } +/* 58 */ currentFile = name; +/* 59 */ return args; +/* */ } +/* */ +/* */ public static String runScript(String name) throws Exception { +/* 63 */ return run(loadUp(name)); +/* */ } +/* */ private static String run(ArrayList<String> args) throws Exception { +/* 66 */ for (idx = 0; idx < args.size(); idx += 1) { +/* 67 */ if (Thread.currentThread().isInterrupted()) +/* */ { +/* 69 */ return ""; +/* */ } +/* 71 */ if (((String)args.get(idx)).equals("HLT")) return ""; +/* 72 */ if ((!((String)args.get(idx)).equals("then")) && (!((String)args.get(idx)).equals("end"))) { +/* 73 */ if (((String)args.get(idx)).equals("continue")) return null; +/* 74 */ if (((String)args.get(idx)).startsWith("return")) { +/* 75 */ if ((((String)args.get(idx)).endsWith("return")) && (((String)args.get(idx)).length() == 6)) return ""; +/* 76 */ return ControlPanel.parseOut(((String)args.get(idx)).substring(7)); +/* */ } +/* 78 */ if (((String)args.get(idx)).startsWith("if")) { +/* 79 */ if (ControlPanel.figure(((String)args.get(idx)).substring(2)).equals("0")) { +/* 80 */ if (!((String)args.get(idx + 1)).equals("then")) idx += 1; else +/* 81 */ idx = indexOfCorrect(args, idx + 1); +/* 82 */ lastBoolean = false; +/* */ } +/* 84 */ else if (((String)args.get(idx + 1)).equals("then")) { +/* 85 */ lastBoolean = true; +/* 86 */ idx += 1; +/* */ } else { +/* 88 */ lastBoolean = true; +/* */ } +/* 90 */ } else if (((String)args.get(idx)).startsWith("elseif")) { +/* 91 */ if ((lastBoolean) || (ControlPanel.figure(((String)args.get(idx)).substring(6)).equals("0"))) { +/* 92 */ if (!((String)args.get(idx + 1)).equals("then")) idx += 1; else +/* 93 */ idx = indexOfCorrect(args, idx + 1); +/* 94 */ lastBoolean = false; +/* */ } +/* 96 */ else if (((String)args.get(idx + 1)).equals("then")) { +/* 97 */ lastBoolean = true; +/* 98 */ idx += 1; +/* */ } else { +/* 100 */ lastBoolean = true; +/* */ } +/* 102 */ } else if (((String)args.get(idx)).startsWith("else")) { +/* 103 */ if (lastBoolean) { +/* 104 */ if (!((String)args.get(idx + 1)).equals("then")) idx += 1; else +/* 105 */ idx = indexOfCorrect(args, idx + 1); +/* */ } +/* 107 */ else if (((String)args.get(idx + 1)).equals("then")) { +/* 108 */ lastBoolean = true; +/* 109 */ idx += 1; +/* */ } else { +/* 111 */ lastBoolean = true; +/* */ } +/* 113 */ } else if (((String)args.get(idx)).startsWith("while")) { +/* 114 */ if (ControlPanel.figure(((String)args.get(idx)).substring(5)).equals("0")) { +/* 115 */ if (!((String)args.get(idx)).equals("then")) idx += 1; else +/* 116 */ idx = indexOfCorrect(args, idx + 1); +/* */ } +/* */ else +/* */ { +/* 120 */ ArrayList chomp; +/* */ ArrayList chomp; +/* 120 */ if (!((String)args.get(idx + 1)).trim().equals("then")) chomp = subArray(args, idx + 1, idx + 2); else +/* 121 */ chomp = subArray(args, idx + 2, indexOfCorrect(args, idx + 2)); +/* 122 */ int idxC = idx; +/* 123 */ int neIdx = 0; +/* 124 */ while (!ControlPanel.figure(((String)args.get(idx)).substring(5)).equals("0")) +/* */ { +/* 126 */ String x = run(chomp); +/* 127 */ if (x != null) return x; +/* 128 */ idx = idxC; +/* */ } +/* 130 */ if (!((String)args.get(idxC + 1)).trim().equals("then")) +/* 131 */ idx = idxC + 1; +/* */ else +/* 133 */ idx = indexOfCorrect(args, idxC + 2) - 1; +/* */ } +/* */ } +/* */ else +/* 137 */ ControlPanel.parseLine((String)args.get(idx)); +/* */ } +/* */ } +/* 140 */ return null; +/* */ } +/* */ private static int indexOfLastControl(ArrayList<String> args, int from) { +/* 143 */ int i = from; +/* 144 */ while ((((String)args.get(i)).startsWith("if")) || (((String)args.get(i)).startsWith("else")) || (((String)args.get(i)).startsWith("while"))) i++; +/* 145 */ return i + 1; +/* */ } +/* */ private static int indexOfCorrect(ArrayList<String> args, int from) { +/* 148 */ int i = 0; +/* */ +/* 151 */ i = from; for (int x = 1; x > 0; i++) { +/* 152 */ if (((String)args.get(i)).startsWith("then")) x++; +/* 153 */ else if (((String)args.get(i)).startsWith("end")) x--; +/* */ } +/* 155 */ return i; +/* */ } +/* */ private static int indexOf(ArrayList<Object> args, Object arg, int from) { +/* 158 */ for (int i = from; i < args.size(); i++) { +/* 159 */ if (args.get(i).equals(arg)) return i; +/* */ } +/* 161 */ return -1; +/* */ } +/* */ private static ArrayList<String> subArray(ArrayList<String> args, int from, int to) { +/* 164 */ ArrayList ret = new ArrayList(); +/* 165 */ for (int i = from; i < to; i++) ret.add((String)args.get(i)); +/* 166 */ return ret; +/* */ } +/* */ public static String preformFunction(String function, ArrayList<String> file) throws Exception { +/* 169 */ int idxC = idx; +/* 170 */ String toSplit = function.substring(function.indexOf("(") + 1, function.lastIndexOf(")")); +/* 171 */ String[] splitted = toSplit.split(","); +/* */ +/* 174 */ int index = 0; +/* */ String str; +/* 175 */ while (!(str = (String)file.get(index++)).startsWith("function " + function.substring(0, function.indexOf("(") + 1))); +/* 176 */ String arg = str; +/* 177 */ String[] splitArg = arg.substring(arg.indexOf("(") + 1, arg.lastIndexOf(")")).split(","); +/* 178 */ if (splitArg.length != splitted.length) throw new Exception("The Parameters do not match"); +/* 179 */ int x = 1; +/* 180 */ ArrayList compileList = new ArrayList(); +/* */ +/* 182 */ while (((str = (String)file.get(index++)) != null) && (x > 0)) { +/* 183 */ if (str.startsWith("then")) x++; +/* 184 */ else if (str.startsWith("end")) x--; +/* 185 */ if ((x != 0) && +/* 186 */ (!str.trim().equals(""))) { +/* 187 */ compileList.add(str.trim()); +/* */ } +/* */ } +/* 190 */ for (int i = 0; i < splitArg.length; i++) { +/* 191 */ ControlPanel.parseLine("STP " + splitted[i] + "," + splitArg[i]); +/* */ } +/* */ +/* 194 */ String ret = run(compileList); +/* */ +/* 196 */ for (int i = 0; i < splitArg.length; i++) { +/* 197 */ ControlPanel.parseLine("POP " + splitArg[i]); +/* */ } +/* 199 */ idx = idxC; +/* 200 */ return ret; +/* */ } +/* */ +/* */ public static String preformFunction(String function, String fileName, Object[] objs) throws Exception { +/* 204 */ int idxC = idx; +/* 205 */ String temp = function.substring(0, function.indexOf("(")); +/* 206 */ if ((!contains(ControlPanel.getFunctions(), temp)) || (!contains(ControlPanel.getFiles(), fileName))) +/* 207 */ ControlPanel.addToFunctionList(temp, fileName, null); +/* 208 */ if (fileName.endsWith(".marc")) +/* */ { +/* 210 */ String toSplit = function.substring(function.indexOf("(") + 1, function.lastIndexOf(")")); +/* 211 */ String[] split = toSplit.split(","); +/* 212 */ for (int i = split.length - 1; i >= 0; i--) +/* 213 */ if (!split[i].equals("")) { +/* 214 */ String s = split[i]; +/* */ +/* 216 */ push(Integer.parseInt(ControlPanel.figure(s))); +/* */ } +/* 218 */ run(fileName); +/* 219 */ String ret = getFromStack(0); +/* 220 */ clrstk(); +/* 221 */ return ret; +/* */ } +/* 223 */ if (fileName.endsWith(".class")) { +/* 224 */ fileName = fileName.replaceAll("\\\\", "/"); +/* */ +/* 226 */ MethodClass cls = new MethodClass((Class)objs[0]); +/* 227 */ Method methodToParse = cls.getMethod(function.substring(0, function.indexOf("("))); +/* */ +/* 231 */ String[] arguments = function.substring(function.indexOf("(") + 1, function.lastIndexOf(")")).split(","); +/* 232 */ for (int i = 0; i < arguments.length; i++) { +/* 233 */ if ((arguments[i].startsWith("\"")) && (arguments[i].endsWith("\""))) +/* 234 */ arguments[i] = ControlPanel.parseOut(arguments[i].substring(1, arguments[i].length() - 1)); +/* */ else { +/* 236 */ arguments[i] = ControlPanel.figure(arguments[i]); +/* */ } +/* */ } +/* 239 */ Object ret = methodToParse.invoke(null, new Object[] { arguments }); +/* 240 */ return ret.toString(); +/* */ } +/* 242 */ String toSplit = function.substring(function.indexOf("(") + 1, function.lastIndexOf(")")); +/* 243 */ String[] splitted = toSplit.split(","); +/* */ +/* 245 */ FileInputStream fstream = new FileInputStream(new File(fileName)); +/* 246 */ DataInputStream in = new DataInputStream(fstream); +/* */ BufferedReader br; +/* */ String str; +/* 250 */ while (!(str = br.readLine()).startsWith("function " + function.substring(0, function.indexOf("(") + 1))); +/* 251 */ String arg = str; +/* 252 */ String[] splitArg = arg.substring(arg.indexOf("(") + 1, arg.lastIndexOf(")")).split(","); +/* */ +/* 255 */ if (splitArg.length != splitted.length) throw new Exception("The Parameters do not match"); +/* 256 */ int x = 1; +/* 257 */ ArrayList compileList = new ArrayList(); +/* */ +/* 259 */ while (((str = br.readLine()) != null) && (x > 0)) { +/* 260 */ if ((str.startsWith("if")) || (str.startsWith("else")) || (str.startsWith("while"))) x++; +/* 261 */ else if (str.startsWith("end")) x--; +/* 262 */ if ((x != 0) && +/* 263 */ (!str.trim().equals(""))) { +/* 264 */ compileList.add(str.trim()); +/* */ } +/* */ } +/* 267 */ for (int i = 0; i < splitArg.length; i++) { +/* 268 */ ControlPanel.parseLine("STP " + splitted[i] + "," + splitArg[i]); +/* */ } +/* */ +/* 271 */ String ret = run(compileList); +/* */ +/* 273 */ for (int i = 0; i < splitArg.length; i++) { +/* 274 */ ControlPanel.parseLine("POP " + splitArg[i]); +/* */ } +/* 276 */ idx = idxC; +/* 277 */ return ret; +/* */ } +/* */ private static boolean contains(Object[] x, Object y) { +/* 280 */ for (int i = 0; i < x.length; i++) if (x[i].equals(y)) return true; +/* 281 */ return false; +/* */ } +/* */ +/* */ public static String getFile() { +/* 285 */ return currentFile; +/* */ } +/* */ public static String remesh(String[] args) { +/* 288 */ String ret = ""; +/* 289 */ String[] arrayOfString = args; int j = args.length; for (int i = 0; i < j; i++) { String x = arrayOfString[i]; +/* 290 */ ret = ret + x; +/* 291 */ ret = ret + ","; +/* */ } +/* 293 */ ret = ret.substring(0, ret.length() - 1); +/* 294 */ return ret; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ScriptReader + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/SilentThread.java b/src/SilentThread.java new file mode 100644 index 0000000..ac28059 --- /dev/null +++ b/src/SilentThread.java @@ -0,0 +1,21 @@ +/* */ public class SilentThread extends Thread +/* */ { +/* */ private String info; +/* */ +/* */ public SilentThread(Runnable run, String info) +/* */ { +/* 14 */ super(run); +/* 15 */ this.info = info; +/* */ } +/* */ public void start() { +/* 18 */ super.start(); +/* 19 */ CalculatorGUI.silentPrint("------------------------------\n"); +/* 20 */ CalculatorGUI.silentPrint("Finished Running File: " + this.info); +/* 21 */ CalculatorGUI.silentPrint("------------------------------\n"); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: SilentThread + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StandardIO/Approvable.java b/src/StandardIO/Approvable.java new file mode 100644 index 0000000..56a31d1 --- /dev/null +++ b/src/StandardIO/Approvable.java @@ -0,0 +1,15 @@ +package StandardIO; + +import java.io.File; + +public abstract interface Approvable +{ + public abstract void onApprove(File paramFile); + + public abstract void onCancel(); +} + +/* Location: Modulus.jar + * Qualified Name: StandardIO.Approvable + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StandardIO/FileIO/FileDecomposer.java b/src/StandardIO/FileIO/FileDecomposer.java new file mode 100644 index 0000000..9b1df75 --- /dev/null +++ b/src/StandardIO/FileIO/FileDecomposer.java @@ -0,0 +1,60 @@ +/* */ package StandardIO.FileIO; +/* */ +/* */ import java.io.BufferedReader; +/* */ import java.io.DataInputStream; +/* */ import java.io.File; +/* */ import java.io.FileInputStream; +/* */ import java.io.IOException; +/* */ import java.io.InputStreamReader; +/* */ +/* */ public class FileDecomposer +/* */ { +/* */ public static String[] decompose(String file) +/* */ throws IOException +/* */ { +/* 14 */ return decompose(new File(file)); +/* */ } +/* */ public static String[] decompose(File file) throws IOException { +/* 17 */ String[] toReturn = new String[getCountOf(file)]; +/* 18 */ int count = 0; +/* */ +/* 20 */ FileInputStream fstream = new FileInputStream(file); +/* 21 */ DataInputStream in = new DataInputStream(fstream); +/* 22 */ BufferedReader br = new BufferedReader(new InputStreamReader(in)); +/* 23 */ String str = ""; +/* 24 */ while ((str = br.readLine()) != null) { +/* 25 */ toReturn[count] = str; +/* 26 */ count++; +/* */ } +/* */ +/* 29 */ fstream.close(); +/* 30 */ in.close(); +/* 31 */ br.close(); +/* */ +/* 33 */ return toReturn; +/* */ } +/* */ public static int getCountOf(File f) { +/* */ try { +/* 37 */ int count = 0; +/* 38 */ FileInputStream fstream = new FileInputStream(f); +/* 39 */ DataInputStream in = new DataInputStream(fstream); +/* 40 */ BufferedReader br = new BufferedReader(new InputStreamReader(in)); +/* */ +/* 42 */ while (br.readLine() != null) count++; +/* */ +/* 44 */ fstream.close(); +/* 45 */ in.close(); +/* 46 */ br.close(); +/* */ +/* 48 */ return count; +/* */ } +/* */ catch (Exception e) { +/* 51 */ e.printStackTrace(); +/* 52 */ }return 0; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.FileIO.FileDecomposer + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StandardIO/FileOutputArray.java b/src/StandardIO/FileOutputArray.java new file mode 100644 index 0000000..923b075 --- /dev/null +++ b/src/StandardIO/FileOutputArray.java @@ -0,0 +1,49 @@ +/* */ package StandardIO; +/* */ +/* */ import java.io.File; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.io.PrintWriter; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ +/* */ public class FileOutputArray +/* */ { +/* */ private List<String> output; +/* */ +/* */ public FileOutputArray() +/* */ { +/* 15 */ this.output = new ArrayList(); +/* */ } +/* */ public void flushToFile(String file) { +/* */ try { +/* 19 */ PrintWriter stream = new SaveFileWriter(file); +/* 20 */ for (int i = 0; i < this.output.size(); i++) { +/* 21 */ stream.print((String)this.output.get(i)); +/* */ } +/* 23 */ stream.flush(); +/* 24 */ stream.close(); +/* */ } +/* */ catch (IOException e) { +/* 27 */ e.printStackTrace(); +/* 28 */ System.err.println("File could not be written."); +/* */ } +/* */ } +/* */ +/* 32 */ public void flushToFile(File f) { flushToFile(f.toString()); } +/* */ +/* */ public void reset() { +/* 35 */ this.output = new ArrayList(); +/* */ } +/* */ public void setOutput(List<String> arr) { +/* 38 */ this.output = arr; +/* */ } +/* */ public void append(String what) { +/* 41 */ this.output.add(what); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.FileOutputArray + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StandardIO/MFileFilter.java b/src/StandardIO/MFileFilter.java new file mode 100644 index 0000000..8484806 --- /dev/null +++ b/src/StandardIO/MFileFilter.java @@ -0,0 +1,40 @@ +/* */ package StandardIO; +/* */ +/* */ import java.io.File; +/* */ +/* */ public class MFileFilter extends javax.swing.filechooser.FileFilter +/* */ { +/* */ java.io.FileFilter filter; +/* */ String description; +/* */ String[] ext; +/* */ +/* */ public MFileFilter(java.io.FileFilter f, String description) +/* */ { +/* 18 */ this.filter = f; +/* 19 */ this.description = description; +/* 20 */ this.ext = null; +/* */ } +/* */ +/* */ public MFileFilter(String[] acceptedExtensions, String description) { +/* 24 */ this.ext = acceptedExtensions; +/* 25 */ this.description = description; +/* 26 */ this.filter = null; +/* */ } +/* */ public boolean accept(File f) { +/* 29 */ if (f.isDirectory()) return true; +/* 30 */ if (this.filter != null) +/* 31 */ return this.filter.accept(f); +/* 32 */ for (String ex : this.ext) +/* 33 */ if (f.toString().endsWith(ex)) +/* 34 */ return true; +/* 35 */ return false; +/* */ } +/* */ public String getDescription() { +/* 38 */ return this.description; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.MFileFilter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StandardIO/MFileWriter.java b/src/StandardIO/MFileWriter.java new file mode 100644 index 0000000..b6a0a5f --- /dev/null +++ b/src/StandardIO/MFileWriter.java @@ -0,0 +1,26 @@ +/* */ package StandardIO; +/* */ +/* */ import java.io.FileWriter; +/* */ import java.io.IOException; +/* */ import java.io.PrintWriter; +/* */ import java.text.SimpleDateFormat; +/* */ import java.util.Calendar; +/* */ +/* */ public class MFileWriter extends PrintWriter +/* */ { +/* */ public MFileWriter(String file) +/* */ throws IOException +/* */ { +/* 16 */ super(new FileWriter(file)); +/* */ } +/* */ public void writeDateAndTime() { +/* 19 */ Calendar c = Calendar.getInstance(); +/* 20 */ SimpleDateFormat fmt = new SimpleDateFormat("MM/dd/yyyy\tHH:mm:ss"); +/* 21 */ super.println(fmt.format(c.getTime())); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.MFileWriter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StandardIO/ModulusFileChooser.java b/src/StandardIO/ModulusFileChooser.java new file mode 100644 index 0000000..1d73c80 --- /dev/null +++ b/src/StandardIO/ModulusFileChooser.java @@ -0,0 +1,49 @@ +/* */ package StandardIO; +/* */ +/* */ import javax.swing.JFileChooser; +/* */ +/* */ public class ModulusFileChooser extends JFileChooser +/* */ { +/* */ Approvable onApprove; +/* */ +/* */ public ModulusFileChooser(Approvable app, String currentDirectory, MFileFilter[] chooseableFilters) +/* */ { +/* 16 */ super(currentDirectory); +/* 17 */ for (MFileFilter f : chooseableFilters) { +/* 18 */ super.addChoosableFileFilter(f); +/* */ } +/* 20 */ this.onApprove = app; +/* 21 */ setFileFilter(chooseableFilters[0]); +/* */ } +/* */ public void promptOpen() { +/* 24 */ int returnVal = super.showOpenDialog(this); +/* 25 */ if (returnVal == 0) { +/* 26 */ this.onApprove.onApprove(getSelectedFile()); +/* */ } +/* */ else +/* 29 */ this.onApprove.onCancel(); +/* */ } +/* */ +/* */ public void promptSave() { +/* 33 */ int returnVal = super.showSaveDialog(this); +/* 34 */ if (returnVal == 0) { +/* 35 */ this.onApprove.onApprove(getSelectedFile()); +/* */ } +/* */ else +/* 38 */ this.onApprove.onCancel(); +/* */ } +/* */ +/* */ public void promptDialog(String dialog) { +/* 42 */ int returnVal = super.showDialog(this, dialog); +/* 43 */ if (returnVal == 0) { +/* 44 */ this.onApprove.onApprove(getSelectedFile()); +/* */ } +/* */ else +/* 47 */ this.onApprove.onCancel(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.ModulusFileChooser + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StandardIO/ModulusOutputStream.java b/src/StandardIO/ModulusOutputStream.java new file mode 100644 index 0000000..8ef368b --- /dev/null +++ b/src/StandardIO/ModulusOutputStream.java @@ -0,0 +1,168 @@ +/* */ package StandardIO; +/* */ +/* */ import java.io.File; +/* */ import java.io.OutputStream; +/* */ import java.io.PrintStream; +/* */ import javax.swing.JTextArea; +/* */ +/* */ public class ModulusOutputStream extends PrintStream +/* */ { +/* */ private JTextArea textAreaToAppend; +/* */ private FileOutputArray output; +/* */ +/* */ public ModulusOutputStream(OutputStream out, boolean autoFlush) +/* */ { +/* 22 */ super(out, autoFlush); +/* 23 */ this.output = new FileOutputArray(); +/* */ } +/* */ +/* */ public ModulusOutputStream(JTextArea append, OutputStream out, boolean autoFlush) +/* */ { +/* 30 */ super(out, autoFlush); +/* 31 */ this.textAreaToAppend = append; +/* 32 */ this.output = new FileOutputArray(); +/* */ } +/* */ +/* */ public void print(String s) +/* */ { +/* */ try +/* */ { +/* 41 */ this.textAreaToAppend.append(s); +/* 42 */ this.output.append(s); +/* */ } +/* */ catch (Exception e) { +/* 45 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void print(int s) { +/* */ try { +/* 51 */ this.textAreaToAppend.append(s); +/* 52 */ this.output.append(s); +/* */ } +/* */ catch (Exception e) { +/* 55 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void print(float s) { +/* */ try { +/* 61 */ this.textAreaToAppend.append(s); +/* 62 */ this.output.append(s); +/* */ } +/* */ catch (Exception e) { +/* 65 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void print(double s) { +/* */ try { +/* 71 */ this.textAreaToAppend.append(s); +/* 72 */ this.output.append(s); +/* */ } +/* */ catch (Exception e) { +/* 75 */ e.printStackTrace(); +/* 76 */ this.output.append(s); +/* */ } +/* */ } +/* */ +/* */ public void print(boolean s) { +/* */ try { +/* 82 */ this.textAreaToAppend.append(s); +/* 83 */ this.output.append(s); +/* */ } +/* */ catch (Exception e) { +/* 86 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void print(char s) { +/* */ try { +/* 92 */ this.textAreaToAppend.append(s); +/* 93 */ this.output.append(s); +/* */ } +/* */ catch (Exception e) { +/* 96 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* 100 */ public void print(char[] s) { print(new String(s)); } +/* */ +/* */ public void println(String s) +/* */ { +/* */ try { +/* 105 */ this.textAreaToAppend.append(s + "\n"); +/* 106 */ this.output.append(s + "\n"); +/* */ } +/* */ catch (Exception e) { +/* 109 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void println(int s) { +/* */ try { +/* 115 */ this.textAreaToAppend.append(s + "\n"); +/* 116 */ this.output.append(s + "\n"); +/* */ } +/* */ catch (Exception e) { +/* 119 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void println(float s) { +/* */ try { +/* 125 */ this.textAreaToAppend.append(s + "\n"); +/* 126 */ this.output.append(s + "\n"); +/* */ } +/* */ catch (Exception e) { +/* 129 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void println(double s) { +/* */ try { +/* 135 */ this.textAreaToAppend.append(s + "\n"); +/* 136 */ this.output.append(s + "\n"); +/* */ } +/* */ catch (Exception e) { +/* 139 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void println(boolean s) { +/* */ try { +/* 145 */ this.textAreaToAppend.append(s + "\n"); +/* 146 */ this.output.append(s + "\n"); +/* */ } +/* */ catch (Exception e) { +/* 149 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void println(char s) { +/* */ try { +/* 155 */ this.textAreaToAppend.append(s + "\n"); +/* 156 */ this.output.append(s + "\n"); +/* */ } +/* */ catch (Exception e) { +/* 159 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* 163 */ public void println(char[] s) { println(new String(s)); } +/* */ +/* */ public void silentPrint(String prnt) { +/* 166 */ this.output.append(prnt); +/* */ } +/* */ public void flushTo(File file) { +/* 169 */ this.output.flushToFile(file); +/* */ } +/* */ public void flushTo(String file) { +/* 172 */ this.output.flushToFile(file); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.ModulusOutputStream + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StandardIO/PropertiesReader.java b/src/StandardIO/PropertiesReader.java new file mode 100644 index 0000000..172162b --- /dev/null +++ b/src/StandardIO/PropertiesReader.java @@ -0,0 +1,60 @@ +/* */ package StandardIO; +/* */ +/* */ import StandardIO.FileIO.FileDecomposer; +/* */ import java.io.BufferedWriter; +/* */ import java.io.FileWriter; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ +/* */ public class PropertiesReader +/* */ { +/* */ private String dir; +/* */ +/* */ public PropertiesReader(String directory) +/* */ { +/* 11 */ this.dir = directory; +/* */ } +/* */ public String[] readProperties() { +/* 14 */ String[] file = new String[0]; +/* 15 */ String[] toReturn = new String[6]; +/* */ try { +/* 17 */ file = FileDecomposer.decompose(this.dir); +/* */ } +/* */ catch (IOException e) { +/* 20 */ System.out.println("Properties Not Found"); +/* 21 */ return new String[] { "1234567890\\QWERTYUIOP\\ASDFGHJKL\\ZXCVBNM", "none", "none", "none", "full", "false" }; +/* */ } +/* */ +/* 24 */ for (String str : file) { +/* 25 */ if (str.startsWith("keyboard-style")) +/* 26 */ if (str.substring(str.indexOf(":") + 1).trim().equals("QWERTY")) toReturn[0] = "1234567890\\QWERTYUIOP\\ASDFGHJKL\\ZXCVBNM"; +/* 27 */ else if (str.substring(str.indexOf(":") + 1).trim().equals("DVORAK")) toReturn[0] = "1234567890\\PYFGCRL\\AOEUIDHTNS\\QJKXBMWVZ"; +/* 28 */ else if (str.substring(str.indexOf(":") + 1).trim().equals("ALPHABETICAL")) toReturn[0] = "0123456789\\ABCDEFGHIJ\\KLMNOPQRST\\UVWXYZ"; +/* 29 */ if (str.startsWith("keyboard")) toReturn[0] = str.substring(str.indexOf(":") + 1); +/* 30 */ if (str.startsWith("ColorKeys")) toReturn[1] = str.substring(str.indexOf(":") + 1); +/* 31 */ if (str.startsWith("LastFunctionDir")) toReturn[2] = str.substring(str.indexOf(":") + 1); +/* 32 */ if (str.startsWith("LastLoadDir")) toReturn[3] = str.substring(str.indexOf(":") + 1); +/* 33 */ if (str.startsWith("calcsize:")) toReturn[4] = str.substring(str.indexOf(":") + 1); +/* 34 */ if (str.startsWith("ontop:")) toReturn[5] = str.substring(str.indexOf(":") + 1); +/* */ } +/* 36 */ return toReturn; +/* */ } +/* */ public void writeProperties(String[] props) { +/* 39 */ String[] scrpt = { "keyboard-style:", "ColorKeys:", "LastFunctionDir:", "LastLoadDir:", "calcsize:", "ontop:" }; +/* */ try { +/* 41 */ BufferedWriter out = new BufferedWriter(new FileWriter(this.dir)); +/* 42 */ for (int i = 0; i < props.length; i++) { +/* 43 */ out.write(scrpt[i] + props[i] + "\n"); +/* */ } +/* 45 */ out.close(); +/* */ } +/* */ catch (IOException localIOException) +/* */ { +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.PropertiesReader + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StandardIO/SaveFileWriter.java b/src/StandardIO/SaveFileWriter.java new file mode 100644 index 0000000..98309b1 --- /dev/null +++ b/src/StandardIO/SaveFileWriter.java @@ -0,0 +1,20 @@ +/* */ package StandardIO; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ public class SaveFileWriter extends MFileWriter +/* */ { +/* */ public SaveFileWriter(String file) +/* */ throws IOException +/* */ { +/* 14 */ super(file); +/* 15 */ println("Modulus 2.0.0 Save File"); +/* 16 */ super.writeDateAndTime(); +/* 17 */ println("------------------------------"); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.SaveFileWriter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StatPlot.java b/src/StatPlot.java new file mode 100644 index 0000000..5847e06 --- /dev/null +++ b/src/StatPlot.java @@ -0,0 +1,76 @@ +/* */ import java.awt.Graphics; +/* */ import java.util.ArrayList; +/* */ import java.util.Collections; +/* */ import java.util.Comparator; +/* */ +/* */ public class StatPlot +/* */ { +/* */ private ArrayList<Point2D> points; +/* */ private ExtendablePointInvoker invoker; +/* */ private GraphTranslator translate; +/* 11 */ private static final Comparator comparator = new Comparator() +/* */ { +/* */ public int compare(Object o1, Object o2) +/* */ { +/* 15 */ if ((!(o1 instanceof Point2D)) || (!(o2 instanceof Point2D))) return 0; +/* 16 */ Point2D p1 = (Point2D)o1; +/* 17 */ Point2D p2 = (Point2D)o2; +/* 18 */ return p1.getRealX() == p2.getRealX() ? 0 : p1.getRealX() > p2.getRealX() ? 1 : -1; +/* */ } +/* 11 */ }; +/* */ +/* */ public StatPlot(ArrayList<Point2D> points, GraphTranslator translate) +/* */ { +/* 24 */ this.points = ((ArrayList)points.clone()); +/* 25 */ Collections.sort(this.points, comparator); +/* 26 */ this.translate = translate; +/* 27 */ this.invoker = new ExtendablePointInvoker(new ArrayList()); +/* */ } +/* */ public StatPlot(ArrayList<Point2D> points, PointInvoker firstInvoker, GraphTranslator translate) { +/* 30 */ this(points, translate); +/* 31 */ this.invoker.concat(firstInvoker); +/* */ } +/* */ public Point2D[] getPoints() { +/* 34 */ Point2D[] p = new Point2D[this.points.size()]; +/* 35 */ return p = (Point2D[])this.points.toArray(p); +/* */ } +/* */ public void setPoints(ArrayList<Point2D> points) { +/* 38 */ this.points = points; +/* */ } +/* */ public ExtendablePointInvoker getInvoker() { +/* 41 */ return this.invoker; +/* */ } +/* */ public void setInvoker(ExtendablePointInvoker invoker) { +/* 44 */ this.invoker = invoker; +/* */ } +/* */ public void drawPoints(Graphics g) { +/* 47 */ for (int i = 0; i < this.points.size(); i++) { +/* 48 */ Point2D trans = this.translate.translate((Point2D)this.points.get(i)); +/* 49 */ this.invoker.drawPoint(g, trans.getX(), trans.getY()); +/* */ } +/* */ } +/* */ +/* 53 */ public String toString() { String ret = ""; +/* 54 */ for (int i = 0; i < this.points.size(); i++) { +/* 55 */ ret = ret + "," + this.points.get(i); +/* */ } +/* 57 */ return "[" + ret + "]"; } +/* */ +/* */ public Point2D getPoint(int index) { +/* 60 */ return (Point2D)this.points.get(index); +/* */ } +/* */ public double getYAt(int index) { +/* 63 */ return getPoint(index).getRealY(); +/* */ } +/* */ public double getXAt(int index) { +/* 66 */ return getPoint(index).getRealX(); +/* */ } +/* */ public int size() { +/* 69 */ return this.points.size(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StatPlot + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StatPlotCreationDialog.java b/src/StatPlotCreationDialog.java new file mode 100644 index 0000000..a1e4ee7 --- /dev/null +++ b/src/StatPlotCreationDialog.java @@ -0,0 +1,257 @@ +/* */ import GUIComponents.PushablePanel; +/* */ import java.awt.Color; +/* */ import java.awt.Component; +/* */ import java.awt.Dimension; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Graphics; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.awt.image.BufferedImage; +/* */ import java.util.ArrayList; +/* */ import javax.swing.AbstractButton; +/* */ import javax.swing.BorderFactory; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.Icon; +/* */ import javax.swing.ImageIcon; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JCheckBox; +/* */ import javax.swing.JColorChooser; +/* */ import javax.swing.JComboBox; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JSpinner; +/* */ import javax.swing.JTextField; +/* */ import javax.swing.event.ChangeEvent; +/* */ import javax.swing.event.ChangeListener; +/* */ +/* */ public class StatPlotCreationDialog extends JDialog +/* */ implements ActionListener, ChangeListener +/* */ { +/* */ private static final int invoker_length = 3; +/* 34 */ private PushablePanel panel = new PushablePanel(); +/* */ private JButton add; +/* */ private JButton cancel; +/* */ private JButton delete; +/* */ private JButton ok; +/* 36 */ private StatPlot ret = null; +/* */ private GraphTranslator translate; +/* */ private StatPlotDialog owner; +/* */ private Color colorChosen; +/* */ private JButton colorButton; +/* 41 */ private ExtendedPointInvoker[] invokers = { +/* 42 */ new ExtendedPointInvoker.SquarePointInvoker(5, Color.black), +/* 43 */ new ExtendedPointInvoker.SquareFillPointInvoker(5, Color.black), +/* 44 */ new ExtendedPointInvoker.CirclePointInvoker(5, Color.black), +/* 45 */ new ExtendedPointInvoker.PixelPointInvoker(Color.black) }; +/* */ private JComboBox combobox; +/* */ private JSpinner spinner; +/* */ private int editNumber; +/* */ +/* */ public StatPlotCreationDialog(StatPlotDialog owner, GraphTranslator translate, int editNumber) +/* */ { +/* 52 */ super(owner, "Statplot Maker", true); +/* 53 */ this.owner = owner; +/* 54 */ this.translate = translate; +/* 55 */ this.editNumber = editNumber; +/* 56 */ this.colorChosen = Color.black; +/* 57 */ this.colorButton = new JButton(getButtonIcon()); +/* 58 */ this.colorButton.setPreferredSize(new Dimension(30, 30)); +/* 59 */ this.colorButton.addActionListener(this); +/* 60 */ this.combobox = new JComboBox(); +/* 61 */ hideArrow(); +/* 62 */ this.combobox.setPreferredSize(new Dimension(80, 30)); +/* 63 */ this.spinner = new JSpinner(); +/* 64 */ this.spinner.addChangeListener(this); +/* 65 */ updateOptions(); +/* 66 */ JPanel main = new JPanel(); +/* 67 */ JPanel buttons = new JPanel(new FlowLayout()); +/* 68 */ JPanel head = new JPanel(new FlowLayout()); +/* 69 */ JPanel addDelete = new JPanel(); +/* 70 */ this.panel = new PushablePanel(); +/* 71 */ addDelete.setLayout(new BoxLayout(addDelete, 1)); +/* 72 */ main.setLayout(new BoxLayout(main, 1)); +/* */ +/* 74 */ addDelete.setPreferredSize(new Dimension(105, 250)); +/* 75 */ this.panel.setPreferredSize(new Dimension(200, 250)); +/* 76 */ buttons.setPreferredSize(new Dimension(350, 50)); +/* */ +/* 78 */ this.add = new JButton("add"); +/* 79 */ this.cancel = new JButton("Cancel"); +/* 80 */ this.delete = new JButton("delete"); +/* 81 */ this.ok = new JButton("Apply"); +/* 82 */ JPanel addhold = new JPanel(); +/* 83 */ JPanel deletehold = new JPanel(); +/* 84 */ this.add.addActionListener(this); +/* 85 */ this.cancel.addActionListener(this); +/* 86 */ this.delete.addActionListener(this); +/* 87 */ this.ok.addActionListener(this); +/* 88 */ addhold.add(this.add); +/* 89 */ deletehold.add(this.delete); +/* 90 */ addDelete.add(addhold); +/* 91 */ addDelete.add(deletehold); +/* */ +/* 93 */ buttons.add(this.ok); +/* 94 */ buttons.add(this.cancel); +/* */ +/* 96 */ JPanel options = new JPanel(); +/* 97 */ JPanel options1 = new JPanel(new FlowLayout()); +/* 98 */ JPanel options2 = new JPanel(new FlowLayout()); +/* 99 */ options.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), "Options")); +/* 100 */ options.setLayout(new BoxLayout(options, 1)); +/* 101 */ options.setPreferredSize(new Dimension(105, 175)); +/* 102 */ options1.add(this.colorButton); +/* 103 */ options1.add(this.combobox); +/* 104 */ options2.add(this.spinner); +/* 105 */ options.add(options1); +/* 106 */ options.add(options2); +/* */ +/* 108 */ addDelete.add(options); +/* 109 */ head.add(this.panel); +/* 110 */ head.add(addDelete); +/* */ +/* 112 */ main.add(head); +/* 113 */ main.add(buttons); +/* */ +/* 115 */ add(main); +/* 116 */ setPreferredSize(new Dimension(325, 350)); +/* 117 */ setResizable(false); +/* 118 */ pack(); +/* */ } +/* */ +/* */ public StatPlot getPlot() +/* */ { +/* 146 */ ArrayList comps = this.panel.getPushedComponents(); +/* 147 */ ArrayList points = new ArrayList(); +/* 148 */ for (int i = 0; i < comps.size(); i++) { +/* 149 */ if ((comps.get(i) instanceof StatPlotCreationDialog.PointPanel)) { +/* 150 */ StatPlotCreationDialog.PointPanel pointpanel = (StatPlotCreationDialog.PointPanel)comps.get(i); +/* 151 */ points.add(pointpanel.getPoint()); +/* */ } +/* */ } +/* 154 */ return new StatPlot(points, this.invokers[this.combobox.getSelectedIndex()], this.translate); +/* */ } +/* */ private void sweep() { +/* 157 */ ArrayList delete = new ArrayList(); +/* 158 */ ArrayList comps = this.panel.getPushedComponents(); +/* 159 */ for (int i = 0; i < comps.size(); i++) { +/* 160 */ if ((comps.get(i) instanceof StatPlotCreationDialog.PointPanel)) { +/* 161 */ StatPlotCreationDialog.PointPanel comp = (StatPlotCreationDialog.PointPanel)comps.get(i); +/* 162 */ if (comp.isSelected()) { +/* 163 */ delete.add(comp); +/* */ } +/* */ } +/* */ } +/* 167 */ for (int i = 0; i < delete.size(); i++) +/* 168 */ this.panel.removeComponent((JComponent)delete.get(i)); +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) +/* */ { +/* 173 */ if (e.getSource() == this.cancel) { +/* 174 */ setVisible(false); +/* 175 */ } else if (e.getSource() == this.add) { +/* 176 */ this.panel.pushComponent(new StatPlotCreationDialog.PointPanel()); +/* 177 */ } else if (e.getSource() == this.delete) { +/* 178 */ sweep(); +/* 179 */ } else if (e.getSource() == this.ok) { +/* 180 */ boolean upset = false; +/* */ try { +/* 182 */ this.owner.setStatPlot(getPlot(), this.editNumber); +/* */ } +/* */ catch (Exception c) { +/* 185 */ upset = true; +/* 186 */ new ComplicationAlert(this, "One or more points cannot be parsed"); +/* 187 */ c.printStackTrace(); +/* */ } +/* */ finally { +/* 190 */ if (!upset) +/* 191 */ setVisible(false); +/* */ } +/* 193 */ } else if (e.getSource() == this.colorButton) { +/* 194 */ this.colorChosen = JColorChooser.showDialog(this, "Choose a button color: ", this.colorChosen); +/* 195 */ updateOptions(); +/* */ } +/* */ } +/* */ +/* */ private Icon getButtonIcon() { +/* 200 */ BufferedImage bi = new BufferedImage(25, 25, 1); +/* 201 */ Graphics g = bi.getGraphics(); +/* 202 */ g.setColor(this.colorChosen); +/* 203 */ g.fillRect(0, 0, 25, 25); +/* 204 */ return new ImageIcon(bi); +/* */ } +/* */ private Icon makeIconInstance(PointInvoker invoker, int spinneramt) { +/* 207 */ BufferedImage bi = new BufferedImage(25, 25, 1); +/* 208 */ Graphics g = bi.getGraphics(); +/* 209 */ g.setColor(Color.white); +/* 210 */ g.fillRect(0, 0, 25, 25); +/* 211 */ invoker.drawPoint(g, 13, 13); +/* 212 */ return new ImageIcon(bi); +/* */ } +/* */ private void hideArrow() { +/* 215 */ Component[] c = this.combobox.getComponents(); +/* 216 */ for (Component x : c) +/* 217 */ if ((x instanceof AbstractButton)) +/* 218 */ ((AbstractButton)x).setVisible(false); +/* */ } +/* */ +/* */ private void updateOptions() +/* */ { +/* 223 */ this.colorButton.setIcon(getButtonIcon()); +/* 224 */ int selected = this.combobox.getSelectedIndex(); +/* 225 */ int spinneramt = ((Integer)this.spinner.getValue()).intValue(); +/* 226 */ this.combobox.removeAllItems(); +/* */ +/* 228 */ for (ExtendedPointInvoker x : this.invokers) { +/* 229 */ x.setColor(this.colorChosen); +/* 230 */ x.setSize(spinneramt); +/* */ } +/* 232 */ for (int i = 0; i < this.invokers.length; i++) { +/* 233 */ this.combobox.addItem(makeIconInstance(this.invokers[i], spinneramt)); +/* */ } +/* 235 */ this.combobox.setSelectedIndex(selected); +/* 236 */ this.combobox.updateUI(); +/* 237 */ this.spinner.updateUI(); +/* 238 */ this.colorButton.updateUI(); +/* */ } +/* */ +/* */ public void stateChanged(ChangeEvent e) +/* */ { +/* 243 */ if (e.getSource() == this.spinner) updateOptions(); +/* */ } +/* */ +/* */ private class PointPanel extends JPanel +/* */ { +/* */ private JTextField xVal; +/* */ private JTextField yVal; +/* */ private JCheckBox box; +/* */ +/* */ public PointPanel() +/* */ { +/* 125 */ this.box = new JCheckBox(); +/* 126 */ this.xVal = new JTextField("0.0", 4); +/* 127 */ this.yVal = new JTextField("0.0", 4); +/* 128 */ setLayout(new FlowLayout()); +/* 129 */ add(this.box); +/* 130 */ add(new JLabel("(")); +/* 131 */ add(this.xVal); +/* 132 */ add(new JLabel(",")); +/* 133 */ add(this.yVal); +/* 134 */ add(new JLabel("),")); +/* */ } +/* */ +/* */ public Point2D getPoint() { +/* 138 */ return new Point2D(Double.parseDouble(this.xVal.getText()), Double.parseDouble(this.yVal.getText())); +/* */ } +/* */ public boolean isSelected() { +/* 141 */ return this.box.isSelected(); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StatPlotCreationDialog + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/StatPlotDialog.java b/src/StatPlotDialog.java new file mode 100644 index 0000000..73d3a95 --- /dev/null +++ b/src/StatPlotDialog.java @@ -0,0 +1,163 @@ +/* */ import GUIComponents.PushablePanel; +/* */ import java.awt.Dimension; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Frame; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.util.ArrayList; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.ButtonGroup; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JCheckBox; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JRadioButton; +/* */ +/* */ public class StatPlotDialog extends JDialog +/* */ implements ActionListener +/* */ { +/* */ private JButton add; +/* */ private JButton cancel; +/* */ private JButton delete; +/* */ private JButton ok; +/* */ private JButton edit; +/* */ private PushablePanel panel; +/* 21 */ private ArrayList<StatPlotDialog.CheckAndRadioButton> plots = new ArrayList(); +/* 22 */ private ArrayList<StatPlot> statplots = new ArrayList(); +/* 23 */ private ArrayList<StatPlotCreationDialog> dialogs = new ArrayList(); +/* */ private Graph2D graph; +/* 25 */ private ButtonGroup buttonGroup = new ButtonGroup(); +/* */ +/* 27 */ public StatPlotDialog(Frame owner, Graph2D graph) { super(owner, "Statplot", true); +/* 28 */ this.graph = graph; +/* 29 */ JPanel main = new JPanel(); +/* 30 */ JPanel buttons = new JPanel(new FlowLayout()); +/* 31 */ JPanel head = new JPanel(new FlowLayout()); +/* 32 */ JPanel addDelete = new JPanel(); +/* 33 */ this.panel = new PushablePanel(); +/* 34 */ addDelete.setLayout(new BoxLayout(addDelete, 1)); +/* 35 */ main.setLayout(new BoxLayout(main, 1)); +/* */ +/* 37 */ addDelete.setPreferredSize(new Dimension(75, 250)); +/* 38 */ this.panel.setPreferredSize(new Dimension(150, 250)); +/* 39 */ buttons.setPreferredSize(new Dimension(350, 50)); +/* */ +/* 41 */ this.add = new JButton("Add"); +/* 42 */ this.cancel = new JButton("Cancel"); +/* 43 */ this.delete = new JButton("Delete"); +/* 44 */ this.ok = new JButton("Apply"); +/* 45 */ this.edit = new JButton("Edit"); +/* */ +/* 47 */ this.add.addActionListener(this); +/* 48 */ this.cancel.addActionListener(this); +/* 49 */ this.delete.addActionListener(this); +/* 50 */ this.ok.addActionListener(this); +/* 51 */ this.edit.addActionListener(this); +/* */ +/* 53 */ addDelete.add(this.add); +/* 54 */ addDelete.add(this.delete); +/* 55 */ addDelete.add(this.edit); +/* */ +/* 57 */ buttons.add(this.ok); +/* 58 */ buttons.add(this.cancel); +/* */ +/* 60 */ head.add(this.panel); +/* 61 */ head.add(addDelete); +/* */ +/* 63 */ main.add(head); +/* 64 */ main.add(buttons); +/* */ +/* 66 */ add(main); +/* 67 */ setPreferredSize(new Dimension(275, 350)); +/* 68 */ setResizable(false); +/* 69 */ pack(); } +/* */ +/* */ private void sweep() { +/* 72 */ ArrayList delete = new ArrayList(); +/* 73 */ for (int i = 0; i < this.plots.size(); i++) { +/* 74 */ if (((StatPlotDialog.CheckAndRadioButton)this.plots.get(i)).isBoxSelected()) { +/* 75 */ delete.add((StatPlotDialog.CheckAndRadioButton)this.plots.get(i)); +/* */ } +/* */ } +/* 78 */ for (int i = 0; i < delete.size(); i++) { +/* 79 */ this.statplots.remove(this.plots.indexOf(delete.get(i))); +/* 80 */ this.plots.remove(delete.get(i)); +/* 81 */ this.dialogs.remove(delete.get(i)); +/* 82 */ this.panel.removeComponent((JComponent)delete.get(i)); +/* */ } +/* 84 */ for (int i = 0; i < this.plots.size(); i++) ((StatPlotDialog.CheckAndRadioButton)this.plots.get(i)).setText("Stat #" + (i + 1)); +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) +/* */ { +/* 88 */ if ((e.getSource() == this.ok) || (e.getSource() == this.cancel)) { +/* 89 */ if (e.getSource() == this.ok) { +/* 90 */ dumpPlots(); +/* */ } +/* 92 */ setVisible(false); +/* 93 */ } else if (e.getSource() == this.add) { +/* 94 */ this.dialogs.add(new StatPlotCreationDialog(this, this.graph, this.statplots.size())); +/* 95 */ ((StatPlotCreationDialog)this.dialogs.get(this.dialogs.size() - 1)).setVisible(true); +/* 96 */ } else if (e.getSource() == this.delete) { +/* 97 */ sweep(); +/* 98 */ } else if (e.getSource() == this.edit) { +/* 99 */ openEditor(); +/* */ } +/* */ } +/* */ +/* 103 */ public void setStatPlot(StatPlot x, int idx) { if (idx >= this.statplots.size()) addStatPlot(x); else +/* 104 */ this.statplots.set(idx, x); } +/* */ +/* */ public void addStatPlot(StatPlot x) { +/* 107 */ StatPlotDialog.CheckAndRadioButton temp = new StatPlotDialog.CheckAndRadioButton("Stat #" + (this.plots.size() + 1)); +/* 108 */ this.panel.pushComponent(temp); +/* 109 */ this.plots.add(temp); +/* 110 */ this.statplots.add(x); +/* */ } +/* */ private void dumpPlots() { +/* 113 */ this.graph.resetPlots(); +/* 114 */ for (int i = 0; i < this.statplots.size(); i++) +/* 115 */ if (((StatPlotDialog.CheckAndRadioButton)this.plots.get(i)).isBoxSelected()) +/* 116 */ this.graph.addStatPlot((StatPlot)this.statplots.get(i)); +/* */ } +/* */ +/* */ private void openEditor() { +/* 120 */ for (int i = 0; i < this.plots.size(); i++) +/* 121 */ if (((StatPlotDialog.CheckAndRadioButton)this.plots.get(i)).isButtonSelected()) { +/* 122 */ ((StatPlotCreationDialog)this.dialogs.get(i)).setVisible(true); +/* 123 */ return; +/* */ } +/* */ } +/* */ +/* */ public ArrayList<StatPlot> getPlots() { +/* 128 */ return this.statplots; +/* */ } +/* */ +/* */ private class CheckAndRadioButton extends JPanel +/* */ { +/* */ private JCheckBox box; +/* 133 */ private JRadioButton button = new JRadioButton(); +/* */ +/* 135 */ public CheckAndRadioButton(String text) { setLayout(new FlowLayout()); +/* 136 */ this.box = new JCheckBox(text, true); +/* 137 */ StatPlotDialog.this.buttonGroup.add(this.button); +/* 138 */ add(this.box); +/* 139 */ add(this.button); } +/* */ +/* */ public boolean isBoxSelected() { +/* 142 */ return this.box.isSelected(); +/* */ } +/* */ public boolean isButtonSelected() { +/* 145 */ return this.button.isSelected(); +/* */ } +/* */ public void setText(String text) { +/* 148 */ this.box.setText(text); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StatPlotDialog + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/SwingPrompter.java b/src/SwingPrompter.java new file mode 100644 index 0000000..7265e9d --- /dev/null +++ b/src/SwingPrompter.java @@ -0,0 +1,27 @@ +/* */ public class SwingPrompter +/* */ implements Runnable +/* */ { +/* 13 */ public static String hold = ""; +/* 14 */ private String[] runArgs = { "" }; +/* 15 */ public static boolean toggle = false; +/* */ +/* */ public static String getPrompt(String[] args) throws Exception { +/* 18 */ SwingPrompter prompt = new SwingPrompter(); +/* 19 */ prompt.runArgs = args; +/* 20 */ Thread run = new Thread(prompt); +/* 21 */ run.start(); +/* 22 */ while (!toggle); +/* 23 */ toggle = false; +/* 24 */ return hold; +/* */ } +/* */ +/* */ public void run() { +/* 28 */ Thread newThread = new Thread(new ThreadGroup(Thread.currentThread().getThreadGroup().getParent(), "Prompt Window"), new RunnablePrompt(this.runArgs)); +/* 29 */ newThread.start(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: SwingPrompter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/Table.java b/src/Table.java new file mode 100644 index 0000000..df6cca8 --- /dev/null +++ b/src/Table.java @@ -0,0 +1,189 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Component; +/* */ import java.awt.GridLayout; +/* */ import java.awt.event.MouseWheelEvent; +/* */ import java.awt.event.MouseWheelListener; +/* */ import java.io.PrintStream; +/* */ import java.math.BigDecimal; +/* */ import java.util.ArrayList; +/* */ import javax.swing.BorderFactory; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JTextField; +/* */ +/* */ public class Table extends JPanel +/* */ implements MouseWheelListener, GraphTypeStateChangedListener +/* */ { +/* */ private JTextField[][] cells; +/* */ private JPanel panel; +/* */ private JPanel pane; +/* */ public double start; +/* */ public double step; +/* */ ArrayList<MouseWheelListener> listeners; +/* 21 */ ArrayList<JLabel> labels = new ArrayList(); +/* */ +/* */ public Table(String[][] stuff, String[] names) { +/* 24 */ this.cells = new JTextField[stuff.length][stuff[0].length]; +/* 25 */ this.panel = new JPanel(); +/* 26 */ this.panel.setLayout(new GridLayout(this.cells.length + 1, this.cells[0].length, 2, 0)); +/* 27 */ for (String str : names) { +/* 28 */ this.labels.add(new JLabel(str)); +/* 29 */ this.panel.add((Component)this.labels.get(this.labels.size() - 1)); +/* */ } +/* 31 */ for (int i = 0; i < this.cells.length; i++) { +/* 32 */ for (int j = 0; j < this.cells[i].length; j++) { +/* 33 */ this.cells[i][j] = new JTextField(stuff[i][j], 5); +/* 34 */ this.cells[i][j].setEditable(false); +/* 35 */ this.cells[i][j].setBackground(new Color(16777215)); +/* 36 */ this.cells[i][j].addMouseWheelListener(this); +/* 37 */ this.cells[i][j].setCaretPosition(0); +/* 38 */ this.panel.add(this.cells[i][j]); +/* */ } +/* */ } +/* 41 */ this.panel.addMouseWheelListener(this); +/* 42 */ this.panel.setBorder(BorderFactory.createLoweredBevelBorder()); +/* 43 */ add(this.panel); +/* 44 */ this.listeners = new ArrayList(); +/* */ } +/* */ +/* */ public void reset(String[][] stuff) +/* */ { +/* 49 */ for (int i = 0; i < this.cells.length; i++) +/* 50 */ for (int j = 0; j < this.cells[i].length; j++) { +/* 51 */ this.cells[i][j].setText(stuff[i][j]); +/* 52 */ this.cells[i][j].setCaretPosition(0); +/* */ } +/* */ } +/* */ +/* */ public static Table getInstance(String[] equs, double start, double step) throws Exception { +/* 57 */ if (equs.length < 5) { +/* 58 */ String[] nw = new String[5]; +/* 59 */ for (int i = 0; i < nw.length; i++) nw[i] = ""; +/* 60 */ for (int i = 0; i < equs.length; i++) nw[i] = equs[i]; +/* 61 */ equs = nw; +/* */ } +/* 63 */ String[][] data = new String[6][10]; +/* 64 */ String[] names = new String[6]; +/* 65 */ names[0] = ("<html><a style='font-family: Times New Roman'>" + GraphTypeHolder.getInstance().getGraphPointMaker().getIndependentVariable() + "</a></html>"); +/* 66 */ for (int i = 1; i < names.length; i++) { +/* 67 */ names[i] = ("<html><a style='font-family: Times New Roman'>" + GraphTypeHolder.getInstance().getGraphPointMaker().getDependentVariable() + "<sub>" + (i - 1) + "</sub></a></html>"); +/* */ } +/* */ +/* 70 */ double startCpy = start; +/* 71 */ for (int i = 0; i < data[0].length; start += step) { data[0][i] = (Math.round(start * 10000.0D) / 10000.0D); i++; +/* */ } +/* 73 */ int cnt = 1; for (int i = 0; i < 5; cnt++) +/* */ { +/* 75 */ start = startCpy; +/* */ +/* 77 */ for (int j = 0; j < data[cnt].length; start += step) { +/* 78 */ if (!equs[i].equals("")) +/* */ try { +/* 80 */ String str = Math.round(Double.parseDouble(ControlPanel.figure(equs[i].replaceAll("<ivar>", new BigDecimal(start).toPlainString()))) * 10000.0D) / 10000.0D; +/* */ +/* 82 */ data[cnt][j] = str; +/* */ } +/* */ catch (NumberFormatException ex) { +/* 85 */ data[cnt][j] = "ERR"; +/* */ } +/* 77 */ j++; +/* */ } +/* 73 */ i++; +/* */ } +/* */ +/* 90 */ String[][] rev = new String[10][6]; +/* 91 */ for (int i = 0; i < rev.length; i++) { +/* 92 */ rev[i] = { data[0][i], +/* 93 */ data[1][i], +/* 94 */ data[2][i], +/* 95 */ data[3][i], +/* 96 */ data[4][i], +/* 97 */ data[5][i] }; +/* */ } +/* */ +/* 101 */ Table ret = new Table(rev, names); +/* 102 */ return ret; +/* */ } +/* */ public void addMouseWheelListener(MouseWheelListener x) { +/* 105 */ this.listeners.add(x); +/* */ } +/* */ +/* */ public void mouseWheelMoved(MouseWheelEvent e) { +/* 109 */ for (MouseWheelListener listener : this.listeners) +/* 110 */ listener.mouseWheelMoved(e); +/* */ } +/* */ +/* */ public static void resetInstance(Table tbl, String[] equs, double start, double step) throws Exception +/* */ { +/* 115 */ if (equs.length < 5) { +/* 116 */ String[] nw = new String[5]; +/* 117 */ for (int i = 0; i < nw.length; i++) nw[i] = ""; +/* 118 */ for (int i = 0; i < equs.length; i++) nw[i] = equs[i]; +/* 119 */ equs = nw; +/* */ } +/* 121 */ String[][] data = new String[6][10]; +/* */ +/* 123 */ double startCpy = start; +/* 124 */ for (int i = 0; i < data[0].length; start += step) { data[0][i] = (Math.round(start * 10000.0D) / 10000.0D); i++; +/* */ } +/* 126 */ int cnt = 1; for (int i = 0; i < 5; cnt++) +/* */ { +/* 128 */ start = startCpy; +/* */ +/* 130 */ for (int j = 0; j < data[cnt].length; start += step) { +/* 131 */ if (!equs[i].equals("")) +/* */ try { +/* 133 */ String str = Math.round(Double.parseDouble(ControlPanel.figure(equs[i].replaceAll("<ivar>", new BigDecimal(start).toPlainString()))) * 10000.0D) / 10000.0D; +/* */ +/* 135 */ data[cnt][j] = str; +/* */ } +/* */ catch (NumberFormatException ex) { +/* 138 */ data[cnt][j] = "ERR"; +/* */ } +/* 130 */ j++; +/* */ } +/* 126 */ i++; +/* */ } +/* */ +/* 143 */ String[][] rev = new String[10][6]; +/* 144 */ for (int i = 0; i < rev.length; i++) { +/* 145 */ rev[i] = { data[0][i], +/* 146 */ data[1][i], +/* 147 */ data[2][i], +/* 148 */ data[3][i], +/* 149 */ data[4][i], +/* 150 */ data[5][i] }; +/* */ } +/* */ +/* 153 */ tbl.reset(rev); +/* */ } +/* */ private static void print(String[][] x) { +/* 156 */ String[][] arrayOfString = x; int j = x.length; for (int i = 0; i < j; i++) { String[] strs = arrayOfString[i]; +/* 157 */ for (String prt : strs) { +/* 158 */ System.out.print(prt + " "); +/* */ } +/* 160 */ System.out.print("\n"); } +/* */ } +/* */ +/* */ private static double roundTo(double x, int to) { +/* 164 */ x *= Math.pow(10.0D, to); +/* 165 */ x = ()x; +/* 166 */ x /= Math.pow(10.0D, to); +/* 167 */ return x; +/* */ } +/* */ +/* */ public void graphTypeChanged(Point2DMaker maker) { +/* 171 */ String[] names = new String[6]; +/* 172 */ names[0] = ("<html><a style='font-family: Times New Roman'>" + GraphTypeHolder.getInstance().getGraphPointMaker().getIndependentVariable() + "</a></html>"); +/* 173 */ for (int i = 1; i < names.length; i++) { +/* 174 */ names[i] = ("<html><a style='font-family: Times New Roman'>" + GraphTypeHolder.getInstance().getGraphPointMaker().getDependentVariable() + "<sub>" + (i - 1) + "</sub></a></html>"); +/* */ } +/* 176 */ for (int i = 0; (i < names.length) && (i < this.labels.size()); i++) +/* 177 */ ((JLabel)this.labels.get(i)).setText(names[i]); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Table + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/TableFrame.java b/src/TableFrame.java new file mode 100644 index 0000000..226c87c --- /dev/null +++ b/src/TableFrame.java @@ -0,0 +1,115 @@ +/* */ import java.awt.BorderLayout; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Toolkit; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import java.awt.event.MouseWheelEvent; +/* */ import java.awt.event.MouseWheelListener; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JMenuBar; +/* */ import javax.swing.JMenuItem; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JScrollPane; +/* */ import javax.swing.JTextField; +/* */ +/* */ public class TableFrame extends JFrame +/* */ implements ActionListener, MouseWheelListener +/* */ { +/* 16 */ private JButton snap = new JButton("Snap"); +/* */ +/* 18 */ private JButton tblSet = new JButton("Set"); +/* */ +/* 20 */ private JMenuBar bar = new JMenuBar(); +/* */ +/* 23 */ private JTextField field = new JTextField("0", 5); +/* 24 */ private JLabel xEq = new JLabel("x = "); +/* */ private JPanel buttonPanel; +/* */ private Table table; +/* 27 */ private Menu[] menus = { +/* 28 */ new Menu("File", new JComponent[0]), +/* 30 */ new Menu("Table Set", new JComponent[] { +/* 31 */ new JMenuItem("Reset Table"), +/* 32 */ new JMenuItem("Equations") }) }; +/* */ private JScrollPane pane; +/* */ private JPanel panePanel; +/* */ private double start; +/* */ private double step; +/* */ private String[] equs; +/* */ private TableSetter tableSetterInstance; +/* */ +/* */ public TableFrame(Table table) +/* */ { +/* 41 */ setTitle("Modulus 20 Table Frame"); +/* 42 */ for (Menu menu : this.menus) { +/* 43 */ this.bar.add(menu); +/* 44 */ menu.addActionListener(this); +/* */ } +/* 46 */ setLayout(new BorderLayout()); +/* 47 */ this.panePanel = new JPanel(); +/* 48 */ this.table = table; +/* 49 */ this.tableSetterInstance = new TableSetter(this, new String[] { this.start, this.step }); +/* */ +/* 55 */ this.panePanel.add(table); +/* 56 */ add(this.bar, "North"); +/* 57 */ add(this.panePanel, "Center"); +/* */ +/* 59 */ this.buttonPanel = new JPanel(new FlowLayout()); +/* */ +/* 61 */ this.snap.addActionListener(this); +/* */ +/* 64 */ this.buttonPanel.add(this.snap); +/* 65 */ this.buttonPanel.add(this.xEq); +/* 66 */ this.buttonPanel.add(this.field); +/* */ +/* 68 */ add(this.buttonPanel, "South"); +/* 69 */ pack(); +/* 70 */ setIconImage(Toolkit.getDefaultToolkit().getImage("modulus_symbol.png")); +/* 71 */ setVisible(true); +/* 72 */ this.panePanel.addMouseWheelListener(this); +/* 73 */ table.addMouseWheelListener(this); +/* 74 */ addMouseWheelListener(this); +/* */ } +/* */ +/* */ public TableFrame(String[] equs, double start, double step) throws Exception { +/* 78 */ this(Table.getInstance(equs, start, step)); +/* 79 */ this.start = start; +/* 80 */ this.step = step; +/* 81 */ this.equs = equs; +/* */ } +/* */ public void mouseWheelMoved(MouseWheelEvent e) { +/* 84 */ this.start += e.getWheelRotation(); +/* */ try { +/* 86 */ Table.resetInstance(this.table, this.equs, this.start, this.step); +/* */ } +/* */ catch (Exception ex) { +/* 89 */ ex.printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) +/* */ { +/* 97 */ if (e.getSource().getClass() == TableSetter.class) { +/* 98 */ TableSetter y = (TableSetter)e.getSource(); +/* 99 */ this.start = Double.parseDouble(y.getText()[0]); +/* 100 */ this.step = Double.parseDouble(y.getText()[1]); +/* */ } +/* 102 */ if (e.getSource() == this.snap) { +/* */ try { +/* 104 */ Table.resetInstance(this.table, this.equs, this.start = Double.parseDouble(this.field.getText()), this.step); +/* */ } +/* */ catch (Exception ex) { +/* 107 */ ex.printStackTrace(); +/* */ } +/* */ } +/* 110 */ else if (e.getSource() == this.menus[1].get(0)) +/* 111 */ this.tableSetterInstance.setVisible(true); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: TableFrame + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/TableSetter.java b/src/TableSetter.java new file mode 100644 index 0000000..efa1bdd --- /dev/null +++ b/src/TableSetter.java @@ -0,0 +1,74 @@ +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Toolkit; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JTextField; +/* */ +/* */ public class TableSetter extends JFrame +/* */ implements ActionListener +/* */ { +/* */ private JButton OK; +/* */ private JButton cancel; +/* */ private ActionListener flg; +/* */ private JPanel main; +/* 19 */ private JTextField[] fields = { +/* 20 */ new JTextField(5), +/* 21 */ new JTextField(5) }; +/* */ +/* 23 */ private JLabel[] lbls = { +/* 24 */ new JLabel("TblStart"), +/* 25 */ new JLabel("TblStep") }; +/* */ +/* */ public TableSetter(ActionListener caller, String[] originals) +/* */ { +/* 28 */ this.flg = caller; +/* 29 */ this.OK = new JButton("Set"); +/* 30 */ this.cancel = new JButton("Cancel"); +/* 31 */ for (int i = 0; (i < originals.length) && (i < this.fields.length); i++) { +/* 32 */ this.fields[i].setText(originals[i]); +/* */ } +/* 34 */ this.OK.addActionListener(this); +/* 35 */ this.cancel.addActionListener(this); +/* 36 */ this.main = new JPanel(); +/* 37 */ this.main.setLayout(new BoxLayout(this.main, 1)); +/* */ +/* 39 */ for (int i = 0; i < this.fields.length; i++) { +/* 40 */ JPanel temp = new JPanel(new FlowLayout()); +/* 41 */ temp.add(this.lbls[i]); +/* 42 */ temp.add(this.fields[i]); +/* 43 */ this.main.add(temp); +/* */ } +/* */ +/* 46 */ JPanel temp = new JPanel(new FlowLayout()); +/* 47 */ temp.add(this.OK); +/* 48 */ temp.add(this.cancel); +/* 49 */ this.main.add(temp); +/* 50 */ add(this.main); +/* 51 */ setIconImage(Toolkit.getDefaultToolkit().getImage("modulus_symbol.png")); +/* 52 */ pack(); +/* */ } +/* */ +/* */ public String[] getText() { +/* 56 */ return new String[] { +/* 57 */ this.fields[0].getText(), +/* 58 */ this.fields[1].getText() }; +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) { +/* 62 */ if (e.getSource() == this.OK) { +/* 63 */ e.setSource(this); +/* 64 */ this.flg.actionPerformed(e); +/* */ } +/* 66 */ setVisible(false); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: TableSetter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/TernarySolver.java b/src/TernarySolver.java new file mode 100644 index 0000000..dea09a5 --- /dev/null +++ b/src/TernarySolver.java @@ -0,0 +1,47 @@ +/* */ public class TernarySolver +/* */ { +/* */ public static String solve(String arg) +/* */ throws Exception +/* */ { +/* 11 */ arg = arg.replaceAll("\\s+", ""); +/* 12 */ while (arg.contains("(")) { +/* 13 */ String part = arg.substring(arg.lastIndexOf("(", arg.indexOf(")")) + 1, arg.indexOf(")")); +/* 14 */ if (containsTernary(part)) +/* 15 */ arg = arg.substring(0, arg.lastIndexOf("(", arg.indexOf(")"))) + solve(part) + arg.substring(arg.indexOf(")") + 1); +/* 16 */ else if (BooleanLogic.containsBoolean(part)) +/* 17 */ arg = arg.substring(0, arg.lastIndexOf("(", arg.indexOf(")"))) + BooleanLogic.solve(part) + arg.substring(arg.indexOf(")") + 1); +/* */ else { +/* 19 */ arg = arg.substring(0, arg.lastIndexOf("(", arg.indexOf(")"))) + Calculator.solve(part) + arg.substring(arg.indexOf(")") + 1); +/* */ } +/* */ } +/* 22 */ if (!BooleanLogic.solve(arg.substring(2, arg.indexOf("then"))).equals("0")) { +/* 23 */ return Calculator.solve(arg.substring(arg.indexOf("then") + 4, arg.indexOf("else"))); +/* */ } +/* 25 */ return Calculator.solve(arg.substring(arg.indexOf("else") + 4)); +/* */ } +/* */ public static String solveCP(String arg) throws Exception { +/* 28 */ arg = arg.replaceAll("\\s+", ""); +/* 29 */ while (arg.contains("(")) { +/* 30 */ String part = arg.substring(arg.lastIndexOf("(", arg.indexOf(")")) + 1, arg.indexOf(")")); +/* 31 */ if (containsTernary(part)) +/* 32 */ arg = arg.substring(0, arg.lastIndexOf("(", arg.indexOf(")"))) + solve(part) + arg.substring(arg.indexOf(")") + 1); +/* 33 */ else if (BooleanLogic.containsBoolean(part)) +/* 34 */ arg = arg.substring(0, arg.lastIndexOf("(", arg.indexOf(")"))) + BooleanLogic.solve(part) + arg.substring(arg.indexOf(")") + 1); +/* */ else { +/* 36 */ arg = arg.substring(0, arg.lastIndexOf("(", arg.indexOf(")"))) + Calculator.solve(part) + arg.substring(arg.indexOf(")") + 1); +/* */ } +/* */ } +/* 39 */ if (!BooleanLogic.solve(arg.substring(2, arg.indexOf("then"))).equals("0")) { +/* 40 */ return ControlPanel.figure(arg.substring(arg.indexOf("then") + 4, arg.indexOf("else"))); +/* */ } +/* 42 */ return ControlPanel.figure(arg.substring(arg.indexOf("else") + 4)); +/* */ } +/* */ public static boolean containsTernary(String x) { +/* 45 */ return (x.contains("if")) && (x.contains("then")) && (x.contains("else")); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: TernarySolver + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/TrackingPanel.java b/src/TrackingPanel.java new file mode 100644 index 0000000..bef7318 --- /dev/null +++ b/src/TrackingPanel.java @@ -0,0 +1,59 @@ +/* */ import java.awt.FlowLayout; +/* */ import java.awt.GridLayout; +/* */ import java.awt.event.MouseEvent; +/* */ import java.awt.event.MouseMotionListener; +/* */ import java.text.DecimalFormat; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JTextField; +/* */ +/* */ public class TrackingPanel extends JPanel +/* */ implements MouseMotionListener +/* */ { +/* */ private JTextField[] fields; +/* */ private DecimalFormat format; +/* */ private JLabel[] labels; +/* */ private JPanel[] panels; +/* */ private Point2D mousePoint; +/* */ private GraphTranslator translator; +/* */ private AnswerPanel slave; +/* */ +/* */ public TrackingPanel(GraphTranslator translator, AnswerPanel slave) +/* */ { +/* 22 */ this.fields = new JTextField[4]; +/* 23 */ this.panels = new JPanel[5]; +/* 24 */ this.labels = new JLabel[] { +/* 25 */ new JLabel("x = "), +/* 26 */ new JLabel("y = "), +/* 27 */ new JLabel("θ = "), +/* 28 */ new JLabel("r = ") }; +/* */ +/* 30 */ setLayout(new GridLayout(1, 5)); +/* 31 */ for (int i = 0; i < this.fields.length; i++) { +/* 32 */ this.panels[i] = new JPanel(new FlowLayout()); +/* 33 */ this.fields[i] = new JTextField("", 5); +/* 34 */ this.fields[i].setEditable(false); +/* 35 */ this.panels[i].add(this.labels[i]); +/* 36 */ this.panels[i].add(this.fields[i]); +/* 37 */ add(this.panels[i]); +/* */ } +/* 39 */ this.translator = translator; +/* 40 */ this.format = new DecimalFormat(".00"); +/* 41 */ this.slave = slave; +/* */ } +/* */ public void mouseDragged(MouseEvent e) { +/* */ } +/* 45 */ public void mouseMoved(MouseEvent e) { this.mousePoint = this.translator.translateInv(new Point2D(e.getPoint())); +/* 46 */ this.fields[0].setText(this.format.format(this.mousePoint.getRealX())); +/* 47 */ this.fields[1].setText(this.format.format(this.mousePoint.getRealY())); +/* 48 */ double angle = Math.toDegrees(Math.atan2(this.mousePoint.getRealX(), this.mousePoint.getRealY())); +/* 49 */ this.fields[2].setText(this.format.format(360.0D - (angle - 90.0D + 360.0D) % 360.0D)); +/* 50 */ this.fields[3].setText(this.format.format(Math.sqrt(this.mousePoint.getRealX() * this.mousePoint.getRealX() + this.mousePoint.getRealY() * this.mousePoint.getRealY()))); +/* 51 */ this.slave.load(this.mousePoint.getRealX(), this.mousePoint.getRealY(), 360.0D - (angle - 90.0D + 360.0D) % 360.0D); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: TrackingPanel + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/WindowRange.java b/src/WindowRange.java new file mode 100644 index 0000000..19edd0f --- /dev/null +++ b/src/WindowRange.java @@ -0,0 +1,86 @@ +/* */ public class WindowRange +/* */ { +/* */ private double xMin; +/* */ private double xMax; +/* */ private double yMin; +/* */ private double yMax; +/* */ +/* */ public WindowRange(double xMin, double yMin, double xMax, double yMax) +/* */ { +/* 10 */ this.xMin = xMin; +/* 11 */ this.xMax = xMax; +/* 12 */ this.yMin = yMin; +/* 13 */ this.yMax = yMax; +/* */ } +/* */ private WindowRange(double[] args) { +/* 16 */ this(args[0], args[1], args[2], args[3]); +/* */ } +/* */ public WindowRange(Point2D p1, Point2D p2) { +/* 19 */ this(getFromPoints(p1, p2)); +/* */ } +/* */ public WindowRange() { +/* 22 */ this(-10.0D, -10.0D, 10.0D, 10.0D); +/* */ } +/* */ public double getXMin() { +/* 25 */ return this.xMin; +/* */ } +/* */ public double getYMin() { +/* 28 */ return this.yMin; +/* */ } +/* */ public double getXMax() { +/* 31 */ return this.xMax; +/* */ } +/* */ public double getYMax() { +/* 34 */ return this.yMax; +/* */ } +/* */ +/* */ public WindowRange getScaledInstance(double scale) { +/* 38 */ WindowRange ret = new WindowRange(); +/* 39 */ double origdifx = getXMax() - getXMin(); +/* 40 */ double newdifx = origdifx * scale; +/* 41 */ double change = (newdifx - origdifx) / 2.0D; +/* 42 */ ret.xMin = (getXMin() - change); +/* 43 */ ret.xMax = (getXMax() + change); +/* */ +/* 45 */ double origdify = getYMax() - getYMin(); +/* 46 */ double newdify = origdify * scale; +/* 47 */ change = (newdify - origdify) / 2.0D; +/* 48 */ ret.yMin = (getYMin() - change); +/* 49 */ ret.yMax = (getYMax() + change); +/* */ +/* 51 */ return ret; +/* */ } +/* */ public WindowRange getTranslatedInstance(double difx, double dify) { +/* 54 */ return new WindowRange(this.xMin - difx, this.yMin + dify, this.xMax - difx, this.yMax + dify); +/* */ } +/* */ +/* */ private static double[] getFromPoints(Point2D p1, Point2D p2) +/* */ { +/* */ double s3; +/* */ double s3; +/* */ double s1; +/* 58 */ if (p1.getX() > p2.getX()) { +/* 59 */ double s1 = p2.getX(); +/* 60 */ s3 = p1.getX(); +/* */ } else { +/* 62 */ s3 = p2.getX(); +/* 63 */ s1 = p1.getX(); +/* */ } +/* */ double s4; +/* */ double s4; +/* */ double s2; +/* 66 */ if (p1.getY() > p2.getY()) { +/* 67 */ double s2 = p2.getY(); +/* 68 */ s4 = p1.getY(); +/* */ } else { +/* 70 */ s4 = p2.getY(); +/* 71 */ s2 = p1.getY(); +/* */ } +/* 73 */ return new double[] { s1, s2, s3, s4 }; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: WindowRange + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/WindowRangeDialog.java b/src/WindowRangeDialog.java new file mode 100644 index 0000000..83ad285 --- /dev/null +++ b/src/WindowRangeDialog.java @@ -0,0 +1,159 @@ +/* */ import GUIComponents.WrapperPanel; +/* */ import java.awt.BorderLayout; +/* */ import java.awt.Component; +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Frame; +/* */ import java.awt.GridLayout; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JDialog; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JSpinner; +/* */ import javax.swing.JTextField; +/* */ import javax.swing.event.ChangeEvent; +/* */ import javax.swing.event.ChangeListener; +/* */ +/* */ public class WindowRangeDialog extends JDialog +/* */ implements ActionListener, ChangeListener +/* */ { +/* */ private Graph2D graph; +/* */ private WindowRangeDialog.TextFieldBundle xMin; +/* */ private WindowRangeDialog.TextFieldBundle xMax; +/* */ private WindowRangeDialog.TextFieldBundle yMin; +/* */ private WindowRangeDialog.TextFieldBundle yMax; +/* */ private WindowRangeDialog.TextFieldBundle tMin; +/* */ private WindowRangeDialog.TextFieldBundle tMax; +/* */ private JSpinner xStep; +/* */ private JSpinner tStep; +/* */ private JButton ok; +/* */ private JButton cancel; +/* */ +/* */ public WindowRangeDialog(Frame owner, Graph2D toSet) +/* */ { +/* 27 */ super(owner, true); +/* 28 */ this.graph = toSet; +/* 29 */ WindowRange range = toSet.getWindowRange(); +/* */ +/* 31 */ this.xMin = new WindowRangeDialog.TextFieldBundle("X-Min", new JTextField(range.getXMin(), 5)); +/* 32 */ this.xMax = new WindowRangeDialog.TextFieldBundle("X-Max", new JTextField(range.getXMax(), 5)); +/* 33 */ this.yMin = new WindowRangeDialog.TextFieldBundle("Y-Min", new JTextField(range.getYMin(), 5)); +/* 34 */ this.yMax = new WindowRangeDialog.TextFieldBundle("Y-Max", new JTextField(range.getYMax(), 5)); +/* 35 */ this.tMin = new WindowRangeDialog.TextFieldBundle("θ-Min", new JTextField(this.graph.getTStart(), 5)); +/* 36 */ this.tMax = new WindowRangeDialog.TextFieldBundle("θ-Max", new JTextField(this.graph.getTEnd(), 5)); +/* */ +/* 38 */ this.xStep = new JSpinner(); +/* 39 */ this.tStep = new JSpinner(); +/* */ +/* 41 */ this.xStep.setValue(Integer.valueOf(this.graph.getXSkip())); +/* 42 */ this.tStep.setValue(Double.valueOf(this.graph.getTStep())); +/* */ +/* 44 */ this.ok = new JButton("Apply"); +/* 45 */ this.cancel = new JButton("Cancel"); +/* 46 */ this.ok.addActionListener(this); +/* 47 */ this.cancel.addActionListener(this); +/* 48 */ this.xStep.addChangeListener(this); +/* 49 */ this.tStep.addChangeListener(this); +/* 50 */ JPanel main = new JPanel(); +/* 51 */ JPanel buttons = new JPanel(new FlowLayout()); +/* 52 */ main.setLayout(new GridLayout(3, 3)); +/* 53 */ main.add(this.xMax); +/* 54 */ main.add(this.yMax); +/* 55 */ main.add(this.tMax); +/* 56 */ main.add(this.xMin); +/* 57 */ main.add(this.yMin); +/* 58 */ main.add(this.tMin); +/* 59 */ main.add(new WrapperPanel(new Component[] { new JLabel("X-Res"), this.xStep })); +/* 60 */ main.add(new JPanel()); +/* 61 */ main.add(new WrapperPanel(new Component[] { new JLabel("θ-Step"), this.tStep })); +/* 62 */ buttons.add(this.ok); +/* 63 */ buttons.add(this.cancel); +/* 64 */ setLayout(new BorderLayout()); +/* 65 */ add(main, "Center"); +/* 66 */ add(buttons, "South"); +/* 67 */ pack(); +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) +/* */ { +/* 94 */ if ((e.getSource() == this.ok) || (e.getSource() == this.cancel)) { +/* 95 */ boolean upset = false; +/* 96 */ if (e.getSource() == this.ok) { +/* */ try { +/* 98 */ applySettings(); +/* */ } catch (Exception c) { +/* 100 */ c.printStackTrace(); +/* 101 */ upset = true; +/* 102 */ new ComplicationAlert(this, "One or more of the option fields could not be parsed!"); +/* */ } +/* */ } +/* 105 */ if (!upset) +/* 106 */ setVisible(false); +/* */ } +/* */ } +/* */ +/* */ public void stateChanged(ChangeEvent e) +/* */ { +/* 112 */ if ((e.getSource() instanceof JSpinner)) { +/* 113 */ JSpinner src = (JSpinner)e.getSource(); +/* 114 */ if (((Integer)src.getValue()).intValue() <= 0) { +/* 115 */ src.setValue(Integer.valueOf(1)); +/* */ } +/* 117 */ src.updateUI(); +/* */ } +/* */ } +/* */ +/* */ public void applySettings() throws NumberFormatException, Exception +/* */ { +/* 123 */ WindowRange newWinRange = new WindowRange( +/* 124 */ Double.parseDouble(ControlPanel.figure(this.xMin.getFieldText())), +/* 125 */ Double.parseDouble(ControlPanel.figure(this.yMin.getFieldText())), +/* 126 */ Double.parseDouble(ControlPanel.figure(this.xMax.getFieldText())), +/* 127 */ Double.parseDouble(ControlPanel.figure(this.yMax.getFieldText()))); +/* */ +/* 129 */ double tMinNum = Double.parseDouble(ControlPanel.figure(this.tMin.getFieldText())); +/* 130 */ double tMaxNum = Double.parseDouble(ControlPanel.figure(this.tMax.getFieldText())); +/* */ +/* 132 */ this.graph.setWindowRange(newWinRange); +/* 133 */ this.graph.setTStart(tMinNum); +/* 134 */ this.graph.setTEnd(tMaxNum); +/* 135 */ this.graph.setXSkip(((Integer)this.xStep.getValue()).intValue()); +/* 136 */ if ((this.tStep.getValue() instanceof Double)) +/* 137 */ this.graph.setTStep(((Double)this.tStep.getValue()).doubleValue()); +/* 138 */ if ((this.tStep.getValue() instanceof Integer)) +/* 139 */ this.graph.setTStep(((Integer)this.tStep.getValue()).intValue()); +/* */ } +/* */ +/* */ private class TextFieldBundle extends JPanel +/* */ { +/* */ private JTextField field; +/* */ private JLabel text; +/* */ +/* */ public TextFieldBundle(String text, JTextField field) +/* */ { +/* 73 */ super(); +/* 74 */ this.text = new JLabel(text); +/* 75 */ this.field = field; +/* 76 */ add(this.text); +/* 77 */ add(this.field); +/* */ } +/* */ public String getLabelText() { +/* 80 */ return this.text.getText(); +/* */ } +/* */ public void setLabelText(String text) { +/* 83 */ this.text.setText(text); +/* */ } +/* */ public void setFieldText(String text) { +/* 86 */ this.field.setText(text); +/* */ } +/* */ public String getFieldText() { +/* 89 */ return this.field.getText(); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: WindowRangeDialog + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/WirePlotter.java b/src/WirePlotter.java new file mode 100644 index 0000000..975bb76 --- /dev/null +++ b/src/WirePlotter.java @@ -0,0 +1,11 @@ +import java.awt.Graphics; + +public abstract interface WirePlotter +{ + public abstract void plotWire(Graphics paramGraphics, CoordinateSystem paramCoordinateSystem, Point3D[] paramArrayOfPoint3D); +} + +/* Location: Modulus.jar + * Qualified Name: WirePlotter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/XAxis.java b/src/XAxis.java new file mode 100644 index 0000000..fa4d395 --- /dev/null +++ b/src/XAxis.java @@ -0,0 +1,86 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ +/* */ public class XAxis extends Object3D +/* */ { +/* */ private Color color; +/* */ +/* */ public XAxis(double xoff, double yoff, double zoff, double rotX, double rotY, double rotZ, CoordinateSystem graph, Color color) +/* */ { +/* 95 */ super(new Point3D[][] { +/* 15 */ { +/* 17 */ transpose(0.0D, 1.0D, 200.0D), +/* 18 */ transpose(0.75D, 0.75D, 200.0D), +/* 19 */ transpose(1.0D, 0.0D, 200.0D), +/* 20 */ transpose(0.75D, -0.75D, 200.0D), +/* 21 */ transpose(0.0D, -1.0D, 200.0D), +/* 22 */ transpose(-0.75D, -0.75D, 200.0D), +/* 23 */ transpose(-1.0D, 0.0D, 200.0D), +/* 24 */ transpose(-0.75D, 0.75D, 200.0D) }, +/* 26 */ { +/* 28 */ transpose(0.0D, 1.0D, -200.0D), +/* 29 */ transpose(0.75D, 0.75D, -200.0D), +/* 30 */ transpose(1.0D, 0.0D, 200.0D), +/* 31 */ transpose(0.75D, -0.75D, -200.0D), +/* 32 */ transpose(0.0D, -1.0D, 200.0D), +/* 33 */ transpose(-0.75D, -0.75D, -200.0D), +/* 34 */ transpose(-1.0D, 0.0D, 200.0D), +/* 35 */ transpose(-0.75D, 0.75D, -200.0D) }, +/* 37 */ { +/* 39 */ transpose(0.0D, 1.0D, 200.0D), +/* 40 */ transpose(0.0D, 1.0D, -200.0D), +/* 41 */ transpose(0.75D, 0.75D, -200.0D), +/* 42 */ transpose(0.75D, 0.75D, 200.0D) }, +/* 44 */ { +/* 46 */ transpose(0.75D, 0.75D, 200.0D), +/* 47 */ transpose(0.75D, 0.75D, -200.0D), +/* 48 */ transpose(1.0D, 0.0D, -200.0D), +/* 49 */ transpose(1.0D, 0.0D, 200.0D) }, +/* 51 */ { +/* 53 */ transpose(1.0D, 0.0D, 200.0D), +/* 54 */ transpose(1.0D, 0.0D, -200.0D), +/* 55 */ transpose(0.75D, -0.75D, -200.0D), +/* 56 */ transpose(0.75D, -0.75D, 200.0D) }, +/* 58 */ { +/* 60 */ transpose(0.75D, -0.75D, 200.0D), +/* 61 */ transpose(0.75D, -0.75D, -200.0D), +/* 62 */ transpose(0.0D, -1.0D, -200.0D), +/* 63 */ transpose(0.0D, -1.0D, 200.0D) }, +/* 66 */ { +/* 68 */ transpose(0.0D, -1.0D, 200.0D), +/* 69 */ transpose(0.0D, -1.0D, -200.0D), +/* 70 */ transpose(-0.75D, -0.75D, -200.0D), +/* 71 */ transpose(-0.75D, -0.75D, 200.0D) }, +/* 73 */ { +/* 75 */ transpose(-0.75D, -0.75D, 200.0D), +/* 76 */ transpose(-0.75D, -0.75D, -200.0D), +/* 77 */ transpose(-1.0D, 0.0D, -200.0D), +/* 78 */ transpose(-1.0D, 0.0D, 200.0D) }, +/* 80 */ { +/* 82 */ transpose(-1.0D, 0.0D, 200.0D), +/* 83 */ transpose(-1.0D, 0.0D, -200.0D), +/* 84 */ transpose(-0.75D, 0.75D, -200.0D), +/* 85 */ transpose(-0.75D, 0.75D, 200.0D) }, +/* 87 */ { +/* 89 */ transpose(-0.75D, 0.75D, 200.0D), +/* 90 */ transpose(-0.75D, 0.75D, -200.0D), +/* 91 */ transpose(0.0D, 1.0D, -200.0D), +/* 92 */ transpose(0.0D, 1.0D, 200.0D) } }, +/* 95 */ xoff, yoff, zoff, rotX, rotY, rotZ, graph); +/* 96 */ this.color = color; +/* */ } +/* */ private static Point3D transpose(double y, double z, double x) { +/* 99 */ return new Point3D(x, y, z); +/* */ } +/* */ public void invoke(Graphics g) { +/* 102 */ Color temp = g.getColor(); +/* 103 */ g.setColor(this.color); +/* 104 */ super.invoke(g); +/* 105 */ g.setColor(temp); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: XAxis + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/XAxisChar.java b/src/XAxisChar.java new file mode 100644 index 0000000..355af27 --- /dev/null +++ b/src/XAxisChar.java @@ -0,0 +1,111 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ +/* */ public class XAxisChar extends Object3D +/* */ { +/* */ private Color color; +/* */ +/* */ public XAxisChar(double xoff, double yoff, double zoff, double rotX, double rotY, double rotZ, CoordinateSystem graph, Color color) +/* */ { +/* 129 */ super(new Point3D[][] { +/* 15 */ { +/* 17 */ new Point3D(-2.5D, 3.0D, 0.0D), +/* 18 */ new Point3D(-2.5D, 2.0D, 0.0D), +/* 19 */ new Point3D(-0.5D, 0.0D, 0.0D), +/* 20 */ new Point3D(-2.5D, -3.0D, 0.0D), +/* 21 */ new Point3D(-2.5D, -2.0D, 0.0D), +/* 22 */ new Point3D(0.0D, -0.5D, 0.0D), +/* 23 */ new Point3D(2.5D, -3.0D, 0.0D), +/* 24 */ new Point3D(2.5D, -2.0D, 0.0D), +/* 25 */ new Point3D(0.5D, 0.0D, 0.0D), +/* 26 */ new Point3D(2.5D, 3.0D, 0.0D), +/* 27 */ new Point3D(2.5D, 2.0D, 0.0D), +/* 28 */ new Point3D(0.0D, 0.5D, 0.0D) }, +/* 30 */ { +/* 32 */ new Point3D(-2.5D, 3.0D, 3.0D), +/* 33 */ new Point3D(-2.5D, 2.0D, 3.0D), +/* 34 */ new Point3D(-0.5D, 0.0D, 3.0D), +/* 35 */ new Point3D(-2.5D, -3.0D, 3.0D), +/* 36 */ new Point3D(-2.5D, -2.0D, 3.0D), +/* 37 */ new Point3D(0.0D, -0.5D, 3.0D), +/* 38 */ new Point3D(2.5D, -3.0D, 3.0D), +/* 39 */ new Point3D(2.5D, -2.0D, 3.0D), +/* 40 */ new Point3D(0.5D, 0.0D, 3.0D), +/* 41 */ new Point3D(2.5D, 3.0D, 3.0D), +/* 42 */ new Point3D(2.5D, 2.0D, 3.0D), +/* 43 */ new Point3D(0.0D, 0.5D, 3.0D) }, +/* 45 */ { +/* 47 */ new Point3D(0.0D, 0.5D, 0.0D), +/* 48 */ new Point3D(0.0D, 0.5D, 3.0D), +/* 49 */ new Point3D(-2.5D, 3.0D, 3.0D), +/* 50 */ new Point3D(-2.5D, 3.0D, 0.0D) }, +/* 52 */ { +/* 54 */ new Point3D(-2.5D, 3.0D, 0.0D), +/* 55 */ new Point3D(-2.5D, 3.0D, 3.0D), +/* 56 */ new Point3D(-2.5D, 2.0D, 3.0D), +/* 57 */ new Point3D(-2.5D, 2.0D, 0.0D) }, +/* 59 */ { +/* 61 */ new Point3D(-2.5D, 2.0D, 0.0D), +/* 62 */ new Point3D(-2.5D, 2.0D, 3.0D), +/* 63 */ new Point3D(-0.5D, 0.0D, 3.0D), +/* 64 */ new Point3D(-0.5D, 0.0D, 0.0D) }, +/* 66 */ { +/* 68 */ new Point3D(-0.5D, 0.0D, 0.0D), +/* 69 */ new Point3D(-0.5D, 0.0D, 3.0D), +/* 70 */ new Point3D(-2.5D, -2.0D, 3.0D), +/* 71 */ new Point3D(-2.5D, -2.0D, 0.0D) }, +/* 73 */ { +/* 75 */ new Point3D(-2.5D, -2.0D, 0.0D), +/* 76 */ new Point3D(-2.5D, -2.0D, 3.0D), +/* 77 */ new Point3D(-2.5D, -3.0D, 3.0D), +/* 78 */ new Point3D(-2.5D, -3.0D, 0.0D) }, +/* 80 */ { +/* 82 */ new Point3D(-2.5D, -3.0D, 0.0D), +/* 83 */ new Point3D(-2.5D, -3.0D, 3.0D), +/* 84 */ new Point3D(0.0D, -0.5D, 3.0D), +/* 85 */ new Point3D(0.0D, -0.5D, 0.0D) }, +/* 87 */ { +/* 89 */ new Point3D(0.0D, -0.5D, 0.0D), +/* 90 */ new Point3D(0.0D, -0.5D, 3.0D), +/* 91 */ new Point3D(2.5D, -3.0D, 3.0D), +/* 92 */ new Point3D(2.5D, -3.0D, 0.0D) }, +/* 94 */ { +/* 96 */ new Point3D(2.5D, -3.0D, 0.0D), +/* 97 */ new Point3D(2.5D, -3.0D, 3.0D), +/* 98 */ new Point3D(2.5D, -2.0D, 3.0D), +/* 99 */ new Point3D(2.5D, -2.0D, 0.0D) }, +/* 101 */ { +/* 103 */ new Point3D(2.5D, -2.0D, 0.0D), +/* 104 */ new Point3D(2.5D, -2.0D, 3.0D), +/* 105 */ new Point3D(0.5D, 0.0D, 3.0D), +/* 106 */ new Point3D(0.5D, 0.0D, 0.0D) }, +/* 108 */ { +/* 110 */ new Point3D(0.5D, 0.0D, 0.0D), +/* 111 */ new Point3D(0.5D, 0.0D, 3.0D), +/* 112 */ new Point3D(2.5D, 2.0D, 3.0D), +/* 113 */ new Point3D(2.5D, 2.0D, 0.0D) }, +/* 115 */ { +/* 117 */ new Point3D(2.5D, 2.0D, 0.0D), +/* 118 */ new Point3D(2.5D, 2.0D, 3.0D), +/* 119 */ new Point3D(2.5D, 3.0D, 3.0D), +/* 120 */ new Point3D(2.5D, 3.0D, 0.0D) }, +/* 122 */ { +/* 124 */ new Point3D(2.5D, 3.0D, 0.0D), +/* 125 */ new Point3D(2.5D, 3.0D, 3.0D), +/* 126 */ new Point3D(0.0D, 0.5D, 3.0D), +/* 127 */ new Point3D(0.0D, 0.5D, 0.0D) } }, +/* 129 */ xoff, yoff, zoff, rotX, rotY, rotZ, graph); +/* 130 */ this.color = color; +/* */ } +/* */ public void invoke(Graphics g) { +/* 133 */ Color temp = g.getColor(); +/* 134 */ g.setColor(this.color); +/* 135 */ super.invoke(g); +/* 136 */ g.setColor(temp); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: XAxisChar + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/XEqualsDynamicGraphBuilder.java b/src/XEqualsDynamicGraphBuilder.java new file mode 100644 index 0000000..8e78e68 --- /dev/null +++ b/src/XEqualsDynamicGraphBuilder.java @@ -0,0 +1,37 @@ +/* */ import java.util.ArrayList; +/* */ +/* */ public class XEqualsDynamicGraphBuilder +/* */ implements DynamicGraphBuilder +/* */ { +/* */ public void recreate(Graph2D graph) +/* */ { +/* 12 */ Point2D maxY = (Point2D)graph.getPoints()[0].get(graph.getPoints()[0].size() - 1); +/* 13 */ Point2D minY = (Point2D)graph.getPoints()[0].get(0); +/* 14 */ Point2D minStart = graph.translate(minY); +/* 15 */ Point2D maxStart = graph.translate(maxY); +/* 16 */ GraphIterator iterator = GraphTypeHolder.getInstance().getGraphPointMaker().getIteratorInstance(graph); +/* 17 */ if (maxY.getY() < graph.getWindowRange().getYMax()) +/* */ { +/* 19 */ for (int j = 0; j < graph.getEquations().length; j++) +/* 20 */ for (int i = graph.translate(maxY).getY(); i >= 0; i--) { +/* 21 */ double y = graph.translateY(i); +/* 22 */ Point2D toAdd = GraphTypeHolder.getInstance().getGraphPointMaker().createPoint(y, graph.equation(y, graph.getEquations()[j])); +/* 23 */ graph.addPoint(toAdd, j); +/* */ } +/* */ } +/* 26 */ else if (minY.getY() > graph.getWindowRange().getYMin()) +/* */ { +/* 28 */ for (int j = 0; j < graph.getEquations().length; j++) +/* 29 */ for (int i = graph.translate(minY).getY(); i <= graph.getHeight(); i++) { +/* 30 */ double y = graph.translateY(i); +/* 31 */ Point2D toAdd = GraphTypeHolder.getInstance().getGraphPointMaker().createPoint(y, graph.equation(y, graph.getEquations()[j])); +/* 32 */ graph.pushPoint(toAdd, j); +/* */ } +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: XEqualsDynamicGraphBuilder + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/XEqualsGraphIterator.java b/src/XEqualsGraphIterator.java new file mode 100644 index 0000000..a41eacf --- /dev/null +++ b/src/XEqualsGraphIterator.java @@ -0,0 +1,30 @@ +/* */ public class XEqualsGraphIterator extends GraphIterator +/* */ { +/* */ private Graph2D graph; +/* */ +/* */ private XEqualsGraphIterator(Graph2D graph) +/* */ { +/* 13 */ super(-(int)(graph.getHeight() * 1.5D)); +/* 14 */ this.graph = graph; +/* */ } +/* */ public static XEqualsGraphIterator getInstance(Graph2D graph) { +/* 17 */ return new XEqualsGraphIterator(graph); +/* */ } +/* */ public boolean hasMoreTokens() { +/* 20 */ return this.index < this.graph.getHeight() * 1.5D; +/* */ } +/* */ public void onTurn() { +/* 23 */ this.index += this.graph.getXSkip(); +/* */ } +/* */ public double translateIndex(Graph2D graph) { +/* 26 */ return this.index * graph.getYRes() + graph.getWindowRange().getYMin(); +/* */ } +/* */ public double translateNumber(Graph2D graph, double i) { +/* 29 */ return i * graph.getYRes() + graph.getWindowRange().getYMin(); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: XEqualsGraphIterator + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/YAxis.java b/src/YAxis.java new file mode 100644 index 0000000..5a81af2 --- /dev/null +++ b/src/YAxis.java @@ -0,0 +1,86 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ +/* */ public class YAxis extends Object3D +/* */ { +/* */ private Color color; +/* */ +/* */ public YAxis(double xoff, double yoff, double zoff, double rotX, double rotY, double rotZ, CoordinateSystem graph, Color color) +/* */ { +/* 95 */ super(new Point3D[][] { +/* 15 */ { +/* 17 */ transpose(0.0D, 1.0D, 200.0D), +/* 18 */ transpose(0.75D, 0.75D, 200.0D), +/* 19 */ transpose(1.0D, 0.0D, 200.0D), +/* 20 */ transpose(0.75D, -0.75D, 200.0D), +/* 21 */ transpose(0.0D, -1.0D, 200.0D), +/* 22 */ transpose(-0.75D, -0.75D, 200.0D), +/* 23 */ transpose(-1.0D, 0.0D, 200.0D), +/* 24 */ transpose(-0.75D, 0.75D, 200.0D) }, +/* 26 */ { +/* 28 */ transpose(0.0D, 1.0D, -200.0D), +/* 29 */ transpose(0.75D, 0.75D, -200.0D), +/* 30 */ transpose(1.0D, 0.0D, 200.0D), +/* 31 */ transpose(0.75D, -0.75D, -200.0D), +/* 32 */ transpose(0.0D, -1.0D, 200.0D), +/* 33 */ transpose(-0.75D, -0.75D, -200.0D), +/* 34 */ transpose(-1.0D, 0.0D, 200.0D), +/* 35 */ transpose(-0.75D, 0.75D, -200.0D) }, +/* 37 */ { +/* 39 */ transpose(0.0D, 1.0D, 200.0D), +/* 40 */ transpose(0.0D, 1.0D, -200.0D), +/* 41 */ transpose(0.75D, 0.75D, -200.0D), +/* 42 */ transpose(0.75D, 0.75D, 200.0D) }, +/* 44 */ { +/* 46 */ transpose(0.75D, 0.75D, 200.0D), +/* 47 */ transpose(0.75D, 0.75D, -200.0D), +/* 48 */ transpose(1.0D, 0.0D, -200.0D), +/* 49 */ transpose(1.0D, 0.0D, 200.0D) }, +/* 51 */ { +/* 53 */ transpose(1.0D, 0.0D, 200.0D), +/* 54 */ transpose(1.0D, 0.0D, -200.0D), +/* 55 */ transpose(0.75D, -0.75D, -200.0D), +/* 56 */ transpose(0.75D, -0.75D, 200.0D) }, +/* 58 */ { +/* 60 */ transpose(0.75D, -0.75D, 200.0D), +/* 61 */ transpose(0.75D, -0.75D, -200.0D), +/* 62 */ transpose(0.0D, -1.0D, -200.0D), +/* 63 */ transpose(0.0D, -1.0D, 200.0D) }, +/* 66 */ { +/* 68 */ transpose(0.0D, -1.0D, 200.0D), +/* 69 */ transpose(0.0D, -1.0D, -200.0D), +/* 70 */ transpose(-0.75D, -0.75D, -200.0D), +/* 71 */ transpose(-0.75D, -0.75D, 200.0D) }, +/* 73 */ { +/* 75 */ transpose(-0.75D, -0.75D, 200.0D), +/* 76 */ transpose(-0.75D, -0.75D, -200.0D), +/* 77 */ transpose(-1.0D, 0.0D, -200.0D), +/* 78 */ transpose(-1.0D, 0.0D, 200.0D) }, +/* 80 */ { +/* 82 */ transpose(-1.0D, 0.0D, 200.0D), +/* 83 */ transpose(-1.0D, 0.0D, -200.0D), +/* 84 */ transpose(-0.75D, 0.75D, -200.0D), +/* 85 */ transpose(-0.75D, 0.75D, 200.0D) }, +/* 87 */ { +/* 89 */ transpose(-0.75D, 0.75D, 200.0D), +/* 90 */ transpose(-0.75D, 0.75D, -200.0D), +/* 91 */ transpose(0.0D, 1.0D, -200.0D), +/* 92 */ transpose(0.0D, 1.0D, 200.0D) } }, +/* 95 */ xoff, yoff, zoff, rotX, rotY, rotZ, graph); +/* 96 */ this.color = color; +/* */ } +/* */ private static Point3D transpose(double x, double z, double y) { +/* 99 */ return new Point3D(x, y, z); +/* */ } +/* */ public void invoke(Graphics g) { +/* 102 */ Color temp = g.getColor(); +/* 103 */ g.setColor(this.color); +/* 104 */ super.invoke(g); +/* 105 */ g.setColor(temp); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: YAxis + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/YAxisChar.java b/src/YAxisChar.java new file mode 100644 index 0000000..07e124a --- /dev/null +++ b/src/YAxisChar.java @@ -0,0 +1,79 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ +/* */ public class YAxisChar extends Object3D +/* */ { +/* */ Color color; +/* */ +/* */ public YAxisChar(double xoff, double yoff, double zoff, double rotX, double rotY, double rotZ, CoordinateSystem graph, Color color) +/* */ { +/* 89 */ super(new Point3D[][] { { +/* 18 */ new Point3D(-0.5D, -3.0D, 0.0D), +/* 19 */ new Point3D(-0.5D, 0.0D, 0.0D), +/* 20 */ new Point3D(-2.5D, 2.0D, 0.0D), +/* 21 */ new Point3D(-2.5D, 3.0D, 0.0D), +/* 22 */ new Point3D(0.0D, 0.5D, 0.0D), +/* 23 */ new Point3D(2.5D, 3.0D, 0.0D), +/* 24 */ new Point3D(2.5D, 2.0D, 0.0D), +/* 25 */ new Point3D(0.5D, 0.0D, 0.0D), +/* 26 */ new Point3D(0.5D, -3.0D, 0.0D) }, +/* 28 */ { +/* 30 */ new Point3D(-0.5D, -3.0D, 3.0D), +/* 31 */ new Point3D(-0.5D, 0.0D, 3.0D), +/* 32 */ new Point3D(-2.5D, 2.0D, 3.0D), +/* 33 */ new Point3D(-2.5D, 3.0D, 3.0D), +/* 34 */ new Point3D(0.0D, 0.5D, 3.0D), +/* 35 */ new Point3D(2.5D, 3.0D, 3.0D), +/* 36 */ new Point3D(2.5D, 2.0D, 3.0D), +/* 37 */ new Point3D(0.5D, 0.0D, 3.0D), +/* 38 */ new Point3D(0.5D, -3.0D, 3.0D) }, +/* 40 */ { +/* 42 */ new Point3D(2.5D, 3.0D, 0.0D), +/* 43 */ new Point3D(2.5D, 3.0D, 3.0D), +/* 44 */ new Point3D(2.5D, 2.0D, 3.0D), +/* 45 */ new Point3D(2.5D, 2.0D, 0.0D) }, +/* 47 */ { +/* 49 */ new Point3D(2.5D, 2.0D, 0.0D), +/* 50 */ new Point3D(2.5D, 2.0D, 3.0D), +/* 51 */ new Point3D(0.5D, 0.0D, 3.0D), +/* 52 */ new Point3D(0.5D, 0.0D, 0.0D) }, +/* 54 */ { +/* 56 */ new Point3D(0.5D, 0.0D, 0.0D), +/* 57 */ new Point3D(0.5D, 0.0D, 3.0D), +/* 58 */ new Point3D(0.5D, -3.0D, 3.0D), +/* 59 */ new Point3D(0.5D, -3.0D, 0.0D) }, +/* 61 */ { +/* 63 */ new Point3D(0.5D, -3.0D, 0.0D), +/* 64 */ new Point3D(0.5D, -3.0D, 3.0D), +/* 65 */ new Point3D(-0.5D, -3.0D, 3.0D), +/* 66 */ new Point3D(-0.5D, -3.0D, 0.0D) }, +/* 68 */ { +/* 70 */ new Point3D(-2.5D, 3.0D, 0.0D), +/* 71 */ new Point3D(-2.5D, 3.0D, 3.0D), +/* 72 */ new Point3D(-2.5D, 2.0D, 3.0D), +/* 73 */ new Point3D(-2.5D, 2.0D, 0.0D) }, +/* 75 */ { +/* 77 */ new Point3D(-2.5D, 2.0D, 0.0D), +/* 78 */ new Point3D(-2.5D, 2.0D, 3.0D), +/* 79 */ new Point3D(-0.5D, 0.0D, 3.0D), +/* 80 */ new Point3D(-0.5D, 0.0D, 0.0D) }, +/* 82 */ { +/* 84 */ new Point3D(-0.5D, 0.0D, 0.0D), +/* 85 */ new Point3D(-0.5D, 0.0D, 3.0D), +/* 86 */ new Point3D(-0.5D, -3.0D, 3.0D), +/* 87 */ new Point3D(-0.5D, -3.0D, 0.0D) } }, +/* 89 */ xoff, yoff, zoff, rotX, rotY, rotZ, graph); +/* 90 */ this.color = color; +/* */ } +/* */ public void invoke(Graphics g) { +/* 93 */ Color temp = g.getColor(); +/* 94 */ g.setColor(this.color); +/* 95 */ super.invoke(g); +/* 96 */ g.setColor(temp); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: YAxisChar + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ZAxis.java b/src/ZAxis.java new file mode 100644 index 0000000..035d1ce --- /dev/null +++ b/src/ZAxis.java @@ -0,0 +1,83 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ +/* */ public class ZAxis extends Object3D +/* */ { +/* */ private Color color; +/* */ +/* */ public ZAxis(double xoff, double yoff, double zoff, double rotX, double rotY, double rotZ, CoordinateSystem graph, Color color) +/* */ { +/* 95 */ super(new Point3D[][] { +/* 15 */ { +/* 17 */ new Point3D(0.0D, 1.0D, 200.0D), +/* 18 */ new Point3D(0.75D, 0.75D, 200.0D), +/* 19 */ new Point3D(1.0D, 0.0D, 200.0D), +/* 20 */ new Point3D(0.75D, -0.75D, 200.0D), +/* 21 */ new Point3D(0.0D, -1.0D, 200.0D), +/* 22 */ new Point3D(-0.75D, -0.75D, 200.0D), +/* 23 */ new Point3D(-1.0D, 0.0D, 200.0D), +/* 24 */ new Point3D(-0.75D, 0.75D, 200.0D) }, +/* 26 */ { +/* 28 */ new Point3D(0.0D, 1.0D, -200.0D), +/* 29 */ new Point3D(0.75D, 0.75D, -200.0D), +/* 30 */ new Point3D(1.0D, 0.0D, 200.0D), +/* 31 */ new Point3D(0.75D, -0.75D, -200.0D), +/* 32 */ new Point3D(0.0D, -1.0D, 200.0D), +/* 33 */ new Point3D(-0.75D, -0.75D, -200.0D), +/* 34 */ new Point3D(-1.0D, 0.0D, 200.0D), +/* 35 */ new Point3D(-0.75D, 0.75D, -200.0D) }, +/* 37 */ { +/* 39 */ new Point3D(0.0D, 1.0D, 200.0D), +/* 40 */ new Point3D(0.0D, 1.0D, -200.0D), +/* 41 */ new Point3D(0.75D, 0.75D, -200.0D), +/* 42 */ new Point3D(0.75D, 0.75D, 200.0D) }, +/* 44 */ { +/* 46 */ new Point3D(0.75D, 0.75D, 200.0D), +/* 47 */ new Point3D(0.75D, 0.75D, -200.0D), +/* 48 */ new Point3D(1.0D, 0.0D, -200.0D), +/* 49 */ new Point3D(1.0D, 0.0D, 200.0D) }, +/* 51 */ { +/* 53 */ new Point3D(1.0D, 0.0D, 200.0D), +/* 54 */ new Point3D(1.0D, 0.0D, -200.0D), +/* 55 */ new Point3D(0.75D, -0.75D, -200.0D), +/* 56 */ new Point3D(0.75D, -0.75D, 200.0D) }, +/* 58 */ { +/* 60 */ new Point3D(0.75D, -0.75D, 200.0D), +/* 61 */ new Point3D(0.75D, -0.75D, -200.0D), +/* 62 */ new Point3D(0.0D, -1.0D, -200.0D), +/* 63 */ new Point3D(0.0D, -1.0D, 200.0D) }, +/* 66 */ { +/* 68 */ new Point3D(0.0D, -1.0D, 200.0D), +/* 69 */ new Point3D(0.0D, -1.0D, -200.0D), +/* 70 */ new Point3D(-0.75D, -0.75D, -200.0D), +/* 71 */ new Point3D(-0.75D, -0.75D, 200.0D) }, +/* 73 */ { +/* 75 */ new Point3D(-0.75D, -0.75D, 200.0D), +/* 76 */ new Point3D(-0.75D, -0.75D, -200.0D), +/* 77 */ new Point3D(-1.0D, 0.0D, -200.0D), +/* 78 */ new Point3D(-1.0D, 0.0D, 200.0D) }, +/* 80 */ { +/* 82 */ new Point3D(-1.0D, 0.0D, 200.0D), +/* 83 */ new Point3D(-1.0D, 0.0D, -200.0D), +/* 84 */ new Point3D(-0.75D, 0.75D, -200.0D), +/* 85 */ new Point3D(-0.75D, 0.75D, 200.0D) }, +/* 87 */ { +/* 89 */ new Point3D(-0.75D, 0.75D, 200.0D), +/* 90 */ new Point3D(-0.75D, 0.75D, -200.0D), +/* 91 */ new Point3D(0.0D, 1.0D, -200.0D), +/* 92 */ new Point3D(0.0D, 1.0D, 200.0D) } }, +/* 95 */ xoff, yoff, zoff, rotX, rotY, rotZ, graph); +/* 96 */ this.color = color; +/* */ } +/* */ public void invoke(Graphics g) { +/* 99 */ Color temp = g.getColor(); +/* 100 */ g.setColor(this.color); +/* 101 */ super.invoke(g); +/* 102 */ g.setColor(temp); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ZAxis + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ZAxisChar.java b/src/ZAxisChar.java new file mode 100644 index 0000000..7e118d8 --- /dev/null +++ b/src/ZAxisChar.java @@ -0,0 +1,97 @@ +/* */ import java.awt.Color; +/* */ import java.awt.Graphics; +/* */ +/* */ public class ZAxisChar extends Object3D +/* */ { +/* */ private Color color; +/* */ +/* */ public ZAxisChar(double xoff, double yoff, double zoff, double rotX, double rotY, double rotZ, CoordinateSystem graph, Color color) +/* */ { +/* 113 */ super(new Point3D[][] { +/* 15 */ { +/* 17 */ new Point3D(-2.5D, 3.0D, 0.0D), +/* 18 */ new Point3D(2.5D, 3.0D, 0.0D), +/* 19 */ new Point3D(2.5D, 2.0D, 0.0D), +/* 20 */ new Point3D(-1.5D, -2.0D, 0.0D), +/* 21 */ new Point3D(2.5D, -2.0D, 0.0D), +/* 22 */ new Point3D(2.5D, -3.0D, 0.0D), +/* 23 */ new Point3D(-2.5D, -3.0D, 0.0D), +/* 24 */ new Point3D(-2.5D, -2.0D, 0.0D), +/* 25 */ new Point3D(1.5D, 2.0D, 0.0D), +/* 26 */ new Point3D(-2.5D, 2.0D, 0.0D) }, +/* 28 */ { +/* 30 */ new Point3D(-2.5D, 3.0D, 3.0D), +/* 31 */ new Point3D(2.5D, 3.0D, 3.0D), +/* 32 */ new Point3D(2.5D, 2.0D, 3.0D), +/* 33 */ new Point3D(-1.5D, -2.0D, 3.0D), +/* 34 */ new Point3D(2.5D, -2.0D, 3.0D), +/* 35 */ new Point3D(2.5D, -3.0D, 3.0D), +/* 36 */ new Point3D(-2.5D, -3.0D, 3.0D), +/* 37 */ new Point3D(-2.5D, -2.0D, 3.0D), +/* 38 */ new Point3D(1.5D, 2.0D, 3.0D), +/* 39 */ new Point3D(-2.5D, 2.0D, 3.0D) }, +/* 41 */ { +/* 43 */ new Point3D(-2.5D, 3.0D, 0.0D), +/* 44 */ new Point3D(-2.5D, 3.0D, 3.0D), +/* 45 */ new Point3D(-2.5D, 2.0D, 3.0D), +/* 46 */ new Point3D(-2.5D, 2.0D, 0.0D) }, +/* 48 */ { +/* 50 */ new Point3D(-2.5D, 2.0D, 0.0D), +/* 51 */ new Point3D(-2.5D, 2.0D, 3.0D), +/* 52 */ new Point3D(1.5D, 2.0D, 3.0D), +/* 53 */ new Point3D(1.5D, 2.0D, 0.0D) }, +/* 55 */ { +/* 57 */ new Point3D(1.5D, 2.0D, 0.0D), +/* 58 */ new Point3D(1.5D, 2.0D, 3.0D), +/* 59 */ new Point3D(-2.5D, -2.0D, 3.0D), +/* 60 */ new Point3D(-2.5D, -2.0D, 0.0D) }, +/* 62 */ { +/* 64 */ new Point3D(-2.5D, -2.0D, 0.0D), +/* 65 */ new Point3D(-2.5D, -2.0D, 3.0D), +/* 66 */ new Point3D(-2.5D, -3.0D, 3.0D), +/* 67 */ new Point3D(-2.5D, -3.0D, 0.0D) }, +/* 70 */ { +/* 72 */ new Point3D(-2.5D, -3.0D, 0.0D), +/* 73 */ new Point3D(-2.5D, -3.0D, 3.0D), +/* 74 */ new Point3D(2.5D, -3.0D, 3.0D), +/* 75 */ new Point3D(2.5D, -3.0D, 0.0D) }, +/* 77 */ { +/* 79 */ new Point3D(2.5D, -2.0D, 0.0D), +/* 80 */ new Point3D(2.5D, -2.0D, 3.0D), +/* 81 */ new Point3D(2.5D, -3.0D, 3.0D), +/* 82 */ new Point3D(2.5D, -3.0D, 0.0D) }, +/* 84 */ { +/* 86 */ new Point3D(2.5D, -2.0D, 0.0D), +/* 87 */ new Point3D(2.5D, -2.0D, 3.0D), +/* 88 */ new Point3D(-1.5D, -2.0D, 3.0D), +/* 89 */ new Point3D(-1.5D, -2.0D, 0.0D) }, +/* 91 */ { +/* 93 */ new Point3D(2.5D, 2.0D, 0.0D), +/* 94 */ new Point3D(2.5D, 2.0D, 3.0D), +/* 95 */ new Point3D(-1.5D, -2.0D, 3.0D), +/* 96 */ new Point3D(-1.5D, -2.0D, 0.0D) }, +/* 98 */ { +/* 100 */ new Point3D(2.5D, 3.0D, 0.0D), +/* 101 */ new Point3D(2.5D, 3.0D, 3.0D), +/* 102 */ new Point3D(2.5D, 2.0D, 3.0D), +/* 103 */ new Point3D(2.5D, 2.0D, 0.0D) }, +/* 105 */ { +/* 107 */ new Point3D(-2.5D, -3.0D, 0.0D), +/* 108 */ new Point3D(-2.5D, -3.0D, 3.0D), +/* 109 */ new Point3D(2.5D, -3.0D, 3.0D), +/* 110 */ new Point3D(2.5D, -3.0D, 0.0D) } }, +/* 113 */ xoff, yoff, zoff, rotX, rotY, rotZ, graph); +/* 114 */ this.color = color; +/* */ } +/* */ public void invoke(Graphics g) { +/* 117 */ Color temp = g.getColor(); +/* 118 */ g.setColor(this.color); +/* 119 */ super.invoke(g); +/* 120 */ g.setColor(temp); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ZAxisChar + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/ZGraphEquationChooser.java b/src/ZGraphEquationChooser.java new file mode 100644 index 0000000..0743485 --- /dev/null +++ b/src/ZGraphEquationChooser.java @@ -0,0 +1,106 @@ +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Font; +/* */ import java.awt.Toolkit; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JTextField; +/* */ +/* */ public class ZGraphEquationChooser extends JFrame +/* */ implements ActionListener +/* */ { +/* */ private JButton OK; +/* */ private JButton cancel; +/* */ private Flagger flg; +/* */ private JPanel main; +/* 25 */ private char replaceX = 'X'; +/* 26 */ private char replaceY = 'Y'; +/* 27 */ private JTextField[] fields = { +/* 28 */ new JTextField(25), +/* 29 */ new JTextField(25), +/* 30 */ new JTextField(25), +/* 31 */ new JTextField(25), +/* 32 */ new JTextField(25) }; +/* */ +/* 34 */ private JLabel[] lbls = { +/* 35 */ new JLabel("z1 = "), +/* 36 */ new JLabel("z2 = "), +/* 37 */ new JLabel("z3 = "), +/* 38 */ new JLabel("z4 = "), +/* 39 */ new JLabel("z5 = ") }; +/* */ +/* */ public ZGraphEquationChooser(Flagger caller, String[] originals) +/* */ { +/* 42 */ this.flg = caller; +/* 43 */ this.OK = new JButton("Set"); +/* 44 */ this.cancel = new JButton("Cancel"); +/* 45 */ for (JTextField i : this.fields) { +/* 46 */ i.setFont(new Font("Times New Roman", 2, 12)); +/* */ } +/* 48 */ for (int i = 0; (i < originals.length) && (i < this.fields.length); i++) +/* */ { +/* 50 */ this.fields[i].setText(originals[i]); +/* */ } +/* 52 */ this.OK.addActionListener(this); +/* 53 */ this.cancel.addActionListener(this); +/* */ +/* 55 */ this.main = new JPanel(); +/* 56 */ this.main.setLayout(new BoxLayout(this.main, 1)); +/* */ +/* 58 */ for (int i = 0; i < this.fields.length; i++) { +/* 59 */ JPanel temp = new JPanel(new FlowLayout()); +/* 60 */ temp.add(this.lbls[i]); +/* 61 */ temp.add(this.fields[i]); +/* 62 */ this.main.add(temp); +/* */ } +/* */ +/* 65 */ JPanel temp = new JPanel(new FlowLayout()); +/* 66 */ temp.add(this.OK); +/* 67 */ temp.add(this.cancel); +/* 68 */ this.main.add(temp); +/* 69 */ add(this.main); +/* 70 */ pack(); +/* 71 */ setIconImage(Toolkit.getDefaultToolkit().getImage("modulus_symbol.png")); +/* */ } +/* */ +/* */ public String[] getEqs() { +/* 75 */ return new String[] { +/* 76 */ this.fields[0].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y"), +/* 77 */ this.fields[1].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y"), +/* 78 */ this.fields[2].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y"), +/* 79 */ this.fields[3].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y"), +/* 80 */ this.fields[4].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y") }; +/* */ } +/* */ +/* */ public boolean isFocusable() { +/* 84 */ return true; +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) { +/* 88 */ if (e.getSource() == this.OK) { +/* 89 */ ControlPanel.setGraphFunctions( +/* 90 */ new String[] { +/* 91 */ this.fields[0].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y"), +/* 92 */ this.fields[1].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y"), +/* 93 */ this.fields[2].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y"), +/* 94 */ this.fields[3].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y"), +/* 95 */ this.fields[4].getText().replaceAll(this.replaceX, "x").replaceAll(this.replaceY, "y") }); +/* */ +/* 98 */ this.flg.flag2(getEqs()); +/* */ } +/* 100 */ setVisible(false); +/* */ } +/* */ +/* */ public void setXReplace(char xReplace) +/* */ { +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ZGraphEquationChooser + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/equations.jar b/src/equations.jar Binary files differnew file mode 100644 index 0000000..5e868e4 --- /dev/null +++ b/src/equations.jar diff --git a/src/ops.jar b/src/ops.jar Binary files differnew file mode 100644 index 0000000..dae93ce --- /dev/null +++ b/src/ops.jar diff --git a/src/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java b/src/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java new file mode 100644 index 0000000..9cddcf9 --- /dev/null +++ b/src/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java @@ -0,0 +1,104 @@ +/* */ package org.eclipse.jdt.internal.jarinjarloader; +/* */ +/* */ import java.io.IOException; +/* */ import java.io.InputStream; +/* */ import java.io.PrintStream; +/* */ import java.lang.reflect.InvocationTargetException; +/* */ import java.lang.reflect.Method; +/* */ import java.net.URL; +/* */ import java.net.URLClassLoader; +/* */ import java.util.ArrayList; +/* */ import java.util.Enumeration; +/* */ import java.util.List; +/* */ import java.util.jar.Attributes; +/* */ import java.util.jar.Manifest; +/* */ +/* */ public class JarRsrcLoader +/* */ { +/* */ public static void main(String[] args) +/* */ throws ClassNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException, IOException +/* */ { +/* 41 */ ManifestInfo mi = getManifestInfo(); +/* 42 */ ClassLoader cl = Thread.currentThread().getContextClassLoader(); +/* 43 */ URL.setURLStreamHandlerFactory(new RsrcURLStreamHandlerFactory(cl)); +/* 44 */ URL[] rsrcUrls = new URL[mi.rsrcClassPath.length]; +/* 45 */ for (int i = 0; i < mi.rsrcClassPath.length; i++) { +/* 46 */ String rsrcPath = mi.rsrcClassPath[i]; +/* 47 */ if (rsrcPath.endsWith("/")) +/* 48 */ rsrcUrls[i] = new URL("rsrc:" + rsrcPath); +/* */ else +/* 50 */ rsrcUrls[i] = new URL("jar:rsrc:" + rsrcPath + "!/"); +/* */ } +/* 52 */ ClassLoader jceClassLoader = new URLClassLoader(rsrcUrls, null); +/* 53 */ Thread.currentThread().setContextClassLoader(jceClassLoader); +/* 54 */ Class c = Class.forName(mi.rsrcMainClass, true, jceClassLoader); +/* 55 */ Method main = c.getMethod("main", new Class[] { args.getClass() }); +/* 56 */ main.invoke(null, new Object[] { args }); +/* */ } +/* */ +/* */ private static ManifestInfo getManifestInfo() throws IOException +/* */ { +/* 61 */ Enumeration resEnum = Thread.currentThread().getContextClassLoader().getResources("META-INF/MANIFEST.MF"); +/* 62 */ while (resEnum.hasMoreElements()) { +/* */ try { +/* 64 */ URL url = (URL)resEnum.nextElement(); +/* 65 */ InputStream is = url.openStream(); +/* 66 */ if (is != null) { +/* 67 */ ManifestInfo result = new ManifestInfo(null); +/* 68 */ Manifest manifest = new Manifest(is); +/* 69 */ Attributes mainAttribs = manifest.getMainAttributes(); +/* 70 */ result.rsrcMainClass = mainAttribs.getValue("Rsrc-Main-Class"); +/* 71 */ String rsrcCP = mainAttribs.getValue("Rsrc-Class-Path"); +/* 72 */ if (rsrcCP == null) +/* 73 */ rsrcCP = ""; +/* 74 */ result.rsrcClassPath = splitSpaces(rsrcCP); +/* 75 */ if ((result.rsrcMainClass != null) && (!result.rsrcMainClass.trim().equals(""))) +/* 76 */ return result; +/* */ } +/* */ } +/* */ catch (Exception localException) +/* */ { +/* */ } +/* */ } +/* 83 */ System.err.println("Missing attributes for RsrcLoader in Manifest (Rsrc-Main-Class, Rsrc-Class-Path)"); +/* 84 */ return null; +/* */ } +/* */ +/* */ private static String[] splitSpaces(String line) +/* */ { +/* 95 */ if (line == null) +/* 96 */ return null; +/* 97 */ List result = new ArrayList(); +/* 98 */ int firstPos = 0; +/* 99 */ while (firstPos < line.length()) { +/* 100 */ int lastPos = line.indexOf(' ', firstPos); +/* 101 */ if (lastPos == -1) +/* 102 */ lastPos = line.length(); +/* 103 */ if (lastPos > firstPos) { +/* 104 */ result.add(line.substring(firstPos, lastPos)); +/* */ } +/* 106 */ firstPos = lastPos + 1; +/* */ } +/* 108 */ return (String[])result.toArray(new String[result.size()]); +/* */ } +/* */ +/* */ private static class ManifestInfo +/* */ { +/* */ String rsrcMainClass; +/* */ String[] rsrcClassPath; +/* */ +/* */ private ManifestInfo() +/* */ { +/* */ } +/* */ +/* */ ManifestInfo(ManifestInfo paramManifestInfo) +/* */ { +/* 35 */ this(); +/* */ } +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java b/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java new file mode 100644 index 0000000..9cc10e7 --- /dev/null +++ b/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java @@ -0,0 +1,36 @@ +/* */ package org.eclipse.jdt.internal.jarinjarloader; +/* */ +/* */ import java.io.IOException; +/* */ import java.io.InputStream; +/* */ import java.net.MalformedURLException; +/* */ import java.net.URL; +/* */ import java.net.URLConnection; +/* */ import java.net.URLDecoder; +/* */ +/* */ public class RsrcURLConnection extends URLConnection +/* */ { +/* */ private ClassLoader classLoader; +/* */ +/* */ public RsrcURLConnection(URL url, ClassLoader classLoader) +/* */ { +/* 34 */ super(url); +/* 35 */ this.classLoader = classLoader; +/* */ } +/* */ +/* */ public void connect() throws IOException { +/* */ } +/* */ +/* */ public InputStream getInputStream() throws IOException { +/* 42 */ String file = URLDecoder.decode(this.url.getFile(), "UTF-8"); +/* 43 */ InputStream result = this.classLoader.getResourceAsStream(file); +/* 44 */ if (result == null) { +/* 45 */ throw new MalformedURLException("Could not open InputStream for URL '" + this.url + "'"); +/* */ } +/* 47 */ return result; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: org.eclipse.jdt.internal.jarinjarloader.RsrcURLConnection + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandler.java b/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandler.java new file mode 100644 index 0000000..0744c28 --- /dev/null +++ b/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandler.java @@ -0,0 +1,50 @@ +/* */ package org.eclipse.jdt.internal.jarinjarloader; +/* */ +/* */ import java.io.IOException; +/* */ import java.net.URL; +/* */ import java.net.URLConnection; +/* */ import java.net.URLStreamHandler; +/* */ +/* */ public class RsrcURLStreamHandler extends URLStreamHandler +/* */ { +/* */ private ClassLoader classLoader; +/* */ +/* */ public RsrcURLStreamHandler(ClassLoader classLoader) +/* */ { +/* 33 */ this.classLoader = classLoader; +/* */ } +/* */ +/* */ protected URLConnection openConnection(URL u) throws IOException { +/* 37 */ return new RsrcURLConnection(u, this.classLoader); +/* */ } +/* */ +/* */ protected void parseURL(URL url, String spec, int start, int limit) +/* */ { +/* */ String file; +/* */ String file; +/* 42 */ if (spec.startsWith("rsrc:")) { +/* 43 */ file = spec.substring(5); +/* */ } +/* */ else +/* */ { +/* */ String file; +/* 44 */ if (url.getFile().equals("./")) { +/* 45 */ file = spec; +/* */ } +/* */ else +/* */ { +/* */ String file; +/* 46 */ if (url.getFile().endsWith("/")) +/* 47 */ file = url.getFile() + spec; +/* */ else +/* 49 */ file = spec; +/* */ } +/* */ } +/* 50 */ setURL(url, "rsrc", "", -1, null, null, file, null, null); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: org.eclipse.jdt.internal.jarinjarloader.RsrcURLStreamHandler + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandlerFactory.java b/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandlerFactory.java new file mode 100644 index 0000000..8d0adce --- /dev/null +++ b/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLStreamHandlerFactory.java @@ -0,0 +1,34 @@ +/* */ package org.eclipse.jdt.internal.jarinjarloader; +/* */ +/* */ import java.net.URLStreamHandler; +/* */ import java.net.URLStreamHandlerFactory; +/* */ +/* */ public class RsrcURLStreamHandlerFactory +/* */ implements URLStreamHandlerFactory +/* */ { +/* */ private ClassLoader classLoader; +/* */ private URLStreamHandlerFactory chainFac; +/* */ +/* */ public RsrcURLStreamHandlerFactory(ClassLoader cl) +/* */ { +/* 30 */ this.classLoader = cl; +/* */ } +/* */ +/* */ public URLStreamHandler createURLStreamHandler(String protocol) { +/* 34 */ if ("rsrc".equals(protocol)) +/* 35 */ return new RsrcURLStreamHandler(this.classLoader); +/* 36 */ if (this.chainFac != null) +/* 37 */ return this.chainFac.createURLStreamHandler(protocol); +/* 38 */ return null; +/* */ } +/* */ +/* */ public void setURLStreamHandlerFactory(URLStreamHandlerFactory fac) +/* */ { +/* 50 */ this.chainFac = fac; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: org.eclipse.jdt.internal.jarinjarloader.RsrcURLStreamHandlerFactory + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/utilities/BaseConverter.java b/src/utilities/BaseConverter.java new file mode 100644 index 0000000..c4fb116 --- /dev/null +++ b/src/utilities/BaseConverter.java @@ -0,0 +1,72 @@ +/* */ package utilities; +/* */ +/* */ public class BaseConverter +/* */ { +/* */ public static final String CHARACTERS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +/* */ +/* */ public static double convertToDecimal(String original, int base) +/* */ { +/* 12 */ int neg = 1; +/* 13 */ if (original.startsWith("-")) { +/* 14 */ original = original.substring(1); +/* 15 */ neg = -1; +/* */ } +/* 17 */ if (original.contains(".")) return neg * convertToDecimal(original, base, original.indexOf(".") - 1); +/* 18 */ return neg * convertToDecimal(original, base, original.length() - 1); +/* */ } +/* */ private static double convertToDecimal(String original, int base, int length) { +/* 21 */ if (base == 10) return Double.parseDouble(original); +/* 22 */ if (base == 1) return original.length(); +/* 23 */ if (original.length() == 0) return 0.0D; +/* 24 */ if (original.charAt(0) == '.') return convertToDecimal(original.substring(1), base, length); +/* 25 */ return Math.pow(base, length) * "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(original.charAt(0)) + convertToDecimal(original.substring(1), base, length - 1); +/* */ } +/* */ public static String convertFromDecimal(double original, int base) { +/* 28 */ if (original < 0.0D) return "-" + convertFromDecimal(-1.0D * original, base); +/* 29 */ if ((original < 1.0D) && (original > 0.0D)) return "0" + convertFromDecimal(1.0D + original, base).substring(1); +/* 30 */ if (base == 10) return original; +/* 31 */ if (base == 1) { +/* 32 */ String ret = ""; +/* 33 */ for (int i = 0; i < original; i++) ret = ret + "0"; +/* 34 */ return ret; +/* */ } +/* 36 */ double pwr = nearestLog(()original, base); +/* 37 */ String ret = ""; +/* 38 */ boolean lessThan = false; +/* 39 */ while ((original > 1.E-09D) || (pwr >= 1.0D)) { +/* 40 */ if ((!lessThan) && (pwr < 1.0D)) { +/* 41 */ ret = ret + "."; +/* 42 */ lessThan = true; +/* */ } +/* 44 */ if (original >= pwr) { +/* 45 */ ret = ret + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt((int)(original / pwr)); +/* 46 */ original %= pwr; +/* */ } +/* */ else { +/* 49 */ ret = ret + 0; +/* */ } +/* 51 */ pwr /= base; +/* */ } +/* 53 */ return ret; +/* */ } +/* */ public static String convertFromDecimal(long original, int base, long start, int digits) { +/* 56 */ if (original < base) { +/* 57 */ String ret = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt((int)original); +/* 58 */ while (digits != 0) { +/* 59 */ ret = ret + 0; +/* 60 */ digits--; +/* */ } +/* 62 */ return ret; +/* */ } +/* */ +/* 65 */ return "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt((int)(original / start)) + convertFromDecimal(original % start, base, start / base, digits - 1); +/* */ } +/* */ public static long nearestLog(long start, int base) { +/* 68 */ return ()Math.pow(base, (int)(Math.log(start) / Math.log(base))); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: utilities.BaseConverter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/utilities/DecimalFormatter.java b/src/utilities/DecimalFormatter.java new file mode 100644 index 0000000..a6b084e --- /dev/null +++ b/src/utilities/DecimalFormatter.java @@ -0,0 +1,109 @@ +/* */ package utilities; +/* */ +/* */ import java.math.BigDecimal; +/* */ import java.math.MathContext; +/* */ +/* */ public abstract class DecimalFormatter +/* */ { +/* */ private int sigFigs; +/* */ private String sigstr; +/* */ private boolean flt; +/* */ +/* */ public DecimalFormatter(int sigFigs, boolean flt) +/* */ { +/* 17 */ this.sigFigs = sigFigs; +/* 18 */ this.flt = flt; +/* 19 */ this.sigstr = ""; +/* 20 */ for (int i = 0; i < sigFigs + 1; i++) this.sigstr += "0"; +/* */ } +/* */ +/* 23 */ public String scientificNotation(BigDecimal d) { int hold = 0; +/* 24 */ boolean negatory = d.compareTo(BigDecimal.ZERO) == -1; +/* 25 */ if (negatory) d = d.abs(); +/* 26 */ while (d.compareTo(BigDecimal.ONE) == -1) +/* */ { +/* 28 */ d = d.multiply(BigDecimal.TEN); +/* 29 */ hold--; +/* */ } +/* 31 */ while (d.compareTo(BigDecimal.TEN) == 1) +/* */ { +/* 33 */ d = d.divide(BigDecimal.TEN); +/* 34 */ hold++; +/* */ } +/* */ +/* 37 */ String dec = roundTo(d, this.sigFigs - 1).toString(); +/* 38 */ if (!this.flt) { +/* 39 */ dec = removeTrailingZeros(dec); +/* */ } +/* 41 */ return (negatory ? "-" : "") + dec.substring(0, this.sigFigs + 1) + "*10^" + hold; } +/* */ +/* */ public String scientificNotation(String num) { +/* 44 */ return scientificNotation(new BigDecimal(num)); +/* */ } +/* */ public String scientificNotation(double num) { +/* 47 */ return scientificNotation(new BigDecimal(num)); +/* */ } +/* */ public String eNotation(BigDecimal d) { +/* 50 */ int hold = 0; +/* 51 */ boolean negatory = d.compareTo(BigDecimal.ZERO) == -1; +/* 52 */ if (negatory) d = d.abs(); +/* 53 */ while (d.compareTo(BigDecimal.ONE) == -1) +/* */ { +/* 55 */ d = d.multiply(BigDecimal.TEN); +/* 56 */ hold--; +/* */ } +/* 58 */ while (d.compareTo(BigDecimal.TEN) == 1) +/* */ { +/* 60 */ d = d.divide(BigDecimal.TEN); +/* 61 */ hold++; +/* */ } +/* */ +/* 64 */ String dec = roundTo(d, this.sigFigs - 1).toString(); +/* 65 */ if (!this.flt) { +/* 66 */ dec = removeTrailingZeros(dec); +/* */ } +/* 68 */ return (negatory ? "-" : "") + dec + "e" + hold; +/* */ } +/* */ public static BigDecimal roundTo(BigDecimal b, int to) { +/* 71 */ b = b.movePointRight(to); +/* 72 */ b = b.round(MathContext.DECIMAL64); +/* 73 */ b = b.movePointLeft(to); +/* 74 */ return b; +/* */ } +/* */ public String eNotation(String num) { +/* 77 */ return eNotation(new BigDecimal(num)); +/* */ } +/* */ public String eNotation(double num) { +/* 80 */ return eNotation(new BigDecimal(num)); +/* */ } +/* */ public String getSigFigs(String num) { +/* 83 */ boolean rec = false; +/* 84 */ String ret = ""; +/* 85 */ int cnt = 0; +/* 86 */ for (int i = 0; (i < num.length()) && (cnt < this.sigFigs); i++) { +/* 87 */ ret = ret + num.charAt(i); +/* 88 */ if ((num.charAt(i) != '0') && (num.charAt(i) != '.') && (!rec)) rec = true; +/* 89 */ if (rec) cnt++; +/* */ } +/* 91 */ return ret; +/* */ } +/* */ private static String removeTrailingZeros(String str) { +/* 94 */ if (!str.contains(".")) return str; +/* 95 */ for (int i = str.length() - 1; i >= 0; i--) { +/* 96 */ if (str.charAt(i) != '0') +/* 97 */ return str.substring(0, i + 1); +/* */ } +/* 99 */ return str; +/* */ } +/* */ public abstract String format(String paramString); +/* */ +/* 103 */ public void setFigs(int sigFigs) { this.sigFigs = sigFigs; +/* 104 */ this.sigstr = ""; +/* 105 */ for (int i = 0; i < sigFigs + 1; i++) this.sigstr += "0"; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: utilities.DecimalFormatter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/utilities/EFormatter.java b/src/utilities/EFormatter.java new file mode 100644 index 0000000..d9a060b --- /dev/null +++ b/src/utilities/EFormatter.java @@ -0,0 +1,26 @@ +/* */ package utilities; +/* */ +/* */ public class EFormatter extends DecimalFormatter +/* */ { +/* */ private int base; +/* */ +/* */ public EFormatter(int radix, int base, boolean flt) +/* */ { +/* 14 */ super(radix, flt); +/* 15 */ this.base = base; +/* */ } +/* */ +/* */ public String format(String str) { +/* 19 */ if (Double.parseDouble(str) < this.base) return str; +/* 20 */ String temp = super.eNotation(str); +/* 21 */ String exp = temp.substring(temp.lastIndexOf("e") + 1); +/* 22 */ temp = temp.substring(0, temp.lastIndexOf("e") + 1); +/* 23 */ exp = BaseConverter.convertFromDecimal(Long.parseLong(exp), this.base); +/* 24 */ return temp + exp; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: utilities.EFormatter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/utilities/NoFormatter.java b/src/utilities/NoFormatter.java new file mode 100644 index 0000000..9130700 --- /dev/null +++ b/src/utilities/NoFormatter.java @@ -0,0 +1,17 @@ +/* */ package utilities; +/* */ +/* */ public class NoFormatter extends DecimalFormatter +/* */ { +/* */ public NoFormatter(int radix) +/* */ { +/* 13 */ super(radix, true); +/* */ } +/* */ public String format(String str) { +/* 16 */ return str; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: utilities.NoFormatter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/utilities/PublicFileClassLoader.java b/src/utilities/PublicFileClassLoader.java new file mode 100644 index 0000000..addf4f9 --- /dev/null +++ b/src/utilities/PublicFileClassLoader.java @@ -0,0 +1,44 @@ +/* */ package utilities; +/* */ +/* */ import java.io.File; +/* */ import java.net.MalformedURLException; +/* */ import java.net.URI; +/* */ import java.net.URL; +/* */ import java.net.URLClassLoader; +/* */ +/* */ public class PublicFileClassLoader extends URLClassLoader +/* */ { +/* */ public PublicFileClassLoader() +/* */ { +/* 15 */ super(new URL[0]); +/* */ } +/* */ public PublicFileClassLoader(String dir) throws MalformedURLException { +/* 18 */ this(new File(dir)); +/* */ } +/* */ public PublicFileClassLoader(File directory) throws MalformedURLException { +/* 21 */ super(new URL[] { directory.toURI().toURL() }); +/* */ } +/* */ public PublicFileClassLoader(File[] dirs) throws MalformedURLException { +/* 24 */ this(); +/* 25 */ for (File f : dirs) addURL(f.toURI().toURL()); +/* */ } +/* */ +/* 28 */ public void addURL(URL url) { super.addURL(url); } +/* */ +/* */ public boolean addDir(String dir) { +/* 31 */ return addDir(new File(dir)); +/* */ } +/* */ public boolean addDir(File dir) { +/* */ try { +/* 35 */ addURL(dir.toURI().toURL()); +/* 36 */ return true; +/* */ } catch (MalformedURLException e) { +/* */ } +/* 39 */ return false; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: utilities.PublicFileClassLoader + * JD-Core Version: 0.6.2 + */
\ No newline at end of file diff --git a/src/utilities/ScientificFormatter.java b/src/utilities/ScientificFormatter.java new file mode 100644 index 0000000..65c8afe --- /dev/null +++ b/src/utilities/ScientificFormatter.java @@ -0,0 +1,26 @@ +/* */ package utilities; +/* */ +/* */ public class ScientificFormatter extends DecimalFormatter +/* */ { +/* */ private int base; +/* */ +/* */ public ScientificFormatter(int radix, int base, boolean flt) +/* */ { +/* 14 */ super(radix, flt); +/* 15 */ this.base = base; +/* */ } +/* */ public String format(String str) { +/* 18 */ if (Double.parseDouble(str) < this.base) return str; +/* 19 */ String temp = super.scientificNotation(str); +/* 20 */ String exp = temp.substring(temp.lastIndexOf("*10^") + 4); +/* 21 */ temp = temp.substring(0, temp.lastIndexOf("*10^") + 4); +/* 22 */ exp = BaseConverter.convertFromDecimal(Long.parseLong(exp), this.base); +/* */ +/* 24 */ return temp + exp; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: utilities.ScientificFormatter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file |