Package mgui.interfaces.graphics
Class Graphic2DGrid
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.graphics.Graphic2DGrid
- All Implemented Interfaces:
AttributeListener,AttributeObject,InterfaceObject,NamedObject,TreeObject,CleanableObject
public class Graphic2DGrid extends AbstractInterfaceObject implements AttributeObject, AttributeListener
Defines a 2D grid, for display in an
InterfaceGraphic2D window.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes -
Constructor Summary
Constructors Constructor Description Graphic2DGrid() -
Method Summary
Modifier and Type Method Description voidaddDisplayListener(DisplayListener listener)voidattributeUpdated(AttributeEvent e)Called when an Attribute's value has been updated.voiddraw2D(java.awt.Graphics2D g, DrawingEngine de)protected voidfireListeners()Attribute<?>getAttribute(java.lang.String attrName)Returns a specific attribute for this object.AttributeListgetAttributes()Returns the list of current attributes for this object.java.lang.ObjectgetAttributeValue(java.lang.String name)Gets the value of attributename, ornullif it does not exist.java.awt.ColorgetColour()booleangetIsMajor()booleangetIsVisible()java.awt.ColorgetLabelColour()java.awt.FontgetLabelFont()intgetLabelSize()doublegetMax()doublegetMin()java.lang.StringgetName()Gets the name for this object.booleangetShowLabels()doublegetSpacing()java.awt.StrokegetStyle()protected voidinit()voidremoveDisplayListener(DisplayListener listener)voidsetAttribute(java.lang.String attrName, java.lang.Object newValue)Sets a value for a specific attribute.voidsetAttributes(AttributeList thisList)Sets the list of attributes for this object.voidsetColour(java.awt.Color c)voidsetIsMajor(boolean b)voidsetIsVisible(boolean b)voidsetLabelColour(java.awt.Color c)voidsetLabelSize(int b)voidsetMax(double max)voidsetMin(double min)voidsetName(java.lang.String name)Sets the name for this object.voidsetShowLabels(boolean b)voidsetSpacing(double s)voidsetStyle(java.awt.Stroke s)voidsetTreeNode(InterfaceTreeNode treeNode)Sets the children for this node'sInterfaceTreeNode.java.lang.StringtoString()Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, getTreeLabel, isDestroyed, issueTreeNode, updateTreeNodesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
Graphic2DGrid
public Graphic2DGrid()
-
-
Method Details
-
init
protected void init() -
draw2D
-
setIsVisible
public void setIsVisible(boolean b) -
setIsMajor
public void setIsMajor(boolean b) -
getShowLabels
public boolean getShowLabels() -
setShowLabels
public void setShowLabels(boolean b) -
getLabelSize
public int getLabelSize() -
setLabelSize
public void setLabelSize(int b) -
getLabelFont
public java.awt.Font getLabelFont() -
getLabelColour
public java.awt.Color getLabelColour() -
setLabelColour
public void setLabelColour(java.awt.Color c) -
setMin
public void setMin(double min) -
setMax
public void setMax(double max) -
setSpacing
public void setSpacing(double s) -
setColour
public void setColour(java.awt.Color c) -
setStyle
public void setStyle(java.awt.Stroke s) -
setName
public void setName(java.lang.String name)Description copied from interface:NamedObjectSets the name for this object.- Specified by:
setNamein interfaceNamedObject- Overrides:
setNamein classAbstractInterfaceObject
-
getName
public java.lang.String getName()Description copied from interface:NamedObjectGets the name for this object.- Specified by:
getNamein interfaceNamedObject- Overrides:
getNamein classAbstractInterfaceObject- Returns:
-
getIsVisible
public boolean getIsVisible() -
getIsMajor
public boolean getIsMajor() -
getMin
public double getMin() -
getMax
public double getMax() -
getSpacing
public double getSpacing() -
getColour
public java.awt.Color getColour() -
getStyle
public java.awt.Stroke getStyle() -
getAttribute
Description copied from interface:AttributeObjectReturns a specific attribute for this object.- Specified by:
getAttributein interfaceAttributeObject- Returns:
-
getAttributeValue
public java.lang.Object getAttributeValue(java.lang.String name)Description copied from interface:AttributeObjectGets the value of attributename, ornullif it does not exist.- Specified by:
getAttributeValuein interfaceAttributeObject- Parameters:
name- Name of the attribute- Returns:
- the value of attribute
name, ornullif it does not exist
-
getAttributes
Description copied from interface:AttributeObjectReturns the list of current attributes for this object.- Specified by:
getAttributesin interfaceAttributeObject- Returns:
-
setAttribute
public void setAttribute(java.lang.String attrName, java.lang.Object newValue)Description copied from interface:AttributeObjectSets a value for a specific attribute.- Specified by:
setAttributein interfaceAttributeObject
-
setAttributes
Description copied from interface:AttributeObjectSets the list of attributes for this object.- Specified by:
setAttributesin interfaceAttributeObject
-
setTreeNode
Description copied from interface:TreeObjectSets the children for this node'sInterfaceTreeNode.- Specified by:
setTreeNodein interfaceTreeObject- Overrides:
setTreeNodein classAbstractInterfaceObject
-
attributeUpdated
Description copied from interface:AttributeListenerCalled when an Attribute's value has been updated.- Specified by:
attributeUpdatedin interfaceAttributeListener
-
addDisplayListener
-
removeDisplayListener
-
fireListeners
protected void fireListeners() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-