Class Graph3DInt

All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.lang.Comparable<InterfaceShape>, AttributeListener, AttributeObject, InterfaceObject, PersistentObject, VariableObject, PopupMenuObject, NamedObject, InterfaceQueryObject, InterfaceShapeQueryObject, VertexDataColumnListener, InterfaceTransferable, TreeObject, CleanableObject, XMLObject, IconObject, org.jogamp.java3d.GeometryUpdater

public class Graph3DInt
extends PointSet3DInt
Represents a graph as a 3D shape. Uses modified Jung code.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

    • vertex_appearance

      protected org.jogamp.java3d.Appearance vertex_appearance
    • edge_appearance

      protected org.jogamp.java3d.Appearance edge_appearance
    • node_map

      protected java.util.HashMap<AbstractGraphNode,​java.lang.Integer> node_map
    • renderContext

      protected edu.uci.ics.jung.visualization3d.RenderContext<AbstractGraphNode,​AbstractGraphEdge> renderContext
  • Constructor Details

    • Graph3DInt

      public Graph3DInt()
    • Graph3DInt

      public Graph3DInt​(Graph3D graph)
    • Graph3DInt

      public Graph3DInt​(Graph3D graph, java.lang.String name)
    • Graph3DInt

      public Graph3DInt​(InterfaceAbstractGraph graph)
  • Method Details

    • getLabelOffset

      public float getLabelOffset()
    • getEdgeScale

      public float getEdgeScale​(AbstractGraphEdge edge)
    • getEdgeWeightColourMap

      public ColourMap getEdgeWeightColourMap()
    • getShape2D

      protected Shape2DInt getShape2D​(Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)
      Description copied from class: Shape3DInt
      To be overridden by subclasses implementing a 2D representation
      Overrides:
      getShape2D in class PointSet3DInt
      Parameters:
      plane - Plane on which to render
      above_dist - Distance above plane within which to project a shape
      below_dist - Distance below plane within which to project a shape
      Returns:
    • addShape2DChild

      public void addShape2DChild​(Shape2DInt shape)
      Overrides:
      addShape2DChild in class Shape3DInt
    • isHeritableAttribute

      public boolean isHeritableAttribute​(java.lang.String name)
      Description copied from class: InterfaceShape
      Is this parent attribute inherited by a child shape?
      Overrides:
      isHeritableAttribute in class Shape3DInt
      Returns:
    • getInheritingAttribute

      public Attribute<?> getInheritingAttribute​(Attribute<?> attribute)
      Description copied from class: Shape3DInt
      Returns the 2D attribute inheriting from a 3D attribute. Use when InheritFromParent=true. Subclasses should override this method if certain 3D attributes are not intended to be inherited (e.g., vertex scales).
      Overrides:
      getInheritingAttribute in class Shape3DInt
      Returns:
      The inheriting attribute, or null if attribute is not heritable
    • getVertexScale

      public float getVertexScale​(AbstractGraphNode node)
    • getVertexColour

      public java.awt.Color getVertexColour​(AbstractGraphNode node)
    • getEdgeColour

      public java.awt.Color getEdgeColour​(AbstractGraphEdge edge)
    • getEdgeAppearance

      protected org.jogamp.java3d.Appearance getEdgeAppearance​(AbstractGraphEdge edge)
    • getVertexAppearance

      protected org.jogamp.java3d.Appearance getVertexAppearance​(AbstractGraphNode node)
    • getLabelAppearance

      protected org.jogamp.java3d.Appearance getLabelAppearance​(AbstractGraphNode node)
    • getLayout

      protected edu.uci.ics.jung.algorithms.layout3d.Layout<AbstractGraphNode,​AbstractGraphEdge> getLayout()
    • getLayoutClass

      protected java.lang.Class<?> getLayoutClass()
    • getGraph

      public InterfaceAbstractGraph getGraph()
    • setGraph

      public void setGraph​(Graph3D graph)
    • setShape

      public void setShape​(Shape3D shape)
      Overrides:
      setShape in class Shape3DInt
    • getGraphLayoutInstance

      protected edu.uci.ics.jung.algorithms.layout3d.Layout<AbstractGraphNode,​AbstractGraphEdge> getGraphLayoutInstance() throws GraphException
      Throws:
      GraphException
    • setScene3DObject

      public void setScene3DObject​(boolean make_live)
      Description copied from class: Shape3DInt
      Sets this ShapeInt's Java3D scene node from its current geometry and rendering attributes. This node should be retrieved using the Shape3DInt.getShapeSceneNode() method. A scene node will only created if one of these conditions is met:
      • The shape is auxiliary (i.e., not a model shape, but a helper shape such as a section polygon)
      • The shape is associated with a ShapeModel3D, and this model is live (is associated with at least one Java3D scene graph).
      Subclasses which call this super method should always check that a scene node has indeed been created.
      Overrides:
      setScene3DObject in class PointSet3DInt
    • updateEdgeColours

      protected void updateEdgeColours()
      Update the colours of this graph's edges, without regenerating it.
    • updateEdgeShapes

      protected void updateEdgeShapes()
      Update the shapes of this graph's edges, without regenerating it.
    • updateVertexColours

      protected void updateVertexColours()
      Update the colours of this graph's vertices, without regenerating it.
    • updateVertexShapes

      protected void updateVertexShapes()
      Update the shapes of this graph's vertices, without regenerating it.
    • updateShape

      public void updateShape()
      Description copied from class: Shape3DInt
      Updates the geometric bounds of this ShapeInt. Does not call Shape3DInt.setScene3DObject().
      Overrides:
      updateShape in class Shape3DInt
    • getPopupMenu

      public InterfacePopupMenu getPopupMenu()
      Description copied from interface: PopupMenuObject
      Produces and returns a popup menu for this object.
      Specified by:
      getPopupMenu in interface PopupMenuObject
      Overrides:
      getPopupMenu in class InterfaceShape
      Returns:
    • attributeUpdated

      public void attributeUpdated​(AttributeEvent e)
      Description copied from class: Shape3DInt
      Responds to an update in one of this shape's attributes.

      Subclasses should override and call this super method AFTER handling the attribute change appropriately. Subclasses should also override needsRedraw() to indicate whether the scene node should be regenerated.

      Specified by:
      attributeUpdated in interface AttributeListener
      Overrides:
      attributeUpdated in class PointSet3DInt
      Parameters:
      e - an AttributeEvent specifying which attribute has been changed
    • setLayout

      protected void setLayout()
    • getGeometryInstance

      public Shape getGeometryInstance()
      Description copied from class: InterfaceShape
      Returns an instance of this InterfaceShape's geometry class.
      Overrides:
      getGeometryInstance in class PointSet3DInt
      Returns:
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class PointSet3DInt
    • getObjectIcon

      public javax.swing.Icon getObjectIcon()
      Description copied from class: InterfaceShape
      Returns an icon for this shape, if one has been defined. Returns null otherwise.
      Specified by:
      getObjectIcon in interface IconObject
      Overrides:
      getObjectIcon in class InterfaceShape
      Returns:
    • getLocalName

      public java.lang.String getLocalName()
      Description copied from interface: XMLObject
      Returns the local name associated with this XML object.
      Specified by:
      getLocalName in interface XMLObject
      Overrides:
      getLocalName in class PointSet3DInt
      Returns:
    • finalizeAfterXML

      public void finalizeAfterXML()
      Description copied from class: InterfaceShape
      Allows subclasses to do some finalization after an XML load operation. Does nothing by default.
      Overrides:
      finalizeAfterXML in class InterfaceShape