public Object readResolve() throws ObjectStreamException { Line ln = null; if (descriptionBitMask == -1) return null; try { VertexDescription vd = VertexDescriptionDesignerImpl .getVertexDescription(descriptionBitMask); ln = new Line(vd); if (attribs != null) { ln.setStartXY(attribs[0], attribs[1]); ln.setEndXY(attribs[2], attribs[3]); int index = 4; for (int i = 1, n = vd.getAttributeCount(); i < n; i++) { int semantics = vd.getSemantics(i); int comps = VertexDescription.getComponentCount(semantics); for (int ord = 0; ord < comps; ord++) { ln.setStartAttribute(semantics, ord, attribs[index++]); ln.setEndAttribute(semantics, ord, attribs[index++]); } } } } catch (Exception ex) { throw new InvalidObjectException("Cannot read geometry from stream"); } return ln; }
public Object readResolve() throws ObjectStreamException { Line ln = null; if (descriptionBitMask == -1) return null; try { VertexDescription vd = VertexDescriptionDesignerImpl .getVertexDescription(descriptionBitMask); ln = new Line(vd); if (attribs != null) { ln.setStartXY(attribs[0], attribs[1]); ln.setEndXY(attribs[2], attribs[3]); int index = 4; for (int i = 1, n = vd.getAttributeCount(); i < n; i++) { int semantics = vd.getSemantics(i); int comps = VertexDescription.getComponentCount(semantics); for (int ord = 0; ord < comps; ord++) { ln.setStartAttribute(semantics, ord, attribs[index++]); ln.setEndAttribute(semantics, ord, attribs[index++]); } } } } catch (Exception ex) { throw new InvalidObjectException("Cannot read geometry from stream"); } return ln; }