Package net.wigis.graph.dnv.utilities

Examples of net.wigis.graph.dnv.utilities.Vector3D


    float red = node.getColor().getX();
    float green = node.getColor().getY();
    float blue = node.getColor().getZ();
    String label = node.getLabel();

    Vector3D color = new Vector3D( red, green, blue );
    int size = ServletHelper.getIntParameter( "s", request );
    String icon = node.getIcon();
    boolean showIcons = true;
    if( icon == null || icon.equals( "" ) )
    {
View Full Code Here


      {
        pub = new DNVNode( g );
        pub.setLabel( p.getTitle() );
        pub.setRadius( PUBLICATION_NODE_RADIUS );
        pub.setPosition( (float)Math.random(), (float)Math.random() );
        pub.setColor( new Vector3D( 0.2f, 0.2f, 0.8f ) );
        g.addNode( 0, pub );

        // iterate for all authors in this result
        Iterator<Author> aiterator = p.getAuthors().iterator();
        aut = null;
        while( aiterator.hasNext() )
        {
          // check if the author already exists in the graph
          a = aiterator.next();
          if( g.getNodeById( a.getId() ) != null )
          {
            aut = (DNVNode)g.getNodeById( a.getId() );
          }
          else
          {
            aut = new DNVNode( g );
            aut.setId( a.getId() );
            aut.setLabel( a.getName() );
            aut.setRadius( AUTHOR_NODE_RADIUS );
            aut.setPosition( (float)Math.random(), (float)Math.random() );
            aut.setColor( new Vector3D( 0.5f, 0.7f, 0.4f ) );
            g.addNode( 0, aut );
          }

          edge = new DNVEdge( 0, DNVEdge.DEFAULT_RESTING_DISTANCE, false, aut, pub, g );
          edge.setId( count );
View Full Code Here

  public Rectangle( Vector2D topLeft, Vector2D bottomRight, float thickness, Vector3D color, float alpha, boolean fill )
  {
    this.topLeft = new Vector2D( topLeft );
    this.bottomRight = new Vector2D( bottomRight );
    this.thickness = thickness;
    this.color = new Vector3D( color );
    this.fill = fill;
    this.alpha = alpha;
  }
View Full Code Here

  {
    this.center = new Vector2D( center );
    this.innerRadius = innerRadius;
    this.outerRadius = outerRadius;
    this.thickness = thickness;
    this.color = new Vector3D( color );
    this.fill = fill;
    this.alpha = alpha;
    this.isScreenPosition = isScreenPosition;
  }
View Full Code Here

    }
    else
    {
      if( this.outlineColor == null )
      {
        this.outlineColor = new Vector3D();
      }
      this.outlineColor.set( outlineColor );
    }
  }
View Full Code Here

    }
    else
    {
      if( this.labelColor == null )
      {
        this.labelColor = new Vector3D();
      }
      this.labelColor.set( labelColor );
    }
  }
View Full Code Here

    }
    else
    {
      if( this.labelOutlineColor == null )
      {
        this.labelOutlineColor = new Vector3D();
      }
      this.labelOutlineColor.set( labelOutlineColor );
    }
  }
View Full Code Here

    Integer maxCount = 0;
    String maxValue = "";
    Integer count = 0;
    Map<String, Integer> expertiseCount;
    Map<String, Vector3D> expertiseToColor = new HashMap<String, Vector3D>();
    Vector3D color;
    StringBuilder output = new StringBuilder();
    output.append( "All Departments:,Field Mapping:,Color Mapping\n" );
    for( String auth : authorToExpertiseCount.keySet() )
    {
      maxCount = 0;
      maxValue = "";
      expertiseCount = authorToExpertiseCount.get( auth );
      for( String value : expertiseCount.keySet() )
      {
        count = expertiseCount.get( value );
        if( count > maxCount )
        {
          maxCount = count;
          maxValue = value;
        }
      }

      color = expertiseToColor.get( maxValue );
      if( color == null )
      {
        if( colorList.size() > 0 )
        {
          color = GraphFunctions.convertColor( colorList.remove( 0 ) );
        }
        else
        {
          color = new Vector3D( (float)Math.random(), (float)Math.random(), (float)Math.random() );
        }
        expertiseToColor.put( maxValue, color );
      }

      output.append( "\"" ).append( auth ).append( "\",\"" ).append( maxValue ).append( "\",\"" ).append( color.toHexColor() ).append( "\"\n" );
    }

    writeFile( directory + mappingFile, output.toString() );
  }
View Full Code Here

    {
      tempLine = line.substring( line.indexOf( checkString ) + checkString.length() );
      tempLine = tempLine.substring( 0, tempLine.indexOf( "\"" ) );
      if( !tempLine.equals( "null" ) )
      {
        labelColor = new Vector3D( tempLine );
        if( labelColor.getX() > 1 )
          labelColor.setX( 1 );
        if( labelColor.getY() > 1 )
          labelColor.setY( 1 );
        if( labelColor.getZ() > 1 )
          labelColor.setZ( 1 );
        if( labelColor.getX() < 0 )
          labelColor.setX( 0 );
        if( labelColor.getY() < 0 )
          labelColor.setY( 0 );
        if( labelColor.getZ() < 0 )
          labelColor.setZ( 0 );
      }
    }
    checkString = " LabelOutlineColor=\"";
    if( line.contains( checkString ) )
    {
      tempLine = line.substring( line.indexOf( checkString ) + checkString.length() );
      tempLine = tempLine.substring( 0, tempLine.indexOf( "\"" ) );
      if( !tempLine.equals( "null" ) )
      {
        labelOutlineColor = new Vector3D( tempLine );
        if( labelOutlineColor.getX() > 1 )
          labelOutlineColor.setX( 1 );
        if( labelOutlineColor.getY() > 1 )
          labelOutlineColor.setY( 1 );
        if( labelOutlineColor.getZ() > 1 )
View Full Code Here

    DNVNode newNode = new DNVNode( new Vector2D( tempNode.getPosition() ), graph );
    newNode.setColor( tempNode.getColor() );
    newNode.setLevel( newLevel.intValue() );
    newNode.setFirstChild( tempNode );
    graph.addNode( newLevel, newNode );
    Vector3D color = new Vector3D( tempNode.getColor() );
    newNode.setColor( color );

    nodeToParent.put( tempNode.getId(), newNode );
    List<DNVNode> tempList = new ArrayList<DNVNode>();
    tempList.add( tempNode );
View Full Code Here

TOP

Related Classes of net.wigis.graph.dnv.utilities.Vector3D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.