touchgraphentityrenderer.java
来自「Semantic Web Ontology Editor」· Java 代码 · 共 1,463 行 · 第 1/4 页
JAVA
1,463 行
// ex.printStackTrace(); // } // }// // // oneof (DONE)// public void visit(OWLEnumeration enumeration) throws OWLException // {// try// { // URI uri = new URI(OWL_ONEOF);// // Node oneOfNode = new SwoopNode(uri, shortForms.shortForm( uri ), myModel);// myPanel.addNode( oneOfNode );// oneOfNode.setBackColor( Color.WHITE );// oneOfNode.setTextColor( Color.BLACK );//// for ( Iterator it = enumeration.getIndividuals().iterator();it.hasNext(); )// {// OWLIndividual ind = (OWLIndividual) it.next();// ind.accept( this );// myPanel.addEdge( oneOfNode, myResultNode, DEFAULT_DISTANCE );// }// // oneOfNode.setBackColor( Edge.DEFAULT_COLOR );// oneOfNode.setType( Node.TYPE_HOLLOW_CIRCLE );// myResultNode = oneOfNode;// myEdgeID = null;// }// catch (Exception ex) // { ex.printStackTrace(); }// }// // // object some restriction (DONE)// public void visit( OWLObjectSomeRestriction restriction ) throws OWLException {// try// { // URI propertyURI = restriction.getObjectProperty().getURI();// // Node propNode = new SwoopNode(propertyURI, propertyURI.toString(), shortForms.shortForm(propertyURI), myModel);// propNode.setType( Node.TYPE_ELLIPSE );// propNode.setBackColor( OBJ_PROP_NODE_COLOR);// propNode = myPanel.addNode( propNode );// // OWLDescription desc = restriction.getDescription();// desc.accept( this );//// Edge edge = new Edge( propNode, myResultNode );// edge.setID( EXISTS );// myPanel.addEdge( edge );// // myResultNode = propNode;// myEdgeID = null;// }// catch (Exception ex)// { ex.printStackTrace(); }// }// // // object all restriction (DONE)// public void visit(OWLObjectAllRestriction restriction) throws OWLException // {// try// { // URI propertyURI = restriction.getObjectProperty().getURI(); // Node propNode = new SwoopNode(propertyURI, propertyURI.toString(), shortForms.shortForm(propertyURI), myModel);// propNode.setType( Node.TYPE_ELLIPSE );// propNode.setBackColor( OBJ_PROP_NODE_COLOR);// propNode = myPanel.addNode( propNode );//// OWLDescription desc = restriction.getDescription();// desc.accept( this );//// Edge edge = new Edge( propNode, myResultNode );// edge.setID( FORALL );// myPanel.addEdge( edge );// // myResultNode = propNode;// myEdgeID = null;//// }// catch (Exception ex)// { ex.printStackTrace(); }// }// // // object value restriction (DONE)// public void visit(OWLObjectValueRestriction restriction) throws OWLException// {// try// { // URI propertyURI = restriction.getObjectProperty().getURI(); // Node propNode = new SwoopNode(propertyURI, propertyURI.toString(), shortForms.shortForm(propertyURI), myModel);// propNode.setType( Node.TYPE_ELLIPSE );// propNode.setBackColor( OBJ_PROP_NODE_COLOR);// propNode = myPanel.addNode( propNode );// // restriction.getIndividual().accept( this );//// Edge edge = new Edge( propNode, myResultNode );// edge.setID( MUSTBE );// myPanel.addEdge( edge );// // myResultNode = propNode;// myEdgeID = null;// // }// catch (Exception ex)// { ex.printStackTrace(); }// }// // // object cardinality restriction (DONE)// public void visit(OWLObjectCardinalityRestriction restriction) throws OWLException // {// try// { // URI propertyURI = restriction.getObjectProperty().getURI();// Node propNode = new SwoopNode(propertyURI, propertyURI.toString(), shortForms.shortForm(propertyURI), myModel);// propNode.setType( Node.TYPE_ELLIPSE );// propNode.setBackColor( OBJ_PROP_NODE_COLOR);// propNode = myPanel.addNode( propNode );// // String number = "";// String garnish = "";// if ( restriction.isExactly() ) {// number = number + restriction.getAtLeast();// garnish = EQUALS;// } else if ( restriction.isAtMost() ) {// number = number + restriction.getAtMost();// garnish = LESSTHAN;// } else if ( restriction.isAtLeast() ) {// number = number + restriction.getAtLeast();// garnish = GREATERTHAN;// }// // // add number node// Node numNode = new SwoopNode( null, number, myModel); // myPanel.addNode( numNode );// numNode.setBackColor( LIT_NODE_COLOR );// // // add edge from property to number// Edge edge = new Edge( propNode, numNode, DEFAULT_DISTANCE);// edge.setID( garnish );// myPanel.addEdge( edge );// // myResultNode = propNode;// myEdgeID = null;// }// catch(Exception ex)// { ex.printStackTrace(); }// }// // // data all restriction (DONE)// public void visit(OWLDataAllRestriction restriction) throws OWLException// {// // try// { // URI propertyURI = restriction.getDataProperty().getURI(); // Node propNode = new SwoopNode( propertyURI, propertyURI.toString(), shortForms.shortForm( propertyURI ), myModel);// propNode.setType( Node.TYPE_ELLIPSE );// propNode.setBackColor( DATA_PROP_NODE_COLOR);// propNode = myPanel.addNode( propNode );// // OWLDataRange ran = restriction.getDataType();// ran.accept( this );//// Edge edge = new Edge( propNode, myResultNode );// edge.setID( FORALL );// myPanel.addEdge( edge );// // myResultNode = propNode;// myEdgeID = null;// }// catch (Exception ex)// { ex.printStackTrace(); }// }// // // data some restriction (DONE)// public void visit(OWLDataSomeRestriction restriction) throws OWLException // {// try// { // URI propertyURI = restriction.getDataProperty().getURI(); // Node propNode = new SwoopNode( propertyURI, propertyURI.toString(), shortForms.shortForm( propertyURI ), myModel);// propNode.setType( Node.TYPE_ELLIPSE );// propNode.setBackColor( DATA_PROP_NODE_COLOR);// propNode = myPanel.addNode( propNode );// // OWLDataRange ran = restriction.getDataType();// ran.accept( this );//// Edge edge = new Edge( propNode, myResultNode );// edge.setID( EXISTS );// myPanel.addEdge( edge );// // myResultNode = propNode;// myEdgeID = null;// }// catch (Exception ex)// { ex.printStackTrace(); }// }// // // data value restriction (DONE )// public void visit(OWLDataValueRestriction restriction) throws OWLException // {// try// { // URI propertyURI = restriction.getDataProperty().getURI(); // Node propNode = new SwoopNode( propertyURI, propertyURI.toString(), shortForms.shortForm( propertyURI ), myModel);// propNode.setType( Node.TYPE_ELLIPSE );// propNode.setBackColor( DATA_PROP_NODE_COLOR);// propNode = myPanel.addNode( propNode );//// restriction.getValue().accept( this );//// Edge edge = new Edge( propNode, myResultNode );// edge.setID( MUSTBE );// myPanel.addEdge( edge );// // myResultNode = propNode;// myEdgeID = null;// }// catch (Exception ex)// { ex.printStackTrace(); }// }// // // data cardinality restriction// public void visit(OWLDataCardinalityRestriction restriction) throws OWLException // {// try// {// URI propertyURI = restriction.getDataProperty().getURI();// Node propNode = new SwoopNode( propertyURI, propertyURI.toString(), shortForms.shortForm( propertyURI ), myModel);// propNode.setType( Node.TYPE_ELLIPSE );// propNode.setBackColor( DATA_PROP_NODE_COLOR);// propNode = myPanel.addNode( propNode );// // String number = "";// String garnish = "";// if ( restriction.isExactly() ) {// number = number + restriction.getAtLeast();// garnish = EQUALS;// } else if ( restriction.isAtMost() ) {// number = number + restriction.getAtMost();// garnish = LESSTHAN;// } else if ( restriction.isAtLeast() ) {// number = number + restriction.getAtLeast();// garnish = GREATERTHAN;// }// // Node numNode = new SwoopNode(null, number, myModel); // myPanel.addNode( numNode );// numNode.setBackColor( LIT_NODE_COLOR );// Edge edge = new Edge( propNode, numNode, DEFAULT_DISTANCE);// edge.setID( garnish );// myPanel.addEdge( edge );// // myResultNode = propNode;// myEdgeID = null;// }// catch(Exception ex)// { ex.printStackTrace(); }// }//// public void visit(OWLAnnotationProperty arg0) throws OWLException {}// public void visit(OWLAnnotationInstance arg0) throws OWLException {}// // public void visit(OWLFrame arg0) throws OWLException {}// public void visit(OWLOntology arg0) throws OWLException {}//// public void visit(OWLDifferentIndividualsAxiom arg0) throws OWLException {}// public void visit(OWLDisjointClassesAxiom arg0) throws OWLException {}// public void visit(OWLEquivalentClassesAxiom arg0) throws OWLException {}// public void visit(OWLEquivalentPropertiesAxiom arg0) throws OWLException {}// public void visit(OWLSameIndividualsAxiom arg0) throws OWLException {}// public void visit(OWLSubClassAxiom arg0) throws OWLException {}// public void visit(OWLSubPropertyAxiom arg0) throws OWLException {}//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLFunctionalPropertyAxiom)// */// public void visit(OWLFunctionalPropertyAxiom node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLInverseFunctionalPropertyAxiom)// */// public void visit(OWLInverseFunctionalPropertyAxiom node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLTransitivePropertyAxiom)// */// public void visit(OWLTransitivePropertyAxiom node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLSymmetricPropertyAxiom)// */// public void visit(OWLSymmetricPropertyAxiom node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLInversePropertyAxiom)// */// public void visit(OWLInversePropertyAxiom node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLPropertyDomainAxiom)// */// public void visit(OWLPropertyDomainAxiom node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLObjectPropertyRangeAxiom)// */// public void visit(OWLObjectPropertyRangeAxiom node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLDataPropertyRangeAxiom)// */// public void visit(OWLDataPropertyRangeAxiom node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLObjectPropertyInstance)// */// public void visit(OWLObjectPropertyInstance node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLDataPropertyInstance)// */// public void visit(OWLDataPropertyInstance node) throws OWLException {// // TODO Auto-generated method stub// // }//// /* (non-Javadoc)// * @see org.semanticweb.owl.model.OWLObjectVisitor#visit(org.semanticweb.owl.model.OWLIndividualTypeAssertion)// */// public void visit(OWLIndividualTypeAssertion node) throws OWLException {// // TODO Auto-generated method stub// // }// }// //
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?