-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the "None" border style for Notes
- Loading branch information
Showing
8 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...tor/src/com/archimatetool/editor/model/compatibility/handlers/NoteBorderStyleHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* This program and the accompanying materials | ||
* are made available under the terms of the License | ||
* which accompanies this distribution in the file LICENSE.txt | ||
*/ | ||
package com.archimatetool.editor.model.compatibility.handlers; | ||
|
||
import java.util.Iterator; | ||
|
||
import org.eclipse.emf.ecore.EObject; | ||
import org.eclipse.emf.ecore.resource.Resource; | ||
|
||
import com.archimatetool.editor.model.compatibility.CompatibilityHandlerException; | ||
import com.archimatetool.editor.model.compatibility.ICompatibilityHandler; | ||
import com.archimatetool.model.IArchimateModel; | ||
import com.archimatetool.model.IDiagramModelNote; | ||
import com.archimatetool.model.IDiagramModelObject; | ||
|
||
|
||
|
||
/** | ||
* Change a Note's border type from "None" to "Rectangle" and set its line style to "None" instead | ||
* | ||
* @author Phillip Beauvoir | ||
*/ | ||
public class NoteBorderStyleHandler implements ICompatibilityHandler { | ||
|
||
@Override | ||
public void fixCompatibility(Resource resource) throws CompatibilityHandlerException { | ||
IArchimateModel model = (IArchimateModel)resource.getContents().get(0); | ||
convertNoteBorders(model); | ||
} | ||
|
||
private void convertNoteBorders(IArchimateModel model) { | ||
for(Iterator<EObject> iter = model.eAllContents(); iter.hasNext();) { | ||
EObject eObject = iter.next(); | ||
|
||
if((eObject instanceof IDiagramModelNote note && note.getBorderType() == IDiagramModelNote.BORDER_NONE)) { | ||
note.setBorderType(IDiagramModelNote.BORDER_RECTANGLE); | ||
note.setLineStyle(IDiagramModelObject.LINE_STYLE_NONE); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters