Tabnine Logo
DefaultGraphModel
Code IndexAdd Tabnine 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)

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

  • Finding current android device location
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JButton (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now