Package mgui.interfaces.shapes.graphs
Class Graph3DInt
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.shapes.InterfaceShape
mgui.interfaces.shapes.Shape3DInt
mgui.interfaces.shapes.PointSet3DInt
mgui.interfaces.shapes.graphs.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
-
Nested Class Summary
Nested classes/interfaces inherited from class mgui.interfaces.shapes.Shape3DInt
Shape3DInt.VertexShapeTransformerNested classes/interfaces inherited from class mgui.interfaces.shapes.InterfaceShape
InterfaceShape.VertexDataSetNested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType -
Field Summary
Fields Modifier and Type Field Description protected org.jogamp.java3d.Appearanceedge_appearanceprotected java.util.HashMap<AbstractGraphNode,java.lang.Integer>node_mapprotected edu.uci.ics.jung.visualization3d.RenderContext<AbstractGraphNode,AbstractGraphEdge>renderContextprotected org.jogamp.java3d.Appearancevertex_appearanceFields inherited from class mgui.interfaces.shapes.Shape3DInt
boundBox, boundBoxNode, bounds_group, bounds_shape, boundSphere, centerPt, children2D, creatable_scene_node, drawEngine2D, has_3d_node, hasCameraListener, idStr, nodeListener, parent2D, scene3DObject, sceneNode, selected_vertices_group, shape_group, shape3d, vertex_shape_transformer, vertices_groupFields inherited from class mgui.interfaces.shapes.InterfaceShape
attributes, constraints, data_columns, icon, ID, is_auxiliary, is_registered, isDrawable, isImageShape, isLight, isOverridden, last_column_added, last_column_changed, last_column_removed, linked_colour_maps, loader_options, notifyListeners, overrideAttr, parent_set, selected_nodes, shapeListeners, vertex_data, writer_options, xml_current_column, xml_current_loader, xml_current_shape, xml_current_shape_options, xml_current_type, xml_current_url, xml_is_vertex_data, xml_root_dirFields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes -
Constructor Summary
Constructors Constructor Description Graph3DInt()Graph3DInt(Graph3D graph)Graph3DInt(Graph3D graph, java.lang.String name)Graph3DInt(InterfaceAbstractGraph graph) -
Method Summary
Modifier and Type Method Description voidaddShape2DChild(Shape2DInt shape)voidattributeUpdated(AttributeEvent e)Responds to an update in one of this shape's attributes.voidfinalizeAfterXML()Allows subclasses to do some finalization after an XML load operation.protected org.jogamp.java3d.AppearancegetEdgeAppearance(AbstractGraphEdge edge)java.awt.ColorgetEdgeColour(AbstractGraphEdge edge)floatgetEdgeScale(AbstractGraphEdge edge)ColourMapgetEdgeWeightColourMap()ShapegetGeometryInstance()Returns an instance of thisInterfaceShape's geometry class.InterfaceAbstractGraphgetGraph()protected edu.uci.ics.jung.algorithms.layout3d.Layout<AbstractGraphNode,AbstractGraphEdge>getGraphLayoutInstance()Attribute<?>getInheritingAttribute(Attribute<?> attribute)Returns the 2D attribute inheriting from a 3D attribute.protected org.jogamp.java3d.AppearancegetLabelAppearance(AbstractGraphNode node)floatgetLabelOffset()protected edu.uci.ics.jung.algorithms.layout3d.Layout<AbstractGraphNode,AbstractGraphEdge>getLayout()protected java.lang.Class<?>getLayoutClass()java.lang.StringgetLocalName()Returns the local name associated with this XML object.javax.swing.IcongetObjectIcon()Returns an icon for this shape, if one has been defined.InterfacePopupMenugetPopupMenu()Produces and returns a popup menu for this object.protected Shape2DIntgetShape2D(Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)To be overridden by subclasses implementing a 2D representationprotected org.jogamp.java3d.AppearancegetVertexAppearance(AbstractGraphNode node)java.awt.ColorgetVertexColour(AbstractGraphNode node)floatgetVertexScale(AbstractGraphNode node)booleanisHeritableAttribute(java.lang.String name)Is this parent attribute inherited by a child shape?voidsetGraph(Graph3D graph)protected voidsetLayout()voidsetScene3DObject(boolean make_live)Sets this ShapeInt's Java3D scene node from its current geometry and rendering attributes.voidsetShape(Shape3D shape)java.lang.StringtoString()protected voidupdateEdgeColours()Update the colours of this graph's edges, without regenerating it.protected voidupdateEdgeShapes()Update the shapes of this graph's edges, without regenerating it.voidupdateShape()Updates the geometric bounds of this ShapeInt.protected voidupdateVertexColours()Update the colours of this graph's vertices, without regenerating it.protected voidupdateVertexShapes()Update the shapes of this graph's vertices, without regenerating it.Methods inherited from class mgui.interfaces.shapes.PointSet3DInt
appendPoints, appendPoints, getDimensions, getLabelAppearance, getPointSet, getVertexAlpha, getVertexAppearance, getVertexColour, getVerticesAsPoints, getVerticesAsSpheres, getXML, needsRedraw, setIconMethods inherited from class mgui.interfaces.shapes.Shape3DInt
clear2DChildren, contains, copyAttributes, crossesPlane, deregisterCameraListener, destroy, draw2D, drawShape2D, drawShape2D, drawShape2D, fireChildren2D, fireChildren2DModified, fireShapeListeners, fireShapeModified, geometryChanged, getAlpha, getBoundBox, getBoundBoxNode, getBoundSphere, getCameraListener, getCenterOfGravity, getClosestVertex, getDTD, getFullName, getGeometricCenter, getGeometry, getIcon, getLabelColour, getLabelFont, getLabelScale, getLineColour, getLineStyle, getModifiedAttribute, getParent2D, getParentAttribute, getPopupMenu, getPopupMenuLength, getProximity, getScene3DObject, getScene3DObject, getShape, getShape2D, getShape2DInt, getShape2DInt, getShapeSceneNode, getShapeSceneNode, getShortXML, getTransferData, getTransferDataFlavors, getTreeLabel, getVertex, getVertexColour, getVertexCount, getVertexScale, getVertexScale, getVertexSelection, getVertices, handlePopupEvent, hasAlpha, hasAlpha, hasCameraListener, hasParentShape, init, isDataFlavorSupported, isInheritingAttribute, isLive, issueTreeNode, performTransfer, registerCameraListener, releaseScene3DChildren, removeShape2DChild, setAlpha, setBoundBoxNode, setCreatableSceneNode, setCurrentColumn, setGeometry, setGraphic3DPopupMenu, setLabelColour, setLabelFont, setLabelScale, setLineStyle, setLive, setParent2D, setScene3DObject, setSelectedVertices, setShapeSceneNode, setShowSelectedVertices, setVertexSelection, showPopupMenu, showVertices, showVertices, updateChildren2D, updateData, updateSelectedVertices, updateVerticesMethods inherited from class mgui.interfaces.shapes.InterfaceShape
_init, addDataLink, addShapeListener, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, cleanTreeNodes, compareTo, fromVariable, getAllVertexData, getAttribute, getAttributes, getAttributeValue, getByReferenceUrls, getColourMap, getColourMap, getConstraint, getConstraints, getCurrentColumn, getCurrentDataColumn, getCurrentVertexData, getDataLink, getDataMax, getDataMin, getDatumAtVertex, getDatumAtVertex, getDefaultColourMap, getFileLoader, getFileWriter, getID, getInheritedAttribute, getInheritedAttributes, getInheritedAttributeValue, getLastColumnAdded, getLastColumnChanged, getLastColumnRemoved, getLegalName, getLinkedVertexData, getLinkedVertexDatum, getLoaderOptions, getModel, getName, getNameMap, getNameMap, getNonLinkedDataColumns, getParentSet, getSourceURL, getUnit, getUrlReference, getVariables, getVariableType, getVariableValue, getVariableValues, getVertexData, getVertexData, getVertexDataColumn, getVertexDataColumnCount, getVertexDataColumnNames, getVertexDataColumns, getVertexDataMap, getWriterOptions, getXML, getXML, getXMLSchema, handleXMLElementEnd, handleXMLElementStart, handleXMLString, hasAttribute, hasColumn, hasData, inheritAttributesFromParent, isAuxiliaryShape, isAuxiliaryShape, isDestroyed, isDrawable, isImageShape, isLegalName, isLight, isSelectable, isVisible, newVertexData, queryObject, queryShapeAtVertex, register, removeColourMap, removeDataLink, removeNameMap, removeShapeListener, removeVertexData, renameVertexDataColumn, setAttribute, setAttributes, setColourMap, setColourMap, setConstraint, setCurrentColumn, setDataMax, setDataMax, setDataMax, setDataMin, setDataMin, setDataMin, setDatumAtVertex, setDatumAtVertex, setDatumAtVertex, setDatumAtVertex, setDefaultColourMap, setDefaultColourMap, setFileLoader, setFileLoader, setFileWriter, setID, setLoaderOptions, setName, setNameMap, setOverride, setParentSet, setSelectable, setTreeNode, setUnit, setUrlReference, setVariableValues, setVariableValues, setVertexData, setVertexData, setVertexData, setVertexDataMap, setVisible, setWriterOptions, setXMLRoot, show2D, show2D, show3D, show3D, showData, showData, supportsVariableType, toVariable, unsetOverride, updateDataColumns, vertexDataColumnChanged, vertexDataColumnColourMapChanged, writeXML, writeXML, writeXMLMethods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, updateTreeNodesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface mgui.interfaces.util.CleanableObject
clean
-
Field Details
-
vertex_appearance
protected org.jogamp.java3d.Appearance vertex_appearance -
edge_appearance
protected org.jogamp.java3d.Appearance edge_appearance -
node_map
-
renderContext
protected edu.uci.ics.jung.visualization3d.RenderContext<AbstractGraphNode,AbstractGraphEdge> renderContext
-
-
Constructor Details
-
Graph3DInt
public Graph3DInt() -
Graph3DInt
-
Graph3DInt
-
Graph3DInt
-
-
Method Details
-
getLabelOffset
public float getLabelOffset() -
getEdgeScale
-
getEdgeWeightColourMap
-
getShape2D
protected Shape2DInt getShape2D(Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)Description copied from class:Shape3DIntTo be overridden by subclasses implementing a 2D representation- Overrides:
getShape2Din classPointSet3DInt- Parameters:
plane- Plane on which to renderabove_dist- Distance above plane within which to project a shapebelow_dist- Distance below plane within which to project a shape- Returns:
-
addShape2DChild
- Overrides:
addShape2DChildin classShape3DInt
-
isHeritableAttribute
public boolean isHeritableAttribute(java.lang.String name)Description copied from class:InterfaceShapeIs this parent attribute inherited by a child shape?- Overrides:
isHeritableAttributein classShape3DInt- Returns:
-
getInheritingAttribute
Description copied from class:Shape3DIntReturns 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:
getInheritingAttributein classShape3DInt- Returns:
- The inheriting attribute, or
nullif attribute is not heritable
-
getVertexScale
-
getVertexColour
-
getEdgeColour
-
getEdgeAppearance
-
getVertexAppearance
-
getLabelAppearance
-
getLayout
protected edu.uci.ics.jung.algorithms.layout3d.Layout<AbstractGraphNode,AbstractGraphEdge> getLayout() -
getLayoutClass
protected java.lang.Class<?> getLayoutClass() -
getGraph
-
setGraph
-
setShape
- Overrides:
setShapein classShape3DInt
-
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:Shape3DIntSets this ShapeInt's Java3D scene node from its current geometry and rendering attributes. This node should be retrieved using theShape3DInt.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).
- Overrides:
setScene3DObjectin classPointSet3DInt
-
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:Shape3DIntUpdates the geometric bounds of this ShapeInt. Does not callShape3DInt.setScene3DObject().- Overrides:
updateShapein classShape3DInt
-
getPopupMenu
Description copied from interface:PopupMenuObjectProduces and returns a popup menu for this object.- Specified by:
getPopupMenuin interfacePopupMenuObject- Overrides:
getPopupMenuin classInterfaceShape- Returns:
-
attributeUpdated
Description copied from class:Shape3DIntResponds 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:
attributeUpdatedin interfaceAttributeListener- Overrides:
attributeUpdatedin classPointSet3DInt- Parameters:
e- anAttributeEventspecifying which attribute has been changed
-
setLayout
protected void setLayout() -
getGeometryInstance
Description copied from class:InterfaceShapeReturns an instance of thisInterfaceShape's geometry class.- Overrides:
getGeometryInstancein classPointSet3DInt- Returns:
-
toString
public java.lang.String toString()- Overrides:
toStringin classPointSet3DInt
-
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from class:InterfaceShapeReturns an icon for this shape, if one has been defined. Returns null otherwise.- Specified by:
getObjectIconin interfaceIconObject- Overrides:
getObjectIconin classInterfaceShape- Returns:
-
getLocalName
public java.lang.String getLocalName()Description copied from interface:XMLObjectReturns the local name associated with this XML object.- Specified by:
getLocalNamein interfaceXMLObject- Overrides:
getLocalNamein classPointSet3DInt- Returns:
-
finalizeAfterXML
public void finalizeAfterXML()Description copied from class:InterfaceShapeAllows subclasses to do some finalization after an XML load operation. Does nothing by default.- Overrides:
finalizeAfterXMLin classInterfaceShape
-