-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #506 Add a fitAll() service that call fit() on all MImages of a…
… MElement.
- Loading branch information
Showing
3 changed files
with
106 additions
and
0 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions
45
....obeonetwork.m2doc.tests/src/org/obeonetwork/m2doc/tests/services/MImageTestServices.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,45 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Obeo. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
* | ||
*******************************************************************************/ | ||
package org.obeonetwork.m2doc.tests.services; | ||
|
||
import org.eclipse.emf.common.util.URI; | ||
import org.eclipse.emf.ecore.resource.URIConverter; | ||
import org.obeonetwork.m2doc.element.MElement; | ||
import org.obeonetwork.m2doc.element.MImage; | ||
import org.obeonetwork.m2doc.element.MList; | ||
import org.obeonetwork.m2doc.element.impl.MImageImpl; | ||
import org.obeonetwork.m2doc.element.impl.MListImpl; | ||
import org.obeonetwork.m2doc.element.impl.MParagraphImpl; | ||
import org.obeonetwork.m2doc.element.impl.MTextImpl; | ||
|
||
/** | ||
* Test services for {@link MImage}. | ||
* | ||
* @author <a href="mailto:[email protected]">Yvan Lussaud</a> | ||
*/ | ||
public class MImageTestServices { | ||
|
||
public MElement getMElements(Object object) { | ||
final MList res = new MListImpl(); | ||
|
||
final MParagraphImpl paragraph1 = new MParagraphImpl(new MTextImpl("Some text", null), null); | ||
res.add(paragraph1); | ||
final MImage image = new MImageImpl(URIConverter.INSTANCE, URI.createURI("resources/dh1.gif")); | ||
final MParagraphImpl paragraph2 = new MParagraphImpl(image, null); | ||
res.add(paragraph2); | ||
final MParagraphImpl paragraph3 = new MParagraphImpl(new MTextImpl("More text", null), null); | ||
res.add(paragraph3); | ||
|
||
return res; | ||
} | ||
|
||
} |