Tabnine Logo
DefaultGraphArcStyle
Code IndexAdd Tabnine to your IDE (free)

How to use
DefaultGraphArcStyle
in
ca.uvic.cs.chisel.cajun.graph.arc

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

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

/**
 * Sets the arc types - maps a color to each arc type.
 */
public void setTypes(Collection<? extends Object> types) {
  setArcTypes(types);
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

/**
 * Sets the arc types - this is done to map a background color/gradient to each arc type.
 * @param arcTypes the node types to add
 */
public void setArcTypes(Collection<? extends Object> arcTypes) {
  for (Object type : arcTypes) {
    addArcType(type);
  }
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public DefaultGraphArcStyle() {
  loadDefaultColors();
  this.nextColorIndex = 0;
  this.arcTypeToColor = new HashMap<Object, Paint>();
  this.defaultArcColor = getNextDefaultColor(); // new Color(64, 64, 128)
  
  this.dashWidth = 10f;
  this.capSquare = BasicStroke.CAP_SQUARE;
  tooltipBackground = defaultArcColor;
  tooltipTextColor = GraphicsUtils.getTextColor(tooltipBackground);
  tooltipFont = PText.DEFAULT_FONT;
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public MainFrame() {
  super("Baby Shrimp Test");
  SampleGraphModel model = new SampleGraphModel();
  this.graph = new FlatGraph(model);
  // color the nodes based on node type
  DefaultGraphNodeStyle nodeStyle = new DefaultGraphNodeStyle();
  nodeStyle.setNodeTypes(model.getNodeTypes());
  this.graph.setGraphNodeStyle(nodeStyle);
  // color the arcs based on arc type
  DefaultGraphArcStyle arcStyle = new DefaultGraphArcStyle();
  arcStyle.setArcTypes(model.getArcTypes());
  this.graph.setGraphArcStyle(arcStyle);
  initialize();
  // run the initial layout on the nodes
  //SwingUtilities.invokeLater(new Runnable() {
  //	public void run() {
  //		try {
  //			Thread.sleep(100);
  //		} catch (InterruptedException e) {
  //		}
  //		graph.performLayout();
  //}
  //});
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

  public void paintIcon(Component c, Graphics g, int x, int y) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    Paint paint = getTypePaint(type);
    g2.setPaint(paint);
    g2.setStroke(new BasicStroke(3));
    int midY = y + (height / 2);
    g2.drawLine(x + 2, midY, x + width - 4, midY);
  }
};
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public DefaultGraphArc(Object userObject, GraphNode src, GraphNode dest, Icon icon, Object type) {
  super();
  this.userObject = userObject;
  this.src = src;
  this.dest = dest;
  setType(type);
  //this.path = new GeneralPath();
  this.curveFactor = 0;
  this.selected = false;
  this.highlighted = false;
  this.showArrowHead = true;
  this.arrowHead = new ArrowHead();
  this.inverted = false;
  if(icon != null) {
    this.icon = icon;
    image = new PImage(((ImageIcon) icon).getImage());
    addChild(image);
  }
  
  this.style = new DefaultGraphArcStyle();
}

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

/**
 * Adds the arc type and maps a color/gradient to it which is used as the line color for the
 * arc. If the arc type already exists then nothing is done.
 * 
 * @param type the node type to add
 */
public void addArcType(Object type) {
  if (!arcTypeToColor.containsKey(type)) {
    Color color = getNextDefaultColor();
    arcTypeToColor.put(type, color);
  }
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public Stroke getStroke(GraphArc arc) {
  float width = (arc.isSelected() && arc.isHighlighted() ? THICK_STROKE_WIDTH : (arc.isHighlighted() || arc.isSelected() ? MEDIUM_STROKE_WIDTH : THIN_STROKE_WIDTH));
  return createStroke(width, isDashed);
}
origin: edu.stanford.protege/org.protege.ontograf

  public Stroke getStroke(GraphArc arc) {
    if (arc.getType().toString().contains(ProtegeGraphModel.DIRECT_SUBCLASS_SLOT_TYPE) || arc.getType().toString().contains(ProtegeGraphModel.DIRECT_INDIVIDUAL_SLOT_TYPE)) {
      setDashed(false);
    } else {
      setDashed(true);
      if (arc.getType().toString().contains("Equivalent")) {
        setDashedCapSquare(BasicStroke.CAP_ROUND);
        setDashWidth(2f);
      }
      else {
        setDashedCapSquare(BasicStroke.CAP_SQUARE);
        setDashWidth(10f);
      }
    }
    return super.getStroke(arc);
  }
};
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

/**
 * Returns the paint to use for the arc. Checks if the arc type has a color mapped to it, if so
 * that color/paint is returned. Otherwise the default arc color is returned.
 * @param arc the arc whose paint/color will be returned
 * @return the paint or color for the arc
 */
public Paint getPaint(GraphArc arc) {
  return getTypePaint(arc.getType());
}
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/org.protege.ontograf

arcStyle.setArcTypes(model.getArcTypes());
this.graph.setGraphArcStyle(arcStyle);
ca.uvic.cs.chisel.cajun.graph.arcDefaultGraphArcStyle

Javadoc

Contains the default colors and strokes for arcs.

Most used methods

  • setArcTypes
    Sets the arc types - this is done to map a background color/gradient to each arc type.
  • <init>
  • addArcType
    Adds the arc type and maps a color/gradient to it which is used as the line color for the arc. If th
  • createStroke
  • getNextDefaultColor
  • getStroke
  • getTypePaint
    Returns the color for the given type, or the default arc color.
  • loadDefaultColors

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • onRequestPermissionsResult (Fragment)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Collectors (java.util.stream)
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • IsNull (org.hamcrest.core)
    Is the value null?
  • CodeWhisperer alternatives
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