Codota Logo
DefaultGraphModel
Code IndexAdd Codota to your IDE (free)

How to use
DefaultGraphModel
in
ca.uvic.cs.chisel.cajun.graph

Best Java code snippets using ca.uvic.cs.chisel.cajun.graph.DefaultGraphModel (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public FlatGraph() {
  this(new DefaultGraphModel());
  
  this.showNodeTooltips = true;
}

origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public GraphArc addArc(Object userObject, GraphNode src, GraphNode dest, Object type) {
  return addArc(userObject, src, dest, type, null);
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public GraphNode addNode(Object userObject, String text) {
  return addNode(userObject, text, null, null);
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public GraphArc addArc(Object userObject, GraphNode src, GraphNode dest, Object type, Icon icon) {
  if (userObject == null) {
    throw new NullPointerException("All graph arcs must have a user object.");
  }
  if (!arcs.containsKey(userObject)) {
    addNodeInternal(src);
    addNodeInternal(dest);
    DefaultGraphArc arc = new DefaultGraphArc(userObject, src, dest, icon, type);
    addArcInternal(arc);
    arrangeArcs(arc.getSource(), arc.getDestination());
  }
  return arcs.get(userObject);
}

origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

protected void addArcInternal(DefaultGraphArc arc) {
  // this is the ONLY place where arcs are added
  arcs.put(arc.getUserObject(), arc);
  if (!arcTypes.contains(arc.getType())) {
    arcTypes.add(arc.getType());
    fireArcTypeAddedEvent(arc.getType());
  }
  // add this arc to the source and destination nodes
  arc.getSource().addArc(arc);
  arc.getDestination().addArc(arc);
  fireArcAddedEvent(arc);
}

origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public void clear() {
  if ((nodes.size() > 0) || (arcs.size() > 0)) {
    nodes.clear();
    arcs.clear();
    nodeTypes.clear();
    arcTypes.clear();
    fireGraphClearedEvent();
  }
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public GraphNode addNode(Object userObject, String text, Icon icon, Object type) {
  if (userObject == null) {
    throw new NullPointerException("All graph nodes must have a user object.");
  }
  if (!nodes.containsKey(userObject)) {
    if (type == null) {
      type = GraphItem.UNKNOWN_TYPE;
    }
    DefaultGraphNode node = new DefaultGraphNode(userObject, text, icon, type);
    addNodeInternal(node);
  }
  return nodes.get(userObject);
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

/**
 * Clears the arc types, then iterates through all the arcs and adds the
 * arc types back in.
 */
public void recalculateArcTypes() {
  arcTypes.clear();
  for (GraphArc arc: arcs.values()) {
    Object arcType = arc.getType();
    if (!arcTypes.contains(arcType)) {
      arcTypes.add(arcType);
      fireArcTypeAddedEvent(arcType);
    }
  }
}

origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

protected void removeArcInternal(GraphArc arc) {
  if ((arc != null) && arcs.containsKey(arc.getUserObject())) {
    // remove this arc from the source and destination nodes
    arc.getSource().removeArc(arc);
    arc.getDestination().removeArc(arc);
    // now remove the arc from the model and fire the event
    arcs.remove(arc.getUserObject());
    fireArcRemovedEvent(arc);
  }
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public void setModel(GraphModel model) {
  GraphModel oldModel = this.model;
  oldModel.removeGraphModelListener(modelListener);
  // now remove any of "our" graph model listeners
  for (GraphModelListener gml : graphModelListeners) {
    oldModel.removeGraphModelListener(gml);
  }
  // don't allow null models
  if (model == null) {
    model = new DefaultGraphModel();
  }
  this.model = model;
  this.model.addGraphModelListener(modelListener);
  // now add "our" graph model listeners back
  for (GraphModelListener gml : graphModelListeners) {
    this.model.addGraphModelListener(gml);
  }
  loadModel();
  firePropertyChange(GRAPH_MODEL_PROPERTY, oldModel, this.model);
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public GraphNode addNode(Object userObject, String text, Icon icon) {
  return addNode(userObject, text, icon, null);
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public AbstractGraph() {
  super();
  this.model = new DefaultGraphModel();
  this.graphModelListeners = new ArrayList<GraphModelListener>();
  this.layouts = new ArrayList<LayoutAction>();
  addDefaultLayouts();
  this.graphPopupListener = new GraphPopupListener();
  getCamera().addInputEventListener(graphPopupListener);
  this.filterManager = new FilterManager(this);
  this.filterManager.addFilterChangedListener(filterListener);
  this.selectedNodes = new NodeCollection();
  selectedNodes.addCollectionListener(selectionListener);
  this.matchingNodes = new NodeCollection();
  matchingNodes.addCollectionListener(matchingListener);
  this.nodeStyle = new DefaultGraphNodeStyle();
  this.arcStyle = new DefaultGraphArcStyle();
  addFocusListener(focusListener);
  // register to use our custom tooltips
  CustomToolTipManager.sharedInstance().registerComponent(this);
  initializeLayers();
  // this is needed to handle keyboard events
  getRoot().getDefaultInputManager().setKeyboardFocus(new KeyHandlerDelegate(getCamera()));
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public GraphNode addNode(Object userObject) {
  return addNode(userObject, String.valueOf(userObject), null, null);
}
ca.uvic.cs.chisel.cajun.graphDefaultGraphModel

Most used methods

  • <init>
  • addArc
  • addArcInternal
  • addNode
  • addNodeInternal
  • arrangeArcs
    Arranges all arcs going between the source and destination nodes so that they do not overlap. Sets t
  • fireArcAddedEvent
  • fireArcRemovedEvent
  • fireArcTypeAddedEvent
  • fireGraphClearedEvent
  • fireNodeAddedEvent
  • fireNodeRemovedEvent
  • fireNodeAddedEvent,
  • fireNodeRemovedEvent,
  • fireNodeTypeAddedEvent,
  • getAllNodes,
  • getArcTypes,
  • removeArc,
  • removeArcInternal,
  • removeNode,
  • removeNodeInternal

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now