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.VertexDataSet
Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType
-
Field Summary
Fields Modifier and Type Field Description Rect2D
bounds
org.jogamp.vecmath.Point2f
centerPt
Shape3DInt
child3D
DrawingEngine
drawEngine
java.lang.String
idStr
protected java.util.HashMap<java.lang.Integer,java.lang.Integer>
map_idx_to_parent
protected ShapeListener
nodeListener
Shape3DInt
parentShape
ShapeSceneNode
sceneNode
Shape2D
thisShape
Fields 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_dir
Fields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes
-
Constructor Summary
Constructors Constructor Description Shape2DInt()
-
Method Summary
Modifier and Type Method Description boolean
addVertexData(java.lang.String key)
Add a vertex-wise data column of typeDataBuffer.TYPE_DOUBLE
.boolean
addVertexData(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
.boolean
addVertexData(java.lang.String key, java.util.ArrayList<MguiNumber> data)
Adds a new vertex data column and populates it withdata
.boolean
addVertexData(java.lang.String key, java.util.ArrayList<MguiNumber> data, NameMap map)
Adds vertex-wise data to this shape.void
attributeUpdated(AttributeEvent e)
Responds to a change in a specific attribute by notifying this ShapeInt's shape listeners with anAttributeModified
shape event.java.lang.Object
clone()
boolean
contains(org.jogamp.vecmath.Point2f thisPoint)
void
destroy()
Destroy this object (prepare it to be removed from memory)void
destroy(ShapeEvent event)
protected void
draw(java.awt.Graphics2D g, DrawingEngine d)
void
drawShape2D(java.awt.Graphics2D g, DrawingEngine d)
ABSTRACT METHODSvoid
fireShapeListeners(ShapeEvent e)
java.util.ArrayList<java.util.ArrayList<MguiNumber>>
getAllVertexData()
Returns all vertex-wide data associated with this shape.float
getAlpha()
Gets the current transparency level for this shape.Rect2D
getBounds()
Shape
getBoundShape()
org.jogamp.vecmath.Point2f
getCenterPoint()
Shape3DInt
getChild3D()
int
getClosestVertex(org.jogamp.vecmath.Point2f point)
Returns the index of the vertex in this shape which is closest topoint
.int
getClosestVertex3D(org.jogamp.vecmath.Point2f point, Plane3D plane)
If this shape has a parentShape3DInt
object, this method calls the getClosestVertex method of the parent.java.lang.String
getCurrentColumn()
Returns the name of the current data columnjava.util.ArrayList<MguiNumber>
getCurrentVertexData()
Retrieves the currently selected vertex-wise data column.MguiNumber
getDatumAtVertex(java.lang.String column, int index)
Returns the datum fromcolumn
atindex
.int[]
getDimensions()
Returns the dimensions of this object as an array of integersjava.lang.String
getDTD()
Returns the Data Type Declaration (DTD) for this object's XML representationRect2D
getExtBounds()
Shape
getGeometry()
Returns the Shape associated with this objectShape
getGeometryInstance()
Returns an instance of thisInterfaceShape
's geometry class.java.awt.Color
getLabelColour()
java.awt.Font
getLabelFont()
float
getLabelScale()
java.awt.Color
getLineColour()
Returns the colour of this shape's lines/edges.java.awt.Stroke
getLineStyle()
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.MguiNumber
getLinkedVertexDatum(java.lang.String linked_column, int index)
Returns the value at the given vertex, for the given linked column.java.lang.String
getLocalName()
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)
Shape3DInt
getParentShape()
InterfacePopupMenu
getPopupMenu()
Produces and returns a popup menu for this object.InterfacePopupMenu
getPopupMenu(java.util.List<java.lang.Object> selected)
Produces and returns a popup menu for this object.double
getProximity(org.jogamp.vecmath.Point2f thisPoint)
Shape2D
getShape()
protected Shape3DInt
getShape3D(Plane3D plane)
Shape3DInt
getShape3DInt(Plane3D plane)
Returns a 3D representation of this shape, assuming it belongs toplane
.Shape3DInt
getShape3DInt(Plane3D plane, boolean set_parent)
Returns a 3D representation of this shape, assuming it belongs toplane
.java.lang.String
getShortXML(int tab)
Returns a short XML representation of this object.java.lang.Object
getTransferData(java.awt.datatransfer.DataFlavor flavor)
java.awt.datatransfer.DataFlavor[]
getTransferDataFlavors()
java.lang.String
getTreeLabel()
Returns the label text to appear in a tree node.org.jogamp.vecmath.Point2f
getVertex(int i)
java.awt.Color
getVertexColour()
Returns the colour of this shape's vertices.int
getVertexCount()
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
.VertexDataColumn
getVertexDataColumn(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.float
getVertexScale()
Returns the scale of this shape's verticesVertexSelection
getVertexSelection()
TODO: implement meNodeShape
getVertexShape()
java.util.ArrayList<org.jogamp.vecmath.Point2f>
getVertices()
boolean
getVisibility()
Deprecated.void
handlePopupEvent(java.awt.event.ActionEvent e)
Handles an event on this object's popup menu.boolean
hasAlpha()
Queries whether this shape has transparency.void
hasAlpha(boolean b)
Specifies whether this shape has transparency.boolean
hasColumn(java.lang.String s)
boolean
hasData()
boolean
hasParentShape()
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.boolean
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
boolean
isHeritableAttribute(java.lang.String name)
Is this parent attribute inherited by a child shape?boolean
isInheritingAttribute(Attribute<?> attribute)
Does this child attribute inherit values from a parent shape?boolean
isLabelShape()
InterfaceTreeNode
issueTreeNode()
Issues a new tree node and sets it usingAbstractInterfaceObject.setTreeNode(mgui.interfaces.trees.InterfaceTreeNode)
.boolean
needsRedraw(Attribute<?> a)
Returnstrue
if a change toattribute
will require a redraw of this shape.boolean
performTransfer(javax.swing.TransferHandler.TransferSupport support)
java.lang.String
printNodes()
void
removeVertexData(java.lang.String key)
Remove a vertex data column from this shape.void
setAlpha(float f)
Sets the current transparency level for this shape.void
setChild3D(Shape3DInt child)
void
setCurrentColumn(java.lang.String key)
void
setCurrentColumn(java.lang.String key, boolean update)
boolean
setGeometry(Shape geometry)
Sets the Shape associated with this object.void
setGraphic2DPopupMenu(InterfacePopupMenu menu)
Subclasses should override this if necessary and call super.getGraphic3DPopupMenu() to get this top-level menu and add items to it.protected void
setIcon()
void
setLabelColour(java.awt.Color colour)
void
setLabelFont(java.awt.Font font)
void
setLabelScale(float scale)
void
setLineStyle(java.awt.Stroke s)
Returns the line/edge style for this shape.void
setMapIdxToParent(java.util.HashMap<java.lang.Integer,java.lang.Integer> map_idx_to_parent)
void
setParentShape(Shape3DInt shape)
void
setShape(Shape2D newShape)
void
setTreeNode(InterfaceTreeNode treeNode)
Constructs a tree node from this shape.void
setVertexDataMap(java.util.HashMap<java.lang.String,java.util.ArrayList<MguiNumber>> data)
Sets the hash map specified the vertex-wise data associated with this shape.void
setVertexSelection(VertexSelection selection)
void
setVertexShape(NodeShape shape)
void
shapeUpdated(ShapeEvent e)
A shape that this object is listening to has been updated.void
showPopupMenu(java.awt.event.MouseEvent e)
Shows a popup menu at the point of the givenMouseEvent
.boolean
showVertices()
Queries whether the vertices of this shape are visible.void
showVertices(boolean b)
Specifies whether the vertices of this shape are visible.java.lang.String
toString()
protected void
updateDataColumns()
void
updateShape()
boolean
validateNodes()
protected void
writeShapeToXML(int tab, java.io.Writer writer, ProgressUpdater progress_bar, XMLObject.XMLType type)
void
writeXML(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, writeXML
Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, updateTreeNodes
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface mgui.interfaces.util.CleanableObject
clean
Methods 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:InterfaceShape
Returns an instance of thisInterfaceShape
's geometry class.- Specified by:
getGeometryInstance
in classInterfaceShape
- Returns:
-
getParentAttribute
- Specified by:
getParentAttribute
in 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:InterfaceShape
Returns the Shape associated with this object- Specified by:
getGeometry
in classInterfaceShape
- Returns:
-
setGeometry
Description copied from class:InterfaceShape
Sets the Shape associated with this object. If the class type is incorrect, returnsfalse
- Specified by:
setGeometry
in classInterfaceShape
- Returns:
-
getVertexShape
-
setVertexShape
-
isLabelShape
public boolean isLabelShape() -
getVertexCount
public int getVertexCount()Description copied from class:InterfaceShape
Returns the number of vertices defining the geometry of this shape.- Specified by:
getVertexCount
in classInterfaceShape
- Returns:
-
getDimensions
public int[] getDimensions()Description copied from interface:VariableObject
Returns the dimensions of this object as an array of integers- Specified by:
getDimensions
in 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:InterfaceShape
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.- Specified by:
hasParentShape
in classInterfaceShape
- Returns:
-
getModifiedAttribute
- Specified by:
getModifiedAttribute
in classInterfaceShape
-
getVertexSelection
TODO: implement me- Specified by:
getVertexSelection
in classInterfaceShape
-
setVertexSelection
- Specified by:
setVertexSelection
in 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 parentShape3DInt
object, 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:
setIcon
in classInterfaceShape
-
getTreeLabel
public java.lang.String getTreeLabel()Description copied from interface:TreeObject
Returns the label text to appear in a tree node.- Specified by:
getTreeLabel
in interfaceTreeObject
- Overrides:
getTreeLabel
in classAbstractInterfaceObject
- Returns:
-
destroy
public void destroy()Description copied from interface:InterfaceObject
Destroy this object (prepare it to be removed from memory)- Specified by:
destroy
in interfaceInterfaceObject
- Specified by:
destroy
in interfaceShapeListener
- Overrides:
destroy
in 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:InterfaceShape
ABSTRACT METHODS- Specified by:
drawShape2D
in classInterfaceShape
-
draw
-
needsRedraw
Description copied from class:InterfaceShape
Returnstrue
if a change toattribute
will require a redraw of this shape.- Specified by:
needsRedraw
in classInterfaceShape
- Returns:
-
fireShapeListeners
- Overrides:
fireShapeListeners
in classInterfaceShape
-
isHeritableAttribute
public boolean isHeritableAttribute(java.lang.String name)Description copied from class:InterfaceShape
Is this parent attribute inherited by a child shape?- Specified by:
isHeritableAttribute
in classInterfaceShape
- Returns:
-
isInheritingAttribute
Description copied from class:InterfaceShape
Does this child attribute inherit values from a parent shape?- Specified by:
isInheritingAttribute
in classInterfaceShape
- Returns:
-
getLabelFont
public java.awt.Font getLabelFont()- Specified by:
getLabelFont
in classInterfaceShape
-
setLabelFont
public void setLabelFont(java.awt.Font font)- Specified by:
setLabelFont
in classInterfaceShape
-
getLabelScale
public float getLabelScale()- Specified by:
getLabelScale
in classInterfaceShape
-
setLabelScale
public void setLabelScale(float scale)- Specified by:
setLabelScale
in classInterfaceShape
-
getLabelColour
public java.awt.Color getLabelColour()- Specified by:
getLabelColour
in classInterfaceShape
-
setLabelColour
public void setLabelColour(java.awt.Color colour)- Specified by:
setLabelColour
in classInterfaceShape
-
hasAlpha
public boolean hasAlpha()Description copied from class:InterfaceShape
Queries whether this shape has transparency.- Specified by:
hasAlpha
in classInterfaceShape
- Returns:
-
hasAlpha
public void hasAlpha(boolean b)Description copied from class:InterfaceShape
Specifies whether this shape has transparency.- Specified by:
hasAlpha
in classInterfaceShape
-
showVertices
public boolean showVertices()Description copied from class:InterfaceShape
Queries whether the vertices of this shape are visible.- Specified by:
showVertices
in classInterfaceShape
- Returns:
-
showVertices
public void showVertices(boolean b)Description copied from class:InterfaceShape
Specifies whether the vertices of this shape are visible.- Specified by:
showVertices
in classInterfaceShape
-
getVertexScale
public float getVertexScale()Description copied from class:InterfaceShape
Returns the scale of this shape's vertices- Specified by:
getVertexScale
in classInterfaceShape
- Returns:
-
getVertexColour
public java.awt.Color getVertexColour()Description copied from class:InterfaceShape
Returns the colour of this shape's vertices.- Specified by:
getVertexColour
in classInterfaceShape
- Returns:
-
getAlpha
public float getAlpha()Description copied from class:InterfaceShape
Gets the current transparency level for this shape.- Specified by:
getAlpha
in classInterfaceShape
- Returns:
-
setAlpha
public void setAlpha(float f)Description copied from class:InterfaceShape
Sets the current transparency level for this shape.- Specified by:
setAlpha
in classInterfaceShape
-
getLineColour
public java.awt.Color getLineColour()Description copied from class:InterfaceShape
Returns the colour of this shape's lines/edges.- Specified by:
getLineColour
in classInterfaceShape
- Returns:
-
getLineStyle
public java.awt.Stroke getLineStyle()Description copied from class:InterfaceShape
Returns the line/edge style for this shape.- Specified by:
getLineStyle
in classInterfaceShape
- Returns:
-
setLineStyle
public void setLineStyle(java.awt.Stroke s)Description copied from class:InterfaceShape
Returns the line/edge style for this shape.- Specified by:
setLineStyle
in classInterfaceShape
-
setShape
-
getShape
-
getBoundShape
-
getBounds
-
getExtBounds
-
getProximity
public double getProximity(org.jogamp.vecmath.Point2f thisPoint) -
shapeUpdated
Description copied from interface:ShapeListener
A shape that this object is listening to has been updated. The specific type of event is defined by ShapeEvent.EventType.- Specified by:
shapeUpdated
in interfaceShapeListener
-
getVisibility
@Deprecated public boolean getVisibility()Deprecated. -
issueTreeNode
Description copied from class:AbstractInterfaceObject
Issues 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:
issueTreeNode
in interfaceTreeObject
- Overrides:
issueTreeNode
in classAbstractInterfaceObject
- Returns:
- a new
InterfaceTreeNode
-
setTreeNode
Description copied from class:InterfaceShape
Constructs a tree node from this shape. Adds anAttributeTreeNode
via thesuper
method, 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:
setTreeNode
in interfaceTreeObject
- Overrides:
setTreeNode
in classInterfaceShape
- Parameters:
treeNode
- the tree node to construct
-
updateShape
public void updateShape()- Specified by:
updateShape
in 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:
toString
in classjava.lang.Object
-
clone
public java.lang.Object clone()- Overrides:
clone
in classjava.lang.Object
-
attributeUpdated
Responds to a change in a specific attribute by notifying this ShapeInt's shape listeners with anAttributeModified
shape event. If overriding, this super method should be called AFTER the special handling has been performed.- Specified by:
attributeUpdated
in interfaceAttributeListener
-
getDTD
public java.lang.String getDTD()Description copied from interface:XMLObject
Returns 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:XMLObject
Returns the local name associated with this XML object.- Specified by:
getLocalName
in interfaceXMLObject
- Returns:
-
writeXML
public void writeXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOExceptionDescription copied from interface:XMLObject
Writes 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.Ascii
will be used.- Specified by:
writeXML
in interfaceXMLObject
- Overrides:
writeXML
in 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:XMLObject
Returns a short XML representation of this object.- Specified by:
getShortXML
in interfaceXMLObject
- Returns:
-
getPopupMenu
Description copied from interface:PopupMenuObject
Produces and returns a popup menu for this object.- Specified by:
getPopupMenu
in interfacePopupMenuObject
- Overrides:
getPopupMenu
in classInterfaceShape
- Returns:
-
getPopupMenu
Description copied from interface:PopupMenuObject
Produces and returns a popup menu for this object. Allows an associated list of objects to be passed as an argument.- Specified by:
getPopupMenu
in interfacePopupMenuObject
- Returns:
-
handlePopupEvent
public void handlePopupEvent(java.awt.event.ActionEvent e)Description copied from interface:PopupMenuObject
Handles an event on this object's popup menu.- Specified by:
handlePopupEvent
in interfacePopupMenuObject
-
showPopupMenu
public void showPopupMenu(java.awt.event.MouseEvent e)Description copied from interface:PopupMenuObject
Shows a popup menu at the point of the givenMouseEvent
.- Specified by:
showPopupMenu
in interfacePopupMenuObject
-
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException- Specified by:
getTransferData
in interfacejava.awt.datatransfer.Transferable
- Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()- Specified by:
getTransferDataFlavors
in interfacejava.awt.datatransfer.Transferable
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)- Specified by:
isDataFlavorSupported
in interfacejava.awt.datatransfer.Transferable
-
performTransfer
public boolean performTransfer(javax.swing.TransferHandler.TransferSupport support)- Specified by:
performTransfer
in interfaceInterfaceTransferable
-
getVertexDataColumnNames
public java.util.ArrayList<java.lang.String> getVertexDataColumnNames()Description copied from class:InterfaceShape
Returns a list of the names of all vertex data columns.- Overrides:
getVertexDataColumnNames
in classInterfaceShape
- Returns:
-
getVertexDataColumns
Description copied from class:InterfaceShape
Returns a list of all vertex data columns.- Overrides:
getVertexDataColumns
in classInterfaceShape
- Returns:
-
getVertexDataColumn
Description copied from class:InterfaceShape
Returns the vertex data column associated withname
.- Overrides:
getVertexDataColumn
in classInterfaceShape
- Parameters:
name
- Name of the vertex data column- Returns:
-
addVertexData
Description copied from class:InterfaceShape
Adds a new vertex data column and populates it withdata
.- Overrides:
addVertexData
in classInterfaceShape
- Returns:
-
addVertexData
public boolean addVertexData(java.lang.String key, java.util.ArrayList<MguiNumber> data, NameMap map)Description copied from class:InterfaceShape
Adds vertex-wise data to this shape.- Overrides:
addVertexData
in 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:InterfaceShape
Add a vertex-wise data column of typeDataBuffer.TYPE_DOUBLE
.- Overrides:
addVertexData
in classInterfaceShape
- Parameters:
key
- The key associated with the data column
-
addVertexData
public boolean addVertexData(java.lang.String key, int dataType)Description copied from class:InterfaceShape
Add 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:
addVertexData
in 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:InterfaceShape
Remove a vertex data column from this shape. This also removes all associated data, and calls listeners to update, for instance, tree nodes.- Overrides:
removeVertexData
in classInterfaceShape
-
getCurrentColumn
public java.lang.String getCurrentColumn()Description copied from class:InterfaceShape
Returns the name of the current data column- Overrides:
getCurrentColumn
in classInterfaceShape
- Returns:
-
getVertexDataMap
Description copied from class:InterfaceShape
Retrieves a hash map containing the vertex-wise data associated with this shape.- Overrides:
getVertexDataMap
in classInterfaceShape
- Returns:
-
setVertexDataMap
public void setVertexDataMap(java.util.HashMap<java.lang.String,java.util.ArrayList<MguiNumber>> data)Description copied from class:InterfaceShape
Sets the hash map specified the vertex-wise data associated with this shape.- Overrides:
setVertexDataMap
in classInterfaceShape
-
getCurrentVertexData
Description copied from class:InterfaceShape
Retrieves the currently selected vertex-wise data column.- Overrides:
getCurrentVertexData
in classInterfaceShape
-
getLinkedVertexDatum
Description copied from class:InterfaceShape
Returns the value at the given vertex, for the given linked column.- Overrides:
getLinkedVertexDatum
in classInterfaceShape
- Returns:
-
getLinkedVertexData
Description copied from class:InterfaceShape
Retrieves the vertex-wise data associated with a data-linked column.- Overrides:
getLinkedVertexData
in classInterfaceShape
- Returns:
-
hasColumn
public boolean hasColumn(java.lang.String s)- Overrides:
hasColumn
in classInterfaceShape
-
setCurrentColumn
public void setCurrentColumn(java.lang.String key)- Overrides:
setCurrentColumn
in classInterfaceShape
-
setCurrentColumn
public void setCurrentColumn(java.lang.String key, boolean update)- Overrides:
setCurrentColumn
in classInterfaceShape
-
getVertexData
Description copied from class:InterfaceShape
Returns a live version of the data incolumn
.- Overrides:
getVertexData
in classInterfaceShape
- Returns:
-
getAllVertexData
Description copied from class:InterfaceShape
Returns all vertex-wide data associated with this shape.- Overrides:
getAllVertexData
in classInterfaceShape
- Returns:
-
getDatumAtVertex
Description copied from class:InterfaceShape
Returns the datum fromcolumn
atindex
.- Overrides:
getDatumAtVertex
in classInterfaceShape
- Returns:
-
hasData
public boolean hasData()- Overrides:
hasData
in classInterfaceShape
-
getNonLinkedDataColumns
public java.util.ArrayList<java.lang.String> getNonLinkedDataColumns()Description copied from class:InterfaceShape
Returns a list of this shape's data columns, minus the linked columns.- Overrides:
getNonLinkedDataColumns
in classInterfaceShape
- Returns:
-
updateDataColumns
protected void updateDataColumns()- Overrides:
updateDataColumns
in classInterfaceShape
-