The symbol '.' is now a NumericChar Block

This commit is contained in:
Cavallium 2018-03-12 09:56:08 +01:00
parent 4bb28c3f39
commit 9fb9335e97
3 changed files with 7 additions and 6 deletions

View File

@ -6,7 +6,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>

View File

@ -8,9 +8,9 @@ import org.warp.picalculator.math.MathematicalSymbols;
import org.warp.picalculator.math.parser.features.FeatureChar;
import org.warp.picalculator.math.parser.features.interfaces.Feature;
public class BlockNumber extends BlockChar {
public class BlockNumericChar extends BlockChar {
public BlockNumber(char ch) {
public BlockNumericChar(char ch) {
super(ch);
}

View File

@ -8,7 +8,7 @@ import org.warp.picalculator.gui.expression.blocks.Block;
import org.warp.picalculator.gui.expression.blocks.BlockChar;
import org.warp.picalculator.gui.expression.blocks.BlockContainer;
import org.warp.picalculator.gui.expression.blocks.BlockDivision;
import org.warp.picalculator.gui.expression.blocks.BlockNumber;
import org.warp.picalculator.gui.expression.blocks.BlockNumericChar;
import org.warp.picalculator.gui.expression.blocks.BlockParenthesis;
import org.warp.picalculator.gui.expression.blocks.BlockPower;
import org.warp.picalculator.gui.expression.blocks.BlockReference;
@ -70,7 +70,8 @@ public class NormalInputContainer extends InputContainer {
case '7':
case '8':
case '9':
return new BlockNumber(c);
case '.':
return new BlockNumericChar(c);
case MathematicalSymbols.SINE:
return new BlockSine();
case MathematicalSymbols.PI:
@ -102,7 +103,7 @@ public class NormalInputContainer extends InputContainer {
currentBlock = currentBlock.getPreviousBlock();
if (currentBlock == null) break;
Block b = currentBlock.get();
if (b instanceof BlockNumber || b instanceof BlockVariable) {
if (b instanceof BlockNumericChar || b instanceof BlockVariable) {
if (!groupedBefore) {
groupedBefore = true;
}