AbstractBusPrimitive extends AbstractBoundedGISElement<CONTAINER, AbstractBusPrimitive<CONTAINER>> implements BusPrimitive<CONTAINER> { @Override @Pure public boolean isReadOnlyObject() { return hasFlag(FLAG_READONLY); } AbstractBusPrimitive(UUID id, AttributeCollection attributeProvider); @Override void addGISEditableChangeListener(GISEditableChangeListener listener); @Override void removeGISEditableChangeListener(GISEditableChangeListener listener); @Override void addBusChangeListener(BusChangeListener listener); @Override void removeBusChangeListener(BusChangeListener listener); @Pure abstract int indexInParent(); @Override void firePrimitiveChanged(BusChangeEvent event); @Override void fireGraphicalAttributeChanged(String propertyName, Object oldValue, Object newValue); @Override void fireGraphicalAttributeChanged(BusChangeEvent event); @Override void fireShapeChanged(); @Override void fireShapeChanged(BusChangeEvent event); @Override void setUUID(UUID id); @Override @Pure GeoLocation getGeoLocation(); @Override @Pure int getColor(); @Pure int getColor(int defaultColor); @Override @Pure Integer getRawColor(); @Override void setColor(int color); @Override @Pure boolean isReadOnlyObject(); void setReadOnlyObject(boolean readOnly); @Override @Pure int getFlags(); @Override @Pure boolean hasFlag(int flagIndex); @Override void switchFlag(int flagIndex); @Override void setFlag(int flag); @Override void unsetFlag(int flagIndex); @SuppressWarnings("unlikely-arg-type") @Override @Pure final boolean isValidPrimitive(); @SuppressWarnings("unlikely-arg-type") @Override @Pure final BusPrimitiveInvalidity getInvalidityReason(); @Override void revalidate(); @Override final void rebuild(); @Override @Pure void toJson(JsonBuffer buffer); static final String ATTR_COLOR; static final int DEFAULT_COLOR; }
@Test public void testIsReadOnlyObject() { assertFalse(this.primitive.isReadOnlyObject()); this.primitive.setReadOnlyObject(true); assertTrue(this.primitive.isReadOnlyObject()); this.primitive.setReadOnlyObject(true); assertTrue(this.primitive.isReadOnlyObject()); this.primitive.setReadOnlyObject(false); assertFalse(this.primitive.isReadOnlyObject()); }