Package mgui.interfaces.shapes
Class Shape2DInt
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.shapes.InterfaceShape
mgui.interfaces.shapes.Shape2DInt
- All Implemented Interfaces:
java.awt.datatransfer.Transferable,java.lang.Cloneable,java.lang.Comparable<InterfaceShape>,AttributeListener,AttributeObject,InterfaceObject,PersistentObject,VariableObject,PopupMenuObject,NamedObject,InterfaceQueryObject,InterfaceShapeQueryObject,ShapeListener,VertexDataColumnListener,InterfaceTransferable,TreeObject,CleanableObject,XMLObject,IconObject
- Direct Known Subclasses:
Circle2DInt,Ellipse2DInt,Image2DInt,Line2DInt,Mesh2DInt,Point2DInt,PointSet2DInt,Polygon2DInt,RadialRep2DInt,Rect2DInt,SectionSet2DInt,Shape2DSelectionSet,ShapeSet2DInt,Text2DInt,Vector2DInt
public abstract class Shape2DInt extends InterfaceShape implements ShapeListener, java.lang.Cloneable
Base class for all interfaces to 2D geometrical shapes. Specifies functions and fields
common to all shapes.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested 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 Rect2Dboundsorg.jogamp.vecmath.Point2fcenterPtShape3DIntchild3DDrawingEnginedrawEnginejava.lang.StringidStrprotected java.util.HashMap<java.lang.Integer,java.lang.Integer>map_idx_to_parentprotected ShapeListenernodeListenerShape3DIntparentShapeShapeSceneNodesceneNodeShape2DthisShapeFields 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 Shape2DInt() -
Method Summary
Modifier and Type Method Description booleanaddVertexData(java.lang.String key)Add a vertex-wise data column of typeDataBuffer.TYPE_DOUBLE.booleanaddVertexData(java.lang.String key, int dataType)Add a vertex-wise data column of typedataType, which must be one ofDataBuffer.TYPE_DOUBLE,DataBuffer.TYPE_FLOAT, orDataBuffer.TYPE_INT.booleanaddVertexData(java.lang.String key, java.util.ArrayList<MguiNumber> data)Adds a new vertex data column and populates it withdata.booleanaddVertexData(java.lang.String key, java.util.ArrayList<MguiNumber> data, NameMap map)Adds vertex-wise data to this shape.voidattributeUpdated(AttributeEvent e)Responds to a change in a specific attribute by notifying this ShapeInt's shape listeners with anAttributeModifiedshape event.java.lang.Objectclone()booleancontains(org.jogamp.vecmath.Point2f thisPoint)voiddestroy()Destroy this object (prepare it to be removed from memory)voiddestroy(ShapeEvent event)protected voiddraw(java.awt.Graphics2D g, DrawingEngine d)voiddrawShape2D(java.awt.Graphics2D g, DrawingEngine d)ABSTRACT METHODSvoidfireShapeListeners(ShapeEvent e)java.util.ArrayList<java.util.ArrayList<MguiNumber>>getAllVertexData()Returns all vertex-wide data associated with this shape.floatgetAlpha()Gets the current transparency level for this shape.Rect2DgetBounds()ShapegetBoundShape()org.jogamp.vecmath.Point2fgetCenterPoint()Shape3DIntgetChild3D()intgetClosestVertex(org.jogamp.vecmath.Point2f point)Returns the index of the vertex in this shape which is closest topoint.intgetClosestVertex3D(org.jogamp.vecmath.Point2f point, Plane3D plane)If this shape has a parentShape3DIntobject, this method calls the getClosestVertex method of the parent.java.lang.StringgetCurrentColumn()Returns the name of the current data columnjava.util.ArrayList<MguiNumber>getCurrentVertexData()Retrieves the currently selected vertex-wise data column.MguiNumbergetDatumAtVertex(java.lang.String column, int index)Returns the datum fromcolumnatindex.int[]getDimensions()Returns the dimensions of this object as an array of integersjava.lang.StringgetDTD()Returns the Data Type Declaration (DTD) for this object's XML representationRect2DgetExtBounds()ShapegetGeometry()Returns the Shape associated with this objectShapegetGeometryInstance()Returns an instance of thisInterfaceShape's geometry class.java.awt.ColorgetLabelColour()java.awt.FontgetLabelFont()floatgetLabelScale()java.awt.ColorgetLineColour()Returns the colour of this shape's lines/edges.java.awt.StrokegetLineStyle()Returns the line/edge style for this shape.java.util.ArrayList<MguiNumber>getLinkedVertexData(java.lang.String linked_column)Retrieves the vertex-wise data associated with a data-linked column.MguiNumbergetLinkedVertexDatum(java.lang.String linked_column, int index)Returns the value at the given vertex, for the given linked column.java.lang.StringgetLocalName()Returns the local name associated with this XML object.java.util.HashMap<java.lang.Integer,java.lang.Integer>getMapIdxToParent()Attribute<?>getModifiedAttribute()java.util.ArrayList<java.lang.String>getNonLinkedDataColumns()Returns a list of this shape's data columns, minus the linked columns.protected Attribute<?>getParentAttribute(java.lang.String attrName)Shape3DIntgetParentShape()InterfacePopupMenugetPopupMenu()Produces and returns a popup menu for this object.InterfacePopupMenugetPopupMenu(java.util.List<java.lang.Object> selected)Produces and returns a popup menu for this object.doublegetProximity(org.jogamp.vecmath.Point2f thisPoint)Shape2DgetShape()protected Shape3DIntgetShape3D(Plane3D plane)Shape3DIntgetShape3DInt(Plane3D plane)Returns a 3D representation of this shape, assuming it belongs toplane.Shape3DIntgetShape3DInt(Plane3D plane, boolean set_parent)Returns a 3D representation of this shape, assuming it belongs toplane.java.lang.StringgetShortXML(int tab)Returns a short XML representation of this object.java.lang.ObjectgetTransferData(java.awt.datatransfer.DataFlavor flavor)java.awt.datatransfer.DataFlavor[]getTransferDataFlavors()java.lang.StringgetTreeLabel()Returns the label text to appear in a tree node.org.jogamp.vecmath.Point2fgetVertex(int i)java.awt.ColorgetVertexColour()Returns the colour of this shape's vertices.intgetVertexCount()Returns the number of vertices defining the geometry of this shape.java.util.ArrayList<MguiNumber>getVertexData(java.lang.String column)Returns a live version of the data incolumn.VertexDataColumngetVertexDataColumn(java.lang.String name)Returns the vertex data column associated withname.java.util.ArrayList<java.lang.String>getVertexDataColumnNames()Returns a list of the names of all vertex data columns.java.util.ArrayList<VertexDataColumn>getVertexDataColumns()Returns a list of all vertex data columns.java.util.HashMap<java.lang.String,java.util.ArrayList<MguiNumber>>getVertexDataMap()Retrieves a hash map containing the vertex-wise data associated with this shape.floatgetVertexScale()Returns the scale of this shape's verticesVertexSelectiongetVertexSelection()TODO: implement meNodeShapegetVertexShape()java.util.ArrayList<org.jogamp.vecmath.Point2f>getVertices()booleangetVisibility()Deprecated.voidhandlePopupEvent(java.awt.event.ActionEvent e)Handles an event on this object's popup menu.booleanhasAlpha()Queries whether this shape has transparency.voidhasAlpha(boolean b)Specifies whether this shape has transparency.booleanhasColumn(java.lang.String s)booleanhasData()booleanhasParentShape()Is this shape a child of another shape? Usually this refers to shapes which produce themselves in a different dimensionality; e.g., a 3D shape represented on a 2D plane.booleanisDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)booleanisHeritableAttribute(java.lang.String name)Is this parent attribute inherited by a child shape?booleanisInheritingAttribute(Attribute<?> attribute)Does this child attribute inherit values from a parent shape?booleanisLabelShape()InterfaceTreeNodeissueTreeNode()Issues a new tree node and sets it usingAbstractInterfaceObject.setTreeNode(mgui.interfaces.trees.InterfaceTreeNode).booleanneedsRedraw(Attribute<?> a)Returnstrueif a change toattributewill require a redraw of this shape.booleanperformTransfer(javax.swing.TransferHandler.TransferSupport support)java.lang.StringprintNodes()voidremoveVertexData(java.lang.String key)Remove a vertex data column from this shape.voidsetAlpha(float f)Sets the current transparency level for this shape.voidsetChild3D(Shape3DInt child)voidsetCurrentColumn(java.lang.String key)voidsetCurrentColumn(java.lang.String key, boolean update)booleansetGeometry(Shape geometry)Sets the Shape associated with this object.voidsetGraphic2DPopupMenu(InterfacePopupMenu menu)Subclasses should override this if necessary and call super.getGraphic3DPopupMenu() to get this top-level menu and add items to it.protected voidsetIcon()voidsetLabelColour(java.awt.Color colour)voidsetLabelFont(java.awt.Font font)voidsetLabelScale(float scale)voidsetLineStyle(java.awt.Stroke s)Returns the line/edge style for this shape.voidsetMapIdxToParent(java.util.HashMap<java.lang.Integer,java.lang.Integer> map_idx_to_parent)voidsetParentShape(Shape3DInt shape)voidsetShape(Shape2D newShape)voidsetTreeNode(InterfaceTreeNode treeNode)Constructs a tree node from this shape.voidsetVertexDataMap(java.util.HashMap<java.lang.String,java.util.ArrayList<MguiNumber>> data)Sets the hash map specified the vertex-wise data associated with this shape.voidsetVertexSelection(VertexSelection selection)voidsetVertexShape(NodeShape shape)voidshapeUpdated(ShapeEvent e)A shape that this object is listening to has been updated.voidshowPopupMenu(java.awt.event.MouseEvent e)Shows a popup menu at the point of the givenMouseEvent.booleanshowVertices()Queries whether the vertices of this shape are visible.voidshowVertices(boolean b)Specifies whether the vertices of this shape are visible.java.lang.StringtoString()protected voidupdateDataColumns()voidupdateShape()booleanvalidateNodes()protected voidwriteShapeToXML(int tab, java.io.Writer writer, ProgressUpdater progress_bar, XMLObject.XMLType type)voidwriteXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)Writes the XML representation of this object to file.Methods inherited from class mgui.interfaces.shapes.InterfaceShape
_init, addDataLink, addShapeListener, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, cleanTreeNodes, compareTo, copyAttributes, finalizeAfterXML, fireShapeModified, fromVariable, getAttribute, getAttributes, getAttributeValue, getByReferenceUrls, getColourMap, getColourMap, getConstraint, getConstraints, getCurrentDataColumn, getDataLink, getDataMax, getDataMin, getDatumAtVertex, getDefaultColourMap, getFileLoader, getFileWriter, getFullName, getID, getInheritedAttribute, getInheritedAttributes, getInheritedAttributeValue, getLastColumnAdded, getLastColumnChanged, getLastColumnRemoved, getLegalName, getLoaderOptions, getModel, getName, getNameMap, getNameMap, getObjectIcon, getParentSet, getSourceURL, getUnit, getUrlReference, getVariables, getVariableType, getVariableValue, getVariableValues, getVertexData, getVertexDataColumnCount, getWriterOptions, getXML, getXML, getXML, getXMLSchema, handleXMLElementEnd, handleXMLElementStart, handleXMLString, hasAttribute, inheritAttributesFromParent, isAuxiliaryShape, isAuxiliaryShape, isDestroyed, isDrawable, isImageShape, isLegalName, isLight, isSelectable, isVisible, newVertexData, queryObject, queryShapeAtVertex, register, removeColourMap, removeDataLink, removeNameMap, removeShapeListener, renameVertexDataColumn, setAttribute, setAttributes, setColourMap, setColourMap, setConstraint, setDataMax, setDataMax, setDataMax, setDataMin, setDataMin, setDataMin, setDatumAtVertex, setDatumAtVertex, setDatumAtVertex, setDatumAtVertex, setDefaultColourMap, setDefaultColourMap, setFileLoader, setFileLoader, setFileWriter, setID, setLoaderOptions, setName, setNameMap, setOverride, setParentSet, setSelectable, setUnit, setUrlReference, setVariableValues, setVariableValues, setVertexData, setVertexData, setVertexData, setVisible, setWriterOptions, setXMLRoot, show2D, show2D, show3D, show3D, showData, showData, supportsVariableType, toVariable, unsetOverride, vertexDataColumnChanged, vertexDataColumnColourMapChanged, writeXML, writeXMLMethods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, updateTreeNodesMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface mgui.interfaces.util.CleanableObject
cleanMethods inherited from interface mgui.interfaces.shapes.util.ShapeListener
isDestroyed
-
Field Details
-
thisShape
-
drawEngine
-
idStr
public java.lang.String idStr -
bounds
-
nodeListener
-
centerPt
public org.jogamp.vecmath.Point2f centerPt -
sceneNode
-
parentShape
-
child3D
-
map_idx_to_parent
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> map_idx_to_parent
-
-
Constructor Details
-
Shape2DInt
public Shape2DInt()
-
-
Method Details
-
getGeometryInstance
Description copied from class:InterfaceShapeReturns an instance of thisInterfaceShape's geometry class.- Specified by:
getGeometryInstancein classInterfaceShape- Returns:
-
getParentAttribute
- Specified by:
getParentAttributein classInterfaceShape
-
setMapIdxToParent
public void setMapIdxToParent(java.util.HashMap<java.lang.Integer,java.lang.Integer> map_idx_to_parent) -
getMapIdxToParent
public java.util.HashMap<java.lang.Integer,java.lang.Integer> getMapIdxToParent() -
getGeometry
Description copied from class:InterfaceShapeReturns the Shape associated with this object- Specified by:
getGeometryin classInterfaceShape- Returns:
-
setGeometry
Description copied from class:InterfaceShapeSets the Shape associated with this object. If the class type is incorrect, returnsfalse- Specified by:
setGeometryin classInterfaceShape- Returns:
-
getVertexShape
-
setVertexShape
-
isLabelShape
public boolean isLabelShape() -
getVertexCount
public int getVertexCount()Description copied from class:InterfaceShapeReturns the number of vertices defining the geometry of this shape.- Specified by:
getVertexCountin classInterfaceShape- Returns:
-
getDimensions
public int[] getDimensions()Description copied from interface:VariableObjectReturns the dimensions of this object as an array of integers- Specified by:
getDimensionsin interfaceVariableObject- Returns:
- the dimensions of this object
-
getVertices
public java.util.ArrayList<org.jogamp.vecmath.Point2f> getVertices() -
getVertex
public org.jogamp.vecmath.Point2f getVertex(int i) -
hasParentShape
public boolean hasParentShape()Description copied from class:InterfaceShapeIs this shape a child of another shape? Usually this refers to shapes which produce themselves in a different dimensionality; e.g., a 3D shape represented on a 2D plane.- Specified by:
hasParentShapein classInterfaceShape- Returns:
-
getModifiedAttribute
- Specified by:
getModifiedAttributein classInterfaceShape
-
getVertexSelection
TODO: implement me- Specified by:
getVertexSelectionin classInterfaceShape
-
setVertexSelection
- Specified by:
setVertexSelectionin classInterfaceShape
-
getClosestVertex
public int getClosestVertex(org.jogamp.vecmath.Point2f point)Returns the index of the vertex in this shape which is closest topoint.- Parameters:
point-- Returns:
-
getClosestVertex3D
If this shape has a parentShape3DIntobject, this method calls the getClosestVertex method of the parent.- Parameters:
point- The point to testplane- The plane on which this 2D object is described- Returns:
-
setIcon
protected void setIcon()- Overrides:
setIconin classInterfaceShape
-
getTreeLabel
public java.lang.String getTreeLabel()Description copied from interface:TreeObjectReturns the label text to appear in a tree node.- Specified by:
getTreeLabelin interfaceTreeObject- Overrides:
getTreeLabelin classAbstractInterfaceObject- Returns:
-
destroy
public void destroy()Description copied from interface:InterfaceObjectDestroy this object (prepare it to be removed from memory)- Specified by:
destroyin interfaceInterfaceObject- Specified by:
destroyin interfaceShapeListener- Overrides:
destroyin classAbstractInterfaceObject
-
destroy
-
getParentShape
-
setChild3D
-
getChild3D
-
getShape3DInt
Returns a 3D representation of this shape, assuming it belongs toplane.- Parameters:
plane- Plane which gives this shape 3D coordinates- Returns:
- The 3D representation
-
getShape3DInt
Returns a 3D representation of this shape, assuming it belongs toplane.- Parameters:
plane- Plane which gives this shape 3D coordinatesset_parent- Whether to register this shape as a parent on the issued shape- Returns:
- The 3D representation
-
getShape3D
-
setParentShape
-
getCenterPoint
public org.jogamp.vecmath.Point2f getCenterPoint() -
drawShape2D
Description copied from class:InterfaceShapeABSTRACT METHODS- Specified by:
drawShape2Din classInterfaceShape
-
draw
-
needsRedraw
Description copied from class:InterfaceShapeReturnstrueif a change toattributewill require a redraw of this shape.- Specified by:
needsRedrawin classInterfaceShape- Returns:
-
fireShapeListeners
- Overrides:
fireShapeListenersin classInterfaceShape
-
isHeritableAttribute
public boolean isHeritableAttribute(java.lang.String name)Description copied from class:InterfaceShapeIs this parent attribute inherited by a child shape?- Specified by:
isHeritableAttributein classInterfaceShape- Returns:
-
isInheritingAttribute
Description copied from class:InterfaceShapeDoes this child attribute inherit values from a parent shape?- Specified by:
isInheritingAttributein classInterfaceShape- Returns:
-
getLabelFont
public java.awt.Font getLabelFont()- Specified by:
getLabelFontin classInterfaceShape
-
setLabelFont
public void setLabelFont(java.awt.Font font)- Specified by:
setLabelFontin classInterfaceShape
-
getLabelScale
public float getLabelScale()- Specified by:
getLabelScalein classInterfaceShape
-
setLabelScale
public void setLabelScale(float scale)- Specified by:
setLabelScalein classInterfaceShape
-
getLabelColour
public java.awt.Color getLabelColour()- Specified by:
getLabelColourin classInterfaceShape
-
setLabelColour
public void setLabelColour(java.awt.Color colour)- Specified by:
setLabelColourin classInterfaceShape
-
hasAlpha
public boolean hasAlpha()Description copied from class:InterfaceShapeQueries whether this shape has transparency.- Specified by:
hasAlphain classInterfaceShape- Returns:
-
hasAlpha
public void hasAlpha(boolean b)Description copied from class:InterfaceShapeSpecifies whether this shape has transparency.- Specified by:
hasAlphain classInterfaceShape
-
showVertices
public boolean showVertices()Description copied from class:InterfaceShapeQueries whether the vertices of this shape are visible.- Specified by:
showVerticesin classInterfaceShape- Returns:
-
showVertices
public void showVertices(boolean b)Description copied from class:InterfaceShapeSpecifies whether the vertices of this shape are visible.- Specified by:
showVerticesin classInterfaceShape
-
getVertexScale
public float getVertexScale()Description copied from class:InterfaceShapeReturns the scale of this shape's vertices- Specified by:
getVertexScalein classInterfaceShape- Returns:
-
getVertexColour
public java.awt.Color getVertexColour()Description copied from class:InterfaceShapeReturns the colour of this shape's vertices.- Specified by:
getVertexColourin classInterfaceShape- Returns:
-
getAlpha
public float getAlpha()Description copied from class:InterfaceShapeGets the current transparency level for this shape.- Specified by:
getAlphain classInterfaceShape- Returns:
-
setAlpha
public void setAlpha(float f)Description copied from class:InterfaceShapeSets the current transparency level for this shape.- Specified by:
setAlphain classInterfaceShape
-
getLineColour
public java.awt.Color getLineColour()Description copied from class:InterfaceShapeReturns the colour of this shape's lines/edges.- Specified by:
getLineColourin classInterfaceShape- Returns:
-
getLineStyle
public java.awt.Stroke getLineStyle()Description copied from class:InterfaceShapeReturns the line/edge style for this shape.- Specified by:
getLineStylein classInterfaceShape- Returns:
-
setLineStyle
public void setLineStyle(java.awt.Stroke s)Description copied from class:InterfaceShapeReturns the line/edge style for this shape.- Specified by:
setLineStylein classInterfaceShape
-
setShape
-
getShape
-
getBoundShape
-
getBounds
-
getExtBounds
-
getProximity
public double getProximity(org.jogamp.vecmath.Point2f thisPoint) -
shapeUpdated
Description copied from interface:ShapeListenerA shape that this object is listening to has been updated. The specific type of event is defined by ShapeEvent.EventType.- Specified by:
shapeUpdatedin interfaceShapeListener
-
getVisibility
@Deprecated public boolean getVisibility()Deprecated. -
issueTreeNode
Description copied from class:AbstractInterfaceObjectIssues a new tree node and sets it usingAbstractInterfaceObject.setTreeNode(mgui.interfaces.trees.InterfaceTreeNode). The tree node is stored in this object, which facilitates their destruction when necessary (e.g., when this object is destroyed). All issued tree nodes can informed of changes to their user object using the methodAbstractInterfaceObject.updateTreeNodes().- Specified by:
issueTreeNodein interfaceTreeObject- Overrides:
issueTreeNodein classAbstractInterfaceObject- Returns:
- a new
InterfaceTreeNode
-
setTreeNode
Description copied from class:InterfaceShapeConstructs a tree node from this shape. Adds anAttributeTreeNodevia thesupermethod, and also adds a node to display the vertex-wise data columns associated with this ShapeInt.If overriding this method, subclass implementations should first call this super method to initialize the node and provide a basic construction.
- Specified by:
setTreeNodein interfaceTreeObject- Overrides:
setTreeNodein classInterfaceShape- Parameters:
treeNode- the tree node to construct
-
updateShape
public void updateShape()- Specified by:
updateShapein classInterfaceShape
-
validateNodes
public boolean validateNodes() -
printNodes
public java.lang.String printNodes() -
contains
public boolean contains(org.jogamp.vecmath.Point2f thisPoint) -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
clone
public java.lang.Object clone()- Overrides:
clonein classjava.lang.Object
-
attributeUpdated
Responds to a change in a specific attribute by notifying this ShapeInt's shape listeners with anAttributeModifiedshape event. If overriding, this super method should be called AFTER the special handling has been performed.- Specified by:
attributeUpdatedin interfaceAttributeListener
-
getDTD
public java.lang.String getDTD()Description copied from interface:XMLObjectReturns the Data Type Declaration (DTD) for this object's XML representationSee http://en.wikipedia.org/wiki/Document_Type_Definition for a description.
-
getLocalName
public java.lang.String getLocalName()Description copied from interface:XMLObjectReturns the local name associated with this XML object.- Specified by:
getLocalNamein interfaceXMLObject- Returns:
-
writeXML
public void writeXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOExceptionDescription copied from interface:XMLObjectWrites the XML representation of this object to file. The basic contract for this method is that it should not write a newline character at its start or end. The default format ofXMLFormat.Asciiwill be used.- Specified by:
writeXMLin interfaceXMLObject- Overrides:
writeXMLin classInterfaceShape- Parameters:
tab- The number of tabs to place before the XML textwriter- The writeroptions- XMLOutputOptions defining the write parametersprogress_bar- Optional progress updater (may benull)- Throws:
java.io.IOException
-
writeShapeToXML
protected void writeShapeToXML(int tab, java.io.Writer writer, ProgressUpdater progress_bar, XMLObject.XMLType type) throws java.io.IOException- Throws:
java.io.IOException
-
getShortXML
public java.lang.String getShortXML(int tab)Description copied from interface:XMLObjectReturns a short XML representation of this object.- Specified by:
getShortXMLin interfaceXMLObject- Returns:
-
getPopupMenu
Description copied from interface:PopupMenuObjectProduces and returns a popup menu for this object.- Specified by:
getPopupMenuin interfacePopupMenuObject- Overrides:
getPopupMenuin classInterfaceShape- Returns:
-
getPopupMenu
Description copied from interface:PopupMenuObjectProduces and returns a popup menu for this object. Allows an associated list of objects to be passed as an argument.- Specified by:
getPopupMenuin interfacePopupMenuObject- Returns:
-
handlePopupEvent
public void handlePopupEvent(java.awt.event.ActionEvent e)Description copied from interface:PopupMenuObjectHandles an event on this object's popup menu.- Specified by:
handlePopupEventin interfacePopupMenuObject
-
showPopupMenu
public void showPopupMenu(java.awt.event.MouseEvent e)Description copied from interface:PopupMenuObjectShows a popup menu at the point of the givenMouseEvent.- Specified by:
showPopupMenuin interfacePopupMenuObject
-
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException- Specified by:
getTransferDatain interfacejava.awt.datatransfer.Transferable- Throws:
java.awt.datatransfer.UnsupportedFlavorExceptionjava.io.IOException
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()- Specified by:
getTransferDataFlavorsin interfacejava.awt.datatransfer.Transferable
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)- Specified by:
isDataFlavorSupportedin interfacejava.awt.datatransfer.Transferable
-
performTransfer
public boolean performTransfer(javax.swing.TransferHandler.TransferSupport support)- Specified by:
performTransferin interfaceInterfaceTransferable
-
getVertexDataColumnNames
public java.util.ArrayList<java.lang.String> getVertexDataColumnNames()Description copied from class:InterfaceShapeReturns a list of the names of all vertex data columns.- Overrides:
getVertexDataColumnNamesin classInterfaceShape- Returns:
-
getVertexDataColumns
Description copied from class:InterfaceShapeReturns a list of all vertex data columns.- Overrides:
getVertexDataColumnsin classInterfaceShape- Returns:
-
getVertexDataColumn
Description copied from class:InterfaceShapeReturns the vertex data column associated withname.- Overrides:
getVertexDataColumnin classInterfaceShape- Parameters:
name- Name of the vertex data column- Returns:
-
addVertexData
Description copied from class:InterfaceShapeAdds a new vertex data column and populates it withdata.- Overrides:
addVertexDatain classInterfaceShape- Returns:
-
addVertexData
public boolean addVertexData(java.lang.String key, java.util.ArrayList<MguiNumber> data, NameMap map)Description copied from class:InterfaceShapeAdds vertex-wise data to this shape.- Overrides:
addVertexDatain classInterfaceShape- Parameters:
key- The key by which this column is to be referreddata- The values for this columnmap- Name map [optionally null] associating integer keys to names- Returns:
-
addVertexData
public boolean addVertexData(java.lang.String key)Description copied from class:InterfaceShapeAdd a vertex-wise data column of typeDataBuffer.TYPE_DOUBLE.- Overrides:
addVertexDatain classInterfaceShape- Parameters:
key- The key associated with the data column
-
addVertexData
public boolean addVertexData(java.lang.String key, int dataType)Description copied from class:InterfaceShapeAdd a vertex-wise data column of typedataType, which must be one ofDataBuffer.TYPE_DOUBLE,DataBuffer.TYPE_FLOAT, orDataBuffer.TYPE_INT. If an incorrect type is specified, this method creates a column of typeDataBuffer.TYPE_DOUBLE.- Overrides:
addVertexDatain classInterfaceShape- Parameters:
key- The key associated with the data columndataType- The data type with which to store the data
-
removeVertexData
public void removeVertexData(java.lang.String key)Description copied from class:InterfaceShapeRemove a vertex data column from this shape. This also removes all associated data, and calls listeners to update, for instance, tree nodes.- Overrides:
removeVertexDatain classInterfaceShape
-
getCurrentColumn
public java.lang.String getCurrentColumn()Description copied from class:InterfaceShapeReturns the name of the current data column- Overrides:
getCurrentColumnin classInterfaceShape- Returns:
-
getVertexDataMap
Description copied from class:InterfaceShapeRetrieves a hash map containing the vertex-wise data associated with this shape.- Overrides:
getVertexDataMapin classInterfaceShape- Returns:
-
setVertexDataMap
public void setVertexDataMap(java.util.HashMap<java.lang.String,java.util.ArrayList<MguiNumber>> data)Description copied from class:InterfaceShapeSets the hash map specified the vertex-wise data associated with this shape.- Overrides:
setVertexDataMapin classInterfaceShape
-
getCurrentVertexData
Description copied from class:InterfaceShapeRetrieves the currently selected vertex-wise data column.- Overrides:
getCurrentVertexDatain classInterfaceShape
-
getLinkedVertexDatum
Description copied from class:InterfaceShapeReturns the value at the given vertex, for the given linked column.- Overrides:
getLinkedVertexDatumin classInterfaceShape- Returns:
-
getLinkedVertexData
Description copied from class:InterfaceShapeRetrieves the vertex-wise data associated with a data-linked column.- Overrides:
getLinkedVertexDatain classInterfaceShape- Returns:
-
hasColumn
public boolean hasColumn(java.lang.String s)- Overrides:
hasColumnin classInterfaceShape
-
setCurrentColumn
public void setCurrentColumn(java.lang.String key)- Overrides:
setCurrentColumnin classInterfaceShape
-
setCurrentColumn
public void setCurrentColumn(java.lang.String key, boolean update)- Overrides:
setCurrentColumnin classInterfaceShape
-
getVertexData
Description copied from class:InterfaceShapeReturns a live version of the data incolumn.- Overrides:
getVertexDatain classInterfaceShape- Returns:
-
getAllVertexData
Description copied from class:InterfaceShapeReturns all vertex-wide data associated with this shape.- Overrides:
getAllVertexDatain classInterfaceShape- Returns:
-
getDatumAtVertex
Description copied from class:InterfaceShapeReturns the datum fromcolumnatindex.- Overrides:
getDatumAtVertexin classInterfaceShape- Returns:
-
hasData
public boolean hasData()- Overrides:
hasDatain classInterfaceShape
-
getNonLinkedDataColumns
public java.util.ArrayList<java.lang.String> getNonLinkedDataColumns()Description copied from class:InterfaceShapeReturns a list of this shape's data columns, minus the linked columns.- Overrides:
getNonLinkedDataColumnsin classInterfaceShape- Returns:
-
updateDataColumns
protected void updateDataColumns()- Overrides:
updateDataColumnsin classInterfaceShape
-