Concept.getGlyphIcon
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.visallo.core.model.ontology.Concept.getGlyphIcon (Showing top 5 results out of 315)

origin: org.visallo/visallo-web

  private byte[] getGlyphIcon(Concept concept, String workspaceId) {
    byte[] glyphIcon = null;
    for (Concept con = concept; glyphIcon == null && con != null; con = ontologyRepository.getParentConcept(con, workspaceId)) {
      glyphIcon = con.hasGlyphIconResource() ? con.getGlyphIcon() : null;
    }
    return glyphIcon;
  }
}
origin: org.visallo/visallo-web

private Glyph getGlyph(Concept concept, boolean isSelected) {
  Glyph glyph = null;
  if (isSelected && concept.hasGlyphIconSelectedResource()) {
    byte[] resource = concept.getGlyphIconSelected();
    if (resource != null) {
      glyph = new Image(resource);
    } else {
      glyph = new Path(concept.getGlyphIconSelectedFilePath());
    }
  } else if (concept.hasGlyphIconResource()) {
    byte[] resource = concept.getGlyphIcon();
    if (resource != null) {
      glyph = new Image(resource);
    } else {
      glyph = new Path(concept.getGlyphIconFilePath());
    }
  }
  return glyph;
}
origin: org.visallo/visallo-core

private void addEntityGlyphIcon(Concept entityConcept, Authorizations authorizations) {
  if (entityConcept.getGlyphIcon() != null) {
    LOGGER.debug("entityConcept GlyphIcon already set. skipping addEntityGlyphIcon.");
    return;
  }
  LOGGER.debug("addEntityGlyphIcon");
  InputStream entityGlyphIconInputStream = OntologyRepositoryBase.class.getResourceAsStream(RESOURCE_ENTITY_PNG);
  checkNotNull(entityGlyphIconInputStream, "Could not load resource " + RESOURCE_ENTITY_PNG);
  try {
    ByteArrayOutputStream imgOut = new ByteArrayOutputStream();
    IOUtils.copy(entityGlyphIconInputStream, imgOut);
    byte[] rawImg = imgOut.toByteArray();
    addEntityGlyphIconToEntityConcept(entityConcept, rawImg, authorizations);
  } catch (IOException e) {
    throw new VisalloException("invalid stream for glyph icon");
  }
}
origin: org.visallo/visallo-core-test

private void validateChangedOwlConcepts() throws IOException {
  Concept contact = getOntologyRepository().getConceptByIRI(TEST_IRI + "#contact", PUBLIC);
  Concept person = getOntologyRepository().getConceptByIRI(TEST_IRI + "#person", PUBLIC);
  assertEquals("Person", person.getDisplayName());
  List<String> intents = Arrays.asList(person.getIntents());
  assertEquals(1, intents.size());
  assertFalse(intents.contains("person"));
  assertFalse(intents.contains("face"));
  assertTrue(intents.contains("test"));
  assertNull(person.getTimeFormula());
  assertEquals("prop('http://visallo.org/test#name') || ''", person.getTitleFormula());
  assertNull(person.getGlyphIcon());
  assertEquals("rgb(28, 137, 28)", person.getColor());
  Set<Concept> conceptAndAllChildren = getOntologyRepository().getConceptAndAllChildren(contact, PUBLIC);
  List<String> iris = Lists.newArrayList();
  conceptAndAllChildren.forEach(c -> iris.add(c.getIRI()));
  assertEquals(2, iris.size());
  assertTrue(iris.contains(contact.getIRI()));
  assertTrue(iris.contains(person.getIRI()));
}
origin: org.visallo/visallo-core-test

private void validateTestOwlConcepts(int expectedIriSize) throws IOException {
  Concept contact = getOntologyRepository().getConceptByIRI(TEST_IRI + "#contact", PUBLIC);
  assertEquals("Contact", contact.getDisplayName());
  assertEquals("rgb(149, 138, 218)", contact.getColor());
  assertEquals("test", contact.getDisplayType());
  List<String> intents = Arrays.asList(contact.getIntents());
  assertEquals(1, intents.size());
  assertTrue(intents.contains("face"));
  Concept person = getOntologyRepository().getConceptByIRI(TEST_IRI + "#person", PUBLIC);
  assertEquals("Person", person.getDisplayName());
  intents = Arrays.asList(person.getIntents());
  assertEquals(1, intents.size());
  assertTrue(intents.contains("person"));
  assertEquals("prop('http://visallo.org/test#birthDate') || ''", person.getTimeFormula());
  assertEquals("prop('http://visallo.org/test#name') || ''", person.getTitleFormula());
  byte[] bytes = IOUtils.toByteArray(OntologyRepositoryTestBase.class.getResourceAsStream("glyphicons_003_user@2x.png"));
  assertArrayEquals(bytes, person.getGlyphIcon());
  assertEquals("rgb(28, 137, 28)", person.getColor());
  Set<Concept> conceptAndAllChildren = getOntologyRepository().getConceptAndAllChildren(contact, PUBLIC);
  List<String> iris = Lists.newArrayList();
  conceptAndAllChildren.forEach(c -> iris.add(c.getIRI()));
  assertEquals(expectedIriSize, iris.size());
  assertTrue(iris.contains(contact.getIRI()));
  assertTrue(iris.contains(person.getIRI()));
}
org.visallo.core.model.ontologyConceptgetGlyphIcon

Popular methods of Concept

  • getIRI
  • getParentConceptIRI
  • getId
  • getSandboxStatus
  • getDisplayName
  • getProperties
  • setProperty
  • addIntent
  • getColor
  • getDisplayType
  • getIntents
  • getSubtitleFormula
  • getIntents,
  • getSubtitleFormula,
  • getTimeFormula,
  • getTitleFormula,
  • hasGlyphIconResource,
  • hasGlyphIconSelectedResource,
  • toClientApi,
  • getAddRelatedConceptWhiteList,
  • getDeleteable

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)