This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed minor METS validation bug on export related to structLink section
made diagram assistant more schema aware, only prompting with valid element/attribute selections (multiplicity) fixed double popup menu for adding XML Elements from the palette fixed / by zero bug related to modulo operator on staging monitor some code regenerated fixed location of new XML elements dropped on canvas
- Loading branch information
Showing
23 changed files
with
465 additions
and
440 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
76 changes: 76 additions & 0 deletions
76
crosswalk-gmf.diagram/src/crosswalk/diagram/custom/SpecialCreationEditPolicy.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,76 @@ | ||
/** | ||
* Copyright 2011 The University of North Carolina at Chapel Hill | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package crosswalk.diagram.custom; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.eclipse.emf.ecore.EObject; | ||
import org.eclipse.gef.Request; | ||
import org.eclipse.gef.commands.Command; | ||
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; | ||
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; | ||
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; | ||
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest; | ||
import org.eclipse.gmf.runtime.emf.type.core.IElementType; | ||
import org.eclipse.gmf.runtime.notation.View; | ||
|
||
import crosswalk.CrossWalk; | ||
import crosswalk.MappedElement; | ||
import crosswalk.diagram.providers.CrosswalkElementTypes; | ||
|
||
/** | ||
* @author Gregory Jansen | ||
* | ||
*/ | ||
public class SpecialCreationEditPolicy extends CreationEditPolicy { | ||
|
||
@Override | ||
public Command getCommand(Request request) { | ||
if (understandsRequest(request)) { | ||
if (request instanceof CreateUnspecifiedTypeRequest) { | ||
CreateUnspecifiedTypeRequest r = (CreateUnspecifiedTypeRequest) request; | ||
View view = (View)getHost().getModel(); | ||
EObject hostElement = ViewUtil.resolveSemanticElement(view); | ||
CreateViewAndElementRequest chosenRequest = null; | ||
IElementType type = null; | ||
if(hostElement instanceof CrossWalk) { | ||
type = CrosswalkElementTypes.MappedElement_2016; | ||
chosenRequest = (CreateViewAndElementRequest)r.getRequestForType(type); | ||
} else if(hostElement instanceof MappedElement) { | ||
type = CrosswalkElementTypes.MappedElement_3015; | ||
chosenRequest = (CreateViewAndElementRequest)r.getRequestForType(type); | ||
} | ||
if (chosenRequest != null) { | ||
//chosenRequest.setLocation(r.getLocation()); | ||
//chosenRequest.setExtendedData(r.getExtendedData()); | ||
//chosenRequest.setSize(r.getSize()); | ||
//chosenRequest.setType(r.getType()); | ||
List types = new ArrayList(); | ||
types.add(type); | ||
CreateUnspecifiedTypeRequest answerReq = new CreateUnspecifiedTypeRequest(types, chosenRequest.getViewAndElementDescriptor().getPreferencesHint() ); | ||
answerReq.setExtendedData(r.getExtendedData()); | ||
answerReq.setLocation(r.getLocation()); | ||
answerReq.setSize(r.getSize()); | ||
System.out.println("chose type: "+type); | ||
return super.getCommand(answerReq); | ||
} | ||
} | ||
return super.getCommand(request); | ||
} | ||
return null; | ||
} | ||
} |
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
Oops, something went wrong.