| Summary: | [diagram] improve color and line style api | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Konstantin Komissarchik <konstantin> | ||||||
| Component: | Sapphire | Assignee: | Shenxue Zhou <shenxue.zhou> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Konstantin Komissarchik
Created attachment 188088 [details]
Patch v1
A few issues... 1. ColorSerializationService needs encode implementation. The default implementation uses toString(), but you haven't implemented toString() on Color either. 2. LineStyle.getLineStyle() static method should be removed. This sort of translation should happen via serialization service. For enums, the serialization service is supplied by the system. You would write something like this... element.service( MyProperty, ValueSerializationService.class ).decode( str ) 3. There is a commented-out color hint line in MapEditor.sdef with old syntax. Should this line be removed? Also, please name your patches "Patch v1", "Patch v2", etc. This makes it simpler to sort out what's going on. A detail description of the content should go in the accompanying comment rather than attachment title. Created attachment 188097 [details]
Patch V2
Patch v2 to address the above issues
Released patch v2. There was one other problem that I noticed in ColorSerializationService, but I just fixed it up myself. The issue is that the decode method isn't supposed to throw exceptions. It should return null instead. I have also updated javadoc of ValueSerializationService to state as much. Closing. This can be considered verified as Shenxue has submitted the patch and I reviewed the code and behavior before releasing. |