package gui.animate.cellanimate; import java.text.DecimalFormat; class CellState implements Matrix { private String name; private CellPosition dim = null; private boolean only2D = true; private double[] matrix = null; public CellState(CellPosition dimension, double initialvalue) { int size = dimension.size(); if(size==0) throw new IndexOutOfBoundsException("0-dimension Matrix"); else if (size==1) { dim = new CellPosition(2); dim.setValue(0, 1); dim.setValue(1, dimension.getValue(0)); } else { dim = new CellPosition(dimension); } size = 1; for(int i=0; i=0 && y>=0 && x=width) return str; boolean rightAlign = true; if(width<0) { rightAlign = false; width = -width; } StringBuffer buf = new StringBuffer(str); for(int i=buf.length(); i3) { for(i=0; i0) { number_pattern.append('.'); for(i=0; i