void setRelateLabel(JLabel lbl, int imValue) { buf.setCharAt(0, org.locationtech.jts.geom.Dimension.toDimensionSymbol(imValue)); lbl.setText(buf.toString()); }
/** * Changes the elements of this <code>IntersectionMatrix</code> to the * dimension symbols in <code>dimensionSymbols</code>. * *@param dimensionSymbols nine dimension symbols to which to set this <code>IntersectionMatrix</code> * s elements. Possible values are <code>{T, F, * , 0, 1, 2}</code> */ public void set(String dimensionSymbols) { for (int i = 0; i < dimensionSymbols.length(); i++) { int row = i / 3; int col = i % 3; matrix[row][col] = Dimension.toDimensionValue(dimensionSymbols.charAt(i)); } }
/** * Returns a nine-character <code>String</code> representation of this <code>IntersectionMatrix</code> * . * *@return the nine dimension symbols of this <code>IntersectionMatrix</code> * in row-major order. */ public String toString() { StringBuilder builder = new StringBuilder("123456789"); for (int ai = 0; ai < 3; ai++) { for (int bi = 0; bi < 3; bi++) { builder.setCharAt(3 * ai + bi, Dimension.toDimensionSymbol(matrix[ai][bi])); } } return builder.toString(); } }
/** * For each element in this <code>IntersectionMatrix</code>, changes the * element to the corresponding minimum dimension symbol if the element is * less. * *@param minimumDimensionSymbols nine dimension symbols with which to * compare the elements of this <code>IntersectionMatrix</code>. The * order of dimension values from least to greatest is <code>{DONTCARE, TRUE, FALSE, 0, 1, 2}</code> * . */ public void setAtLeast(String minimumDimensionSymbols) { for (int i = 0; i < minimumDimensionSymbols.length(); i++) { int row = i / 3; int col = i % 3; setAtLeast(row, col, Dimension.toDimensionValue(minimumDimensionSymbols.charAt(i))); } }