/** * @param newView the default stereotype view * @deprecated for 0.27.2 by tfmorris. Not for use in new code. Only for help in transitioning to * enum based methods. Use {@link #setDefaultStereotypeView(StereotypeStyle)}. */ public void setDefaultStereotypeView(final int newView) { StereotypeStyle sv = StereotypeStyle.getEnum(newView); if (sv == null) { throw new IllegalArgumentException("Bad argument " + newView); } setDefaultStereotypeView(sv); }
/** * Convert old style int representation to an enum. The enum returned is the one at the given * ordinal (ie this is the inverse of the mapping done by ordinal()). * * @param value one of the defined int values in DiagramAppearance * @return the corresponding StereotypeView enum */ public static StereotypeStyle getEnum(int value) { int counter = 0; for (StereotypeStyle sv : StereotypeStyle.values()) { if (counter == value) { return sv; } counter++; } return null; }