ingenias.editor.actions.diagram.MetamodelActionsFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ingened Show documentation
Show all versions of ingened Show documentation
Meta-language editor built over INGENME. It is the most basic editor to be used in the rest of projects
/**
* Copyright (C) 2010 Jorge J. Gomez-Sanz
*
*
* This file is part of the INGENME tool. INGENME is an open source meta-editor
* which produces customized editors for user-defined modeling languages
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3 of the License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
**/
package ingenias.editor.actions.diagram;
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.util.Map;
import java.util.Hashtable;
import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
import java.awt.event.*;
import java.net.URL;
import java.util.Map;
import java.util.Hashtable;
import java.util.ArrayList;
import javax.swing.event.UndoableEditEvent;
import org.jgraph.JGraph;
import org.jgraph.graph.*;
import org.jgraph.event.*;
import java.util.Vector;
import org.jgraph.JGraph;
import org.jgraph.graph.*;
import org.jgraph.event.*;
import org.jgraph.plaf.basic.*;
import java.lang.reflect.*;
import ingenias.editor.entities.*;
import ingenias.editor.widget.*;
import ingenias.exception.NullEntity;
import ingenias.generator.browser.BrowserImp;
import ingenias.generator.browser.Graph;
import ingenias.generator.browser.GraphEntity;
import ingenias.exception.InvalidEntity;
import ingenias.editor.*;
// MarqueeHandler that Connects Vertices and Displays PopupMenus
public class MetamodelActionsFactory extends DiagramMenuEntriesActionsFactory implements java.io.Serializable {
public MetamodelActionsFactory(GUIResources resources, IDEState state){
super(resources,state);
}
public Vector createChangeViewActions(final DefaultGraphCell cell, final ModelJGraph graph) {
Vector possibleViews=new Vector();
final ingenias.editor.entities.Entity ent=((ingenias.editor.entities.Entity)cell.getUserObject());
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaObject")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaObject")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaDiagram")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaDiagram")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaRelationship")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaRelationship")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaRole")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaRole")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.VisualRepresentation")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.VisualRepresentation")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.BasicRepresentation")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.BasicRepresentation")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PropertyField")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PropertyField")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.UMLComment")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.UMLComment")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PreferredOrder")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PreferredOrder")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.Documentation")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.Documentation")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.ExternalTypeWrapper")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.ExternalTypeWrapper")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaDiagramTypeWrapper")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaDiagramTypeWrapper")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaObjectTypeWrapper")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.UML;
possibleViews.add(new AbstractAction("UML") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "UML");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.UML);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.MetaObjectTypeWrapper")){
final ViewPreferences.ViewType current1=ViewPreferences.ViewType.INGENIAS;
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
graph.getListenerContainer().storeContraints(cell);
graph.getModel().getAttributes(cell).put("view", "INGENIAS");
ent.getPrefs(graph.getModel().getAttributes(cell)).setView(ViewPreferences.ViewType.INGENIAS);
graph.getListenerContainer().restoreContraints(cell);
graph.invalidate();
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.UMLAnnotatedElement")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.UMLAnnotatedElement")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.UMLAnnotatedElement")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.Has")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.Has")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.Has")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.InheritsO")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.InheritsO")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.InheritsO")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.InheritsR")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.InheritsR")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.InheritsR")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.Contains")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.Contains")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.Contains")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.VisualizedAs")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.VisualizedAs")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.VisualizedAs")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PlayedBy")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PlayedBy")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PlayedBy")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.AssociationEnd")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.AssociationEnd")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.AssociationEnd")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.BinaryRel")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.BinaryRel")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.BinaryRel")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PropsOrderedAs")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PropsOrderedAs")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.PropsOrderedAs")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.IsDocumentedBy")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.IsDocumentedBy")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.IsDocumentedBy")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.HasMO")){
possibleViews.add(new AbstractAction("NOICON") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.NOICON,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.HasMO")){
possibleViews.add(new AbstractAction("INGENIAS") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.INGENIAS,
ent, cell, graph);
graph.refresh();
}
});
}
if (ent.getClass().getName().equals("ingenias.editor.entities.HasMO")){
possibleViews.add(new AbstractAction("LABEL") {
public void actionPerformed(ActionEvent e) {
ingenias.editor.cell.RenderComponentManager.setRelationshipView(ViewPreferences.ViewType.LABEL,
ent, cell, graph);
graph.refresh();
}
});
}
return possibleViews;
}
protected Vector createDiagramSpecificInsertActions(final Point pt, final ModelJGraph graph) {
Vector nobjects=new Vector();
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "MetaObject")){
// Insert an object of type MetaObject
AbstractAction aa=new AbstractAction("Insert MetaObject") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "MetaObject");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type MetaObject is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new MetaObject("").getHelpDesc()+"\n\n"+new MetaObject("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "MetaDiagram")){
// Insert an object of type MetaDiagram
AbstractAction aa=new AbstractAction("Insert MetaDiagram") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "MetaDiagram");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type MetaDiagram is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new MetaDiagram("").getHelpDesc()+"\n\n"+new MetaDiagram("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "MetaRelationship")){
// Insert an object of type MetaRelationship
AbstractAction aa=new AbstractAction("Insert MetaRelationship") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "MetaRelationship");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type MetaRelationship is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new MetaRelationship("").getHelpDesc()+"\n\n"+new MetaRelationship("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "MetaRole")){
// Insert an object of type MetaRole
AbstractAction aa=new AbstractAction("Insert MetaRole") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "MetaRole");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type MetaRole is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new MetaRole("").getHelpDesc()+"\n\n"+new MetaRole("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "VisualRepresentation")){
// Insert an object of type VisualRepresentation
AbstractAction aa=new AbstractAction("Insert VisualRepresentation") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "VisualRepresentation");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type VisualRepresentation is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new VisualRepresentation("").getHelpDesc()+"\n\n"+new VisualRepresentation("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "BasicRepresentation")){
// Insert an object of type BasicRepresentation
AbstractAction aa=new AbstractAction("Insert BasicRepresentation") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "BasicRepresentation");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type BasicRepresentation is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new BasicRepresentation("").getHelpDesc()+"\n\n"+new BasicRepresentation("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "PropertyField")){
// Insert an object of type PropertyField
AbstractAction aa=new AbstractAction("Insert PropertyField") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "PropertyField");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type PropertyField is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new PropertyField("").getHelpDesc()+"\n\n"+new PropertyField("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "UMLComment")){
// Insert an object of type UMLComment
AbstractAction aa=new AbstractAction("Insert UMLComment") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "UMLComment");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type UMLComment is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new UMLComment("").getHelpDesc()+"\n\n"+new UMLComment("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "PreferredOrder")){
// Insert an object of type PreferredOrder
AbstractAction aa=new AbstractAction("Insert PreferredOrder") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "PreferredOrder");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type PreferredOrder is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new PreferredOrder("").getHelpDesc()+"\n\n"+new PreferredOrder("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "Documentation")){
// Insert an object of type Documentation
AbstractAction aa=new AbstractAction("Insert Documentation") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "Documentation");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type Documentation is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new Documentation("").getHelpDesc()+"\n\n"+new Documentation("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "PropertyOrder")){
// Insert an object of type PropertyOrder
AbstractAction aa=new AbstractAction("Insert PropertyOrder") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "PropertyOrder");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type PropertyOrder is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new PropertyOrder("").getHelpDesc()+"\n\n"+new PropertyOrder("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "ExternalTypeWrapper")){
// Insert an object of type ExternalTypeWrapper
AbstractAction aa=new AbstractAction("Insert ExternalTypeWrapper") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "ExternalTypeWrapper");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type ExternalTypeWrapper is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new ExternalTypeWrapper("").getHelpDesc()+"\n\n"+new ExternalTypeWrapper("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "MetaDiagramTypeWrapper")){
// Insert an object of type MetaDiagramTypeWrapper
AbstractAction aa=new AbstractAction("Insert MetaDiagramTypeWrapper") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "MetaDiagramTypeWrapper");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type MetaDiagramTypeWrapper is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new MetaDiagramTypeWrapper("").getHelpDesc()+"\n\n"+new MetaDiagramTypeWrapper("").getHelpRecom());
nobjects.add(aa);
}
if (this.getState().getDiagramFilter().isValidEntity("Metamodel", "MetaObjectTypeWrapper")){
// Insert an object of type MetaObjectTypeWrapper
AbstractAction aa=new AbstractAction("Insert MetaObjectTypeWrapper") {
public void actionPerformed(ActionEvent ev) {
try {
graph.insert(pt, "MetaObjectTypeWrapper");
} catch (InvalidEntity e) {
e.printStackTrace();
JOptionPane.showMessageDialog(graph, "Object type MetaObjectTypeWrapper is not allowed in this diagram",
"Warning", JOptionPane.WARNING_MESSAGE);
}
}
};
aa.putValue("tooltip", new MetaObjectTypeWrapper("").getHelpDesc()+"\n\n"+new MetaObjectTypeWrapper("").getHelpRecom());
nobjects.add(aa);
}
return nobjects;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy