-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
723 additions
and
60 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- /dev/null | ||
+++ src/main/java/com/lushprojects/circuitjs1/client/EditDialog.java | ||
@@ -162,6 +162,10 @@ | ||
if (ei.text == null) { | ||
ei.textf.setText(unitString(ei)); | ||
} | ||
+ if (ei.isColor){ | ||
+ ei.textf.getElement().setAttribute("type", "color"); | ||
+ ei.textf.getElement().setAttribute("style", "width:178px;padding:0"); | ||
+ } | ||
} | ||
if (vp.getWidgetCount() > 15) { | ||
// start a new column | ||
@@ -272,6 +276,8 @@ | ||
adj.setSliderValue(ei.value); | ||
} | ||
} | ||
+ cframe.unsavedChanges = true; | ||
+ cframe.changeWindowTitle(true); | ||
cframe.needAnalyze(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- /dev/null | ||
+++ src/main/java/com/lushprojects/circuitjs1/client/EditInfo.java | ||
@@ -77,6 +77,7 @@ | ||
boolean dimensionless; | ||
boolean noSliders; | ||
double minVal, maxVal; | ||
+ boolean isColor = false; | ||
|
||
// for slider dialog | ||
TextBox minBox, maxBox, labelBox; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- /dev/null | ||
+++ src/main/java/com/lushprojects/circuitjs1/client/EditOptions.java | ||
@@ -55,16 +55,36 @@ | ||
return ei; | ||
} | ||
|
||
- if (n == 3) | ||
- return new EditInfo("Positive Color", CircuitElm.positiveColor.getHexValue()); | ||
- if (n == 4) | ||
- return new EditInfo("Negative Color", CircuitElm.negativeColor.getHexValue()); | ||
- if (n == 5) | ||
- return new EditInfo("Neutral Color", CircuitElm.neutralColor.getHexValue()); | ||
- if (n == 6) | ||
- return new EditInfo("Selection Color", CircuitElm.selectColor.getHexValue()); | ||
- if (n == 7) | ||
- return new EditInfo("Current Color", CircuitElm.currentColor.getHexValue()); | ||
+ if (n == 3){ | ||
+ EditInfo ei = new EditInfo("Positive Color", CircuitElm.positiveColor.getHexValue()); | ||
+ ei.isColor = true; | ||
+ return ei; | ||
+ } | ||
+ | ||
+ if (n == 4){ | ||
+ EditInfo ei = new EditInfo("Negative Color", CircuitElm.negativeColor.getHexValue()); | ||
+ ei.isColor = true; | ||
+ return ei; | ||
+ } | ||
+ | ||
+ if (n == 5){ | ||
+ EditInfo ei = new EditInfo("Neutral Color", CircuitElm.neutralColor.getHexValue()); | ||
+ ei.isColor = true; | ||
+ return ei; | ||
+ } | ||
+ | ||
+ if (n == 6){ | ||
+ EditInfo ei = new EditInfo("Selection Color", CircuitElm.selectColor.getHexValue()); | ||
+ ei.isColor = true; | ||
+ return ei; | ||
+ } | ||
+ | ||
+ if (n == 7){ | ||
+ EditInfo ei = new EditInfo("Current Color", CircuitElm.currentColor.getHexValue()); | ||
+ ei.isColor = true; | ||
+ return ei; | ||
+ } | ||
+ | ||
if (n == 8) | ||
return new EditInfo("# of Decimal Digits (short format)", CircuitElm.shortDecimalDigits); | ||
if (n == 9) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- /dev/null | ||
+++ src/main/java/com/lushprojects/circuitjs1/client/LoadFile.java | ||
@@ -37,7 +37,7 @@ | ||
sim.readCircuit(s); | ||
sim.createNewLoadFile(); | ||
sim.setCircuitTitle(t); | ||
- ExportAsLocalFileDialog.setLastFileName(t); | ||
+ sim.setLastFileName(t); | ||
sim.unsavedChanges = false; | ||
} | ||
|
||
@@ -57,6 +57,16 @@ | ||
} | ||
|
||
|
||
+ public native String getPath() | ||
+ /*-{ | ||
+ return $doc.getElementById("LoadFileElement").value; | ||
+ }-*/; | ||
+ | ||
+ public native String getFileName() | ||
+ /*-{ | ||
+ return $doc.getElementById("LoadFileElement").files[0].name; | ||
+ }-*/; | ||
+ | ||
public final native void click() | ||
/*-{ | ||
$doc.getElementById("LoadFileElement").click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters