Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Violet/New folder/VioletPlugin.ClassDiagram/src/main/java/com/horstmann/violet/product/diagram/classes/ClassDiagramGraph.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
97 lines (76 sloc)
3.6 KB
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
package com.horstmann.violet.product.diagram.classes; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Locale; | |
import java.util.ResourceBundle; | |
import com.horstmann.violet.product.diagram.abstracts.AbstractGraph; | |
import com.horstmann.violet.product.diagram.abstracts.edge.IEdge; | |
import com.horstmann.violet.product.diagram.abstracts.node.INode; | |
import com.horstmann.violet.product.diagram.classes.edges.AggregationEdge; | |
import com.horstmann.violet.product.diagram.classes.edges.AssociationEdge; | |
import com.horstmann.violet.product.diagram.classes.edges.CompositionEdge; | |
import com.horstmann.violet.product.diagram.classes.edges.DependencyEdge; | |
import com.horstmann.violet.product.diagram.classes.edges.InheritanceEdge; | |
import com.horstmann.violet.product.diagram.classes.edges.InterfaceInheritanceEdge; | |
import com.horstmann.violet.product.diagram.classes.nodes.ClassNode; | |
import com.horstmann.violet.product.diagram.classes.nodes.InterfaceNode; | |
import com.horstmann.violet.product.diagram.classes.nodes.PackageNode; | |
import com.horstmann.violet.product.diagram.common.DiagramLinkNode; | |
import com.horstmann.violet.product.diagram.common.NoteEdge; | |
import com.horstmann.violet.product.diagram.common.NoteNode; | |
/** | |
* A UML class diagram. | |
*/ | |
public class ClassDiagramGraph extends AbstractGraph | |
{ | |
public List<INode> getNodePrototypes() | |
{ | |
return NODE_PROTOTYPES; | |
} | |
public List<IEdge> getEdgePrototypes() | |
{ | |
return EDGE_PROTOTYPES; | |
} | |
private static final List<INode> NODE_PROTOTYPES = new ArrayList<INode>(); | |
private static final List<IEdge> EDGE_PROTOTYPES = new ArrayList<IEdge>(); | |
static | |
{ | |
ResourceBundle rs = ResourceBundle.getBundle(ClassDiagramConstant.CLASS_DIAGRAM_STRINGS, Locale.getDefault()); | |
ClassNode node0 = new ClassNode(); | |
node0.setToolTip(rs.getString("node0.tooltip")); | |
NODE_PROTOTYPES.add(node0); | |
InterfaceNode node1 = new InterfaceNode(); | |
node1.setToolTip(rs.getString("node1.tooltip")); | |
NODE_PROTOTYPES.add(node1); | |
PackageNode node2 = new PackageNode(); | |
node2.setToolTip(rs.getString("node2.tooltip")); | |
NODE_PROTOTYPES.add(node2); | |
NoteNode node3 = new NoteNode(); | |
node3.setToolTip(rs.getString("node3.tooltip")); | |
NODE_PROTOTYPES.add(node3); | |
DiagramLinkNode node4 = new DiagramLinkNode(); | |
node4.setToolTip(rs.getString("node4.tooltip")); | |
NODE_PROTOTYPES.add(node4); | |
DependencyEdge dependency = new DependencyEdge(); | |
dependency.setToolTip(rs.getString("edge0.tooltip")); | |
EDGE_PROTOTYPES.add(dependency); | |
InheritanceEdge inheritance = new InheritanceEdge(); | |
inheritance.setToolTip(rs.getString("edge1.tooltip")); | |
EDGE_PROTOTYPES.add(inheritance); | |
InterfaceInheritanceEdge interfaceInheritance = new InterfaceInheritanceEdge(); | |
interfaceInheritance.setToolTip(rs.getString("edge2.tooltip")); | |
EDGE_PROTOTYPES.add(interfaceInheritance); | |
AssociationEdge association = new AssociationEdge(); | |
association.setToolTip(rs.getString("edge3.tooltip")); | |
EDGE_PROTOTYPES.add(association); | |
AggregationEdge aggregation = new AggregationEdge(); | |
aggregation.setToolTip(rs.getString("edge4.tooltip")); | |
EDGE_PROTOTYPES.add(aggregation); | |
CompositionEdge composition = new CompositionEdge(); | |
composition.setToolTip(rs.getString("edge5.tooltip")); | |
EDGE_PROTOTYPES.add(composition); | |
NoteEdge noteEdge = new NoteEdge(); | |
noteEdge.setToolTip(rs.getString("edge6.tooltip")); | |
EDGE_PROTOTYPES.add(noteEdge); | |
} | |
} |